diff --git a/src/Execute.cpp b/src/Execute.cpp index 22ab26f..30d2e6b 100644 --- a/src/Execute.cpp +++ b/src/Execute.cpp @@ -876,8 +876,8 @@ bool Execute::ECALL(Instruction &inst) { cout << "Simulation time " << sc_time_stamp() << endl; perf->dump(); - SC_REPORT_ERROR("Execute", "ECALL"); - + //SC_REPORT_ERROR("Execute", "ECALL"); + sc_stop(); return true; } diff --git a/src/Simulator.cpp b/src/Simulator.cpp index 41aa47d..8c24c68 100644 --- a/src/Simulator.cpp +++ b/src/Simulator.cpp @@ -68,7 +68,6 @@ SC_MODULE(Simulator) } ~Simulator() { - cout << "Simulator destructor" << endl; delete cpu; delete MainMemory; delete Bus; @@ -120,7 +119,7 @@ void process_arguments(int argc, char* argv[]) { filename = std::string(optarg); break; case '?' : - std::cout << "Call ./RISCV_TLM -D (0..4) filename.hex" << std::endl; + std::cout << "Call ./RISCV_TLM -D (0..3) filename.hex" << std::endl; break; } } @@ -144,5 +143,12 @@ int sc_main(int argc, char* argv[]) top = new Simulator("top"); sc_start(); + + cout << "Press Enter to finish" << endl; + cin.ignore(); + + // call all destructors, clean exit. + delete top; + return 0; }