From c2a22b03b43368fde6fe0622224d07cd0570f440 Mon Sep 17 00:00:00 2001 From: Nitish Arya <42148385+aryanitish@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:41:10 +0100 Subject: [PATCH] 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 Co-authored-by: Jason Lowe-Power --- src/mem/ruby/system/RubySystem.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mem/ruby/system/RubySystem.cc b/src/mem/ruby/system/RubySystem.cc index 109fd43051..21062eac14 100644 --- a/src/mem/ruby/system/RubySystem.cc +++ b/src/mem/ruby/system/RubySystem.cc @@ -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();