From c16f083c023844098c2863902a2d0540793f09f8 Mon Sep 17 00:00:00 2001 From: Rajit Manohar Date: Sat, 4 Feb 2023 10:30:00 -0500 Subject: [PATCH] each list insert must be matched with an object in sstall --- chpsim.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chpsim.cc b/chpsim.cc index 73db4d4..34b82ac 100644 --- a/chpsim.cc +++ b/chpsim.cc @@ -1055,6 +1055,7 @@ int ChpSim::Step (Event *ev) int _breakpt = 0; if (pc == MAX_LOCAL_PCS) { + // wake-up from a shared variable scenario Assert (!list_isempty (_stalled_pc), "What?"); pc = list_delete_ihead (_stalled_pc); } @@ -1560,13 +1561,11 @@ int ChpSim::Step (Event *ev) forceret = 1; if ((stmt->u.cond.is_shared || stmt->u.cond.is_probe) && (_add_waitcond (&stmt->u.cond.c, pc) || stmt->u.cond.is_shared)) { - if (list_isempty (_stalled_pc)) { #ifdef DUMP_ALL printf (" [stall-sh]"); #endif sStall (); - } - list_iappend (_stalled_pc, pc); + list_iappend (_stalled_pc, pc); } else { if (!_probe) {