mem-ruby: fix ruby startup() to reset exit event correctly (#773)

When restoring the simulate_limit_event pointer is not
restored after running the dry simulation run which ends up in
"Panic: event not found!"
In this commit we fix this issue by correctly restoring
the pointer value along with the event queue head

Change-Id: Id5ad4d2a270a6cd34eec1dc5c9b170b2b84610d4

---------

Co-authored-by: narya <nitish.arya@bsc.es>
Co-authored-by: Jason Lowe-Power <jason@lowepower.com>
This commit is contained in:
Nitish Arya
2024-01-17 17:41:10 +01:00
committed by GitHub
parent 70376d43a3
commit c2a22b03b4

View File

@@ -454,6 +454,9 @@ RubySystem::startup()
Tick curtick_original = curTick();
// save the event queue head
Event* eventq_head = eventq->replaceHead(NULL);
// save the exit event pointer
GlobalSimLoopExitEvent *original_simulate_limit_event = nullptr;
original_simulate_limit_event = simulate_limit_event;
// set curTick to 0 and reset Ruby System's clock
setCurTick(0);
resetClock();
@@ -471,6 +474,8 @@ RubySystem::startup()
// Restore eventq head
eventq->replaceHead(eventq_head);
// Restore exit event pointer
simulate_limit_event = original_simulate_limit_event;
// Restore curTick and Ruby System's clock
setCurTick(curtick_original);
resetClock();