Skip to content

Commit

Permalink
dump engine log in case simulation test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
joern274 committed May 17, 2024
1 parent c5809ed commit e882c9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -1323,7 +1323,7 @@ namespace hal {
wd->clear();
}
}
qDebug() << "setUserTimeframe-Tfc" << mTimeframe.sceneMaxTime();
// qDebug() << "setUserTimeframe-Tfc" << mTimeframe.sceneMaxTime();
Q_EMIT timeframeChanged(&mTimeframe);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
}

Expand Down Expand Up @@ -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";
}

Expand Down Expand Up @@ -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";
}

Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -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";
}

Expand Down

0 comments on commit e882c9c

Please sign in to comment.