added sc_stop at the end of the simulation to call destructors
This commit is contained in:
parent
0415ba3c66
commit
1babf6cb88
|
@ -876,8 +876,8 @@ bool Execute::ECALL(Instruction &inst) {
|
||||||
cout << "Simulation time " << sc_time_stamp() << endl;
|
cout << "Simulation time " << sc_time_stamp() << endl;
|
||||||
perf->dump();
|
perf->dump();
|
||||||
|
|
||||||
SC_REPORT_ERROR("Execute", "ECALL");
|
//SC_REPORT_ERROR("Execute", "ECALL");
|
||||||
|
sc_stop();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,6 @@ SC_MODULE(Simulator)
|
||||||
}
|
}
|
||||||
|
|
||||||
~Simulator() {
|
~Simulator() {
|
||||||
cout << "Simulator destructor" << endl;
|
|
||||||
delete cpu;
|
delete cpu;
|
||||||
delete MainMemory;
|
delete MainMemory;
|
||||||
delete Bus;
|
delete Bus;
|
||||||
|
@ -120,7 +119,7 @@ void process_arguments(int argc, char* argv[]) {
|
||||||
filename = std::string(optarg);
|
filename = std::string(optarg);
|
||||||
break;
|
break;
|
||||||
case '?' :
|
case '?' :
|
||||||
std::cout << "Call ./RISCV_TLM -D <debuglevel> (0..4) filename.hex" << std::endl;
|
std::cout << "Call ./RISCV_TLM -D <debuglevel> (0..3) filename.hex" << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,5 +143,12 @@ int sc_main(int argc, char* argv[])
|
||||||
|
|
||||||
top = new Simulator("top");
|
top = new Simulator("top");
|
||||||
sc_start();
|
sc_start();
|
||||||
|
|
||||||
|
cout << "Press Enter to finish" << endl;
|
||||||
|
cin.ignore();
|
||||||
|
|
||||||
|
// call all destructors, clean exit.
|
||||||
|
delete top;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue