diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-01-12 21:27:58 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-01-12 21:27:58 +0100 |
commit | 10f07155f071a53ebd6e45a70c449a8a262f9701 (patch) | |
tree | 4b1f69e79d1b932ae58fc5ce7f0f7aa7ab42731e /src/synth/netlists-utils.adb | |
parent | 0cb5d1c6a5c6c8c9eae14d5438be83e25d5b1868 (diff) | |
download | ghdl-10f07155f071a53ebd6e45a70c449a8a262f9701.tar.gz ghdl-10f07155f071a53ebd6e45a70c449a8a262f9701.tar.bz2 ghdl-10f07155f071a53ebd6e45a70c449a8a262f9701.zip |
netlists: get_net_uns64: handle id_const_sb32.
Diffstat (limited to 'src/synth/netlists-utils.adb')
-rw-r--r-- | src/synth/netlists-utils.adb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/synth/netlists-utils.adb b/src/synth/netlists-utils.adb index face94c0e..f1dd42f73 100644 --- a/src/synth/netlists-utils.adb +++ b/src/synth/netlists-utils.adb @@ -148,6 +148,17 @@ package body Netlists.Utils is pragma Assert (Shift_Right (Va, Natural (Wd)) = 0); return Uns64 (Va); end; + when Id_Const_SB32 => + declare + Va : constant Uns32 := Get_Param_Uns32 (Inst, 0); + Wd : constant Natural := Natural (Get_Width (N)); + Res : Uns64; + begin + Res := Uns64 (Va); + Res := Shift_Left (Res, 64 - Wd); + Res := Shift_Right_Arithmetic (Res, 64 - Wd); + return Res; + end; when others => if Get_Width (N) = 0 then return 0; |