diff --git a/dram/resources/configs/memconfigs/fr_fcfs.xml b/dram/resources/configs/memconfigs/fr_fcfs.xml index ad54f1e4..ba84ec9e 100644 --- a/dram/resources/configs/memconfigs/fr_fcfs.xml +++ b/dram/resources/configs/memconfigs/fr_fcfs.xml @@ -3,8 +3,8 @@ - - + + diff --git a/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml b/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml new file mode 100644 index 00000000..48daa1e8 --- /dev/null +++ b/dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/dram/resources/simulations/first.xml b/dram/resources/simulations/first.xml index 44906c04..619e6e4a 100644 --- a/dram/resources/simulations/first.xml +++ b/dram/resources/simulations/first.xml @@ -2,19 +2,12 @@ MICRON_4Gb_DDR4-1866_8bit_A.xml am_wideio.xml - memconfig.xml - fifo.xml - fr_fcfs_unaware.xml + fr_fcfs.xml + fr_fcfs_bankwise.xml - chstone-mips_32.stl - - - chstone-adpcm_32.stl - empty.stl - empty.stl - empty.stl + mediabench-h263encode_32.stl diff --git a/dram/src/simulation/Simulation.cpp b/dram/src/simulation/Simulation.cpp index 77ee2b98..5bbb31a7 100644 --- a/dram/src/simulation/Simulation.cpp +++ b/dram/src/simulation/Simulation.cpp @@ -22,13 +22,15 @@ namespace simulation { void Simulation::setupDebugManager(bool silent, const string& traceName) { + SC_THREAD(stop); + vector whiteList; if (!silent) { whiteList.push_back(controller->name()); whiteList.push_back(player2->name()); whiteList.push_back(player1->name()); - whiteList.push_back(this->senderName); + whiteList.push_back(this->name()); whiteList.push_back(TlmRecorder::senderName); whiteList.push_back(ControllerCore::senderName); whiteList.push_back(PowerDownManagerBankwise::senderName); @@ -43,9 +45,9 @@ void Simulation::setupDebugManager(bool silent, const string& traceName) } } -Simulation::Simulation(string name, string pathToResources, string traceName, DramSetup setup, std::vector devices, +Simulation::Simulation(sc_module_name name, string pathToResources, string traceName, DramSetup setup, std::vector devices, bool silent) : - traceName(traceName), senderName(name), dramSetup(setup) + traceName(traceName), dramSetup(setup) { xmlAddressDecoder::addressConfigURI = pathToResources + string("configs/amconfigs/") + setup.addressmapping; @@ -105,6 +107,7 @@ void Simulation::start() player2->start(); player3->start(); player4->start(); + sc_set_stop_mode(SC_STOP_FINISH_DELTA); sc_start(); } @@ -115,13 +118,15 @@ void inline Simulation::transactionFinished() if (remainingTransactions == 0) { cout<terminateSimulation(); + wait(sc_time(50, SC_NS)); TlmRecorder::getInstance().closeConnection(); sc_stop(); @@ -131,7 +136,7 @@ void Simulation::stop() void Simulation::report(string message) { - DebugManager::getInstance().printDebugMessage(senderName, message); + DebugManager::getInstance().printDebugMessage(this->name(), message); cout << message << endl; } diff --git a/dram/src/simulation/Simulation.h b/dram/src/simulation/Simulation.h index 7b1bbd07..c4c7a589 100644 --- a/dram/src/simulation/Simulation.h +++ b/dram/src/simulation/Simulation.h @@ -37,10 +37,11 @@ struct Device unsigned int burstLength; }; -class Simulation: public ISimulation +class Simulation: public ISimulation, public sc_module { public: - Simulation(string name, string pathToResources, string traceName, DramSetup setup, + SC_HAS_PROCESS(Simulation); + Simulation(sc_module_name name, string pathToResources, string traceName, DramSetup setup, std::vector devices, bool silent = false); ~Simulation(); @@ -52,9 +53,10 @@ public: private: std::string traceName; - std::string senderName; DramSetup dramSetup; + sc_event terminateSimulation; + Dram<> *dram; Arbiter *arbiter; Controller<> *controller;