aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-01-03 21:18:38 +0100
committerTristan Gingold <tgingold@free.fr>2023-01-03 21:18:38 +0100
commit2f48848575261265b1c37efe10ded83ccff11aa2 (patch)
tree9478a10d84a404775f9709df2de3ee987ad8a514 /src/grt
parent20971ccc7bce94ad28525021cc27557a11d428de (diff)
downloadghdl-2f48848575261265b1c37efe10ded83ccff11aa2.tar.gz
ghdl-2f48848575261265b1c37efe10ded83ccff11aa2.tar.bz2
ghdl-2f48848575261265b1c37efe10ded83ccff11aa2.zip
simul: handle force/release signal assignments
Diffstat (limited to 'src/grt')
-rw-r--r--src/grt/grt-signals.adb46
-rw-r--r--src/grt/grt-signals.ads5
2 files changed, 38 insertions, 13 deletions
diff --git a/src/grt/grt-signals.adb b/src/grt/grt-signals.adb
index b81a86fd3..7ddb24891 100644
--- a/src/grt/grt-signals.adb
+++ b/src/grt/grt-signals.adb
@@ -2070,6 +2070,26 @@ package body Grt.Signals is
F64 => Val)));
end Ghdl_Signal_Force_Effective_F64;
+ procedure Ghdl_Signal_Force_Driving_Any (Sig : Ghdl_Signal_Ptr;
+ Val : Value_Union) is
+ begin
+ Append_Force_Value (new Force_Value'(Kind => Force,
+ Mode => Force_Driving,
+ Next => null,
+ Sig => Sig,
+ Val => Val));
+ end Ghdl_Signal_Force_Driving_Any;
+
+ procedure Ghdl_Signal_Force_Effective_Any (Sig : Ghdl_Signal_Ptr;
+ Val : Value_Union) is
+ begin
+ Append_Force_Value (new Force_Value'(Kind => Force,
+ Mode => Force_Effective,
+ Next => null,
+ Sig => Sig,
+ Val => Val));
+ end Ghdl_Signal_Force_Effective_Any;
+
-- Remove all (but Signal_End) signals in the next active chain.
-- Called when a transaction/event will occur before the time for this
-- chain.
@@ -3565,20 +3585,20 @@ package body Grt.Signals is
if Trans /= null then
Free (Sig.S.Drivers (0).First_Trans);
Sig.S.Drivers (0).First_Trans := Trans;
- end if;
- -- Update driving value (unless forced)
- if not Sig.Flags.Is_Drv_Forced then
- case Trans.Kind is
- when Trans_Value =>
- Sig.Driving_Value := Trans.Val;
- when Trans_Direct =>
- Internal_Error ("update_signals: trans_direct");
- when Trans_Null =>
- Error ("null transaction");
- when Trans_Error =>
- Error_Trans_Error (Trans);
- end case;
+ -- Update driving value (unless forced)
+ if not Sig.Flags.Is_Drv_Forced then
+ case Trans.Kind is
+ when Trans_Value =>
+ Sig.Driving_Value := Trans.Val;
+ when Trans_Direct =>
+ Internal_Error ("update_signals: trans_direct");
+ when Trans_Null =>
+ Error ("null transaction");
+ when Trans_Error =>
+ Error_Trans_Error (Trans);
+ end case;
+ end if;
end if;
if not Sig.Flags.Is_Eff_Forced then
diff --git a/src/grt/grt-signals.ads b/src/grt/grt-signals.ads
index 76977d37a..6014180be 100644
--- a/src/grt/grt-signals.ads
+++ b/src/grt/grt-signals.ads
@@ -614,6 +614,11 @@ package Grt.Signals is
procedure Ghdl_Process_Add_Port_Driver
(Sign : Ghdl_Signal_Ptr; Val : Value_Union);
+ procedure Ghdl_Signal_Force_Driving_Any (Sig : Ghdl_Signal_Ptr;
+ Val : Value_Union);
+ procedure Ghdl_Signal_Force_Effective_Any (Sig : Ghdl_Signal_Ptr;
+ Val : Value_Union);
+
-- For B1
function Ghdl_Create_Signal_B1 (Val_Ptr : Ghdl_Value_Ptr;
Resolv_Func : Resolver_Acc;