diff options
-rw-r--r-- | pyGHDL/libghdl/vhdl/nodes.py | 13 | ||||
-rw-r--r-- | pyGHDL/libghdl/vhdl/nodes_meta.py | 83 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.adb | 16 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 17 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes_meta.adb | 556 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes_meta.ads | 2 |
6 files changed, 384 insertions, 303 deletions
diff --git a/pyGHDL/libghdl/vhdl/nodes.py b/pyGHDL/libghdl/vhdl/nodes.py index df1455c82..9af4cacea 100644 --- a/pyGHDL/libghdl/vhdl/nodes.py +++ b/pyGHDL/libghdl/vhdl/nodes.py @@ -6527,6 +6527,19 @@ def Set_Use_Flag(obj: Iir, value: Boolean) -> None: @export +@BindToLibGHDL("vhdl__nodes__get_elaborated_flag") +def Get_Elaborated_Flag(obj: Iir) -> Boolean: + """""" + return 0 + + +@export +@BindToLibGHDL("vhdl__nodes__set_elaborated_flag") +def Set_Elaborated_Flag(obj: Iir, value: Boolean) -> None: + """""" + + +@export @BindToLibGHDL("vhdl__nodes__get_end_has_reserved_id") def Get_End_Has_Reserved_Id(obj: Iir) -> Boolean: """""" diff --git a/pyGHDL/libghdl/vhdl/nodes_meta.py b/pyGHDL/libghdl/vhdl/nodes_meta.py index ef851f816..f1d70aa22 100644 --- a/pyGHDL/libghdl/vhdl/nodes_meta.py +++ b/pyGHDL/libghdl/vhdl/nodes_meta.py @@ -466,44 +466,45 @@ class fields(IntEnum): Protected_Type_Body = 346 Protected_Type_Declaration = 347 Use_Flag = 348 - End_Has_Reserved_Id = 349 - End_Has_Identifier = 350 - End_Has_Postponed = 351 - Has_Label = 352 - Has_Begin = 353 - Has_End = 354 - Has_Is = 355 - Has_Pure = 356 - Has_Body = 357 - Has_Parameter = 358 - Has_Component = 359 - Has_Identifier_List = 360 - Has_Mode = 361 - Has_Class = 362 - Has_Delay_Mechanism = 363 - Suspend_Flag = 364 - Stop_Flag = 365 - Is_Ref = 366 - Is_Forward_Ref = 367 - Psl_Property = 368 - Psl_Sequence = 369 - Psl_Declaration = 370 - Psl_Expression = 371 - Psl_Boolean = 372 - PSL_Clock = 373 - PSL_NFA = 374 - PSL_Nbr_States = 375 - PSL_Clock_Sensitivity = 376 - PSL_EOS_Flag = 377 - PSL_Abort_Flag = 378 - Count_Expression = 379 - Clock_Expression = 380 - Default_Clock = 381 - Foreign_Node = 382 - Suspend_State_Index = 383 - Suspend_State_Chain = 384 - Suspend_State_Last = 385 - Suspend_State_Decl = 386 + Elaborated_Flag = 349 + End_Has_Reserved_Id = 350 + End_Has_Identifier = 351 + End_Has_Postponed = 352 + Has_Label = 353 + Has_Begin = 354 + Has_End = 355 + Has_Is = 356 + Has_Pure = 357 + Has_Body = 358 + Has_Parameter = 359 + Has_Component = 360 + Has_Identifier_List = 361 + Has_Mode = 362 + Has_Class = 363 + Has_Delay_Mechanism = 364 + Suspend_Flag = 365 + Stop_Flag = 366 + Is_Ref = 367 + Is_Forward_Ref = 368 + Psl_Property = 369 + Psl_Sequence = 370 + Psl_Declaration = 371 + Psl_Expression = 372 + Psl_Boolean = 373 + PSL_Clock = 374 + PSL_NFA = 375 + PSL_Nbr_States = 376 + PSL_Clock_Sensitivity = 377 + PSL_EOS_Flag = 378 + PSL_Abort_Flag = 379 + Count_Expression = 380 + Clock_Expression = 381 + Default_Clock = 382 + Foreign_Node = 383 + Suspend_State_Index = 384 + Suspend_State_Chain = 385 + Suspend_State_Last = 386 + Suspend_State_Decl = 387 def Get_Boolean(node, field): @@ -2733,6 +2734,12 @@ def Has_Use_Flag(kind: IirKind) -> bool: @export +@BindToLibGHDL("vhdl__nodes_meta__has_elaborated_flag") +def Has_Elaborated_Flag(kind: IirKind) -> bool: + """""" + + +@export @BindToLibGHDL("vhdl__nodes_meta__has_end_has_reserved_id") def Has_End_Has_Reserved_Id(kind: IirKind) -> bool: """""" diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb index 7e938d6e0..3891f3f13 100644 --- a/src/vhdl/vhdl-nodes.adb +++ b/src/vhdl/vhdl-nodes.adb @@ -7028,6 +7028,22 @@ package body Vhdl.Nodes is Set_Flag6 (Decl, Val); end Set_Use_Flag; + function Get_Elaborated_Flag (Decl : Iir) return Boolean is + begin + pragma Assert (Decl /= Null_Iir); + pragma Assert (Has_Elaborated_Flag (Get_Kind (Decl)), + "no field Elaborated_Flag"); + return Get_Flag7 (Decl); + end Get_Elaborated_Flag; + + procedure Set_Elaborated_Flag (Decl : Iir; Val : Boolean) is + begin + pragma Assert (Decl /= Null_Iir); + pragma Assert (Has_Elaborated_Flag (Get_Kind (Decl)), + "no field Elaborated_Flag"); + Set_Flag7 (Decl, Val); + end Set_Elaborated_Flag; + function Get_End_Has_Reserved_Id (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 6c7e8f8c8..a1efaf81f 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -1652,6 +1652,10 @@ package Vhdl.Nodes is -- -- Get/Set_Use_Flag (Flag6) -- + -- Immediately set on predefined operators, set at then end of the package, + -- also set when the body is analyzed. + -- Get/Set_Elaborated_Flag (Flag7) + -- -- Only for Iir_Kind_Function_Declaration: -- Get/Set_Resolution_Function_Flag (Flag13) -- @@ -1961,6 +1965,10 @@ package Vhdl.Nodes is -- -- Get/Set_Use_Flag (Flag6) -- + -- Set if not deferred, at end of the package. + -- Only for Iir_Kind_Constant_Declaration: + -- Get/Set_Elaborated_Flag (Flag7) + -- -- Get/Set_Is_Ref (Flag12) -- -- Get/Set_Expr_Staticness (State1) @@ -2776,6 +2784,9 @@ package Vhdl.Nodes is -- -- Get/Set_Signal_Type_Flag (Flag2) -- + -- Set at end of the package or when the body is analyzed. + -- Get/Set_Elaborated_Flag (Flag7) + -- -- Get/Set_End_Has_Reserved_Id (Flag8) -- -- Get/Set_End_Has_Identifier (Flag9) @@ -9481,6 +9492,12 @@ package Vhdl.Nodes is function Get_Use_Flag (Decl : Iir) return Boolean; procedure Set_Use_Flag (Decl : Iir; Val : Boolean); + -- For a subprogram declaration, constant declaration or protected type. + -- Set when it could be used because fully elaborated. + -- Field: Flag7 + function Get_Elaborated_Flag (Decl : Iir) return Boolean; + procedure Set_Elaborated_Flag (Decl : Iir; Val : Boolean); + -- Layout flag: true if 'end' is followed by the reserved identifier. -- Field: Flag8 function Get_End_Has_Reserved_Id (Decl : Iir) return Boolean; diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb index 5c6d5efdf..64757ba69 100644 --- a/src/vhdl/vhdl-nodes_meta.adb +++ b/src/vhdl/vhdl-nodes_meta.adb @@ -366,6 +366,7 @@ package body Vhdl.Nodes_Meta is Field_Protected_Type_Body => Type_Iir, Field_Protected_Type_Declaration => Type_Iir, Field_Use_Flag => Type_Boolean, + Field_Elaborated_Flag => Type_Boolean, Field_End_Has_Reserved_Id => Type_Boolean, Field_End_Has_Identifier => Type_Boolean, Field_End_Has_Postponed => Type_Boolean, @@ -1112,6 +1113,8 @@ package body Vhdl.Nodes_Meta is return "protected_type_declaration"; when Field_Use_Flag => return "use_flag"; + when Field_Elaborated_Flag => + return "elaborated_flag"; when Field_End_Has_Reserved_Id => return "end_has_reserved_id"; when Field_End_Has_Identifier => @@ -2546,6 +2549,8 @@ package body Vhdl.Nodes_Meta is return Attr_Ref; when Field_Use_Flag => return Attr_None; + when Field_Elaborated_Flag => + return Attr_None; when Field_End_Has_Reserved_Id => return Attr_None; when Field_End_Has_Identifier => @@ -3014,6 +3019,7 @@ package body Vhdl.Nodes_Meta is -- Iir_Kind_Protected_Type_Declaration Field_Resolved_Flag, Field_Signal_Type_Flag, + Field_Elaborated_Flag, Field_End_Has_Reserved_Id, Field_End_Has_Identifier, Field_Type_Staticness, @@ -3584,6 +3590,7 @@ package body Vhdl.Nodes_Meta is Field_Visible_Flag, Field_Is_Within_Flag, Field_Use_Flag, + Field_Elaborated_Flag, Field_Has_Pure, Field_Has_Body, Field_Wait_State, @@ -3611,6 +3618,7 @@ package body Vhdl.Nodes_Meta is Field_Visible_Flag, Field_Is_Within_Flag, Field_Use_Flag, + Field_Elaborated_Flag, Field_Has_Body, Field_Wait_State, Field_Purity_State, @@ -3834,6 +3842,7 @@ package body Vhdl.Nodes_Meta is Field_Has_Identifier_List, Field_Visible_Flag, Field_Use_Flag, + Field_Elaborated_Flag, Field_Expr_Staticness, Field_Name_Staticness, Field_Parent, @@ -5444,271 +5453,271 @@ package body Vhdl.Nodes_Meta is Iir_Kind_Incomplete_Type_Definition => 312, Iir_Kind_Interface_Type_Definition => 318, Iir_Kind_File_Type_Definition => 324, - Iir_Kind_Protected_Type_Declaration => 334, - Iir_Kind_Record_Type_Definition => 344, - Iir_Kind_Array_Type_Definition => 355, - Iir_Kind_Array_Subtype_Definition => 372, - Iir_Kind_Record_Subtype_Definition => 385, - Iir_Kind_Access_Subtype_Definition => 393, - Iir_Kind_File_Subtype_Definition => 400, - Iir_Kind_Physical_Subtype_Definition => 410, - Iir_Kind_Floating_Subtype_Definition => 421, - Iir_Kind_Integer_Subtype_Definition => 431, - Iir_Kind_Enumeration_Subtype_Definition => 441, - Iir_Kind_Enumeration_Type_Definition => 452, - Iir_Kind_Integer_Type_Definition => 460, - Iir_Kind_Floating_Type_Definition => 468, - Iir_Kind_Physical_Type_Definition => 479, - Iir_Kind_Range_Expression => 487, - Iir_Kind_Protected_Type_Body => 495, - Iir_Kind_Wildcard_Type_Definition => 499, - Iir_Kind_Foreign_Vector_Type_Definition => 500, - Iir_Kind_Subtype_Definition => 507, - Iir_Kind_Scalar_Nature_Definition => 515, - Iir_Kind_Record_Nature_Definition => 528, - Iir_Kind_Array_Nature_Definition => 542, - Iir_Kind_Array_Subnature_Definition => 557, - Iir_Kind_Overload_List => 558, - Iir_Kind_Foreign_Module => 563, - Iir_Kind_Entity_Declaration => 576, - Iir_Kind_Configuration_Declaration => 586, - Iir_Kind_Context_Declaration => 592, - 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 => 853, - Iir_Kind_Procedure_Declaration => 876, - Iir_Kind_Function_Body => 886, - Iir_Kind_Procedure_Body => 897, - Iir_Kind_Function_Instantiation_Declaration => 908, - Iir_Kind_Procedure_Instantiation_Declaration => 918, - Iir_Kind_Terminal_Declaration => 928, - Iir_Kind_Object_Alias_Declaration => 940, - Iir_Kind_Free_Quantity_Declaration => 952, - Iir_Kind_Spectrum_Quantity_Declaration => 965, - Iir_Kind_Noise_Quantity_Declaration => 977, - Iir_Kind_Across_Quantity_Declaration => 993, - Iir_Kind_Through_Quantity_Declaration => 1009, - Iir_Kind_File_Declaration => 1024, - Iir_Kind_Guard_Signal_Declaration => 1038, - Iir_Kind_Signal_Declaration => 1055, - Iir_Kind_Variable_Declaration => 1068, - Iir_Kind_Constant_Declaration => 1082, - Iir_Kind_Iterator_Declaration => 1094, - Iir_Kind_Interface_Constant_Declaration => 1111, - Iir_Kind_Interface_Variable_Declaration => 1127, - Iir_Kind_Interface_Signal_Declaration => 1148, - Iir_Kind_Interface_File_Declaration => 1164, - Iir_Kind_Interface_Quantity_Declaration => 1180, - Iir_Kind_Interface_Terminal_Declaration => 1192, - Iir_Kind_Interface_Type_Declaration => 1204, - Iir_Kind_Interface_Package_Declaration => 1218, - Iir_Kind_Interface_Function_Declaration => 1238, - Iir_Kind_Interface_Procedure_Declaration => 1254, - Iir_Kind_Attribute_Implicit_Declaration => 1257, - Iir_Kind_Suspend_State_Declaration => 1261, - Iir_Kind_Identity_Operator => 1265, - Iir_Kind_Negation_Operator => 1269, - Iir_Kind_Absolute_Operator => 1273, - Iir_Kind_Not_Operator => 1277, - Iir_Kind_Implicit_Condition_Operator => 1281, - Iir_Kind_Condition_Operator => 1285, - Iir_Kind_Reduction_And_Operator => 1289, - Iir_Kind_Reduction_Or_Operator => 1293, - Iir_Kind_Reduction_Nand_Operator => 1297, - Iir_Kind_Reduction_Nor_Operator => 1301, - Iir_Kind_Reduction_Xor_Operator => 1305, - Iir_Kind_Reduction_Xnor_Operator => 1309, - Iir_Kind_And_Operator => 1314, - Iir_Kind_Or_Operator => 1319, - Iir_Kind_Nand_Operator => 1324, - Iir_Kind_Nor_Operator => 1329, - Iir_Kind_Xor_Operator => 1334, - Iir_Kind_Xnor_Operator => 1339, - Iir_Kind_Equality_Operator => 1344, - Iir_Kind_Inequality_Operator => 1349, - Iir_Kind_Less_Than_Operator => 1354, - Iir_Kind_Less_Than_Or_Equal_Operator => 1359, - Iir_Kind_Greater_Than_Operator => 1364, - Iir_Kind_Greater_Than_Or_Equal_Operator => 1369, - Iir_Kind_Match_Equality_Operator => 1374, - Iir_Kind_Match_Inequality_Operator => 1379, - Iir_Kind_Match_Less_Than_Operator => 1384, - Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1389, - Iir_Kind_Match_Greater_Than_Operator => 1394, - Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1399, - Iir_Kind_Sll_Operator => 1404, - Iir_Kind_Sla_Operator => 1409, - Iir_Kind_Srl_Operator => 1414, - Iir_Kind_Sra_Operator => 1419, - Iir_Kind_Rol_Operator => 1424, - Iir_Kind_Ror_Operator => 1429, - Iir_Kind_Addition_Operator => 1434, - Iir_Kind_Substraction_Operator => 1439, - Iir_Kind_Concatenation_Operator => 1444, - Iir_Kind_Multiplication_Operator => 1449, - Iir_Kind_Division_Operator => 1454, - Iir_Kind_Modulus_Operator => 1459, - Iir_Kind_Remainder_Operator => 1464, - Iir_Kind_Exponentiation_Operator => 1469, - Iir_Kind_Function_Call => 1477, - Iir_Kind_Aggregate => 1485, - Iir_Kind_Parenthesis_Expression => 1488, - Iir_Kind_Qualified_Expression => 1492, - Iir_Kind_Type_Conversion => 1497, - Iir_Kind_Allocator_By_Expression => 1502, - Iir_Kind_Allocator_By_Subtype => 1508, - Iir_Kind_Selected_Element => 1516, - Iir_Kind_Dereference => 1521, - Iir_Kind_Implicit_Dereference => 1526, - Iir_Kind_Slice_Name => 1533, - Iir_Kind_Indexed_Name => 1539, - Iir_Kind_Psl_Prev => 1545, - Iir_Kind_Psl_Stable => 1550, - Iir_Kind_Psl_Rose => 1555, - Iir_Kind_Psl_Fell => 1560, - Iir_Kind_Psl_Onehot => 1563, - Iir_Kind_Psl_Onehot0 => 1566, - Iir_Kind_Psl_Expression => 1568, - Iir_Kind_Sensitized_Process_Statement => 1590, - Iir_Kind_Process_Statement => 1611, - Iir_Kind_Concurrent_Simple_Signal_Assignment => 1624, - Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1637, - Iir_Kind_Concurrent_Selected_Signal_Assignment => 1651, - Iir_Kind_Concurrent_Assertion_Statement => 1659, - Iir_Kind_Concurrent_Procedure_Call_Statement => 1666, - Iir_Kind_Concurrent_Break_Statement => 1674, - Iir_Kind_Psl_Assert_Directive => 1688, - Iir_Kind_Psl_Assume_Directive => 1700, - Iir_Kind_Psl_Cover_Directive => 1712, - Iir_Kind_Psl_Restrict_Directive => 1723, - Iir_Kind_Block_Statement => 1737, - Iir_Kind_If_Generate_Statement => 1748, - Iir_Kind_Case_Generate_Statement => 1757, - Iir_Kind_For_Generate_Statement => 1766, - Iir_Kind_Component_Instantiation_Statement => 1778, - Iir_Kind_Psl_Default_Clock => 1781, - Iir_Kind_Generate_Statement_Body => 1792, - Iir_Kind_If_Generate_Else_Clause => 1798, - Iir_Kind_Simple_Simultaneous_Statement => 1805, - Iir_Kind_Simultaneous_Null_Statement => 1809, - Iir_Kind_Simultaneous_Procedural_Statement => 1820, - Iir_Kind_Simultaneous_Case_Statement => 1829, - Iir_Kind_Simultaneous_If_Statement => 1838, - Iir_Kind_Simultaneous_Elsif => 1844, - Iir_Kind_Simple_Signal_Assignment_Statement => 1855, - Iir_Kind_Conditional_Signal_Assignment_Statement => 1866, - Iir_Kind_Selected_Waveform_Assignment_Statement => 1878, - Iir_Kind_Signal_Force_Assignment_Statement => 1888, - Iir_Kind_Signal_Release_Assignment_Statement => 1897, - Iir_Kind_Null_Statement => 1901, - Iir_Kind_Assertion_Statement => 1908, - Iir_Kind_Report_Statement => 1914, - Iir_Kind_Wait_Statement => 1922, - Iir_Kind_Variable_Assignment_Statement => 1929, - Iir_Kind_Conditional_Variable_Assignment_Statement => 1936, - Iir_Kind_Return_Statement => 1942, - Iir_Kind_For_Loop_Statement => 1953, - Iir_Kind_While_Loop_Statement => 1964, - Iir_Kind_Next_Statement => 1971, - Iir_Kind_Exit_Statement => 1978, - Iir_Kind_Case_Statement => 1987, - Iir_Kind_Procedure_Call_Statement => 1993, - Iir_Kind_Break_Statement => 2000, - Iir_Kind_If_Statement => 2010, - Iir_Kind_Suspend_State_Statement => 2015, - Iir_Kind_Elsif => 2021, - Iir_Kind_Character_Literal => 2028, - Iir_Kind_Simple_Name => 2035, - Iir_Kind_Selected_Name => 2043, - Iir_Kind_Operator_Symbol => 2048, - Iir_Kind_Reference_Name => 2053, - Iir_Kind_External_Constant_Name => 2062, - Iir_Kind_External_Signal_Name => 2072, - Iir_Kind_External_Variable_Name => 2082, - Iir_Kind_Selected_By_All_Name => 2088, - Iir_Kind_Parenthesis_Name => 2093, - Iir_Kind_Package_Pathname => 2097, - Iir_Kind_Absolute_Pathname => 2098, - Iir_Kind_Relative_Pathname => 2099, - Iir_Kind_Pathname_Element => 2104, - Iir_Kind_Base_Attribute => 2106, - Iir_Kind_Subtype_Attribute => 2111, - Iir_Kind_Element_Attribute => 2116, - Iir_Kind_Across_Attribute => 2121, - Iir_Kind_Through_Attribute => 2126, - Iir_Kind_Nature_Reference_Attribute => 2130, - Iir_Kind_Left_Type_Attribute => 2135, - Iir_Kind_Right_Type_Attribute => 2140, - Iir_Kind_High_Type_Attribute => 2145, - Iir_Kind_Low_Type_Attribute => 2150, - Iir_Kind_Ascending_Type_Attribute => 2155, - Iir_Kind_Image_Attribute => 2161, - Iir_Kind_Value_Attribute => 2167, - Iir_Kind_Pos_Attribute => 2173, - Iir_Kind_Val_Attribute => 2179, - Iir_Kind_Succ_Attribute => 2185, - Iir_Kind_Pred_Attribute => 2191, - Iir_Kind_Leftof_Attribute => 2197, - Iir_Kind_Rightof_Attribute => 2203, - Iir_Kind_Signal_Slew_Attribute => 2211, - Iir_Kind_Quantity_Slew_Attribute => 2219, - Iir_Kind_Ramp_Attribute => 2227, - Iir_Kind_Zoh_Attribute => 2235, - Iir_Kind_Ltf_Attribute => 2243, - Iir_Kind_Ztf_Attribute => 2253, - Iir_Kind_Dot_Attribute => 2260, - Iir_Kind_Integ_Attribute => 2267, - Iir_Kind_Quantity_Delayed_Attribute => 2275, - Iir_Kind_Above_Attribute => 2283, - Iir_Kind_Delayed_Attribute => 2292, - Iir_Kind_Stable_Attribute => 2301, - Iir_Kind_Quiet_Attribute => 2310, - Iir_Kind_Transaction_Attribute => 2319, - Iir_Kind_Event_Attribute => 2323, - Iir_Kind_Active_Attribute => 2327, - Iir_Kind_Last_Event_Attribute => 2331, - Iir_Kind_Last_Active_Attribute => 2335, - Iir_Kind_Last_Value_Attribute => 2339, - Iir_Kind_Driving_Attribute => 2343, - Iir_Kind_Driving_Value_Attribute => 2347, - Iir_Kind_Behavior_Attribute => 2347, - Iir_Kind_Structure_Attribute => 2347, - Iir_Kind_Simple_Name_Attribute => 2354, - Iir_Kind_Instance_Name_Attribute => 2359, - Iir_Kind_Path_Name_Attribute => 2364, - Iir_Kind_Left_Array_Attribute => 2371, - Iir_Kind_Right_Array_Attribute => 2378, - Iir_Kind_High_Array_Attribute => 2385, - Iir_Kind_Low_Array_Attribute => 2392, - Iir_Kind_Length_Array_Attribute => 2399, - Iir_Kind_Ascending_Array_Attribute => 2406, - Iir_Kind_Range_Array_Attribute => 2413, - Iir_Kind_Reverse_Range_Array_Attribute => 2420, - Iir_Kind_Attribute_Name => 2429 + Iir_Kind_Protected_Type_Declaration => 335, + Iir_Kind_Record_Type_Definition => 345, + Iir_Kind_Array_Type_Definition => 356, + Iir_Kind_Array_Subtype_Definition => 373, + Iir_Kind_Record_Subtype_Definition => 386, + Iir_Kind_Access_Subtype_Definition => 394, + Iir_Kind_File_Subtype_Definition => 401, + Iir_Kind_Physical_Subtype_Definition => 411, + Iir_Kind_Floating_Subtype_Definition => 422, + Iir_Kind_Integer_Subtype_Definition => 432, + Iir_Kind_Enumeration_Subtype_Definition => 442, + Iir_Kind_Enumeration_Type_Definition => 453, + Iir_Kind_Integer_Type_Definition => 461, + Iir_Kind_Floating_Type_Definition => 469, + Iir_Kind_Physical_Type_Definition => 480, + Iir_Kind_Range_Expression => 488, + Iir_Kind_Protected_Type_Body => 496, + Iir_Kind_Wildcard_Type_Definition => 500, + Iir_Kind_Foreign_Vector_Type_Definition => 501, + Iir_Kind_Subtype_Definition => 508, + Iir_Kind_Scalar_Nature_Definition => 516, + Iir_Kind_Record_Nature_Definition => 529, + Iir_Kind_Array_Nature_Definition => 543, + Iir_Kind_Array_Subnature_Definition => 558, + Iir_Kind_Overload_List => 559, + Iir_Kind_Foreign_Module => 564, + Iir_Kind_Entity_Declaration => 577, + Iir_Kind_Configuration_Declaration => 587, + Iir_Kind_Context_Declaration => 593, + Iir_Kind_Package_Declaration => 608, + Iir_Kind_Package_Instantiation_Declaration => 622, + Iir_Kind_Vmode_Declaration => 634, + Iir_Kind_Vprop_Declaration => 646, + Iir_Kind_Vunit_Declaration => 659, + Iir_Kind_Package_Body => 667, + Iir_Kind_Architecture_Body => 680, + Iir_Kind_Type_Declaration => 687, + Iir_Kind_Anonymous_Type_Declaration => 693, + Iir_Kind_Subtype_Declaration => 701, + Iir_Kind_Nature_Declaration => 707, + Iir_Kind_Subnature_Declaration => 714, + Iir_Kind_Package_Header => 716, + Iir_Kind_Unit_Declaration => 725, + Iir_Kind_Library_Declaration => 733, + Iir_Kind_Component_Declaration => 743, + Iir_Kind_Attribute_Declaration => 750, + Iir_Kind_Group_Template_Declaration => 756, + Iir_Kind_Group_Declaration => 763, + Iir_Kind_Element_Declaration => 771, + Iir_Kind_Nature_Element_Declaration => 778, + Iir_Kind_Non_Object_Alias_Declaration => 786, + Iir_Kind_Psl_Declaration => 794, + Iir_Kind_Psl_Boolean_Parameter => 802, + Iir_Kind_Psl_Endpoint_Declaration => 816, + Iir_Kind_Enumeration_Literal => 828, + Iir_Kind_Function_Declaration => 855, + Iir_Kind_Procedure_Declaration => 879, + Iir_Kind_Function_Body => 889, + Iir_Kind_Procedure_Body => 900, + Iir_Kind_Function_Instantiation_Declaration => 911, + Iir_Kind_Procedure_Instantiation_Declaration => 921, + Iir_Kind_Terminal_Declaration => 931, + Iir_Kind_Object_Alias_Declaration => 943, + Iir_Kind_Free_Quantity_Declaration => 955, + Iir_Kind_Spectrum_Quantity_Declaration => 968, + Iir_Kind_Noise_Quantity_Declaration => 980, + Iir_Kind_Across_Quantity_Declaration => 996, + Iir_Kind_Through_Quantity_Declaration => 1012, + Iir_Kind_File_Declaration => 1027, + Iir_Kind_Guard_Signal_Declaration => 1041, + Iir_Kind_Signal_Declaration => 1058, + Iir_Kind_Variable_Declaration => 1071, + Iir_Kind_Constant_Declaration => 1086, + Iir_Kind_Iterator_Declaration => 1098, + Iir_Kind_Interface_Constant_Declaration => 1115, + Iir_Kind_Interface_Variable_Declaration => 1131, + Iir_Kind_Interface_Signal_Declaration => 1152, + Iir_Kind_Interface_File_Declaration => 1168, + Iir_Kind_Interface_Quantity_Declaration => 1184, + Iir_Kind_Interface_Terminal_Declaration => 1196, + Iir_Kind_Interface_Type_Declaration => 1208, + Iir_Kind_Interface_Package_Declaration => 1222, + Iir_Kind_Interface_Function_Declaration => 1242, + Iir_Kind_Interface_Procedure_Declaration => 1258, + Iir_Kind_Attribute_Implicit_Declaration => 1261, + Iir_Kind_Suspend_State_Declaration => 1265, + Iir_Kind_Identity_Operator => 1269, + Iir_Kind_Negation_Operator => 1273, + Iir_Kind_Absolute_Operator => 1277, + Iir_Kind_Not_Operator => 1281, + Iir_Kind_Implicit_Condition_Operator => 1285, + Iir_Kind_Condition_Operator => 1289, + Iir_Kind_Reduction_And_Operator => 1293, + Iir_Kind_Reduction_Or_Operator => 1297, + Iir_Kind_Reduction_Nand_Operator => 1301, + Iir_Kind_Reduction_Nor_Operator => 1305, + Iir_Kind_Reduction_Xor_Operator => 1309, + Iir_Kind_Reduction_Xnor_Operator => 1313, + Iir_Kind_And_Operator => 1318, + Iir_Kind_Or_Operator => 1323, + Iir_Kind_Nand_Operator => 1328, + Iir_Kind_Nor_Operator => 1333, + Iir_Kind_Xor_Operator => 1338, + Iir_Kind_Xnor_Operator => 1343, + Iir_Kind_Equality_Operator => 1348, + Iir_Kind_Inequality_Operator => 1353, + Iir_Kind_Less_Than_Operator => 1358, + Iir_Kind_Less_Than_Or_Equal_Operator => 1363, + Iir_Kind_Greater_Than_Operator => 1368, + Iir_Kind_Greater_Than_Or_Equal_Operator => 1373, + Iir_Kind_Match_Equality_Operator => 1378, + Iir_Kind_Match_Inequality_Operator => 1383, + Iir_Kind_Match_Less_Than_Operator => 1388, + Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1393, + Iir_Kind_Match_Greater_Than_Operator => 1398, + Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1403, + Iir_Kind_Sll_Operator => 1408, + Iir_Kind_Sla_Operator => 1413, + Iir_Kind_Srl_Operator => 1418, + Iir_Kind_Sra_Operator => 1423, + Iir_Kind_Rol_Operator => 1428, + Iir_Kind_Ror_Operator => 1433, + Iir_Kind_Addition_Operator => 1438, + Iir_Kind_Substraction_Operator => 1443, + Iir_Kind_Concatenation_Operator => 1448, + Iir_Kind_Multiplication_Operator => 1453, + Iir_Kind_Division_Operator => 1458, + Iir_Kind_Modulus_Operator => 1463, + Iir_Kind_Remainder_Operator => 1468, + Iir_Kind_Exponentiation_Operator => 1473, + Iir_Kind_Function_Call => 1481, + Iir_Kind_Aggregate => 1489, + Iir_Kind_Parenthesis_Expression => 1492, + Iir_Kind_Qualified_Expression => 1496, + Iir_Kind_Type_Conversion => 1501, + Iir_Kind_Allocator_By_Expression => 1506, + Iir_Kind_Allocator_By_Subtype => 1512, + Iir_Kind_Selected_Element => 1520, + Iir_Kind_Dereference => 1525, + Iir_Kind_Implicit_Dereference => 1530, + Iir_Kind_Slice_Name => 1537, + Iir_Kind_Indexed_Name => 1543, + Iir_Kind_Psl_Prev => 1549, + Iir_Kind_Psl_Stable => 1554, + Iir_Kind_Psl_Rose => 1559, + Iir_Kind_Psl_Fell => 1564, + Iir_Kind_Psl_Onehot => 1567, + Iir_Kind_Psl_Onehot0 => 1570, + Iir_Kind_Psl_Expression => 1572, + Iir_Kind_Sensitized_Process_Statement => 1594, + Iir_Kind_Process_Statement => 1615, + Iir_Kind_Concurrent_Simple_Signal_Assignment => 1628, + Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1641, + Iir_Kind_Concurrent_Selected_Signal_Assignment => 1655, + Iir_Kind_Concurrent_Assertion_Statement => 1663, + Iir_Kind_Concurrent_Procedure_Call_Statement => 1670, + Iir_Kind_Concurrent_Break_Statement => 1678, + Iir_Kind_Psl_Assert_Directive => 1692, + Iir_Kind_Psl_Assume_Directive => 1704, + Iir_Kind_Psl_Cover_Directive => 1716, + Iir_Kind_Psl_Restrict_Directive => 1727, + Iir_Kind_Block_Statement => 1741, + Iir_Kind_If_Generate_Statement => 1752, + Iir_Kind_Case_Generate_Statement => 1761, + Iir_Kind_For_Generate_Statement => 1770, + Iir_Kind_Component_Instantiation_Statement => 1782, + Iir_Kind_Psl_Default_Clock => 1785, + Iir_Kind_Generate_Statement_Body => 1796, + Iir_Kind_If_Generate_Else_Clause => 1802, + Iir_Kind_Simple_Simultaneous_Statement => 1809, + Iir_Kind_Simultaneous_Null_Statement => 1813, + Iir_Kind_Simultaneous_Procedural_Statement => 1824, + Iir_Kind_Simultaneous_Case_Statement => 1833, + Iir_Kind_Simultaneous_If_Statement => 1842, + Iir_Kind_Simultaneous_Elsif => 1848, + Iir_Kind_Simple_Signal_Assignment_Statement => 1859, + Iir_Kind_Conditional_Signal_Assignment_Statement => 1870, + Iir_Kind_Selected_Waveform_Assignment_Statement => 1882, + Iir_Kind_Signal_Force_Assignment_Statement => 1892, + Iir_Kind_Signal_Release_Assignment_Statement => 1901, + Iir_Kind_Null_Statement => 1905, + Iir_Kind_Assertion_Statement => 1912, + Iir_Kind_Report_Statement => 1918, + Iir_Kind_Wait_Statement => 1926, + Iir_Kind_Variable_Assignment_Statement => 1933, + Iir_Kind_Conditional_Variable_Assignment_Statement => 1940, + Iir_Kind_Return_Statement => 1946, + Iir_Kind_For_Loop_Statement => 1957, + Iir_Kind_While_Loop_Statement => 1968, + Iir_Kind_Next_Statement => 1975, + Iir_Kind_Exit_Statement => 1982, + Iir_Kind_Case_Statement => 1991, + Iir_Kind_Procedure_Call_Statement => 1997, + Iir_Kind_Break_Statement => 2004, + Iir_Kind_If_Statement => 2014, + Iir_Kind_Suspend_State_Statement => 2019, + Iir_Kind_Elsif => 2025, + Iir_Kind_Character_Literal => 2032, + Iir_Kind_Simple_Name => 2039, + Iir_Kind_Selected_Name => 2047, + Iir_Kind_Operator_Symbol => 2052, + Iir_Kind_Reference_Name => 2057, + Iir_Kind_External_Constant_Name => 2066, + Iir_Kind_External_Signal_Name => 2076, + Iir_Kind_External_Variable_Name => 2086, + Iir_Kind_Selected_By_All_Name => 2092, + Iir_Kind_Parenthesis_Name => 2097, + Iir_Kind_Package_Pathname => 2101, + Iir_Kind_Absolute_Pathname => 2102, + Iir_Kind_Relative_Pathname => 2103, + Iir_Kind_Pathname_Element => 2108, + Iir_Kind_Base_Attribute => 2110, + Iir_Kind_Subtype_Attribute => 2115, + Iir_Kind_Element_Attribute => 2120, + Iir_Kind_Across_Attribute => 2125, + Iir_Kind_Through_Attribute => 2130, + Iir_Kind_Nature_Reference_Attribute => 2134, + Iir_Kind_Left_Type_Attribute => 2139, + Iir_Kind_Right_Type_Attribute => 2144, + Iir_Kind_High_Type_Attribute => 2149, + Iir_Kind_Low_Type_Attribute => 2154, + Iir_Kind_Ascending_Type_Attribute => 2159, + Iir_Kind_Image_Attribute => 2165, + Iir_Kind_Value_Attribute => 2171, + Iir_Kind_Pos_Attribute => 2177, + Iir_Kind_Val_Attribute => 2183, + Iir_Kind_Succ_Attribute => 2189, + Iir_Kind_Pred_Attribute => 2195, + Iir_Kind_Leftof_Attribute => 2201, + Iir_Kind_Rightof_Attribute => 2207, + Iir_Kind_Signal_Slew_Attribute => 2215, + Iir_Kind_Quantity_Slew_Attribute => 2223, + Iir_Kind_Ramp_Attribute => 2231, + Iir_Kind_Zoh_Attribute => 2239, + Iir_Kind_Ltf_Attribute => 2247, + Iir_Kind_Ztf_Attribute => 2257, + Iir_Kind_Dot_Attribute => 2264, + Iir_Kind_Integ_Attribute => 2271, + Iir_Kind_Quantity_Delayed_Attribute => 2279, + Iir_Kind_Above_Attribute => 2287, + Iir_Kind_Delayed_Attribute => 2296, + Iir_Kind_Stable_Attribute => 2305, + Iir_Kind_Quiet_Attribute => 2314, + Iir_Kind_Transaction_Attribute => 2323, + Iir_Kind_Event_Attribute => 2327, + Iir_Kind_Active_Attribute => 2331, + Iir_Kind_Last_Event_Attribute => 2335, + Iir_Kind_Last_Active_Attribute => 2339, + Iir_Kind_Last_Value_Attribute => 2343, + Iir_Kind_Driving_Attribute => 2347, + Iir_Kind_Driving_Value_Attribute => 2351, + Iir_Kind_Behavior_Attribute => 2351, + Iir_Kind_Structure_Attribute => 2351, + Iir_Kind_Simple_Name_Attribute => 2358, + Iir_Kind_Instance_Name_Attribute => 2363, + Iir_Kind_Path_Name_Attribute => 2368, + Iir_Kind_Left_Array_Attribute => 2375, + Iir_Kind_Right_Array_Attribute => 2382, + Iir_Kind_High_Array_Attribute => 2389, + Iir_Kind_Low_Array_Attribute => 2396, + Iir_Kind_Length_Array_Attribute => 2403, + Iir_Kind_Ascending_Array_Attribute => 2410, + Iir_Kind_Range_Array_Attribute => 2417, + Iir_Kind_Reverse_Range_Array_Attribute => 2424, + Iir_Kind_Attribute_Name => 2433 ); function Get_Fields_First (K : Iir_Kind) return Fields_Index is @@ -5853,6 +5862,8 @@ package body Vhdl.Nodes_Meta is return Get_Implicit_Alias_Flag (N); when Field_Use_Flag => return Get_Use_Flag (N); + when Field_Elaborated_Flag => + return Get_Elaborated_Flag (N); when Field_End_Has_Reserved_Id => return Get_End_Has_Reserved_Id (N); when Field_End_Has_Identifier => @@ -6015,6 +6026,8 @@ package body Vhdl.Nodes_Meta is Set_Implicit_Alias_Flag (N, V); when Field_Use_Flag => Set_Use_Flag (N, V); + when Field_Elaborated_Flag => + Set_Elaborated_Flag (N, V); when Field_End_Has_Reserved_Id => Set_End_Has_Reserved_Id (N, V); when Field_End_Has_Identifier => @@ -12489,6 +12502,19 @@ package body Vhdl.Nodes_Meta is end case; end Has_Use_Flag; + function Has_Elaborated_Flag (K : Iir_Kind) return Boolean is + begin + case K is + when Iir_Kind_Protected_Type_Declaration + | Iir_Kind_Function_Declaration + | Iir_Kind_Procedure_Declaration + | Iir_Kind_Constant_Declaration => + return True; + when others => + return False; + end case; + end Has_Elaborated_Flag; + function Has_End_Has_Reserved_Id (K : Iir_Kind) return Boolean is begin case K is diff --git a/src/vhdl/vhdl-nodes_meta.ads b/src/vhdl/vhdl-nodes_meta.ads index 7bf9c4684..dc148e50d 100644 --- a/src/vhdl/vhdl-nodes_meta.ads +++ b/src/vhdl/vhdl-nodes_meta.ads @@ -410,6 +410,7 @@ package Vhdl.Nodes_Meta is Field_Protected_Type_Body, Field_Protected_Type_Declaration, Field_Use_Flag, + Field_Elaborated_Flag, Field_End_Has_Reserved_Id, Field_End_Has_Identifier, Field_End_Has_Postponed, @@ -1017,6 +1018,7 @@ package Vhdl.Nodes_Meta is function Has_Protected_Type_Body (K : Iir_Kind) return Boolean; function Has_Protected_Type_Declaration (K : Iir_Kind) return Boolean; function Has_Use_Flag (K : Iir_Kind) return Boolean; + function Has_Elaborated_Flag (K : Iir_Kind) return Boolean; function Has_End_Has_Reserved_Id (K : Iir_Kind) return Boolean; function Has_End_Has_Identifier (K : Iir_Kind) return Boolean; function Has_End_Has_Postponed (K : Iir_Kind) return Boolean; |