14 #ifndef CORE_INTERFACES_SIMPLEMEM_H_
15 #define CORE_INTERFACES_SIMPLEMEM_H_
22 #include <sst/core/sst_types.h>
23 #include <sst/core/warnmacros.h>
24 #include <sst/core/subcomponent.h>
25 #include <sst/core/params.h>
26 #include <sst/core/link.h>
33 namespace Interfaces {
103 addrs.push_back(addr);
112 addrs.push_back(addr);
121 addrs.push_back(addr);
130 addrs.push_back(addr);
136 addrs.push_back(addr);
154 for (
size_t i = 0 ; i < len ; i++ ) {
155 data[i] = data_in[i];
240 static std::atomic<id_t> main_id;
257 template <
typename classT,
typename argT =
void>
260 typedef void (classT::*PtrMember)(
Request*, argT);
262 const PtrMember member;
271 Handler( classT*
const object, PtrMember member, argT data ) :
278 return (object->*member)(req,data);
285 template <
typename classT>
288 typedef void (classT::*PtrMember)(
Request*);
290 const PtrMember member;
297 Handler( classT*
const object, PtrMember member ) :
303 return (object->*member)(req);
317 virtual bool initialize(
const std::string &linkName, HandlerBase *handler = NULL) = 0;
Definition: simpleMem.h:59
virtual SST::Event * recvInitData()
Receive any data during the init() phase.
Definition: simpleMem.h:335
Definition: simpleMem.h:64
size_t size
Definition: simpleMem.h:89
uint32_t flags_t
Definition: simpleMem.h:50
Request(Command cmd, Addr addr, size_t size, uint32_t Opc, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:126
Addr getInstructionPointer()
Definition: simpleMem.h:185
Command
Commands and responses possible with a Request object.
Definition: simpleMem.h:55
Represents both memory requests and responses.
Definition: simpleMem.h:47
Definition: simpleMem.h:68
virtual void sendRequest(Request *req)=0
Send a Request to the other side of the link.
std::vector< Addr > addrs
Definition: simpleMem.h:87
virtual SST::Link * getLink(void) const =0
Returns a handle to the underlying SST::Link.
Definition: simpleMem.h:79
Definition: simpleMem.h:63
uint64_t getVirtualAddress()
Definition: simpleMem.h:170
Command cmd
Definition: simpleMem.h:86
Main component object for the simulation.
Definition: component.h:32
Definition: simpleMem.h:62
Definition: simpleMem.h:60
Handler(classT *const object, PtrMember member, argT data)
Constructor.
Definition: simpleMem.h:271
dataVec data
Definition: simpleMem.h:90
Definition: simpleMem.h:58
void setFlags(flags_t inValue)
Definition: simpleMem.h:199
std::vector< uint8_t > dataVec
Type of the payload or data.
Definition: simpleMem.h:84
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:117
void setInstructionPointer(const Addr newIP)
Sets the instruction pointer associated with the operation.
Definition: simpleMem.h:178
void setPayload(const std::vector< uint8_t > &data_in)
Set the contents of the payload / data field.
Definition: simpleMem.h:143
void operator()(Request *req)
Function called when Handler is invoked.
Definition: simpleMem.h:302
Functor classes for Clock handling.
Definition: simpleMem.h:245
virtual void sendInitData(Request *req)=0
Sends a memory-based request during the init() phase.
flags_t flags
Definition: simpleMem.h:91
Simplified, generic interface to Memory models.
Definition: simpleMem.h:38
Definition: simpleMem.h:76
void operator()(Request *req)
Function called when Handler is invoked.
Definition: simpleMem.h:277
flags_t getMemFlags(void)
Definition: simpleMem.h:227
Handler(classT *const object, PtrMember member)
Constructor.
Definition: simpleMem.h:297
Definition: simpleMem.h:57
void sendInitData(Event *init_data)
Send data during the complete() phase.
Definition: link.h:127
void clearFlags(void)
Clears the flags associated with the operation.
Definition: simpleMem.h:192
Addr instrPtr
Definition: simpleMem.h:94
Request(Command cmd, Addr addr, size_t size, dataVec &data, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:99
Definition: simpleMem.h:61
Event * recvInitData()
Receive an event (if any) during the complete() phase.
Definition: link.h:131
Addr virtualAddr
Definition: simpleMem.h:95
flags_t getFlags(void)
Definition: simpleMem.h:206
Event Handler class with user-data argument.
Definition: simpleMem.h:258
virtual void sendInitData(SST::Event *ev)
Sends a generic Event during the init() phase (Mostly acts as a passthrough)
Definition: simpleMem.h:329
virtual void operator()(Request *)=0
Function called when Handler is invoked.
Definition: simpleMem.h:75
void setMemFlags(flags_t inValue)
Definition: simpleMem.h:220
virtual bool initialize(const std::string &linkName, HandlerBase *handler=NULL)=0
Second half of building the interface.
Definition: simpleMem.h:56
Parameter store.
Definition: params.h:45
uint64_t Addr
All Addresses can be 64-bit.
Definition: simpleMem.h:42
void setVirtualAddress(const Addr newVA)
Set the virtual address associated with the operation.
Definition: simpleMem.h:163
uint32_t getCustomOpc(void)
Definition: simpleMem.h:234
Flags
Flags to specify conditions on a Request.
Definition: simpleMem.h:74
void setPayload(uint8_t *data_in, size_t len)
Set the contents of the payload / data field.
Definition: simpleMem.h:152
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:31
uint32_t custOpc
Definition: simpleMem.h:96
SimpleMem(SST::Component *comp, Params &UNUSED(params))
Constructor, designed to be used via 'loadSubComponent'.
Definition: simpleMem.h:309
Addr addr
Definition: simpleMem.h:88
SubComponent is a class loadable through the factory which allows dynamic functionality to be added t...
Definition: subcomponent.h:29
Link between two components.
Definition: link.h:33
uint64_t id_t
Definition: simpleMem.h:49
id_t id
Definition: simpleMem.h:93
virtual Request * recvResponse(void)=0
Receive a Request response from the side of the link.
void clearMemFlags(void)
Clears the memory flags associated with the operation.
Definition: simpleMem.h:213
Request(Command cmd, Addr addr, size_t size, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:108
flags_t memFlags
Definition: simpleMem.h:92