diff options
-rw-r--r-- | src/vhdl/iirs.adb | 34 | ||||
-rw-r--r-- | src/vhdl/iirs.ads | 39 | ||||
-rw-r--r-- | src/vhdl/iirs_utils.adb | 1 | ||||
-rw-r--r-- | src/vhdl/nodes_meta.adb | 323 | ||||
-rw-r--r-- | src/vhdl/nodes_meta.ads | 2 | ||||
-rw-r--r-- | src/vhdl/sem_types.adb | 1 | ||||
-rw-r--r-- | src/vhdl/std_package.adb | 1 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap7.adb | 11 |
8 files changed, 188 insertions, 224 deletions
diff --git a/src/vhdl/iirs.adb b/src/vhdl/iirs.adb index 9f807b4..6b3a3a0 100644 --- a/src/vhdl/iirs.adb +++ b/src/vhdl/iirs.adb @@ -296,6 +296,7 @@ package body Iirs is | Iir_Kind_Subnature_Declaration | Iir_Kind_Package_Declaration | Iir_Kind_Package_Body + | Iir_Kind_Unit_Declaration | Iir_Kind_Attribute_Declaration | Iir_Kind_Group_Template_Declaration | Iir_Kind_Group_Declaration @@ -303,6 +304,7 @@ package body Iirs is | Iir_Kind_Non_Object_Alias_Declaration | Iir_Kind_Terminal_Declaration | Iir_Kind_Free_Quantity_Declaration + | Iir_Kind_Enumeration_Literal | Iir_Kind_Object_Alias_Declaration | Iir_Kind_Signal_Declaration | Iir_Kind_Variable_Declaration @@ -447,13 +449,11 @@ package body Iirs is | Iir_Kind_Entity_Declaration | Iir_Kind_Architecture_Body | Iir_Kind_Package_Header - | Iir_Kind_Unit_Declaration | Iir_Kind_Library_Declaration | Iir_Kind_Component_Declaration | Iir_Kind_Psl_Declaration | Iir_Kind_Across_Quantity_Declaration | Iir_Kind_Through_Quantity_Declaration - | Iir_Kind_Enumeration_Literal | Iir_Kind_Function_Declaration | Iir_Kind_Implicit_Function_Declaration | Iir_Kind_Implicit_Procedure_Declaration @@ -836,42 +836,42 @@ package body Iirs is begin pragma Assert (Lit /= Null_Iir); pragma Assert (Has_Enum_Pos (Get_Kind (Lit))); - return Iir_Int32'Val (Get_Field10 (Lit)); + return Iir_Int32'Val (Get_Field5 (Lit)); end Get_Enum_Pos; procedure Set_Enum_Pos (Lit : Iir; Val : Iir_Int32) is begin pragma Assert (Lit /= Null_Iir); pragma Assert (Has_Enum_Pos (Get_Kind (Lit))); - Set_Field10 (Lit, Iir_Int32'Pos (Val)); + Set_Field5 (Lit, Iir_Int32'Pos (Val)); end Set_Enum_Pos; function Get_Physical_Literal (Unit : Iir) return Iir is begin pragma Assert (Unit /= Null_Iir); pragma Assert (Has_Physical_Literal (Get_Kind (Unit))); - return Get_Field6 (Unit); + return Get_Field4 (Unit); end Get_Physical_Literal; procedure Set_Physical_Literal (Unit : Iir; Lit : Iir) is begin pragma Assert (Unit /= Null_Iir); pragma Assert (Has_Physical_Literal (Get_Kind (Unit))); - Set_Field6 (Unit, Lit); + Set_Field4 (Unit, Lit); end Set_Physical_Literal; function Get_Physical_Unit_Value (Unit : Iir) return Iir is begin pragma Assert (Unit /= Null_Iir); pragma Assert (Has_Physical_Unit_Value (Get_Kind (Unit))); - return Get_Field7 (Unit); + return Get_Field5 (Unit); end Get_Physical_Unit_Value; procedure Set_Physical_Unit_Value (Unit : Iir; Lit : Iir) is begin pragma Assert (Unit /= Null_Iir); pragma Assert (Has_Physical_Unit_Value (Get_Kind (Unit))); - Set_Field7 (Unit, Lit); + Set_Field5 (Unit, Lit); end Set_Physical_Unit_Value; function Get_Fp_Value (Lit : Iir) return Iir_Fp64 is @@ -888,20 +888,6 @@ package body Iirs is Set_Fp64 (Lit, Val); end Set_Fp_Value; - function Get_Enumeration_Decl (Target : Iir) return Iir is - begin - pragma Assert (Target /= Null_Iir); - pragma Assert (Has_Enumeration_Decl (Get_Kind (Target))); - return Get_Field6 (Target); - end Get_Enumeration_Decl; - - procedure Set_Enumeration_Decl (Target : Iir; Lit : Iir) is - begin - pragma Assert (Target /= Null_Iir); - pragma Assert (Has_Enumeration_Decl (Get_Kind (Target))); - Set_Field6 (Target, Lit); - end Set_Enumeration_Decl; - function Get_Simple_Aggregate_List (Target : Iir) return Iir_List is begin pragma Assert (Target /= Null_Iir); @@ -1790,14 +1776,14 @@ package body Iirs is begin pragma Assert (Target /= Null_Iir); pragma Assert (Has_Subprogram_Hash (Get_Kind (Target))); - return Iir_Int32'Val (Get_Field11 (Target)); + return Iir_Int32'Val (Get_Field4 (Target)); end Get_Subprogram_Hash; procedure Set_Subprogram_Hash (Target : Iir; Val : Iir_Int32) is begin pragma Assert (Target /= Null_Iir); pragma Assert (Has_Subprogram_Hash (Get_Kind (Target))); - Set_Field11 (Target, Iir_Int32'Pos (Val)); + Set_Field4 (Target, Iir_Int32'Pos (Val)); end Set_Subprogram_Hash; function Get_Impure_Depth (Target : Iir) return Iir_Int32 is diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads index c2a76d2..57deca8 100644 --- a/src/vhdl/iirs.ads +++ b/src/vhdl/iirs.ads @@ -1200,6 +1200,8 @@ package Iirs is -- -- Get/Set_Identifier (Field3) -- + -- Get/Set_Subprogram_Hash (Field4) + -- -- Get/Set_Interface_Declaration_Chain (Field5) -- -- Get/Set_Generic_Chain (Field6) @@ -1212,8 +1214,6 @@ package Iirs is -- -- Get/Set_Subprogram_Depth (Field10) -- - -- Get/Set_Subprogram_Hash (Field11) - -- -- Get/Set_Overload_Number (Field12) -- -- Get/Set_Seen_Flag (Flag1) @@ -1304,6 +1304,8 @@ package Iirs is -- -- Get/Set_Identifier (Field3) -- + -- Get/Set_Subprogram_Hash (Field4) + -- -- Get/Set_Interface_Declaration_Chain (Field5) -- -- Get/Set_Generic_Chain (Field6) @@ -1314,8 +1316,6 @@ package Iirs is -- -- Get/Set_Type_Reference (Field10) -- - -- Get/Set_Subprogram_Hash (Field11) - -- -- Get/Set_Overload_Number (Field12) -- -- Get/Set_Wait_State (State1) @@ -1788,7 +1788,7 @@ package Iirs is -- -- Get/Set_Type_Staticness (State1) - -- Iir_Kind_Enumeration_Literal (Medium) + -- Iir_Kind_Enumeration_Literal (Short) -- -- Nota: two literals of the same type are equal iff their value is the -- same; in other words, there may be severals literals with the same @@ -1805,14 +1805,10 @@ package Iirs is -- -- Get/Set_Identifier (Field3) -- - -- The declaration of the literal. If LITERAL_ORIGIN is not set, then this - -- is the node itself, else this is the literal defined. - -- Get/Set_Enumeration_Decl (Field6) + -- Get/Set_Subprogram_Hash (Field4) -- -- The value of an enumeration literal is the position. - -- Get/Set_Enum_Pos (Field10) - -- - -- Get/Set_Subprogram_Hash (Field11) + -- Get/Set_Enum_Pos (Field5) -- -- Get/Set_Seen_Flag (Flag1) -- @@ -1847,7 +1843,7 @@ package Iirs is -- -- Get/Set_End_Has_Identifier (Flag9) - -- Iir_Kind_Unit_Declaration (Medium) + -- Iir_Kind_Unit_Declaration (Short) -- -- LRM08 5.2.4 Physical types -- @@ -1869,11 +1865,11 @@ package Iirs is -- -- The Physical_Literal is the expression that appear in the sources, so -- this is Null_Iir for a primary unit. - -- Get/Set_Physical_Literal (Field6) + -- Get/Set_Physical_Literal (Field4) -- -- The value of the unit, computed from the primary unit. This is always -- a physical integer literal. - -- Get/Set_Physical_Unit_Value (Field7) + -- Get/Set_Physical_Unit_Value (Field5) -- -- Get/Set_Expr_Staticness (State1) -- @@ -5042,16 +5038,16 @@ package Iirs is procedure Set_Value (Lit : Iir; Val : Iir_Int64); -- Position (same as lit_type'pos) of an enumeration literal. - -- Field: Field10 (pos) + -- Field: Field5 (pos) function Get_Enum_Pos (Lit : Iir) return Iir_Int32; procedure Set_Enum_Pos (Lit : Iir; Val : Iir_Int32); - -- Field: Field6 + -- Field: Field4 function Get_Physical_Literal (Unit : Iir) return Iir; procedure Set_Physical_Literal (Unit : Iir; Lit : Iir); -- Value of a physical unit declaration. - -- Field: Field7 + -- Field: Field5 function Get_Physical_Unit_Value (Unit : Iir) return Iir; procedure Set_Physical_Unit_Value (Unit : Iir; Lit : Iir); @@ -5060,13 +5056,6 @@ package Iirs is function Get_Fp_Value (Lit : Iir) return Iir_Fp64; procedure Set_Fp_Value (Lit : Iir; Val : Iir_Fp64); - -- Declaration of the literal. - -- This is used to retrieve the genuine enumeration literal for literals - -- created from static expression. - -- Field: Field6 Ref - function Get_Enumeration_Decl (Target : Iir) return Iir; - procedure Set_Enumeration_Decl (Target : Iir; Lit : Iir); - -- List of elements of a simple aggregate. -- Field: Field3 (uc) function Get_Simple_Aggregate_List (Target : Iir) return Iir_List; @@ -5390,7 +5379,7 @@ package Iirs is -- Hash of a subprogram profile. -- This is used to speed up subprogram profile comparaison, which is very -- often used by overload. - -- Field: Field11 (pos) + -- Field: Field4 (pos) function Get_Subprogram_Hash (Target : Iir) return Iir_Int32; procedure Set_Subprogram_Hash (Target : Iir; Val : Iir_Int32); pragma Inline (Get_Subprogram_Hash); diff --git a/src/vhdl/iirs_utils.adb b/src/vhdl/iirs_utils.adb index 52c1ee8..d767ded 100644 --- a/src/vhdl/iirs_utils.adb +++ b/src/vhdl/iirs_utils.adb @@ -419,7 +419,6 @@ package body Iirs_Utils is Set_Type (Res, Get_Type (Lit)); Set_Enum_Pos (Res, Get_Enum_Pos (Lit)); Set_Expr_Staticness (Res, Locally); - Set_Enumeration_Decl (Res, Lit); return Res; end Copy_Enumeration_Literal; diff --git a/src/vhdl/nodes_meta.adb b/src/vhdl/nodes_meta.adb index 3d5fbef..f31a5a3 100644 --- a/src/vhdl/nodes_meta.adb +++ b/src/vhdl/nodes_meta.adb @@ -47,7 +47,6 @@ package body Nodes_Meta is Field_Physical_Literal => Type_Iir, Field_Physical_Unit_Value => Type_Iir, Field_Fp_Value => Type_Iir_Fp64, - Field_Enumeration_Decl => Type_Iir, Field_Simple_Aggregate_List => Type_Iir_List, Field_Bit_String_Base => Type_Base_Type, Field_Bit_String_0 => Type_Iir, @@ -372,8 +371,6 @@ package body Nodes_Meta is return "physical_unit_value"; when Field_Fp_Value => return "fp_value"; - when Field_Enumeration_Decl => - return "enumeration_decl"; when Field_Simple_Aggregate_List => return "simple_aggregate_list"; when Field_Bit_String_Base => @@ -1438,8 +1435,6 @@ package body Nodes_Meta is return Attr_None; when Field_Fp_Value => return Attr_None; - when Field_Enumeration_Decl => - return Attr_Ref; when Field_Simple_Aggregate_List => return Attr_None; when Field_Bit_String_Base => @@ -2653,9 +2648,9 @@ package body Nodes_Meta is Field_Parent, Field_Type, -- Iir_Kind_Enumeration_Literal - Field_Enum_Pos, - Field_Subprogram_Hash, Field_Identifier, + Field_Subprogram_Hash, + Field_Enum_Pos, Field_Seen_Flag, Field_Visible_Flag, Field_Is_Within_Flag, @@ -2664,12 +2659,11 @@ package body Nodes_Meta is Field_Literal_Origin, Field_Parent, Field_Type, - Field_Enumeration_Decl, -- Iir_Kind_Function_Declaration Field_Subprogram_Depth, - Field_Subprogram_Hash, Field_Overload_Number, Field_Identifier, + Field_Subprogram_Hash, Field_Seen_Flag, Field_Pure_Flag, Field_Foreign_Flag, @@ -2689,9 +2683,9 @@ package body Nodes_Meta is Field_Return_Type, Field_Subprogram_Body, -- Iir_Kind_Implicit_Function_Declaration - Field_Subprogram_Hash, Field_Overload_Number, Field_Identifier, + Field_Subprogram_Hash, Field_Implicit_Definition, Field_Seen_Flag, Field_Pure_Flag, @@ -2707,9 +2701,9 @@ package body Nodes_Meta is Field_Return_Type, Field_Type_Reference, -- Iir_Kind_Implicit_Procedure_Declaration - Field_Subprogram_Hash, Field_Overload_Number, Field_Identifier, + Field_Subprogram_Hash, Field_Implicit_Definition, Field_Seen_Flag, Field_Visible_Flag, @@ -2724,9 +2718,9 @@ package body Nodes_Meta is Field_Type_Reference, -- Iir_Kind_Procedure_Declaration Field_Subprogram_Depth, - Field_Subprogram_Hash, Field_Overload_Number, Field_Identifier, + Field_Subprogram_Hash, Field_Seen_Flag, Field_Passive_Flag, Field_Foreign_Flag, @@ -3932,154 +3926,154 @@ package body Nodes_Meta is Iir_Kind_Free_Quantity_Declaration => 574, Iir_Kind_Across_Quantity_Declaration => 586, Iir_Kind_Through_Quantity_Declaration => 598, - Iir_Kind_Enumeration_Literal => 610, - Iir_Kind_Function_Declaration => 632, - Iir_Kind_Implicit_Function_Declaration => 649, - Iir_Kind_Implicit_Procedure_Declaration => 664, - Iir_Kind_Procedure_Declaration => 684, - Iir_Kind_Function_Body => 694, - Iir_Kind_Procedure_Body => 704, - Iir_Kind_Object_Alias_Declaration => 716, - Iir_Kind_File_Declaration => 731, - Iir_Kind_Guard_Signal_Declaration => 744, - Iir_Kind_Signal_Declaration => 761, - Iir_Kind_Variable_Declaration => 774, - Iir_Kind_Constant_Declaration => 788, - Iir_Kind_Iterator_Declaration => 800, - Iir_Kind_Interface_Constant_Declaration => 816, - Iir_Kind_Interface_Variable_Declaration => 832, - Iir_Kind_Interface_Signal_Declaration => 853, - Iir_Kind_Interface_File_Declaration => 869, - Iir_Kind_Interface_Package_Declaration => 878, - Iir_Kind_Identity_Operator => 882, - Iir_Kind_Negation_Operator => 886, - Iir_Kind_Absolute_Operator => 890, - Iir_Kind_Not_Operator => 894, - Iir_Kind_Condition_Operator => 898, - Iir_Kind_Reduction_And_Operator => 902, - Iir_Kind_Reduction_Or_Operator => 906, - Iir_Kind_Reduction_Nand_Operator => 910, - Iir_Kind_Reduction_Nor_Operator => 914, - Iir_Kind_Reduction_Xor_Operator => 918, - Iir_Kind_Reduction_Xnor_Operator => 922, - Iir_Kind_And_Operator => 927, - Iir_Kind_Or_Operator => 932, - Iir_Kind_Nand_Operator => 937, - Iir_Kind_Nor_Operator => 942, - Iir_Kind_Xor_Operator => 947, - Iir_Kind_Xnor_Operator => 952, - Iir_Kind_Equality_Operator => 957, - Iir_Kind_Inequality_Operator => 962, - Iir_Kind_Less_Than_Operator => 967, - Iir_Kind_Less_Than_Or_Equal_Operator => 972, - Iir_Kind_Greater_Than_Operator => 977, - Iir_Kind_Greater_Than_Or_Equal_Operator => 982, - Iir_Kind_Match_Equality_Operator => 987, - Iir_Kind_Match_Inequality_Operator => 992, - Iir_Kind_Match_Less_Than_Operator => 997, - Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1002, - Iir_Kind_Match_Greater_Than_Operator => 1007, - Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1012, - Iir_Kind_Sll_Operator => 1017, - Iir_Kind_Sla_Operator => 1022, - Iir_Kind_Srl_Operator => 1027, - Iir_Kind_Sra_Operator => 1032, - Iir_Kind_Rol_Operator => 1037, - Iir_Kind_Ror_Operator => 1042, - Iir_Kind_Addition_Operator => 1047, - Iir_Kind_Substraction_Operator => 1052, - Iir_Kind_Concatenation_Operator => 1057, - Iir_Kind_Multiplication_Operator => 1062, - Iir_Kind_Division_Operator => 1067, - Iir_Kind_Modulus_Operator => 1072, - Iir_Kind_Remainder_Operator => 1077, - Iir_Kind_Exponentiation_Operator => 1082, - Iir_Kind_Function_Call => 1090, - Iir_Kind_Aggregate => 1096, - Iir_Kind_Parenthesis_Expression => 1099, - Iir_Kind_Qualified_Expression => 1103, - Iir_Kind_Type_Conversion => 1108, - Iir_Kind_Allocator_By_Expression => 1112, - Iir_Kind_Allocator_By_Subtype => 1116, - Iir_Kind_Selected_Element => 1122, - Iir_Kind_Dereference => 1127, - Iir_Kind_Implicit_Dereference => 1132, - Iir_Kind_Slice_Name => 1139, - Iir_Kind_Indexed_Name => 1145, - Iir_Kind_Psl_Expression => 1147, - Iir_Kind_Sensitized_Process_Statement => 1166, - Iir_Kind_Process_Statement => 1184, - Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1195, - Iir_Kind_Concurrent_Selected_Signal_Assignment => 1207, - Iir_Kind_Concurrent_Assertion_Statement => 1215, - Iir_Kind_Psl_Default_Clock => 1219, - Iir_Kind_Psl_Assert_Statement => 1228, - Iir_Kind_Psl_Cover_Statement => 1237, - Iir_Kind_Concurrent_Procedure_Call_Statement => 1243, - Iir_Kind_Block_Statement => 1256, - Iir_Kind_Generate_Statement => 1268, - Iir_Kind_Component_Instantiation_Statement => 1278, - Iir_Kind_Simple_Simultaneous_Statement => 1285, - Iir_Kind_Signal_Assignment_Statement => 1294, - Iir_Kind_Null_Statement => 1298, - Iir_Kind_Assertion_Statement => 1305, - Iir_Kind_Report_Statement => 1311, - Iir_Kind_Wait_Statement => 1318, - Iir_Kind_Variable_Assignment_Statement => 1324, - Iir_Kind_Return_Statement => 1330, - Iir_Kind_For_Loop_Statement => 1338, - Iir_Kind_While_Loop_Statement => 1345, - Iir_Kind_Next_Statement => 1351, - Iir_Kind_Exit_Statement => 1357, - Iir_Kind_Case_Statement => 1364, - Iir_Kind_Procedure_Call_Statement => 1369, - Iir_Kind_If_Statement => 1377, - Iir_Kind_Elsif => 1382, - Iir_Kind_Character_Literal => 1389, - Iir_Kind_Simple_Name => 1396, - Iir_Kind_Selected_Name => 1404, - Iir_Kind_Operator_Symbol => 1409, - Iir_Kind_Selected_By_All_Name => 1414, - Iir_Kind_Parenthesis_Name => 1418, - Iir_Kind_Base_Attribute => 1420, - Iir_Kind_Left_Type_Attribute => 1425, - Iir_Kind_Right_Type_Attribute => 1430, - Iir_Kind_High_Type_Attribute => 1435, - Iir_Kind_Low_Type_Attribute => 1440, - Iir_Kind_Ascending_Type_Attribute => 1445, - Iir_Kind_Image_Attribute => 1451, - Iir_Kind_Value_Attribute => 1457, - Iir_Kind_Pos_Attribute => 1463, - Iir_Kind_Val_Attribute => 1469, - Iir_Kind_Succ_Attribute => 1475, - Iir_Kind_Pred_Attribute => 1481, - Iir_Kind_Leftof_Attribute => 1487, - Iir_Kind_Rightof_Attribute => 1493, - Iir_Kind_Delayed_Attribute => 1501, - Iir_Kind_Stable_Attribute => 1509, - Iir_Kind_Quiet_Attribute => 1517, - Iir_Kind_Transaction_Attribute => 1525, - Iir_Kind_Event_Attribute => 1529, - Iir_Kind_Active_Attribute => 1533, - Iir_Kind_Last_Event_Attribute => 1537, - Iir_Kind_Last_Active_Attribute => 1541, - Iir_Kind_Last_Value_Attribute => 1545, - Iir_Kind_Driving_Attribute => 1549, - Iir_Kind_Driving_Value_Attribute => 1553, - Iir_Kind_Behavior_Attribute => 1553, - Iir_Kind_Structure_Attribute => 1553, - Iir_Kind_Simple_Name_Attribute => 1560, - Iir_Kind_Instance_Name_Attribute => 1565, - Iir_Kind_Path_Name_Attribute => 1570, - Iir_Kind_Left_Array_Attribute => 1577, - Iir_Kind_Right_Array_Attribute => 1584, - Iir_Kind_High_Array_Attribute => 1591, - Iir_Kind_Low_Array_Attribute => 1598, - Iir_Kind_Length_Array_Attribute => 1605, - Iir_Kind_Ascending_Array_Attribute => 1612, - Iir_Kind_Range_Array_Attribute => 1619, - Iir_Kind_Reverse_Range_Array_Attribute => 1626, - Iir_Kind_Attribute_Name => 1634 + Iir_Kind_Enumeration_Literal => 609, + Iir_Kind_Function_Declaration => 631, + Iir_Kind_Implicit_Function_Declaration => 648, + Iir_Kind_Implicit_Procedure_Declaration => 663, + Iir_Kind_Procedure_Declaration => 683, + Iir_Kind_Function_Body => 693, + Iir_Kind_Procedure_Body => 703, + Iir_Kind_Object_Alias_Declaration => 715, + Iir_Kind_File_Declaration => 730, + Iir_Kind_Guard_Signal_Declaration => 743, + Iir_Kind_Signal_Declaration => 760, + Iir_Kind_Variable_Declaration => 773, + Iir_Kind_Constant_Declaration => 787, + Iir_Kind_Iterator_Declaration => 799, + Iir_Kind_Interface_Constant_Declaration => 815, + Iir_Kind_Interface_Variable_Declaration => 831, + Iir_Kind_Interface_Signal_Declaration => 852, + Iir_Kind_Interface_File_Declaration => 868, + Iir_Kind_Interface_Package_Declaration => 877, + Iir_Kind_Identity_Operator => 881, + Iir_Kind_Negation_Operator => 885, + Iir_Kind_Absolute_Operator => 889, + Iir_Kind_Not_Operator => 893, + Iir_Kind_Condition_Operator => 897, + Iir_Kind_Reduction_And_Operator => 901, + Iir_Kind_Reduction_Or_Operator => 905, + Iir_Kind_Reduction_Nand_Operator => 909, + Iir_Kind_Reduction_Nor_Operator => 913, + Iir_Kind_Reduction_Xor_Operator => 917, + Iir_Kind_Reduction_Xnor_Operator => 921, + Iir_Kind_And_Operator => 926, + Iir_Kind_Or_Operator => 931, + Iir_Kind_Nand_Operator => 936, + Iir_Kind_Nor_Operator => 941, + Iir_Kind_Xor_Operator => 946, + Iir_Kind_Xnor_Operator => 951, + Iir_Kind_Equality_Operator => 956, + Iir_Kind_Inequality_Operator => 961, + Iir_Kind_Less_Than_Operator => 966, + Iir_Kind_Less_Than_Or_Equal_Operator => 971, + Iir_Kind_Greater_Than_Operator => 976, + Iir_Kind_Greater_Than_Or_Equal_Operator => 981, + Iir_Kind_Match_Equality_Operator => 986, + Iir_Kind_Match_Inequality_Operator => 991, + Iir_Kind_Match_Less_Than_Operator => 996, + Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1001, + Iir_Kind_Match_Greater_Than_Operator => 1006, + Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1011, + Iir_Kind_Sll_Operator => 1016, + Iir_Kind_Sla_Operator => 1021, + Iir_Kind_Srl_Operator => 1026, + Iir_Kind_Sra_Operator => 1031, + Iir_Kind_Rol_Operator => 1036, + Iir_Kind_Ror_Operator => 1041, + Iir_Kind_Addition_Operator => 1046, + Iir_Kind_Substraction_Operator => 1051, + Iir_Kind_Concatenation_Operator => 1056, + Iir_Kind_Multiplication_Operator => 1061, + Iir_Kind_Division_Operator => 1066, + Iir_Kind_Modulus_Operator => 1071, + Iir_Kind_Remainder_Operator => 1076, + Iir_Kind_Exponentiation_Operator => 1081, + Iir_Kind_Function_Call => 1089, + Iir_Kind_Aggregate => 1095, + Iir_Kind_Parenthesis_Expression => 1098, + Iir_Kind_Qualified_Expression => 1102, + Iir_Kind_Type_Conversion => 1107, + Iir_Kind_Allocator_By_Expression => 1111, + Iir_Kind_Allocator_By_Subtype => 1115, + Iir_Kind_Selected_Element => 1121, + Iir_Kind_Dereference => 1126, + Iir_Kind_Implicit_Dereference => 1131, + Iir_Kind_Slice_Name => 1138, + Iir_Kind_Indexed_Name => 1144, + Iir_Kind_Psl_Expression => 1146, + Iir_Kind_Sensitized_Process_Statement => 1165, + Iir_Kind_Process_Statement => 1183, + Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1194, + Iir_Kind_Concurrent_Selected_Signal_Assignment => 1206, + Iir_Kind_Concurrent_Assertion_Statement => 1214, + Iir_Kind_Psl_Default_Clock => 1218, + Iir_Kind_Psl_Assert_Statement => 1227, + Iir_Kind_Psl_Cover_Statement => 1236, + Iir_Kind_Concurrent_Procedure_Call_Statement => 1242, + Iir_Kind_Block_Statement => 1255, + Iir_Kind_Generate_Statement => 1267, + Iir_Kind_Component_Instantiation_Statement => 1277, + Iir_Kind_Simple_Simultaneous_Statement => 1284, + Iir_Kind_Signal_Assignment_Statement => 1293, + Iir_Kind_Null_Statement => 1297, + Iir_Kind_Assertion_Statement => 1304, + Iir_Kind_Report_Statement => 1310, + Iir_Kind_Wait_Statement => 1317, + Iir_Kind_Variable_Assignment_Statement => 1323, + Iir_Kind_Return_Statement => 1329, + Iir_Kind_For_Loop_Statement => 1337, + Iir_Kind_While_Loop_Statement => 1344, + Iir_Kind_Next_Statement => 1350, + Iir_Kind_Exit_Statement => 1356, + Iir_Kind_Case_Statement => 1363, + Iir_Kind_Procedure_Call_Statement => 1368, + Iir_Kind_If_Statement => 1376, + Iir_Kind_Elsif => 1381, + Iir_Kind_Character_Literal => 1388, + Iir_Kind_Simple_Name => 1395, + Iir_Kind_Selected_Name => 1403, + Iir_Kind_Operator_Symbol => 1408, + Iir_Kind_Selected_By_All_Name => 1413, + Iir_Kind_Parenthesis_Name => 1417, + Iir_Kind_Base_Attribute => 1419, + Iir_Kind_Left_Type_Attribute => 1424, + Iir_Kind_Right_Type_Attribute => 1429, + Iir_Kind_High_Type_Attribute => 1434, + Iir_Kind_Low_Type_Attribute => 1439, + Iir_Kind_Ascending_Type_Attribute => 1444, + Iir_Kind_Image_Attribute => 1450, + Iir_Kind_Value_Attribute => 1456, + Iir_Kind_Pos_Attribute => 1462, + Iir_Kind_Val_Attribute => 1468, + Iir_Kind_Succ_Attribute => 1474, + Iir_Kind_Pred_Attribute => 1480, + Iir_Kind_Leftof_Attribute => 1486, + Iir_Kind_Rightof_Attribute => 1492, + Iir_Kind_Delayed_Attribute => 1500, + Iir_Kind_Stable_Attribute => 1508, + Iir_Kind_Quiet_Attribute => 1516, + Iir_Kind_Transaction_Attribute => 1524, + Iir_Kind_Event_Attribute => 1528, + Iir_Kind_Active_Attribute => 1532, + Iir_Kind_Last_Event_Attribute => 1536, + Iir_Kind_Last_Active_Attribute => 1540, + Iir_Kind_Last_Value_Attribute => 1544, + Iir_Kind_Driving_Attribute => 1548, + Iir_Kind_Driving_Value_Attribute => 1552, + Iir_Kind_Behavior_Attribute => 1552, + Iir_Kind_Structure_Attribute => 1552, + Iir_Kind_Simple_Name_Attribute => 1559, + Iir_Kind_Instance_Name_Attribute => 1564, + Iir_Kind_Path_Name_Attribute => 1569, + Iir_Kind_Left_Array_Attribute => 1576, + Iir_Kind_Right_Array_Attribute => 1583, + Iir_Kind_High_Array_Attribute => 1590, + Iir_Kind_Low_Array_Attribute => 1597, + Iir_Kind_Length_Array_Attribute => 1604, + Iir_Kind_Ascending_Array_Attribute => 1611, + Iir_Kind_Range_Array_Attribute => 1618, + Iir_Kind_Reverse_Range_Array_Attribute => 1625, + Iir_Kind_Attribute_Name => 1633 ); function Get_Fields (K : Iir_Kind) return Fields_Array @@ -4387,8 +4381,6 @@ package body Nodes_Meta is return Get_Physical_Literal (N); when Field_Physical_Unit_Value => return Get_Physical_Unit_Value (N); - when Field_Enumeration_Decl => - return Get_Enumeration_Decl (N); when Field_Bit_String_0 => return Get_Bit_String_0 (N); when Field_Bit_String_1 => @@ -4749,8 +4741,6 @@ package body Nodes_Meta is Set_Physical_Literal (N, V); when Field_Physical_Unit_Value => Set_Physical_Unit_Value (N, V); - when Field_Enumeration_Decl => - Set_Enumeration_Decl (N, V); when Field_Bit_String_0 => Set_Bit_String_0 (N, V); when Field_Bit_String_1 => @@ -5989,11 +5979,6 @@ package body Nodes_Meta is end case; end Has_Fp_Value; - function Has_Enumeration_Decl (K : Iir_Kind) return Boolean is - begin - return K = Iir_Kind_Enumeration_Literal; - end Has_Enumeration_Decl; - function Has_Simple_Aggregate_List (K : Iir_Kind) return Boolean is begin return K = Iir_Kind_Simple_Aggregate; diff --git a/src/vhdl/nodes_meta.ads b/src/vhdl/nodes_meta.ads index b68f365..7ce120a 100644 --- a/src/vhdl/nodes_meta.ads +++ b/src/vhdl/nodes_meta.ads @@ -86,7 +86,6 @@ package Nodes_Meta is Field_Physical_Literal, Field_Physical_Unit_Value, Field_Fp_Value, - Field_Enumeration_Decl, Field_Simple_Aggregate_List, Field_Bit_String_Base, Field_Bit_String_0, @@ -549,7 +548,6 @@ package Nodes_Meta is function Has_Physical_Literal (K : Iir_Kind) return Boolean; function Has_Physical_Unit_Value (K : Iir_Kind) return Boolean; function Has_Fp_Value (K : Iir_Kind) return Boolean; - function Has_Enumeration_Decl (K : Iir_Kind) return Boolean; function Has_Simple_Aggregate_List (K : Iir_Kind) return Boolean; function Has_Bit_String_Base (K : Iir_Kind) return Boolean; function Has_Bit_String_0 (K : Iir_Kind) return Boolean; diff --git a/src/vhdl/sem_types.adb b/src/vhdl/sem_types.adb index 12f276b..9bddd64 100644 --- a/src/vhdl/sem_types.adb +++ b/src/vhdl/sem_types.adb @@ -789,7 +789,6 @@ package body Sem_Types is Set_Expr_Staticness (El, Locally); Set_Name_Staticness (El, Locally); Set_Type (El, Def); - Set_Enumeration_Decl (El, El); Sem.Compute_Subprogram_Hash (El); Sem_Scopes.Add_Name (El); Name_Visible (El); diff --git a/src/vhdl/std_package.adb b/src/vhdl/std_package.adb index f9e9738..11d1e67 100644 --- a/src/vhdl/std_package.adb +++ b/src/vhdl/std_package.adb @@ -162,7 +162,6 @@ package body Std_Package is Set_Type (Res, Sub_Type); Set_Expr_Staticness (Res, Locally); Set_Name_Staticness (Res, Locally); - Set_Enumeration_Decl (Res, Res); Set_Enum_Pos (Res, Iir_Int32 (Get_Nbr_Elements (List))); Sem.Compute_Subprogram_Hash (Res); Append_Element (List, Res); diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb index db6eafc..67ea811 100644 --- a/src/vhdl/translate/trans-chap7.adb +++ b/src/vhdl/translate/trans-chap7.adb @@ -506,7 +506,16 @@ package body Trans.Chap7 is (Res_Type, Integer_64 (Get_Value (Expr))); when Iir_Kind_Enumeration_Literal => - return Get_Ortho_Expr (Get_Enumeration_Decl (Expr)); + declare + Enum_Type : constant Iir := Get_Base_Type (Get_Type (Expr)); + Lit_List : Iir_List; + Enum : Iir; + begin + Lit_List := Get_Enumeration_Literal_List (Enum_Type); + Enum := Get_Nth_Element + (Lit_List, Natural (Get_Enum_Pos (Expr))); + return Get_Ortho_Expr (Enum); + end; when Iir_Kind_Floating_Point_Literal => return New_Float_Literal |