aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-02-25 08:28:01 +0100
committerTristan Gingold <tgingold@free.fr>2018-02-25 08:28:01 +0100
commit39d357cdff5f78e3727db50b40b259d033670d7f (patch)
treed97b4e58cf3d21a3f32db7d0cfa989a6ea432064 /src
parentcd3ab2472302454d6c9a63ed8aef05d2a966ebb9 (diff)
downloadghdl-39d357cdff5f78e3727db50b40b259d033670d7f.tar.gz
ghdl-39d357cdff5f78e3727db50b40b259d033670d7f.tar.bz2
ghdl-39d357cdff5f78e3727db50b40b259d033670d7f.zip
vpi/force signals: ensure value propagation.
Fix #531
Diffstat (limited to 'src')
-rw-r--r--src/grt/grt-signals.adb14
-rw-r--r--src/grt/grt-vpi.adb14
2 files changed, 16 insertions, 12 deletions
diff --git a/src/grt/grt-signals.adb b/src/grt/grt-signals.adb
index 363e7977e..4cdc8c424 100644
--- a/src/grt/grt-signals.adb
+++ b/src/grt/grt-signals.adb
@@ -3324,15 +3324,21 @@ package body Grt.Signals is
Sig := Fv.Sig;
-- FIXME: Implement the full semantic of force: really force,
-- only set driving/effective value, release...
+ Mark_Active (Sig);
case Fv.Kind is
when Force_Driving =>
- Mark_Active (Sig);
Sig.Driving_Value := Fv.Val;
- Set_Effective_Value (Sig, Sig.Driving_Value'Access);
when Force_Effective =>
- Mark_Active (Sig);
- Set_Effective_Value (Sig, Fv.Val'Access);
+ null;
end case;
+ Set_Effective_Value (Sig, Fv.Val'Access);
+
+ if Sig.Net in Signal_Net_Defined then
+ -- HACK: mark SIG as active so that propagation will execute
+ -- just below.
+ Add_Active_Chain (Sig);
+ end if;
+
Next_Fv := Fv.Next;
Free (Fv);
Fv := Next_Fv;
diff --git a/src/grt/grt-vpi.adb b/src/grt/grt-vpi.adb
index f5c183128..6b69d68c3 100644
--- a/src/grt/grt-vpi.adb
+++ b/src/grt/grt-vpi.adb
@@ -924,10 +924,9 @@ package body Grt.Vpi is
Ghdl_B1 (Vec (J) = '1' or Vec (J) = 'H');
begin
case Info.Val is
- when Vcd_Effective =>
- Ghdl_Signal_Force_Effective_B1
- (To_Signal_Arr_Ptr (Info.Ptr)(J), V);
- when Vcd_Driving =>
+ when Vcd_Effective | Vcd_Driving =>
+ -- Force_Driving sets both the driving and the
+ -- effective value.
Ghdl_Signal_Force_Driving_B1
(To_Signal_Arr_Ptr (Info.Ptr)(J), V);
when Vcd_Variable =>
@@ -942,10 +941,9 @@ package body Grt.Vpi is
V : constant Ghdl_E8 := Std_Ulogic'Pos (Vec (J));
begin
case Info.Val is
- when Vcd_Effective =>
- Ghdl_Signal_Force_Effective_E8
- (To_Signal_Arr_Ptr (Info.Ptr)(J), V);
- when Vcd_Driving =>
+ when Vcd_Effective | Vcd_Driving =>
+ -- Force_Driving sets both the driving and the
+ -- effective value.
Ghdl_Signal_Force_Driving_E8
(To_Signal_Arr_Ptr (Info.Ptr)(J), V);
when Vcd_Variable =>