Example initiator and TLM checkers
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<memconfig>
|
||||
<BankwiseLogic value="0"/>
|
||||
<OpenPagePolicy value="1" />
|
||||
<MaxNrOfTransactions value="8" />
|
||||
<Scheduler value="PAR_BS" />
|
||||
<Capsize value="5" />
|
||||
<PowerDownMode value="NoPowerDown" /> <!-- 4 Modes: NoPowerDown, Staggered, TimeoutPDN, TimeoutSREF -->
|
||||
<PowerDownTimeout value="100" />
|
||||
<!-- Error Modelling -->
|
||||
<ErrorChipSeed value="42" />
|
||||
<ErrorCSVFile value="../../DRAMSys/simulator/src/error/error.csv" />
|
||||
<!-- Modes: NoStorage, Store (store data without errormodel), ErrorModel (store data with errormodel) -->
|
||||
<StoreMode value="NoStorage" />
|
||||
</memconfig>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# "DRAMSys/simulator/simulator.pro"
|
||||
|
||||
# simulation files
|
||||
OTHER_FILES += resources/simulations/sim-batch.xml
|
||||
OTHER_FILES += resources/simulations/sim-batch.xml
|
||||
OTHER_FILES += resources/simulations/ddr3-example.xml
|
||||
|
||||
# scripts
|
||||
@@ -58,6 +58,7 @@ OTHER_FILES += resources/configs/memconfigs/_old/grouper.xml
|
||||
OTHER_FILES += resources/configs/memconfigs/_old/par_bs.xml
|
||||
OTHER_FILES += resources/configs/memconfigs/_old/fr_fcfs_bankwise.xml
|
||||
OTHER_FILES += resources/configs/memconfigs/fr_fcfs.xml
|
||||
OTHER_FILES += resources/configs/memconfigs/par_bs.xml
|
||||
|
||||
# memspecs
|
||||
OTHER_FILES += resources/configs/memspecs/memspec.dtd
|
||||
|
||||
@@ -51,8 +51,6 @@
|
||||
#include "../simulation/TemperatureController.h"
|
||||
#include "../controller/Controller.h"
|
||||
|
||||
#define USE_EXAMPLE_INITIATOR 0
|
||||
|
||||
using namespace std;
|
||||
|
||||
Simulation::Simulation(sc_module_name __attribute__((unused)) name, string pathToResources, string traceName, DramSetup setup,
|
||||
@@ -119,9 +117,8 @@ 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);
|
||||
string str = "ExampleInitiatorTLMChecker";
|
||||
exampleInitiatorTlmChecker = new tlm_utils::tlm2_base_protocol_checker<>(str.c_str());
|
||||
}
|
||||
#else
|
||||
for (size_t i = 0; i < Configuration::getInstance().NumberOfTracePlayers; i++) {
|
||||
@@ -154,9 +151,9 @@ void Simulation::instantiateModules(const string &traceName, const string &pathT
|
||||
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);
|
||||
string str = "TLMCheckerPlayer"+ std::to_string(i);
|
||||
tlm_utils::tlm2_base_protocol_checker<> * playerTlmChecker = new tlm_utils::tlm2_base_protocol_checker<>(str.c_str());
|
||||
playersTlmCheckers.push_back(playerTlmChecker);
|
||||
}
|
||||
}
|
||||
remainingTransactions = totalTransactions;
|
||||
@@ -181,9 +178,9 @@ void Simulation::instantiateModules(const string &traceName, const string &pathT
|
||||
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);
|
||||
str = "TLMCheckerController"+ std::to_string(i);
|
||||
tlm_utils::tlm2_base_protocol_checker<> * controllerTlmChecker = new tlm_utils::tlm2_base_protocol_checker<>(str.c_str());
|
||||
controllersTlmCheckers.push_back(controllerTlmChecker);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,12 +189,12 @@ void Simulation::bindSockets()
|
||||
{
|
||||
#if USE_EXAMPLE_INITIATOR
|
||||
if(Configuration::getInstance().CheckTLM2Protocol) {
|
||||
init->socket.bind(tlmCheckers[0]->target_socket);
|
||||
tlmCheckers[0]->initiator_socket.bind(arbiter->tSocket);
|
||||
init->socket.bind(exampleInitiatorTlmChecker->target_socket);
|
||||
exampleInitiatorTlmChecker->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);
|
||||
arbiter->iSocket.bind(controllersTlmCheckers[i]->target_socket);
|
||||
controllersTlmCheckers[i]->initiator_socket.bind(controllers[i]->tSocket);
|
||||
controllers[i]->iSocket.bind(drams[i]->tSocket);
|
||||
}
|
||||
}
|
||||
@@ -207,13 +204,13 @@ void Simulation::bindSockets()
|
||||
#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);
|
||||
players[i]->iSocket.bind(playersTlmCheckers[i]->target_socket);
|
||||
playersTlmCheckers[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);
|
||||
arbiter->iSocket.bind(controllersTlmCheckers[i]->target_socket);
|
||||
controllersTlmCheckers[i]->initiator_socket.bind(controllers[i]->tSocket);
|
||||
controllers[i]->iSocket.bind(drams[i]->tSocket);
|
||||
}
|
||||
}
|
||||
@@ -237,7 +234,10 @@ Simulation::~Simulation()
|
||||
delete player;
|
||||
}
|
||||
|
||||
#if USE_EXAMPLE_INITIATOR
|
||||
delete init;
|
||||
delete exampleInitiatorTlmChecker;
|
||||
#endif
|
||||
|
||||
delete arbiter;
|
||||
|
||||
@@ -253,7 +253,11 @@ Simulation::~Simulation()
|
||||
delete rec;
|
||||
}
|
||||
|
||||
for (auto tlmChecker : tlmCheckers) {
|
||||
for (auto tlmChecker : playersTlmCheckers) {
|
||||
delete tlmChecker;
|
||||
}
|
||||
|
||||
for (auto tlmChecker : controllersTlmCheckers) {
|
||||
delete tlmChecker;
|
||||
}
|
||||
}
|
||||
@@ -327,4 +331,3 @@ void Simulation::report(string message)
|
||||
DebugManager::getInstance().printDebugMessage(this->name(), message);
|
||||
cout << message << endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
#include "ExampleInitiator.h"
|
||||
#include "../common/tlm2_base_protocol_checker.h"
|
||||
|
||||
#define USE_EXAMPLE_INITIATOR 0
|
||||
|
||||
struct DramSetup
|
||||
{
|
||||
DramSetup():memspec(NULL),memconfig(NULL),simconfig(NULL),addressmapping(NULL), thermalsimconfig(NULL) {}
|
||||
@@ -101,9 +103,13 @@ private:
|
||||
// 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
|
||||
std::vector<tlm_utils::tlm2_base_protocol_checker<>*> playersTlmCheckers;
|
||||
std::vector<tlm_utils::tlm2_base_protocol_checker<>*> controllersTlmCheckers;
|
||||
#if USE_EXAMPLE_INITIATOR
|
||||
ExampleInitiator *init;
|
||||
tlm_utils::tlm2_base_protocol_checker<>* exampleInitiatorTlmChecker;
|
||||
#endif
|
||||
// All transactions pass through the same arbiter
|
||||
Arbiter *arbiter;
|
||||
// Each DRAM unit has a controller
|
||||
std::vector<Controller*> controllers;
|
||||
@@ -126,4 +132,3 @@ private:
|
||||
};
|
||||
|
||||
#endif /* SIMULATIONMANAGER_H_ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user