13#include "MemoryRequest.hpp"
15namespace sparta_target
20 static constexpr char name[] =
"memory";
28 PARAMETER(uint32_t, memory_size , 1024*4,
"Memory Size")
29 PARAMETER(uint32_t, memory_width , 4,
"Memory width")
30 PARAMETER(uint32_t, accept_delay , 4,
"Acceptance delay for new transactions")
31 PARAMETER(uint32_t, read_response_delay , 4,
"Read response delay")
32 PARAMETER(uint32_t, write_response_delay, 4,
"Write response delay")
38 memory_size_ (params->memory_size ),
39 memory_width_ (params->memory_width ),
40 accept_delay_ (params->accept_delay ),
41 read_response_delay_ (params->read_response_delay ),
42 write_response_delay_(params->write_response_delay)
45 m_memory =
new uint8_t[size_t(memory_size_)];
47 memset(m_memory, 0,
size_t(memory_size_));
51 receiveMemoryRequest_,
58 void memoryOperation(MemoryRequest &);
63 void receiveMemoryRequest_(
const MemoryRequest &);
64 void driveMemoryResponse_(
const MemoryRequest &);
70 const uint32_t memory_size_;
71 const uint32_t memory_width_;
72 const uint32_t accept_delay_;
73 const uint32_t read_response_delay_;
74 const uint32_t write_response_delay_;
File that defines Data[In,Out]Port<DataT>
A set of sparta::Parameters per sparta::ResourceTreeNode.
#define PARAMETER(type, name, def, doc)
Parameter declaration.
File that defines the PayloadEvent class.
File that defines the Resource class. Consider using sparta::Unit instead.
#define sparta_assert(...)
Simple variadic assertion that will throw a sparta_exception if the condition fails.
#define CREATE_SPARTA_HANDLER_WITH_DATA(clname, meth, dataT)
Basic Node framework in sparta device tree composite pattern.
File that defines the Unit class, a common grouping of sets and loggers.
DataInPort receives data from sender using a DataOutPort.
DataOutPort is used for transferring any data to another module.
Generic container of Parameters.
Class to schedule a Scheduleable in the future with a payload, typed on both the data type and the sc...
Node in a composite tree representing a sparta Tree item.
The is the base class for user defined blocks in simulation.
Unit(TreeNode *rc, const std::string &name)
Construct unit with a ResouceContainer.
PortSet * getPortSet()
Return the port set.
EventSet * getEventSet()
Return the event set.
SpartaMemory(sparta::TreeNode *container_node, const SpartaMemoryParameters *params)
Macros for handling exponential backoff.