TLM 2.0 Protocol Checking
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
<ThermalSimulation value="0"/>
|
||||
<SimulationProgressBar value="0"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
<CheckTLM2Protocol value = "0" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
|
||||
@@ -170,6 +170,8 @@ void Configuration::setParameter(std::string name, std::string value)
|
||||
SimulationProgressBar = string2bool(value);
|
||||
else if(name == "NumberOfDevicesOnDIMM")
|
||||
NumberOfDevicesOnDIMM = string2int(value);
|
||||
else if(name == "CheckTLM2Protocol")
|
||||
CheckTLM2Protocol = string2bool(value);
|
||||
// Specification for ErrorChipSeed, ErrorCSVFile path and StoreMode
|
||||
else if(name == "ErrorChipSeed")
|
||||
ErrorChipSeed = string2int(value);
|
||||
|
||||
@@ -85,6 +85,7 @@ struct Configuration
|
||||
bool ThermalSimulation = false;
|
||||
bool SimulationProgressBar = false;
|
||||
unsigned int NumberOfDevicesOnDIMM = 1;
|
||||
bool CheckTLM2Protocol = false;
|
||||
|
||||
//MemSpec(from DRAM-Power XML)
|
||||
MemSpec memSpec;
|
||||
|
||||
@@ -118,6 +118,11 @@ void Simulation::instantiateModules(const string &traceName, const string &pathT
|
||||
|
||||
#if USE_EXAMPLE_INITIATOR
|
||||
init = new ExampleInitiator("init");
|
||||
if(Configuration::getInstance().CheckTLM2Protocol) {
|
||||
string str = "tlmChecker"+ std::to_string(tlmCheckers.size());
|
||||
tlm_utils::tlm2_base_protocol_checker<32> *tlmChecker = new tlm_utils::tlm2_base_protocol_checker<32>(str.c_str());
|
||||
tlmCheckers.push_back(tlmChecker);
|
||||
}
|
||||
#else
|
||||
for (size_t i = 0; i < Configuration::getInstance().NumberOfTracePlayers; i++) {
|
||||
std::string playerStr = "tracePlayer" + std::to_string(i);
|
||||
@@ -147,10 +152,14 @@ void Simulation::instantiateModules(const string &traceName, const string &pathT
|
||||
totalTransactions += player->getNumberOfLines(pathToResources + string("traces/") + devices[i].trace);
|
||||
}
|
||||
players.push_back(player);
|
||||
|
||||
if(Configuration::getInstance().CheckTLM2Protocol) {
|
||||
string str = "tlmChecker"+ std::to_string(tlmCheckers.size());
|
||||
tlm_utils::tlm2_base_protocol_checker<32> *tlmChecker = new tlm_utils::tlm2_base_protocol_checker<32>(str.c_str());
|
||||
tlmCheckers.push_back(tlmChecker);
|
||||
}
|
||||
}
|
||||
|
||||
remainingTransactions = totalTransactions;
|
||||
|
||||
#endif /* USE_EXAMPLE_INITIATOR */
|
||||
|
||||
// Create and properly initialize TLM recorders. They need to be ready before creating some modules.
|
||||
@@ -170,22 +179,55 @@ void Simulation::instantiateModules(const string &traceName, const string &pathT
|
||||
dram->setTlmRecorder(tlmRecorders[i]);
|
||||
dram->setDramController(controllers[i]);
|
||||
drams.push_back(dram);
|
||||
|
||||
if(Configuration::getInstance().CheckTLM2Protocol) {
|
||||
str = "tlmChecker"+ std::to_string(tlmCheckers.size());
|
||||
tlm_utils::tlm2_base_protocol_checker<32> *tlmChecker = new tlm_utils::tlm2_base_protocol_checker<32>(str.c_str());
|
||||
tlmCheckers.push_back(tlmChecker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Simulation::bindSockets()
|
||||
{
|
||||
#if USE_EXAMPLE_INITIATOR
|
||||
init->socket.bind(arbiter->tSocket);
|
||||
#else
|
||||
for (auto player : players) {
|
||||
player->iSocket.bind(arbiter->tSocket);
|
||||
if(Configuration::getInstance().CheckTLM2Protocol) {
|
||||
init->socket.bind(tlmCheckers[0]->target_socket);
|
||||
tlmCheckers[0]->initiator_socket.bind(arbiter->tSocket);
|
||||
|
||||
for (size_t i = 0; i < Configuration::getInstance().NumberOfMemChannels; i++) {
|
||||
arbiter->iSocket.bind(tlmCheckers[i+1]->target_socket);
|
||||
tlmCheckers[i+1]->initiator_socket.bind(controllers[i]->tSocket);
|
||||
controllers[i]->iSocket.bind(drams[i]->tSocket);
|
||||
}
|
||||
}
|
||||
else {
|
||||
init->socket.bind(arbiter->tSocket);
|
||||
|
||||
#else
|
||||
if(Configuration::getInstance().CheckTLM2Protocol) {
|
||||
for (size_t i = 0; i < players.size(); i++) {
|
||||
players[i]->iSocket.bind(tlmCheckers[i]->target_socket);
|
||||
tlmCheckers[i]->initiator_socket.bind(arbiter->tSocket);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < Configuration::getInstance().NumberOfMemChannels; i++) {
|
||||
arbiter->iSocket.bind(tlmCheckers[i+players.size()]->target_socket);
|
||||
tlmCheckers[i+players.size()]->initiator_socket.bind(controllers[i]->tSocket);
|
||||
controllers[i]->iSocket.bind(drams[i]->tSocket);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (auto player : players) {
|
||||
player->iSocket.bind(arbiter->tSocket);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < Configuration::getInstance().NumberOfMemChannels; i++) {
|
||||
arbiter->iSocket.bind(controllers[i]->tSocket);
|
||||
controllers[i]->iSocket.bind(drams[i]->tSocket);
|
||||
for (size_t i = 0; i < Configuration::getInstance().NumberOfMemChannels; i++) {
|
||||
arbiter->iSocket.bind(controllers[i]->tSocket);
|
||||
controllers[i]->iSocket.bind(drams[i]->tSocket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,6 +237,8 @@ Simulation::~Simulation()
|
||||
delete player;
|
||||
}
|
||||
|
||||
delete init;
|
||||
|
||||
delete arbiter;
|
||||
|
||||
for (auto controller : controllers) {
|
||||
@@ -208,6 +252,10 @@ Simulation::~Simulation()
|
||||
for (auto rec : tlmRecorders) {
|
||||
delete rec;
|
||||
}
|
||||
|
||||
for (auto tlmChecker : tlmCheckers) {
|
||||
delete tlmChecker;
|
||||
}
|
||||
}
|
||||
|
||||
void Simulation::start()
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "../controller/Controller.h"
|
||||
#include "../common/third_party/tinyxml2/tinyxml2.h"
|
||||
#include "ExampleInitiator.h"
|
||||
#include "../common/tlm2_base_protocol_checker.h"
|
||||
|
||||
struct DramSetup
|
||||
{
|
||||
@@ -99,6 +100,8 @@ private:
|
||||
// A vector of pointers to all trace player (devices which acquire the bus
|
||||
// and initiate transactions targeting the memory)
|
||||
std::vector<TracePlayer*> players;
|
||||
//TLM 2.0 Protocol Checkers
|
||||
std::vector<tlm_utils::tlm2_base_protocol_checker<32>*> tlmCheckers;
|
||||
// All transactions pass through the same arbiter
|
||||
ExampleInitiator *init;
|
||||
Arbiter *arbiter;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<ThermalSimulation value="0"/>
|
||||
<SimulationProgressBar value="1"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
<CheckTLM2Protocol value = "0" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<ThermalSimulation value="0"/>
|
||||
<SimulationProgressBar value="1"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
<CheckTLM2Protocol value = "0" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
|
||||
@@ -406,6 +406,7 @@ The DRAMSys' main configuration file is presented below.
|
||||
<ThermalSimulation value="1"/>
|
||||
<SimulationProgressBar value="1"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
<CheckTLM2Protocol value = "0" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
@@ -508,7 +509,8 @@ The XML code below shows a typic configuration:
|
||||
<ControllerCoreDisableRefresh value="0"/>
|
||||
<ThermalSimulation value="0"/>
|
||||
<SimulationProgressBar value="1"/>
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
<NumberOfDevicesOnDIMM value = "1" />
|
||||
<CheckTLM2Protocol value = "0" />
|
||||
</simconfig>
|
||||
|
||||
<!-- Temperature Simulator Configuration (used for all simulation setups) -->
|
||||
@@ -636,6 +638,9 @@ Below are listed the configuration sections and configuration fields.
|
||||
- "0": disables the simulation progress bar
|
||||
- *NumberOfDevicesOnDIMM* (unsigned int)
|
||||
- Number of devices on dual inline memory module
|
||||
- *CheckTLM2Protocol* (boolean)
|
||||
- "1": enables the TLM 2.0 Protocol Checking
|
||||
- "0": disables the TLM 2.0 Protocol Checking
|
||||
|
||||
- **Temperature Simulator Configuration**
|
||||
- *TemperatureScale* (string)
|
||||
|
||||
Reference in New Issue
Block a user