14 #ifndef CORE_INTERFACES_SIMPLEMEM_H_
15 #define CORE_INTERFACES_SIMPLEMEM_H_
22 #include <sst/core/sst_types.h>
23 #include <sst/core/subcomponent.h>
24 #include <sst/core/params.h>
25 #include <sst/core/link.h>
32 namespace Interfaces {
90 Request(
Command cmd, Addr addr,
size_t size, dataVec &data, flags_t flags = 0, flags_t memFlags = 0) :
91 cmd(cmd), addr(addr), size(size), data(data), flags(flags), memFlags(memFlags), groupId(0),
92 instrPtr(0), virtualAddr(0)
98 Request(
Command cmd, Addr addr,
size_t size, flags_t flags = 0, flags_t memFlags = 0) :
99 cmd(cmd), addr(addr), size(size), flags(flags), memFlags(memFlags), groupId(0),
100 instrPtr(0), virtualAddr(0)
127 for (
size_t i = 0 ; i < len ; i++ ) {
128 data[i] = data_in[i];
149 void setInstructionPointer(
const Addr newIP) {
161 static std::atomic<id_t> main_id;
177 template <
typename classT,
typename argT =
void>
180 typedef void (classT::*PtrMember)(
Request*, argT);
182 const PtrMember member;
191 Handler( classT*
const object, PtrMember member, argT data ) :
198 return (object->*member)(req,data);
205 template <
typename classT>
208 typedef void (classT::*PtrMember)(
Request*);
210 const PtrMember member;
217 Handler( classT*
const object, PtrMember member ) :
223 return (object->*member)(req);
237 virtual bool initialize(
const std::string &linkName, HandlerBase *handler = NULL) = 0;
Definition: simpleMem.h:58
virtual SST::Event * recvInitData()
Receive any data during the init() phase.
Definition: simpleMem.h:255
size_t size
Definition: simpleMem.h:80
uint32_t flags_t
Definition: simpleMem.h:49
Addr getInstructionPointer()
Sets the instruction pointer associated with the operation.
Definition: simpleMem.h:156
Command
Commands and responses possible with a Request object.
Definition: simpleMem.h:54
Represents both memory requests and responses.
Definition: simpleMem.h:46
virtual void sendRequest(Request *req)=0
Send a Request to the other side of the link.
Definition: simpleMem.h:72
uint64_t getVirtualAddress()
Get the virtual address associated with the operation.
Definition: simpleMem.h:142
Command cmd
Definition: simpleMem.h:78
Main component object for the simulation.
Definition: component.h:56
Definition: simpleMem.h:61
Definition: simpleMem.h:59
Handler(classT *const object, PtrMember member, argT data)
Constructor.
Definition: simpleMem.h:191
dataVec data
Definition: simpleMem.h:81
virtual SST::Link * getLink(void) const =0
Returns a handle to the underlying SST::Link.
void setGroupId(uint32_t _groupId)
Set Stats Group Id.
Definition: simpleMem.h:108
Definition: simpleMem.h:57
std::vector< uint8_t > dataVec
Type of the payload or data.
Definition: simpleMem.h:76
void setPayload(const std::vector< uint8_t > &data_in)
Set the contents of the payload / data field.
Definition: simpleMem.h:116
void operator()(Request *req)
Function called when Handler is invoked.
Definition: simpleMem.h:222
Functor classes for Clock handling.
Definition: simpleMem.h:165
virtual void sendInitData(Request *req)=0
Sends a memory-based request during the init() phase.
flags_t flags
Definition: simpleMem.h:82
Event * recvInitData()
Receive an event (if any) during the init() phase.
Definition: link.cc:173
Simplified, generic interface to Memory models.
Definition: simpleMem.h:37
Definition: simpleMem.h:69
void operator()(Request *req)
Function called when Handler is invoked.
Definition: simpleMem.h:197
Handler(classT *const object, PtrMember member)
Constructor.
Definition: simpleMem.h:217
Definition: simpleMem.h:56
SimpleMem(SST::Component *comp, Params ¶ms)
Constructor, designed to be used via 'loadSubComponent'.
Definition: simpleMem.h:229
void sendInitData(Event *init_data)
Send data during the init() phase.
Definition: link.cc:147
Addr instrPtr
Definition: simpleMem.h:86
Request(Command cmd, Addr addr, size_t size, dataVec &data, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:90
Definition: simpleMem.h:60
Addr virtualAddr
Definition: simpleMem.h:87
Event Handler class with user-data argument.
Definition: simpleMem.h:178
virtual void sendInitData(SST::Event *ev)
Sends a generic Event during the init() phase (Mostly acts as a passthrough)
Definition: simpleMem.h:249
virtual void operator()(Request *)=0
Function called when Handler is invoked.
Definition: simpleMem.h:68
virtual bool initialize(const std::string &linkName, HandlerBase *handler=NULL)=0
Second half of building the interface.
Definition: simpleMem.h:55
Parameter store.
Definition: params.h:44
uint64_t Addr
All Addresses can be 64-bit.
Definition: simpleMem.h:41
void setVirtualAddress(const Addr newVA)
Set the virtual address associated with the operation.
Definition: simpleMem.h:135
Flags
Flags to specify conditions on a Request.
Definition: simpleMem.h:67
void setPayload(uint8_t *data_in, size_t len)
Set the contents of the payload / data field.
Definition: simpleMem.h:124
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:31
Addr addr
Definition: simpleMem.h:79
SubComponent is a class loadable through the factory which allows dynamic functionality to be added t...
Definition: subcomponent.h:27
Link between two components.
Definition: link.h:33
uint64_t id_t
Definition: simpleMem.h:48
id_t id
Definition: simpleMem.h:84
virtual Request * recvResponse(void)=0
Receive a Request response from the side of the link.
Request(Command cmd, Addr addr, size_t size, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:98
flags_t memFlags
Definition: simpleMem.h:83