diff options
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-nodes.adb | 16 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 9 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes_meta.adb | 254 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes_meta.ads | 2 |
4 files changed, 42 insertions, 239 deletions
diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb index 4048d2cf2..beff8b527 100644 --- a/src/vhdl/vhdl-nodes.adb +++ b/src/vhdl/vhdl-nodes.adb @@ -2679,6 +2679,22 @@ package body Vhdl.Nodes is Set_Flag1 (Decl, Flag); end Set_Need_Body; + function Get_Immediate_Body_Flag (Decl : Iir) return Boolean is + begin + pragma Assert (Decl /= Null_Iir); + pragma Assert (Has_Immediate_Body_Flag (Get_Kind (Decl)), + "no field Immediate_Body_Flag"); + return Get_Flag5 (Decl); + end Get_Immediate_Body_Flag; + + procedure Set_Immediate_Body_Flag (Decl : Iir; Flag : Boolean) is + begin + pragma Assert (Decl /= Null_Iir); + pragma Assert (Has_Immediate_Body_Flag (Get_Kind (Decl)), + "no field Immediate_Body_Flag"); + Set_Flag5 (Decl, Flag); + end Set_Immediate_Body_Flag; + function Get_Macro_Expanded_Flag (Decl : Iir) return Boolean is begin pragma Assert (Decl /= Null_Iir); diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index 0cd02d637..8601159db 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -1074,6 +1074,8 @@ package Vhdl.Nodes is -- Iir_Kind_Package_Instantiation_Body (Short) -- Note: a body is not a declaration, that's the reason why there is no -- _declaration suffix in the name. + -- Note: Package_Instantiation_Body represent the place of the body when + -- it is not immediately after the instantiation. -- -- Get/Set_Parent (Field0) -- Get/Set_Design_Unit (Alias Field0) @@ -1124,6 +1126,9 @@ package Vhdl.Nodes is -- For macro-expanded packages: the body. -- Get/Set_Instance_Package_Body (Field4) -- + -- For macro-expanded packages: true if the body appears immediately after. + -- Get/Set_Immediate_Body_Flag (Flag5) + -- -- Get/Set_Visible_Flag (Flag4) -- -- Get/Set_End_Has_Reserved_Id (Flag8) @@ -8152,6 +8157,10 @@ package Vhdl.Nodes is function Get_Need_Body (Decl : Iir_Package_Declaration) return Boolean; procedure Set_Need_Body (Decl : Iir_Package_Declaration; Flag : Boolean); + -- Field: Flag5 + function Get_Immediate_Body_Flag (Decl : Iir) return Boolean; + procedure Set_Immediate_Body_Flag (Decl : Iir; Flag : Boolean); + -- Field: Flag2 function Get_Macro_Expanded_Flag (Decl : Iir) return Boolean; procedure Set_Macro_Expanded_Flag (Decl : Iir; Flag : Boolean); diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb index 4004c8509..d3187b7cc 100644 --- a/src/vhdl/vhdl-nodes_meta.adb +++ b/src/vhdl/vhdl-nodes_meta.adb @@ -98,6 +98,7 @@ package body Vhdl.Nodes_Meta is Field_Package_Body => Type_Iir, Field_Instance_Package_Body => Type_Iir, Field_Need_Body => Type_Boolean, + Field_Immediate_Body_Flag => Type_Boolean, Field_Macro_Expanded_Flag => Type_Boolean, Field_Need_Instance_Bodies => Type_Boolean, Field_Hierarchical_Name => Type_Iir, @@ -576,6 +577,8 @@ package body Vhdl.Nodes_Meta is return "instance_package_body"; when Field_Need_Body => return "need_body"; + when Field_Immediate_Body_Flag => + return "immediate_body_flag"; when Field_Macro_Expanded_Flag => return "macro_expanded_flag"; when Field_Need_Instance_Bodies => @@ -2012,6 +2015,8 @@ package body Vhdl.Nodes_Meta is return Attr_None; when Field_Need_Body => return Attr_None; + when Field_Immediate_Body_Flag => + return Attr_None; when Field_Macro_Expanded_Flag => return Attr_None; when Field_Need_Instance_Bodies => @@ -3330,6 +3335,7 @@ package body Vhdl.Nodes_Meta is Field_Instance_Source_File, Field_Identifier, Field_Visible_Flag, + Field_Immediate_Body_Flag, Field_End_Has_Reserved_Id, Field_End_Has_Identifier, Field_Parent, @@ -5487,245 +5493,7 @@ package body Vhdl.Nodes_Meta is Iir_Kind_Entity_Declaration => 576, Iir_Kind_Configuration_Declaration => 586, Iir_Kind_Context_Declaration => 592, -<<<<<<< HEAD Iir_Kind_Package_Declaration => 607, - Iir_Kind_Package_Instantiation_Declaration => 621, - Iir_Kind_Vmode_Declaration => 633, - Iir_Kind_Vprop_Declaration => 645, - Iir_Kind_Vunit_Declaration => 658, - Iir_Kind_Package_Body => 666, - Iir_Kind_Architecture_Body => 679, - Iir_Kind_Type_Declaration => 686, - Iir_Kind_Anonymous_Type_Declaration => 692, - Iir_Kind_Subtype_Declaration => 700, - Iir_Kind_Nature_Declaration => 706, - Iir_Kind_Subnature_Declaration => 713, - Iir_Kind_Package_Header => 715, - Iir_Kind_Unit_Declaration => 724, - Iir_Kind_Library_Declaration => 732, - Iir_Kind_Component_Declaration => 742, - Iir_Kind_Attribute_Declaration => 749, - Iir_Kind_Group_Template_Declaration => 755, - Iir_Kind_Group_Declaration => 762, - Iir_Kind_Element_Declaration => 770, - Iir_Kind_Nature_Element_Declaration => 777, - Iir_Kind_Non_Object_Alias_Declaration => 785, - Iir_Kind_Psl_Declaration => 793, - Iir_Kind_Psl_Boolean_Parameter => 801, - Iir_Kind_Psl_Endpoint_Declaration => 815, - Iir_Kind_Enumeration_Literal => 827, - Iir_Kind_Function_Declaration => 854, - Iir_Kind_Procedure_Declaration => 878, - Iir_Kind_Function_Body => 888, - Iir_Kind_Procedure_Body => 899, - Iir_Kind_Function_Instantiation_Declaration => 910, - Iir_Kind_Procedure_Instantiation_Declaration => 920, - Iir_Kind_Terminal_Declaration => 930, - Iir_Kind_Object_Alias_Declaration => 942, - Iir_Kind_Free_Quantity_Declaration => 954, - Iir_Kind_Spectrum_Quantity_Declaration => 967, - Iir_Kind_Noise_Quantity_Declaration => 979, - Iir_Kind_Across_Quantity_Declaration => 995, - Iir_Kind_Through_Quantity_Declaration => 1011, - Iir_Kind_File_Declaration => 1026, - Iir_Kind_Guard_Signal_Declaration => 1040, - Iir_Kind_Signal_Declaration => 1057, - Iir_Kind_Variable_Declaration => 1070, - Iir_Kind_Constant_Declaration => 1085, - Iir_Kind_Iterator_Declaration => 1097, - Iir_Kind_Interface_Constant_Declaration => 1114, - Iir_Kind_Interface_Variable_Declaration => 1130, - Iir_Kind_Interface_Signal_Declaration => 1151, - Iir_Kind_Interface_File_Declaration => 1167, - Iir_Kind_Interface_Quantity_Declaration => 1183, - Iir_Kind_Interface_Terminal_Declaration => 1195, - Iir_Kind_Interface_Type_Declaration => 1207, - Iir_Kind_Interface_Package_Declaration => 1221, - Iir_Kind_Interface_Function_Declaration => 1241, - Iir_Kind_Interface_Procedure_Declaration => 1257, - Iir_Kind_Attribute_Implicit_Declaration => 1260, - Iir_Kind_Suspend_State_Declaration => 1264, - Iir_Kind_Identity_Operator => 1268, - Iir_Kind_Negation_Operator => 1272, - Iir_Kind_Absolute_Operator => 1276, - Iir_Kind_Not_Operator => 1280, - Iir_Kind_Implicit_Condition_Operator => 1284, - Iir_Kind_Condition_Operator => 1288, - Iir_Kind_Reduction_And_Operator => 1292, - Iir_Kind_Reduction_Or_Operator => 1296, - Iir_Kind_Reduction_Nand_Operator => 1300, - Iir_Kind_Reduction_Nor_Operator => 1304, - Iir_Kind_Reduction_Xor_Operator => 1308, - Iir_Kind_Reduction_Xnor_Operator => 1312, - Iir_Kind_And_Operator => 1317, - Iir_Kind_Or_Operator => 1322, - Iir_Kind_Nand_Operator => 1327, - Iir_Kind_Nor_Operator => 1332, - Iir_Kind_Xor_Operator => 1337, - Iir_Kind_Xnor_Operator => 1342, - Iir_Kind_Equality_Operator => 1347, - Iir_Kind_Inequality_Operator => 1352, - Iir_Kind_Less_Than_Operator => 1357, - Iir_Kind_Less_Than_Or_Equal_Operator => 1362, - Iir_Kind_Greater_Than_Operator => 1367, - Iir_Kind_Greater_Than_Or_Equal_Operator => 1372, - Iir_Kind_Match_Equality_Operator => 1377, - Iir_Kind_Match_Inequality_Operator => 1382, - Iir_Kind_Match_Less_Than_Operator => 1387, - Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1392, - Iir_Kind_Match_Greater_Than_Operator => 1397, - Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1402, - Iir_Kind_Sll_Operator => 1407, - Iir_Kind_Sla_Operator => 1412, - Iir_Kind_Srl_Operator => 1417, - Iir_Kind_Sra_Operator => 1422, - Iir_Kind_Rol_Operator => 1427, - Iir_Kind_Ror_Operator => 1432, - Iir_Kind_Addition_Operator => 1437, - Iir_Kind_Substraction_Operator => 1442, - Iir_Kind_Concatenation_Operator => 1447, - Iir_Kind_Multiplication_Operator => 1452, - Iir_Kind_Division_Operator => 1457, - Iir_Kind_Modulus_Operator => 1462, - Iir_Kind_Remainder_Operator => 1467, - Iir_Kind_Exponentiation_Operator => 1472, - Iir_Kind_Function_Call => 1480, - Iir_Kind_Aggregate => 1488, - Iir_Kind_Parenthesis_Expression => 1491, - Iir_Kind_Qualified_Expression => 1495, - Iir_Kind_Type_Conversion => 1500, - Iir_Kind_Allocator_By_Expression => 1505, - Iir_Kind_Allocator_By_Subtype => 1511, - Iir_Kind_Selected_Element => 1519, - Iir_Kind_Dereference => 1524, - Iir_Kind_Implicit_Dereference => 1529, - Iir_Kind_Slice_Name => 1536, - Iir_Kind_Indexed_Name => 1542, - Iir_Kind_Psl_Prev => 1548, - Iir_Kind_Psl_Stable => 1553, - Iir_Kind_Psl_Rose => 1558, - Iir_Kind_Psl_Fell => 1563, - Iir_Kind_Psl_Onehot => 1566, - Iir_Kind_Psl_Onehot0 => 1569, - Iir_Kind_Psl_Expression => 1571, - Iir_Kind_Sensitized_Process_Statement => 1593, - Iir_Kind_Process_Statement => 1614, - Iir_Kind_Concurrent_Simple_Signal_Assignment => 1627, - Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1640, - Iir_Kind_Concurrent_Selected_Signal_Assignment => 1654, - Iir_Kind_Concurrent_Assertion_Statement => 1662, - Iir_Kind_Concurrent_Procedure_Call_Statement => 1669, - Iir_Kind_Concurrent_Break_Statement => 1677, - Iir_Kind_Psl_Assert_Directive => 1691, - Iir_Kind_Psl_Assume_Directive => 1703, - Iir_Kind_Psl_Cover_Directive => 1715, - Iir_Kind_Psl_Restrict_Directive => 1726, - Iir_Kind_Block_Statement => 1740, - Iir_Kind_If_Generate_Statement => 1751, - Iir_Kind_Case_Generate_Statement => 1760, - Iir_Kind_For_Generate_Statement => 1769, - Iir_Kind_Component_Instantiation_Statement => 1781, - Iir_Kind_Psl_Default_Clock => 1784, - Iir_Kind_Generate_Statement_Body => 1795, - Iir_Kind_If_Generate_Else_Clause => 1801, - Iir_Kind_Simple_Simultaneous_Statement => 1808, - Iir_Kind_Simultaneous_Null_Statement => 1812, - Iir_Kind_Simultaneous_Procedural_Statement => 1823, - Iir_Kind_Simultaneous_Case_Statement => 1832, - Iir_Kind_Simultaneous_If_Statement => 1841, - Iir_Kind_Simultaneous_Elsif => 1847, - Iir_Kind_Simple_Signal_Assignment_Statement => 1858, - Iir_Kind_Conditional_Signal_Assignment_Statement => 1869, - Iir_Kind_Selected_Waveform_Assignment_Statement => 1881, - Iir_Kind_Signal_Force_Assignment_Statement => 1891, - Iir_Kind_Signal_Release_Assignment_Statement => 1900, - Iir_Kind_Null_Statement => 1904, - Iir_Kind_Assertion_Statement => 1911, - Iir_Kind_Report_Statement => 1917, - Iir_Kind_Wait_Statement => 1925, - Iir_Kind_Variable_Assignment_Statement => 1932, - Iir_Kind_Conditional_Variable_Assignment_Statement => 1939, - Iir_Kind_Return_Statement => 1945, - Iir_Kind_For_Loop_Statement => 1956, - Iir_Kind_While_Loop_Statement => 1967, - Iir_Kind_Next_Statement => 1974, - Iir_Kind_Exit_Statement => 1981, - Iir_Kind_Case_Statement => 1990, - Iir_Kind_Procedure_Call_Statement => 1996, - Iir_Kind_Break_Statement => 2003, - Iir_Kind_If_Statement => 2013, - Iir_Kind_Suspend_State_Statement => 2018, - Iir_Kind_Elsif => 2024, - Iir_Kind_Character_Literal => 2031, - Iir_Kind_Simple_Name => 2038, - Iir_Kind_Selected_Name => 2046, - Iir_Kind_Operator_Symbol => 2051, - Iir_Kind_Reference_Name => 2056, - Iir_Kind_External_Constant_Name => 2065, - Iir_Kind_External_Signal_Name => 2075, - Iir_Kind_External_Variable_Name => 2085, - Iir_Kind_Selected_By_All_Name => 2091, - Iir_Kind_Parenthesis_Name => 2096, - Iir_Kind_Package_Pathname => 2100, - Iir_Kind_Absolute_Pathname => 2101, - Iir_Kind_Relative_Pathname => 2102, - Iir_Kind_Pathname_Element => 2107, - Iir_Kind_Base_Attribute => 2109, - Iir_Kind_Subtype_Attribute => 2114, - Iir_Kind_Element_Attribute => 2119, - Iir_Kind_Across_Attribute => 2124, - Iir_Kind_Through_Attribute => 2129, - Iir_Kind_Nature_Reference_Attribute => 2133, - Iir_Kind_Left_Type_Attribute => 2138, - Iir_Kind_Right_Type_Attribute => 2143, - Iir_Kind_High_Type_Attribute => 2148, - Iir_Kind_Low_Type_Attribute => 2153, - Iir_Kind_Ascending_Type_Attribute => 2158, - Iir_Kind_Image_Attribute => 2164, - Iir_Kind_Value_Attribute => 2170, - Iir_Kind_Pos_Attribute => 2176, - Iir_Kind_Val_Attribute => 2182, - Iir_Kind_Succ_Attribute => 2188, - Iir_Kind_Pred_Attribute => 2194, - Iir_Kind_Leftof_Attribute => 2200, - Iir_Kind_Rightof_Attribute => 2206, - Iir_Kind_Signal_Slew_Attribute => 2214, - Iir_Kind_Quantity_Slew_Attribute => 2222, - Iir_Kind_Ramp_Attribute => 2230, - Iir_Kind_Zoh_Attribute => 2238, - Iir_Kind_Ltf_Attribute => 2246, - Iir_Kind_Ztf_Attribute => 2256, - Iir_Kind_Dot_Attribute => 2263, - Iir_Kind_Integ_Attribute => 2270, - Iir_Kind_Quantity_Delayed_Attribute => 2278, - Iir_Kind_Above_Attribute => 2286, - Iir_Kind_Delayed_Attribute => 2295, - Iir_Kind_Stable_Attribute => 2304, - Iir_Kind_Quiet_Attribute => 2313, - Iir_Kind_Transaction_Attribute => 2322, - Iir_Kind_Event_Attribute => 2326, - Iir_Kind_Active_Attribute => 2330, - Iir_Kind_Last_Event_Attribute => 2334, - Iir_Kind_Last_Active_Attribute => 2338, - Iir_Kind_Last_Value_Attribute => 2342, - Iir_Kind_Driving_Attribute => 2346, - Iir_Kind_Driving_Value_Attribute => 2350, - Iir_Kind_Behavior_Attribute => 2350, - Iir_Kind_Structure_Attribute => 2350, - Iir_Kind_Simple_Name_Attribute => 2357, - Iir_Kind_Instance_Name_Attribute => 2362, - Iir_Kind_Path_Name_Attribute => 2367, - Iir_Kind_Left_Array_Attribute => 2374, - Iir_Kind_Right_Array_Attribute => 2381, - Iir_Kind_High_Array_Attribute => 2388, - Iir_Kind_Low_Array_Attribute => 2395, - Iir_Kind_Length_Array_Attribute => 2402, - Iir_Kind_Ascending_Array_Attribute => 2409, - Iir_Kind_Range_Array_Attribute => 2416, - Iir_Kind_Reverse_Range_Array_Attribute => 2423, - Iir_Kind_Attribute_Name => 2432 -======= - Iir_Kind_Package_Declaration => 608, Iir_Kind_Package_Instantiation_Declaration => 622, Iir_Kind_Vmode_Declaration => 634, Iir_Kind_Vprop_Declaration => 646, @@ -5962,7 +5730,6 @@ package body Vhdl.Nodes_Meta is Iir_Kind_Range_Array_Attribute => 2425, Iir_Kind_Reverse_Range_Array_Attribute => 2432, Iir_Kind_Attribute_Name => 2441 ->>>>>>> a5a8fda... vhdl: add iir_kind_package_instantiation_body ); function Get_Fields_First (K : Iir_Kind) return Fields_Index is @@ -6021,6 +5788,8 @@ package body Vhdl.Nodes_Meta is return Get_Element_Type_Flag (N); when Field_Need_Body => return Get_Need_Body (N); + when Field_Immediate_Body_Flag => + return Get_Immediate_Body_Flag (N); when Field_Macro_Expanded_Flag => return Get_Macro_Expanded_Flag (N); when Field_Need_Instance_Bodies => @@ -6185,6 +5954,8 @@ package body Vhdl.Nodes_Meta is Set_Element_Type_Flag (N, V); when Field_Need_Body => Set_Need_Body (N, V); + when Field_Immediate_Body_Flag => + Set_Immediate_Body_Flag (N, V); when Field_Macro_Expanded_Flag => Set_Macro_Expanded_Flag (N, V); when Field_Need_Instance_Bodies => @@ -8845,6 +8616,11 @@ package body Vhdl.Nodes_Meta is return K = Iir_Kind_Package_Declaration; end Has_Need_Body; + function Has_Immediate_Body_Flag (K : Iir_Kind) return Boolean is + begin + return K = Iir_Kind_Package_Instantiation_Declaration; + end Has_Immediate_Body_Flag; + function Has_Macro_Expanded_Flag (K : Iir_Kind) return Boolean is begin return K = Iir_Kind_Package_Declaration; diff --git a/src/vhdl/vhdl-nodes_meta.ads b/src/vhdl/vhdl-nodes_meta.ads index 0f0fe9cb9..e75fdf1c2 100644 --- a/src/vhdl/vhdl-nodes_meta.ads +++ b/src/vhdl/vhdl-nodes_meta.ads @@ -142,6 +142,7 @@ package Vhdl.Nodes_Meta is Field_Package_Body, Field_Instance_Package_Body, Field_Need_Body, + Field_Immediate_Body_Flag, Field_Macro_Expanded_Flag, Field_Need_Instance_Bodies, Field_Hierarchical_Name, @@ -741,6 +742,7 @@ package Vhdl.Nodes_Meta is function Has_Package_Body (K : Iir_Kind) return Boolean; function Has_Instance_Package_Body (K : Iir_Kind) return Boolean; function Has_Need_Body (K : Iir_Kind) return Boolean; + function Has_Immediate_Body_Flag (K : Iir_Kind) return Boolean; function Has_Macro_Expanded_Flag (K : Iir_Kind) return Boolean; function Has_Need_Instance_Bodies (K : Iir_Kind) return Boolean; function Has_Hierarchical_Name (K : Iir_Kind) return Boolean; |