diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/std_names.adb | 3 | ||||
-rw-r--r-- | src/std_names.ads | 35 | ||||
-rw-r--r-- | src/synth/synth-oper.adb | 12 | ||||
-rw-r--r-- | src/vhdl/vhdl-ieee-numeric.adb | 25 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 3 |
5 files changed, 55 insertions, 23 deletions
diff --git a/src/std_names.adb b/src/std_names.adb index 303d14eed..9d9cfcbe7 100644 --- a/src/std_names.adb +++ b/src/std_names.adb @@ -652,6 +652,7 @@ package body Std_Names is Def ("to_stdlogicvector", Name_To_Stdlogicvector); Def ("to_stdulogicvector", Name_To_Stdulogicvector); Def ("is_x", Name_Is_X); + Def ("to_01", Name_To_01); Def ("conv_signed", Name_Conv_Signed); Def ("conv_unsigned", Name_Conv_Unsigned); Def ("conv_integer", Name_Conv_Integer); @@ -786,6 +787,8 @@ package body Std_Names is Def ("synopsys", Name_Synopsys); Def ("translate_off", Name_Translate_Off); Def ("translate_on", Name_Translate_On); + Def ("translate", Name_Translate); + Def ("off", Name_Off); -- PSL keywords Def ("a", Name_A); diff --git a/src/std_names.ads b/src/std_names.ads index 6363db8b8..2c12c0f00 100644 --- a/src/std_names.ads +++ b/src/std_names.ads @@ -735,21 +735,22 @@ package Std_Names is Name_To_Stdlogicvector : constant Name_Id := Name_First_Ieee_Name + 022; Name_To_Stdulogicvector : constant Name_Id := Name_First_Ieee_Name + 023; Name_Is_X : constant Name_Id := Name_First_Ieee_Name + 024; - Name_Conv_Signed : constant Name_Id := Name_First_Ieee_Name + 025; - Name_Conv_Unsigned : constant Name_Id := Name_First_Ieee_Name + 026; - Name_Conv_Integer : constant Name_Id := Name_First_Ieee_Name + 027; - Name_Conv_Std_Logic_Vector : constant Name_Id := Name_First_Ieee_Name + 028; - Name_And_Reduce : constant Name_Id := Name_First_Ieee_Name + 029; - Name_Nand_Reduce : constant Name_Id := Name_First_Ieee_Name + 030; - Name_Or_Reduce : constant Name_Id := Name_First_Ieee_Name + 031; - Name_Nor_Reduce : constant Name_Id := Name_First_Ieee_Name + 032; - Name_Xor_Reduce : constant Name_Id := Name_First_Ieee_Name + 033; - Name_Xnor_Reduce : constant Name_Id := Name_First_Ieee_Name + 034; - Name_Ceil : constant Name_Id := Name_First_Ieee_Name + 035; - Name_Round : constant Name_Id := Name_First_Ieee_Name + 036; - Name_Log2 : constant Name_Id := Name_First_Ieee_Name + 037; - Name_Sin : constant Name_Id := Name_First_Ieee_Name + 038; - Name_Cos : constant Name_Id := Name_First_Ieee_Name + 039; + Name_To_01 : constant Name_Id := Name_First_Ieee_Name + 025; + Name_Conv_Signed : constant Name_Id := Name_First_Ieee_Name + 026; + Name_Conv_Unsigned : constant Name_Id := Name_First_Ieee_Name + 027; + Name_Conv_Integer : constant Name_Id := Name_First_Ieee_Name + 028; + Name_Conv_Std_Logic_Vector : constant Name_Id := Name_First_Ieee_Name + 029; + Name_And_Reduce : constant Name_Id := Name_First_Ieee_Name + 030; + Name_Nand_Reduce : constant Name_Id := Name_First_Ieee_Name + 031; + Name_Or_Reduce : constant Name_Id := Name_First_Ieee_Name + 032; + Name_Nor_Reduce : constant Name_Id := Name_First_Ieee_Name + 033; + Name_Xor_Reduce : constant Name_Id := Name_First_Ieee_Name + 034; + Name_Xnor_Reduce : constant Name_Id := Name_First_Ieee_Name + 035; + Name_Ceil : constant Name_Id := Name_First_Ieee_Name + 036; + Name_Round : constant Name_Id := Name_First_Ieee_Name + 037; + Name_Log2 : constant Name_Id := Name_First_Ieee_Name + 038; + Name_Sin : constant Name_Id := Name_First_Ieee_Name + 039; + Name_Cos : constant Name_Id := Name_First_Ieee_Name + 040; Name_Last_Ieee_Name : constant Name_Id := Name_Cos; Name_First_Synthesis : constant Name_Id := Name_Last_Ieee_Name + 1; @@ -915,7 +916,9 @@ package Std_Names is Name_Synopsys : constant Name_Id := Name_First_Comment + 3; Name_Translate_Off : constant Name_Id := Name_First_Comment + 4; Name_Translate_On : constant Name_Id := Name_First_Comment + 5; - Name_Last_Comment : constant Name_Id := Name_Translate_On; + Name_Translate : constant Name_Id := Name_First_Comment + 6; + Name_Off : constant Name_Id := Name_First_Comment + 7; + Name_Last_Comment : constant Name_Id := Name_Off; -- PSL words. Name_First_PSL : constant Name_Id := Name_Last_Comment + 1; diff --git a/src/synth/synth-oper.adb b/src/synth/synth-oper.adb index 8efaca0c3..ed962e378 100644 --- a/src/synth/synth-oper.adb +++ b/src/synth/synth-oper.adb @@ -1481,13 +1481,11 @@ package body Synth.Oper is | Iir_Predefined_Ieee_1164_Vector_Is_X => -- Always false. return Create_Value_Discrete (0, Boolean_Type); - when Iir_Predefined_Ieee_1164_To_Bitvector => - if Is_Static (L) then - raise Internal_Error; - end if; - return Create_Value_Net (Get_Net (L), Create_Res_Bound (L)); - when Iir_Predefined_Ieee_1164_To_Stdlogicvector_Suv - | Iir_Predefined_Ieee_1164_To_Stdlogicvector_Bv => + when Iir_Predefined_Ieee_1164_To_Bitvector + | Iir_Predefined_Ieee_1164_To_Stdlogicvector_Suv + | Iir_Predefined_Ieee_1164_To_Stdlogicvector_Bv + | Iir_Predefined_Ieee_Numeric_Std_To_01_Uns + | Iir_Predefined_Ieee_Numeric_Std_To_01_Sgn => if Is_Static (L) then raise Internal_Error; end if; diff --git a/src/vhdl/vhdl-ieee-numeric.adb b/src/vhdl/vhdl-ieee-numeric.adb index 8f94b8fde..7be77ac8f 100644 --- a/src/vhdl/vhdl-ieee-numeric.adb +++ b/src/vhdl/vhdl-ieee-numeric.adb @@ -718,6 +718,29 @@ package body Vhdl.Ieee.Numeric is Set_Implicit_Definition (Decl, Predefined); end Handle_Std_Match; + procedure Handle_To_01 + is + Predefined : Iir_Predefined_Functions; + begin + if Arg1_Kind /= Arg_Vect + or else Arg2_Kind /= Arg_Scal + or else Arg2_Sign /= Type_Log + then + raise Error; + end if; + + case Arg1_Sign is + when Type_Unsigned => + Predefined := Iir_Predefined_Ieee_Numeric_Std_To_01_Uns; + when Type_Signed => + Predefined := Iir_Predefined_Ieee_Numeric_Std_To_01_Sgn; + when others => + raise Error; + end case; + + Set_Implicit_Definition (Decl, Predefined); + end Handle_To_01; + procedure Handle_Shift (Pats : Shift_Pattern_Type; Sh_Sign : Sign_Kind) is Res : Iir_Predefined_Functions; @@ -885,6 +908,8 @@ package body Vhdl.Ieee.Numeric is Handle_Shift (Rol_Patterns, Type_Unsigned); when Name_Rotate_Right => Handle_Shift (Ror_Patterns, Type_Unsigned); + when Name_To_01 => + Handle_To_01; when others => null; end case; diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index 7c2bebd42..d27e1aed9 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -5692,6 +5692,9 @@ package Vhdl.Nodes is Iir_Predefined_Ieee_Numeric_Std_Match_Slv, Iir_Predefined_Ieee_Numeric_Std_Match_Suv, + Iir_Predefined_Ieee_Numeric_Std_To_01_Uns, + Iir_Predefined_Ieee_Numeric_Std_To_01_Sgn, + -- Math_Real Iir_Predefined_Ieee_Math_Real_Ceil, Iir_Predefined_Ieee_Math_Real_Round, |