diff options
Diffstat (limited to 'src/vhdl/vhdl-ieee-numeric.adb')
-rw-r--r-- | src/vhdl/vhdl-ieee-numeric.adb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-ieee-numeric.adb b/src/vhdl/vhdl-ieee-numeric.adb index 9f57e7787..ad13f9274 100644 --- a/src/vhdl/vhdl-ieee-numeric.adb +++ b/src/vhdl/vhdl-ieee-numeric.adb @@ -319,6 +319,37 @@ package body Vhdl.Ieee.Numeric is raise Error; end if; end Handle_To_Integer; + + procedure Handle_Resize is + begin + if Arg2_Kind = Arg_Scal and Arg2_Sign = Type_Unsigned then + if Arg1_Kind = Arg_Vect and Arg1_Sign = Type_Unsigned then + Set_Implicit_Definition + (Decl, Iir_Predefined_Ieee_Numeric_Std_Resize_Uns_Nat); + elsif Arg1_Kind = Arg_Vect and Arg1_Sign = Type_Signed then + Set_Implicit_Definition + (Decl, Iir_Predefined_Ieee_Numeric_Std_Resize_Sgn_Nat); + else + raise Error; + end if; + elsif Arg2_Kind = Arg_Vect then + if Arg1_Kind = Arg_Vect and Arg1_Sign = Type_Unsigned + and Arg2_Sign = Type_Unsigned + then + Set_Implicit_Definition + (Decl, Iir_Predefined_Ieee_Numeric_Std_Resize_Uns_Uns); + elsif Arg1_Kind = Arg_Vect and Arg1_Sign = Type_Signed + and Arg2_Sign = Type_Signed + then + Set_Implicit_Definition + (Decl, Iir_Predefined_Ieee_Numeric_Std_Resize_Sgn_Sgn); + else + raise Error; + end if; + else + raise Error; + end if; + end Handle_Resize; begin Decl := Get_Declaration_Chain (Pkg_Decl); @@ -413,6 +444,8 @@ package body Vhdl.Ieee.Numeric is Handle_To_Unsigned; when Name_To_Signed => Handle_To_Signed; + when Name_Resize => + Handle_Resize; when others => null; end case; |