simulation bug fix -> stop after termination delta cycle
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
<parameter id="bankwiseLogic" type="bool" value="0" />
|
||||
<parameter id="openPagePolicy" type="bool" value="1" />
|
||||
<parameter id="adaptiveOpenPagePolicy" type="bool" value="0" />
|
||||
<parameter id="refreshAwareScheduling" type="bool" value="1" />
|
||||
<parameter id="maxNrOfTransactionsInDram" type="uint" value="50" />
|
||||
<parameter id="refreshAwareScheduling" type="bool" value="0" />
|
||||
<parameter id="maxNrOfTransactionsInDram" type="uint" value="100" />
|
||||
<parameter id="scheduler" type="string" value="FR_FCFS" />
|
||||
<parameter id="capsize" type="uint" value="5" />
|
||||
</memconfig>
|
||||
|
||||
11
dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml
Normal file
11
dram/resources/configs/memconfigs/fr_fcfs_bankwise.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<memspec>
|
||||
<memconfig>
|
||||
<parameter id="bankwiseLogic" type="bool" value="1" />
|
||||
<parameter id="openPagePolicy" type="bool" value="1" />
|
||||
<parameter id="adaptiveOpenPagePolicy" type="bool" value="0" />
|
||||
<parameter id="refreshAwareScheduling" type="bool" value="0" />
|
||||
<parameter id="maxNrOfTransactionsInDram" type="uint" value="100" />
|
||||
<parameter id="scheduler" type="string" value="FR_FCFS" />
|
||||
<parameter id="capsize" type="uint" value="5" />
|
||||
</memconfig>
|
||||
</memspec>
|
||||
@@ -2,19 +2,12 @@
|
||||
<memspec>MICRON_4Gb_DDR4-1866_8bit_A.xml</memspec>
|
||||
<addressmapping>am_wideio.xml</addressmapping>
|
||||
<memconfigs>
|
||||
<memconfig>memconfig.xml</memconfig>
|
||||
<memconfig>fifo.xml</memconfig>
|
||||
<memconfig>fr_fcfs_unaware.xml</memconfig>
|
||||
<memconfig>fr_fcfs.xml</memconfig>
|
||||
<memconfig>fr_fcfs_bankwise.xml</memconfig>
|
||||
</memconfigs>
|
||||
<trace-setups>
|
||||
<trace-setup id="1">
|
||||
<device >chstone-mips_32.stl</device>
|
||||
</trace-setup>
|
||||
<trace-setup id="2">
|
||||
<device >chstone-adpcm_32.stl</device>
|
||||
<device >empty.stl</device>
|
||||
<device >empty.stl</device>
|
||||
<device >empty.stl</device>
|
||||
<device >mediabench-h263encode_32.stl</device>
|
||||
</trace-setup>
|
||||
</trace-setups>
|
||||
</simulation>
|
||||
|
||||
@@ -22,13 +22,15 @@ namespace simulation {
|
||||
|
||||
void Simulation::setupDebugManager(bool silent, const string& traceName)
|
||||
{
|
||||
SC_THREAD(stop);
|
||||
|
||||
vector<string> 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<Device> devices,
|
||||
Simulation::Simulation(sc_module_name name, string pathToResources, string traceName, DramSetup setup, std::vector<Device> 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<<endl;
|
||||
stop();
|
||||
terminateSimulation.notify();
|
||||
}
|
||||
}
|
||||
void Simulation::stop()
|
||||
{
|
||||
wait(terminateSimulation);
|
||||
report("\nTerminating simulation");
|
||||
controller->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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<Device> 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<NumberOfTracePlayers, 128> *arbiter;
|
||||
Controller<> *controller;
|
||||
|
||||
Reference in New Issue
Block a user