gem5 v24.0.0.0
|
Wrapper class to avoid having DRAMSim2 names like ClockDomain etc clashing with the normal gem5 world. More...
#include <dramsim2_wrapper.hh>
Public Member Functions | |
DRAMSim2Wrapper (const std::string &config_file, const std::string &system_file, const std::string &working_dir, const std::string &trace_file, unsigned int memory_size_mb, bool enable_debug) | |
Create an instance of the DRAMSim2 multi-channel memory controller using a specific config and system description. | |
~DRAMSim2Wrapper () | |
void | printStats () |
Print the stats gathered in DRAMsim2. | |
void | setCallbacks (DRAMSim::TransactionCompleteCB *read_callback, DRAMSim::TransactionCompleteCB *write_callback) |
Set the callbacks to use for read and write completion. | |
bool | canAccept () const |
Determine if the controller can accept a new packet or not. | |
void | enqueue (bool is_write, uint64_t addr) |
Enqueue a packet. | |
double | clockPeriod () const |
Get the internal clock period used by DRAMSim2, specified in ns. | |
unsigned int | queueSize () const |
Get the transaction queue size used by DRAMSim2. | |
unsigned int | burstSize () const |
Get the burst size in bytes used by DRAMSim2. | |
void | tick () |
Progress the memory controller one cycle. | |
Private Member Functions | |
template<typename T > | |
T | extractConfig (const std::string &field_name, const std::string &file_name) const |
Private Attributes | |
DRAMSim::MultiChannelMemorySystem * | dramsim |
double | _clockPeriod |
unsigned int | _queueSize |
unsigned int | _burstSize |
Wrapper class to avoid having DRAMSim2 names like ClockDomain etc clashing with the normal gem5 world.
Many of the DRAMSim2 headers do not make use of namespaces, and quite a few also open up std. The only thing that needs to be exposed externally are the callbacks. This wrapper effectively avoids clashes by not including any of the conventional gem5 headers (e.g. Packet or SimObject).
Definition at line 73 of file dramsim2_wrapper.hh.
gem5::memory::DRAMSim2Wrapper::DRAMSim2Wrapper | ( | const std::string & | config_file, |
const std::string & | system_file, | ||
const std::string & | working_dir, | ||
const std::string & | trace_file, | ||
unsigned int | memory_size_mb, | ||
bool | enable_debug ) |
Create an instance of the DRAMSim2 multi-channel memory controller using a specific config and system description.
config_file | Memory config file |
system_file | Controller config file |
working_dir | Path pre-pended to config files |
trace_file | Output trace file |
memory_size_mb | Total memory size in MByte |
enable_debug | Enable debug output |
Definition at line 61 of file dramsim2_wrapper.cc.
References _burstSize, _clockPeriod, _queueSize, dramsim, extractConfig(), fatal, and SHOW_SIM_OUTPUT.
gem5::memory::DRAMSim2Wrapper::~DRAMSim2Wrapper | ( | ) |
Definition at line 110 of file dramsim2_wrapper.cc.
References dramsim.
unsigned int gem5::memory::DRAMSim2Wrapper::burstSize | ( | ) | const |
Get the burst size in bytes used by DRAMSim2.
Definition at line 186 of file dramsim2_wrapper.cc.
References _burstSize.
Referenced by gem5::memory::DRAMSim2::init().
bool gem5::memory::DRAMSim2Wrapper::canAccept | ( | ) | const |
Determine if the controller can accept a new packet or not.
Definition at line 161 of file dramsim2_wrapper.cc.
References dramsim.
Referenced by gem5::memory::DRAMSim2::recvTimingReq().
double gem5::memory::DRAMSim2Wrapper::clockPeriod | ( | ) | const |
Get the internal clock period used by DRAMSim2, specified in ns.
Definition at line 174 of file dramsim2_wrapper.cc.
References _clockPeriod.
Referenced by gem5::memory::DRAMSim2::readComplete(), gem5::memory::DRAMSim2::tick(), and gem5::memory::DRAMSim2::writeComplete().
void gem5::memory::DRAMSim2Wrapper::enqueue | ( | bool | is_write, |
uint64_t | addr ) |
Enqueue a packet.
This assumes that canAccept has returned true.
Definition at line 167 of file dramsim2_wrapper.cc.
References gem5::X86ISA::addr, and dramsim.
Referenced by gem5::memory::DRAMSim2::recvTimingReq().
|
private |
Definition at line 117 of file dramsim2_wrapper.cc.
References fatal, and gem5::ArmISA::iss.
Referenced by DRAMSim2Wrapper().
void gem5::memory::DRAMSim2Wrapper::printStats | ( | ) |
Print the stats gathered in DRAMsim2.
Definition at line 147 of file dramsim2_wrapper.cc.
References dramsim.
unsigned int gem5::memory::DRAMSim2Wrapper::queueSize | ( | ) | const |
Get the transaction queue size used by DRAMSim2.
Definition at line 180 of file dramsim2_wrapper.cc.
References _queueSize.
Referenced by gem5::memory::DRAMSim2::recvTimingReq(), and gem5::memory::DRAMSim2::tick().
void gem5::memory::DRAMSim2Wrapper::setCallbacks | ( | DRAMSim::TransactionCompleteCB * | read_callback, |
DRAMSim::TransactionCompleteCB * | write_callback ) |
Set the callbacks to use for read and write completion.
read_callback | Callback used for read completions |
write_callback | Callback used for write completions |
Definition at line 153 of file dramsim2_wrapper.cc.
References dramsim.
void gem5::memory::DRAMSim2Wrapper::tick | ( | ) |
Progress the memory controller one cycle.
Definition at line 192 of file dramsim2_wrapper.cc.
References dramsim.
Referenced by gem5::memory::DRAMSim2::tick().
|
private |
Definition at line 84 of file dramsim2_wrapper.hh.
Referenced by burstSize(), and DRAMSim2Wrapper().
|
private |
Definition at line 80 of file dramsim2_wrapper.hh.
Referenced by clockPeriod(), and DRAMSim2Wrapper().
|
private |
Definition at line 82 of file dramsim2_wrapper.hh.
Referenced by DRAMSim2Wrapper(), and queueSize().
|
private |
Definition at line 78 of file dramsim2_wrapper.hh.
Referenced by canAccept(), DRAMSim2Wrapper(), enqueue(), printStats(), setCallbacks(), tick(), and ~DRAMSim2Wrapper().