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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user