diff options
author | Tristan Gingold | 2014-03-29 04:38:27 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-03-29 04:38:27 +0100 |
commit | e7b2039857db4ba617c5a399c11cc4ff4c969959 (patch) | |
tree | 296cf09fce43c61770a9d45b4301a37b100a3429 /translate/grt/grt-signals.adb | |
parent | 8fc7559a26a3c634b7c87ada03744f5f31637b32 (diff) | |
download | ghdl-e7b2039857db4ba617c5a399c11cc4ff4c969959.tar.gz ghdl-e7b2039857db4ba617c5a399c11cc4ff4c969959.tar.bz2 ghdl-e7b2039857db4ba617c5a399c11cc4ff4c969959.zip |
Fix ticket11: remove from active list a signal not active in the next delta due
to a second assignment.
Diffstat (limited to 'translate/grt/grt-signals.adb')
-rw-r--r-- | translate/grt/grt-signals.adb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/translate/grt/grt-signals.adb b/translate/grt/grt-signals.adb index d939a97..4443bd9 100644 --- a/translate/grt/grt-signals.adb +++ b/translate/grt/grt-signals.adb @@ -675,6 +675,34 @@ package body Grt.Signals is Next := Next.Next; end if; end loop; + + -- A previous assignment (with a 0 after time) may have put this + -- signal on the active chain. But maybe this previous + -- transaction has been removed (due to rejection) and therefore + -- this signal won't be active at the next delta. So remove it + -- from the active chain. This is a little bit costly (because + -- the chain is simply linked), but that issue doesn't appear + -- frequently. + if Sign.Link /= null + and then Driver.First_Trans.Next.Time /= Current_Time + then + if Ghdl_Signal_Active_Chain = Sign then + -- At the head of the chain. + -- FIXME: this is not atomic. + Ghdl_Signal_Active_Chain := Sign.Link; + else + -- In the middle of the chain. + declare + Prev : Ghdl_Signal_Ptr := Ghdl_Signal_Active_Chain; + begin + while Prev.Link /= Sign loop + Prev := Prev.Link; + end loop; + Prev.Link := Sign.Link; + end; + end if; + Sign.Link := null; + end if; end; elsif Reject /= 0 then -- LRM93 8.4 |