diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-12-29 17:29:35 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-12-29 17:29:35 +0100 |
commit | 985525077ec41823962ba2dbc515c0badfe2cf53 (patch) | |
tree | 41604537fd0d602441fc7d072928b081864c4e6e /src/synth/netlists-utils.adb | |
parent | 5764d6ca0fe5809559b43875abecbabeae2b2c12 (diff) | |
download | ghdl-985525077ec41823962ba2dbc515c0badfe2cf53.tar.gz ghdl-985525077ec41823962ba2dbc515c0badfe2cf53.tar.bz2 ghdl-985525077ec41823962ba2dbc515c0badfe2cf53.zip |
synth: handle wire assigned to a static value. Fix #1058
Diffstat (limited to 'src/synth/netlists-utils.adb')
-rw-r--r-- | src/synth/netlists-utils.adb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/synth/netlists-utils.adb b/src/synth/netlists-utils.adb index 722cafc1a..4a189b39e 100644 --- a/src/synth/netlists-utils.adb +++ b/src/synth/netlists-utils.adb @@ -155,6 +155,26 @@ package body Netlists.Utils is return To_Int64 (Get_Net_Uns64 (N)); end Get_Net_Int64; + procedure Get_Net_Element + (N : Net; Off : Uns32; Va : out Uns32; Zx : out Uns32) + is + Inst : constant Instance := Get_Net_Parent (N); + begin + case Get_Id (Inst) is + when Id_Const_UB32 => + declare + V : constant Uns32 := Get_Param_Uns32 (Inst, 0); + Wd : constant Width := Get_Width (N); + begin + pragma Assert (Off < 32); + Zx := 0; + Va := Shift_Right (V, Natural (Wd - Off)) and 1; + end; + when others => + raise Internal_Error; + end case; + end Get_Net_Element; + function Is_Connected (O : Net) return Boolean is begin return Get_First_Sink (O) /= No_Input; |