14 #ifndef SST_CORE_INTERFACES_SIMPLEMEM_H
15 #define SST_CORE_INTERFACES_SIMPLEMEM_H
17 #include "sst/core/link.h"
18 #include "sst/core/params.h"
19 #include "sst/core/sst_types.h"
20 #include "sst/core/ssthandler.h"
21 #include "sst/core/subcomponent.h"
22 #include "sst/core/warnmacros.h"
34 namespace Interfaces {
66 template <
typename classT,
typename dataT =
void>
106 F_NONCACHEABLE = 1 << 1,
110 F_LLSC_RESP = 1 << 4,
113 F_TRANSACTION = 1 << 6
133 Request(
Command cmd, Addr addr,
size_t size, dataVec& data, flags_t flags = 0, flags_t memFlags = 0) :
144 addrs.push_back(addr);
149 Request(
Command cmd, Addr addr,
size_t size, flags_t flags = 0, flags_t memFlags = 0) :
159 addrs.push_back(addr);
165 Command cmd, Addr addr,
size_t size, dataVec& data, uint32_t Opc, flags_t flags = 0, flags_t memFlags = 0) :
176 addrs.push_back(addr);
181 Request(
Command cmd, Addr addr,
size_t size, uint32_t Opc, flags_t flags = 0, flags_t memFlags = 0) :
191 addrs.push_back(addr);
195 void addAddress(Addr addr) { addrs.push_back(addr); }
201 void setPayload(
const std::vector<uint8_t>& data_in) { data = data_in; }
210 for (
size_t i = 0; i < len; i++ ) {
211 data[i] = data_in[i];
245 void setFlags(flags_t inValue) { flags = flags | inValue; }
260 void setMemFlags(flags_t inValue) { memFlags = memFlags | inValue; }
273 static std::atomic<id_t> main_id;
344 #endif // SST_CORE_INTERFACES_SIMPLEMEM_H
Definition: simpleMem.h:89
virtual SST::Event * recvInitData()
Receive any data during the init() phase.
Definition: simpleMem.h:301
Definition: simpleMem.h:95
size_t size
Definition: simpleMem.h:122
uint32_t flags_t
Definition: simpleMem.h:80
Request(Command cmd, Addr addr, size_t size, uint32_t Opc, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:181
Addr getInstructionPointer()
Definition: simpleMem.h:235
Definition: ssthandler.h:100
Command
Commands and responses possible with a Request object.
Definition: simpleMem.h:85
Represents both memory requests and responses.
Definition: simpleMem.h:76
virtual void sendRequest(Request *req)=0
Send a Request to the other side of the link.
std::vector< Addr > addrs
Definition: simpleMem.h:120
virtual SST::Link * getLink(void) const =0
Returns a handle to the underlying SST::Link.
Definition: simpleMem.h:94
Event Handler class with user-data argument.
Definition: ssthandler.h:115
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:26
uint64_t getVirtualAddress()
Definition: simpleMem.h:224
Command cmd
Definition: simpleMem.h:119
Definition: simpleMem.h:92
Definition: simpleMem.h:90
dataVec data
Definition: simpleMem.h:123
Definition: simpleMem.h:88
void setFlags(flags_t inValue)
Definition: simpleMem.h:245
std::vector< uint8_t > dataVec
Type of the payload or data.
Definition: simpleMem.h:117
Request(Command cmd, Addr addr, size_t size, dataVec &data, uint32_t Opc, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:164
void setInstructionPointer(const Addr newIP)
Sets the instruction pointer associated with the operation.
Definition: simpleMem.h:230
void setPayload(const std::vector< uint8_t > &data_in)
Set the contents of the payload / data field.
Definition: simpleMem.h:201
Definition: simpleMem.h:93
virtual void sendInitData(Request *req)=0
Sends a memory-based request during the init() phase.
flags_t flags
Definition: simpleMem.h:124
virtual bool initialize(const std::string &linkName, HandlerBase *handler=nullptr)=0
Second half of building the interface.
Simplified, generic interface to Memory models.
Definition: simpleMem.h:39
flags_t getMemFlags(void)
Definition: simpleMem.h:265
Definition: simpleMem.h:87
void sendInitData(Event *init_data)
Send data during the init() or complete() phase.
Definition: link.h:182
void clearFlags(void)
Clears the flags associated with the operation.
Definition: simpleMem.h:240
Addr instrPtr
Definition: simpleMem.h:128
Request(Command cmd, Addr addr, size_t size, dataVec &data, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:133
Definition: simpleMem.h:91
virtual Addr getLineSize()
Get cache/memory line size from the memory system.
Definition: simpleMem.h:338
Event * recvInitData()
Receive an event (if any) during the init() or complete() phase.
Definition: link.h:189
Addr virtualAddr
Definition: simpleMem.h:129
flags_t getFlags(void)
Definition: simpleMem.h:250
virtual void sendInitData(SST::Event *ev)
Sends a generic Event during the init() phase (Mostly acts as a passthrough)
Definition: simpleMem.h:295
void setMemFlags(flags_t inValue)
Definition: simpleMem.h:260
Definition: simpleMem.h:86
Parameter store.
Definition: params.h:43
uint64_t Addr
All Addresses can be 64-bit.
Definition: simpleMem.h:71
void setVirtualAddress(const Addr newVA)
Set the virtual address associated with the operation.
Definition: simpleMem.h:219
uint32_t getCustomOpc(void)
Definition: simpleMem.h:270
void setPayload(uint8_t *data_in, size_t len)
Set the contents of the payload / data field.
Definition: simpleMem.h:207
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:31
SimpleMem(SST::ComponentId_t id, Params &UNUSED(params))
Constructor, designed to be used via 'loadUserSubComponent and loadAnonymousSubComponent'.
Definition: simpleMem.h:277
uint32_t custOpc
Definition: simpleMem.h:130
Addr addr
Definition: simpleMem.h:121
SubComponent is a class loadable through the factory which allows dynamic functionality to be added t...
Definition: subcomponent.h:28
Link between two components.
Definition: link.h:31
uint64_t id_t
Definition: simpleMem.h:79
id_t id
Definition: simpleMem.h:127
virtual Request * recvResponse(void)=0
Receive a Request response from the side of the link.
SSTHandlerBase< void, Request *, false > HandlerBase
Base handler for request handling.
Definition: simpleMem.h:46
void clearMemFlags(void)
Clears the memory flags associated with the operation.
Definition: simpleMem.h:255
Request(Command cmd, Addr addr, size_t size, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:149
flags_t memFlags
Definition: simpleMem.h:126