Go to the documentation of this file.
45 #include "DRAMsim3/src/dramsim3.h"
56 const std::string& working_dir,
57 std::function<
void(uint64_t)> read_cb,
58 std::function<
void(uint64_t)> write_cb) :
59 dramsim(
dramsim3::GetMemorySystem(config_file, working_dir,
61 _clockPeriod(0.0), _queueSize(0), _burstSize(0)
68 fatal(
"DRAMsim3 wrapper failed to get clock\n");
75 fatal(
"DRAMsim3 wrapper failed to get queue size\n");
80 unsigned int dataBusBits =
dramsim->GetBusBits();
81 unsigned int burstLength =
dramsim->GetBurstLength();
83 if (!dataBusBits || !burstLength)
84 fatal(
"DRAMsim3 wrapper failed to get burst size\n");
109 std::function<
void(uint64_t)> write_complete)
111 dramsim->RegisterCallbacks(read_complete, write_complete);
117 return dramsim->WillAcceptTransaction(
addr, is_write);
123 [[maybe_unused]]
bool success =
dramsim->AddTransaction(
addr, is_write);
dramsim3::MemorySystem * dramsim
#define fatal(...)
This implements a cprintf based fatal() function.
bool canAccept(uint64_t addr, bool is_write) const
Determine if the controller can accept a new packet or not.
double clockPeriod() const
Get the internal clock period used by DRAMsim3, specified in ns.
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.
unsigned int burstSize() const
Get the burst size in bytes used by DRAMsim3.
void printStats()
Print the stats gathered in DRAMsim3.
unsigned int queueSize() const
Get the transaction queue size used by DRAMsim3.
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...
Forward declaration to avoid includes.
void enqueue(uint64_t addr, bool is_write)
Enqueue a packet.
void tick()
Progress the memory controller one cycle.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void resetStats()
Reset stats (useful for fastforwarding switch)
Generated on Sun Jul 30 2023 01:56:58 for gem5 by doxygen 1.8.17