diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-10 07:48:00 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-10 07:48:52 +0100 |
commit | f7bc9abfd1c536353eb45c2586e93432060a3eac (patch) | |
tree | b33292319310b7b8cd1322f5835432f8a61ec467 /src/simul | |
parent | 7286838d5caaa764c7201c82fe390483ef5c5661 (diff) | |
download | ghdl-f7bc9abfd1c536353eb45c2586e93432060a3eac.tar.gz ghdl-f7bc9abfd1c536353eb45c2586e93432060a3eac.tar.bz2 ghdl-f7bc9abfd1c536353eb45c2586e93432060a3eac.zip |
simul: handle inertial assignments
Diffstat (limited to 'src/simul')
-rw-r--r-- | src/simul/simul-vhdl_simul.adb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/simul/simul-vhdl_simul.adb b/src/simul/simul-vhdl_simul.adb index 5764fe5e3..a2a8b3cfb 100644 --- a/src/simul/simul-vhdl_simul.adb +++ b/src/simul/simul-vhdl_simul.adb @@ -976,6 +976,7 @@ package body Simul.Vhdl_Simul is is use Synth.Vhdl_Expr; V_Aft : Std_Time; + V_Rej : Std_Time; Start : Boolean; procedure Execute_Signal_Assignment (Inst : Synth_Instance_Acc; @@ -1013,7 +1014,7 @@ package body Simul.Vhdl_Simul is else Mem := Null_Memtyp; end if; - Assign_Value_To_Signal (Sig, Start, V_Aft, V_Aft, Mem); + Assign_Value_To_Signal (Sig, Start, V_Rej, V_Aft, Mem); when Target_Memory => raise Internal_Error; @@ -1033,7 +1034,10 @@ package body Simul.Vhdl_Simul is Rej := Get_Reject_Time_Expression (Stmt); if Rej /= Null_Node then - raise Internal_Error; + Val := Synth_Expression (Inst, Rej); + V_Rej := Std_Time (Read_I64 (Val.Val.Mem)); + else + V_Rej := 0; end if; Wf := Waveform; @@ -1043,6 +1047,14 @@ package body Simul.Vhdl_Simul is if Aft /= Null_Node then Val := Synth_Expression (Inst, Aft); V_Aft := Std_Time (Read_I64 (Val.Val.Mem)); + if Rej = Null_Node then + case Get_Delay_Mechanism (Stmt) is + when Iir_Inertial_Delay => + V_Rej := V_Aft; + when Iir_Transport_Delay => + V_Rej := 0; + end case; + end if; else V_Aft := 0; end if; |