Go to the documentation of this file.
54 #include "DRAMsim3/src/dramsim3.h"
59 const std::string& working_dir,
60 std::function<
void(uint64_t)> read_cb,
61 std::function<
void(uint64_t)> write_cb) :
62 dramsim(
dramsim3::GetMemorySystem(config_file, working_dir,
64 _clockPeriod(0.0), _queueSize(0), _burstSize(0)
71 fatal(
"DRAMsim3 wrapper failed to get clock\n");
78 fatal(
"DRAMsim3 wrapper failed to get queue size\n");
83 unsigned int dataBusBits =
dramsim->GetBusBits();
84 unsigned int burstLength =
dramsim->GetBurstLength();
86 if (!dataBusBits || !burstLength)
87 fatal(
"DRAMsim3 wrapper failed to get burst size\n");
112 std::function<
void(uint64_t)> write_complete)
114 dramsim->RegisterCallbacks(read_complete, write_complete);
120 return dramsim->WillAcceptTransaction(
addr, is_write);
126 bool success M5_VAR_USED =
dramsim->AddTransaction(
addr, is_write);
#define fatal(...)
This implements a cprintf based fatal() function.
unsigned int queueSize() const
Get the transaction queue size used by DRAMsim3.
void printStats()
Print the stats gathered in DRAMsim3.
unsigned int burstSize() const
Get the burst size in bytes used by DRAMsim3.
double clockPeriod() const
Get the internal clock period used by DRAMsim3, specified in ns.
void resetStats()
Reset stats (useful for fastforwarding switch)
void enqueue(uint64_t addr, bool is_write)
Enqueue a packet.
void setCallbacks(std::function< void(uint64_t)> read_complete, std::function< void(uint64_t)> write_complete)
Set the callbacks to use for read and write completion.
Forward declaration to avoid includes.
dramsim3::MemorySystem * dramsim
DRAMsim3Wrapper(const std::string &config_file, const std::string &working_dir, std::function< void(uint64_t)> read_cb, std::function< void(uint64_t)> write_cb)
Create an instance of the DRAMsim3 multi-channel memory controller using a specific config and system...
void tick()
Progress the memory controller one cycle.
bool canAccept(uint64_t addr, bool is_write) const
Determine if the controller can accept a new packet or not.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17