diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-23 19:22:16 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-24 05:23:32 +0200 |
commit | fd8ab18f6cbe91b0f7820909fffecdd07440cb29 (patch) | |
tree | a65cce0200bba4f9e86388d8ffa90145b09c0468 /src/synth | |
parent | 113fc5b718d4d9a0fee31ce3b35a7f2428d6c214 (diff) | |
download | ghdl-fd8ab18f6cbe91b0f7820909fffecdd07440cb29.tar.gz ghdl-fd8ab18f6cbe91b0f7820909fffecdd07440cb29.tar.bz2 ghdl-fd8ab18f6cbe91b0f7820909fffecdd07440cb29.zip |
synth: handle resize.
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-expr.adb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index 9658bbd25..0d28069ba 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1573,6 +1573,21 @@ package body Synth.Expr is (Synth_Uresize (Get_Net (Subprg_Inst.Objects (1), Get_Type (Inter_Chain)), 32), null); + when Iir_Predefined_Ieee_Numeric_Std_Resize_Uns_Nat => + declare + V : constant Value_Acc := Subprg_Inst.Objects (1); + Sz : constant Value_Acc := Subprg_Inst.Objects (2); + W : Width; + begin + if not Is_Const (Sz) then + Error_Msg_Synth (+Expr, "size must be constant"); + return null; + end if; + W := Uns32 (Sz.Scal); + return Create_Value_Net + (Synth_Uresize (Get_Net (V, Get_Type (Inter_Chain)), W), + Create_Value_Bound ((Iir_Downto, Int32 (W) - 1, 0, W))); + end; when Iir_Predefined_Ieee_Math_Real_Log2 => declare V : constant Value_Acc := Subprg_Inst.Objects (1); |