From e882c9c0fc4ad3c3e527a0290291c184dc7dd570 Mon Sep 17 00:00:00 2001 From: joern274 Date: Fri, 17 May 2024 11:32:22 +0200 Subject: [PATCH] dump engine log in case simulation test failed --- .../src/wave_data.cpp | 8 ++++---- .../test/simulator_test.cpp | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/plugins/simulator/netlist_simulator_controller/src/wave_data.cpp b/plugins/simulator/netlist_simulator_controller/src/wave_data.cpp index 8cf4fdc3b08..419cf69a9fc 100644 --- a/plugins/simulator/netlist_simulator_controller/src/wave_data.cpp +++ b/plugins/simulator/netlist_simulator_controller/src/wave_data.cpp @@ -1290,20 +1290,20 @@ namespace hal { mTimeframe.setSceneMaxTime(tmax); if (mustUpdateClocks) updateClocks(); - qDebug() << "setMaxTime-Tfc" << mTimeframe.sceneMaxTime(); + // qDebug() << "setMaxTime-Tfc" << mTimeframe.sceneMaxTime(); Q_EMIT timeframeChanged(&mTimeframe); } void WaveDataList::emitTimeframeChanged() { - qDebug() << "emitTimeframeChanged-Tfc" << mTimeframe.sceneMaxTime(); + // qDebug() << "emitTimeframeChanged-Tfc" << mTimeframe.sceneMaxTime(); Q_EMIT timeframeChanged(&mTimeframe); } void WaveDataList::incrementSimulTime(u64 deltaT) { mTimeframe.mSimulateMaxTime += deltaT; - qDebug() << "incrementSimulTime-Tfc" << mTimeframe.mSimulateMaxTime << ">" << mTimeframe.mSceneMaxTime; + // qDebug() << "incrementSimulTime-Tfc" << mTimeframe.mSimulateMaxTime << ">" << mTimeframe.mSceneMaxTime; if (mTimeframe.mSimulateMaxTime > mTimeframe.mSceneMaxTime) setMaxTime(mTimeframe.mSimulateMaxTime); } @@ -1323,7 +1323,7 @@ namespace hal { wd->clear(); } } - qDebug() << "setUserTimeframe-Tfc" << mTimeframe.sceneMaxTime(); + // qDebug() << "setUserTimeframe-Tfc" << mTimeframe.sceneMaxTime(); Q_EMIT timeframeChanged(&mTimeframe); } diff --git a/plugins/simulator/netlist_simulator_controller/test/simulator_test.cpp b/plugins/simulator/netlist_simulator_controller/test/simulator_test.cpp index 4ce151d7109..0d6e3eb7622 100644 --- a/plugins/simulator/netlist_simulator_controller/test/simulator_test.cpp +++ b/plugins/simulator/netlist_simulator_controller/test/simulator_test.cpp @@ -63,6 +63,18 @@ namespace hal plugin_manager::unload_all_plugins(); } + void dump_engine_log(std::string directory) + { + std::cout << std::endl; + std::ifstream ff(directory + "/engine_log.html"); + while (ff.good()) + { + std::string line; + std::getline(ff,line); + std::cout << line << std::endl; + } + } + bool cmp_sim_data(NetlistSimulatorController* reference_simulation_ctrl, NetlistSimulatorController* simulation_ctrl, int tolerance = 200) { bool no_errors = true; @@ -429,6 +441,7 @@ namespace hal } if (verilator_engine->get_state() == SimulationEngine::State::Failed) { + dump_engine_log(verilator_engine->get_working_directory()); FAIL() << "engine failed"; } @@ -545,6 +558,7 @@ namespace hal if (verilator_engine->get_state() == SimulationEngine::State::Failed) { + dump_engine_log(verilator_engine->get_working_directory()); FAIL() << "engine failed"; } @@ -719,6 +733,7 @@ namespace hal if (verilator_engine->get_state() == SimulationEngine::State::Failed) { + dump_engine_log(verilator_engine->get_working_directory()); FAIL() << "engine failed"; } @@ -877,6 +892,7 @@ namespace hal if (verilator_engine->get_state() == SimulationEngine::State::Failed) { + dump_engine_log(verilator_engine->get_working_directory()); FAIL() << "engine failed"; } @@ -1333,6 +1349,7 @@ namespace hal if (verilator_engine->get_state() == SimulationEngine::State::Failed) { + dump_engine_log(verilator_engine->get_working_directory()); FAIL() << "engine failed"; }