14 #ifndef SST_CORE_INTERFACES_SIMPLEMEM_H_
15 #define SST_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 {
47 typedef uint64_t
Addr;
81 F_NONCACHEABLE = 1<<1,
85 F_FLUSH_SUCCESS = 1<<5,
105 Request(
Command cmd, Addr addr,
size_t size, dataVec &data, flags_t flags = 0, flags_t memFlags = 0) :
106 cmd(cmd), addr(addr), size(size), data(data), flags(flags), memFlags(memFlags),
107 instrPtr(0), virtualAddr(0), custOpc(0xFFFF)
109 addrs.push_back(addr);
114 Request(
Command cmd, Addr addr,
size_t size, flags_t flags = 0, flags_t memFlags = 0) :
115 cmd(cmd), addr(addr), size(size), flags(flags), memFlags(memFlags),
116 instrPtr(0), virtualAddr(0), custOpc(0xFFFF)
118 addrs.push_back(addr);
123 Request(
Command cmd, Addr addr,
size_t size, dataVec &data, uint32_t Opc, flags_t flags = 0, flags_t memFlags = 0) :
124 cmd(cmd), addr(addr), size(size), data(data), flags(flags), memFlags(memFlags),
125 instrPtr(0), virtualAddr(0), custOpc(Opc)
127 addrs.push_back(addr);
132 Request(
Command cmd, Addr addr,
size_t size, uint32_t Opc, flags_t flags = 0, flags_t memFlags = 0) :
133 cmd(cmd), addr(addr), size(size), flags(flags), memFlags(memFlags),
134 instrPtr(0), virtualAddr(0), custOpc(Opc)
136 addrs.push_back(addr);
140 void addAddress(Addr addr)
142 addrs.push_back(addr);
160 for (
size_t i = 0 ; i < len ; i++ ) {
161 data[i] = data_in[i];
177 return (uint64_t) virtualAddr;
206 flags = flags | inValue;
227 memFlags = memFlags | inValue;
246 static std::atomic<id_t> main_id;
263 template <
typename classT,
typename argT =
void>
266 typedef void (classT::*PtrMember)(Request*, argT);
268 const PtrMember member;
277 Handler( classT*
const object, PtrMember member, argT data ) :
284 return (object->*member)(req,data);
291 template <
typename classT>
294 typedef void (classT::*PtrMember)(Request*);
296 const PtrMember member;
303 Handler( classT*
const object, PtrMember member ) :
309 return (object->*member)(req);
323 virtual bool initialize(
const std::string& linkName, HandlerBase *handler =
nullptr) = 0;
Definition: simpleMem.h:64
virtual SST::Event * recvInitData()
Receive any data during the init() phase.
Definition: simpleMem.h:341
Definition: simpleMem.h:70
size_t size
Definition: simpleMem.h:95
uint32_t flags_t
Definition: simpleMem.h:55
Request(Command cmd, Addr addr, size_t size, uint32_t Opc, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:132
Addr getInstructionPointer()
Definition: simpleMem.h:191
Command
Commands and responses possible with a Request object.
Definition: simpleMem.h:60
Represents both memory requests and responses.
Definition: simpleMem.h:52
virtual void sendRequest(Request *req)=0
Send a Request to the other side of the link.
std::vector< Addr > addrs
Definition: simpleMem.h:93
virtual SST::Link * getLink(void) const =0
Returns a handle to the underlying SST::Link.
Definition: simpleMem.h:69
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:25
uint64_t getVirtualAddress()
Definition: simpleMem.h:176
Command cmd
Definition: simpleMem.h:92
Definition: simpleMem.h:67
Definition: simpleMem.h:65
Handler(classT *const object, PtrMember member, argT data)
Constructor.
Definition: simpleMem.h:277
dataVec data
Definition: simpleMem.h:96
Definition: simpleMem.h:63
void setFlags(flags_t inValue)
Definition: simpleMem.h:205
std::vector< uint8_t > dataVec
Type of the payload or data.
Definition: simpleMem.h:90
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:123
void setInstructionPointer(const Addr newIP)
Sets the instruction pointer associated with the operation.
Definition: simpleMem.h:184
void setPayload(const std::vector< uint8_t > &data_in)
Set the contents of the payload / data field.
Definition: simpleMem.h:149
void operator()(Request *req)
Function called when Handler is invoked.
Definition: simpleMem.h:308
Definition: simpleMem.h:68
Functor classes for Clock handling.
Definition: simpleMem.h:251
virtual void sendInitData(Request *req)=0
Sends a memory-based request during the init() phase.
flags_t flags
Definition: simpleMem.h:97
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
void operator()(Request *req)
Function called when Handler is invoked.
Definition: simpleMem.h:283
flags_t getMemFlags(void)
Definition: simpleMem.h:233
Handler(classT *const object, PtrMember member)
Constructor.
Definition: simpleMem.h:303
Definition: simpleMem.h:62
void sendInitData(Event *init_data)
Send data during the init() or complete() phase.
Definition: link.h:179
void clearFlags(void)
Clears the flags associated with the operation.
Definition: simpleMem.h:198
Addr instrPtr
Definition: simpleMem.h:100
Request(Command cmd, Addr addr, size_t size, dataVec &data, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:105
Definition: simpleMem.h:66
virtual Addr getLineSize()
Get cache/memory line size from the memory system.
Definition: simpleMem.h:378
Event * recvInitData()
Receive an event (if any) during the init() or complete() phase.
Definition: link.h:188
Addr virtualAddr
Definition: simpleMem.h:101
flags_t getFlags(void)
Definition: simpleMem.h:212
Event Handler class with user-data argument.
Definition: simpleMem.h:264
virtual void sendInitData(SST::Event *ev)
Sends a generic Event during the init() phase (Mostly acts as a passthrough)
Definition: simpleMem.h:335
virtual void operator()(Request *)=0
Function called when Handler is invoked.
void setMemFlags(flags_t inValue)
Definition: simpleMem.h:226
Definition: simpleMem.h:61
Parameter store.
Definition: params.h:44
uint64_t Addr
All Addresses can be 64-bit.
Definition: simpleMem.h:43
void setVirtualAddress(const Addr newVA)
Set the virtual address associated with the operation.
Definition: simpleMem.h:169
uint32_t getCustomOpc(void)
Definition: simpleMem.h:240
void setPayload(uint8_t *data_in, size_t len)
Set the contents of the payload / data field.
Definition: simpleMem.h:158
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:315
uint32_t custOpc
Definition: simpleMem.h:102
Addr addr
Definition: simpleMem.h:94
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:32
uint64_t id_t
Definition: simpleMem.h:54
id_t id
Definition: simpleMem.h:99
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:219
Request(Command cmd, Addr addr, size_t size, flags_t flags=0, flags_t memFlags=0)
Constructor.
Definition: simpleMem.h:114
flags_t memFlags
Definition: simpleMem.h:98