aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyGHDL/libghdl/vhdl/nodes.py13
-rw-r--r--pyGHDL/libghdl/vhdl/nodes_meta.py295
-rw-r--r--src/vhdl/vhdl-nodes.adb16
-rw-r--r--src/vhdl/vhdl-nodes.ads8
-rw-r--r--src/vhdl/vhdl-nodes_meta.adb215
-rw-r--r--src/vhdl/vhdl-nodes_meta.ads2
-rw-r--r--src/vhdl/vhdl-sem_inst.adb10
7 files changed, 310 insertions, 249 deletions
diff --git a/pyGHDL/libghdl/vhdl/nodes.py b/pyGHDL/libghdl/vhdl/nodes.py
index b9de81b8f..19f26583a 100644
--- a/pyGHDL/libghdl/vhdl/nodes.py
+++ b/pyGHDL/libghdl/vhdl/nodes.py
@@ -5085,6 +5085,19 @@ def Set_Instantiated_Unit(obj: Iir, value: Iir) -> None:
@export
+@BindToLibGHDL("vhdl__nodes__get_instantiated_header")
+def Get_Instantiated_Header(obj: Iir) -> Iir:
+ """"""
+ return 0
+
+
+@export
+@BindToLibGHDL("vhdl__nodes__set_instantiated_header")
+def Set_Instantiated_Header(obj: Iir, value: Iir) -> None:
+ """"""
+
+
+@export
@BindToLibGHDL("vhdl__nodes__get_generic_map_aspect_chain")
def Get_Generic_Map_Aspect_Chain(obj: Iir) -> Iir:
""""""
diff --git a/pyGHDL/libghdl/vhdl/nodes_meta.py b/pyGHDL/libghdl/vhdl/nodes_meta.py
index a923ac764..5f23a6894 100644
--- a/pyGHDL/libghdl/vhdl/nodes_meta.py
+++ b/pyGHDL/libghdl/vhdl/nodes_meta.py
@@ -356,150 +356,151 @@ class fields(IntEnum):
Report_Expression = 236
Severity_Expression = 237
Instantiated_Unit = 238
- Generic_Map_Aspect_Chain = 239
- Port_Map_Aspect_Chain = 240
- Configuration_Name = 241
- Component_Configuration = 242
- Configuration_Specification = 243
- Default_Binding_Indication = 244
- Default_Configuration_Declaration = 245
- Expression = 246
- Conditional_Expression_Chain = 247
- Allocator_Designated_Type = 248
- Selected_Waveform_Chain = 249
- Conditional_Waveform_Chain = 250
- Guard_Expression = 251
- Guard_Decl = 252
- Guard_Sensitivity_List = 253
- Attribute_Implicit_Chain = 254
- Block_Block_Configuration = 255
- Package_Header = 256
- Block_Header = 257
- Uninstantiated_Package_Name = 258
- Uninstantiated_Package_Decl = 259
- Instance_Source_File = 260
- Generate_Block_Configuration = 261
- Generate_Statement_Body = 262
- Alternative_Label = 263
- Generate_Else_Clause = 264
- Condition = 265
- Else_Clause = 266
- Parameter_Specification = 267
- Parent = 268
- Loop_Label = 269
- Exit_Flag = 270
- Next_Flag = 271
- Component_Name = 272
- Instantiation_List = 273
- Entity_Aspect = 274
- Default_Entity_Aspect = 275
- Binding_Indication = 276
- Named_Entity = 277
- Referenced_Name = 278
- Expr_Staticness = 279
- Scalar_Size = 280
- Error_Origin = 281
- Operand = 282
- Left = 283
- Right = 284
- Unit_Name = 285
- Name = 286
- Group_Template_Name = 287
- Name_Staticness = 288
- Prefix = 289
- Signature_Prefix = 290
- External_Pathname = 291
- Pathname_Suffix = 292
- Pathname_Expression = 293
- In_Formal_Flag = 294
- Inertial_Flag = 295
- Slice_Subtype = 296
- Suffix = 297
- Index_Subtype = 298
- Parameter = 299
- Parameter_2 = 300
- Parameter_3 = 301
- Parameter_4 = 302
- Attr_Chain = 303
- Attribute_Implicit_Declaration = 304
- Actual_Type = 305
- Actual_Type_Definition = 306
- Association_Chain = 307
- Individual_Association_Chain = 308
- Subprogram_Association_Chain = 309
- Aggregate_Info = 310
- Sub_Aggregate_Info = 311
- Aggr_Dynamic_Flag = 312
- Aggr_Min_Length = 313
- Aggr_Low_Limit = 314
- Aggr_High_Limit = 315
- Aggr_Others_Flag = 316
- Aggr_Named_Flag = 317
- Aggregate_Expand_Flag = 318
- Determined_Aggregate_Flag = 319
- Association_Choices_Chain = 320
- Case_Statement_Alternative_Chain = 321
- Matching_Flag = 322
- Choice_Staticness = 323
- Procedure_Call = 324
- Implementation = 325
- Parameter_Association_Chain = 326
- Method_Object = 327
- Subtype_Type_Mark = 328
- Subnature_Nature_Mark = 329
- Type_Conversion_Subtype = 330
- Type_Mark = 331
- File_Type_Mark = 332
- Return_Type_Mark = 333
- Has_Disconnect_Flag = 334
- Has_Active_Flag = 335
- Is_Within_Flag = 336
- Type_Marks_List = 337
- Implicit_Alias_Flag = 338
- Alias_Signature = 339
- Attribute_Signature = 340
- Overload_List = 341
- Simple_Name_Identifier = 342
- Simple_Name_Subtype = 343
- Protected_Type_Body = 344
- Protected_Type_Declaration = 345
- Use_Flag = 346
- End_Has_Reserved_Id = 347
- End_Has_Identifier = 348
- End_Has_Postponed = 349
- Has_Label = 350
- Has_Begin = 351
- Has_End = 352
- Has_Is = 353
- Has_Pure = 354
- Has_Body = 355
- Has_Parameter = 356
- Has_Component = 357
- Has_Identifier_List = 358
- Has_Mode = 359
- Has_Class = 360
- Has_Delay_Mechanism = 361
- Suspend_Flag = 362
- Stop_Flag = 363
- Is_Ref = 364
- Is_Forward_Ref = 365
- Psl_Property = 366
- Psl_Sequence = 367
- Psl_Declaration = 368
- Psl_Expression = 369
- Psl_Boolean = 370
- PSL_Clock = 371
- PSL_NFA = 372
- PSL_Nbr_States = 373
- PSL_Clock_Sensitivity = 374
- PSL_EOS_Flag = 375
- PSL_Abort_Flag = 376
- Count_Expression = 377
- Clock_Expression = 378
- Default_Clock = 379
- Foreign_Node = 380
- Suspend_State_Index = 381
- Suspend_State_Chain = 382
+ Instantiated_Header = 239
+ Generic_Map_Aspect_Chain = 240
+ Port_Map_Aspect_Chain = 241
+ Configuration_Name = 242
+ Component_Configuration = 243
+ Configuration_Specification = 244
+ Default_Binding_Indication = 245
+ Default_Configuration_Declaration = 246
+ Expression = 247
+ Conditional_Expression_Chain = 248
+ Allocator_Designated_Type = 249
+ Selected_Waveform_Chain = 250
+ Conditional_Waveform_Chain = 251
+ Guard_Expression = 252
+ Guard_Decl = 253
+ Guard_Sensitivity_List = 254
+ Attribute_Implicit_Chain = 255
+ Block_Block_Configuration = 256
+ Package_Header = 257
+ Block_Header = 258
+ Uninstantiated_Package_Name = 259
+ Uninstantiated_Package_Decl = 260
+ Instance_Source_File = 261
+ Generate_Block_Configuration = 262
+ Generate_Statement_Body = 263
+ Alternative_Label = 264
+ Generate_Else_Clause = 265
+ Condition = 266
+ Else_Clause = 267
+ Parameter_Specification = 268
+ Parent = 269
+ Loop_Label = 270
+ Exit_Flag = 271
+ Next_Flag = 272
+ Component_Name = 273
+ Instantiation_List = 274
+ Entity_Aspect = 275
+ Default_Entity_Aspect = 276
+ Binding_Indication = 277
+ Named_Entity = 278
+ Referenced_Name = 279
+ Expr_Staticness = 280
+ Scalar_Size = 281
+ Error_Origin = 282
+ Operand = 283
+ Left = 284
+ Right = 285
+ Unit_Name = 286
+ Name = 287
+ Group_Template_Name = 288
+ Name_Staticness = 289
+ Prefix = 290
+ Signature_Prefix = 291
+ External_Pathname = 292
+ Pathname_Suffix = 293
+ Pathname_Expression = 294
+ In_Formal_Flag = 295
+ Inertial_Flag = 296
+ Slice_Subtype = 297
+ Suffix = 298
+ Index_Subtype = 299
+ Parameter = 300
+ Parameter_2 = 301
+ Parameter_3 = 302
+ Parameter_4 = 303
+ Attr_Chain = 304
+ Attribute_Implicit_Declaration = 305
+ Actual_Type = 306
+ Actual_Type_Definition = 307
+ Association_Chain = 308
+ Individual_Association_Chain = 309
+ Subprogram_Association_Chain = 310
+ Aggregate_Info = 311
+ Sub_Aggregate_Info = 312
+ Aggr_Dynamic_Flag = 313
+ Aggr_Min_Length = 314
+ Aggr_Low_Limit = 315
+ Aggr_High_Limit = 316
+ Aggr_Others_Flag = 317
+ Aggr_Named_Flag = 318
+ Aggregate_Expand_Flag = 319
+ Determined_Aggregate_Flag = 320
+ Association_Choices_Chain = 321
+ Case_Statement_Alternative_Chain = 322
+ Matching_Flag = 323
+ Choice_Staticness = 324
+ Procedure_Call = 325
+ Implementation = 326
+ Parameter_Association_Chain = 327
+ Method_Object = 328
+ Subtype_Type_Mark = 329
+ Subnature_Nature_Mark = 330
+ Type_Conversion_Subtype = 331
+ Type_Mark = 332
+ File_Type_Mark = 333
+ Return_Type_Mark = 334
+ Has_Disconnect_Flag = 335
+ Has_Active_Flag = 336
+ Is_Within_Flag = 337
+ Type_Marks_List = 338
+ Implicit_Alias_Flag = 339
+ Alias_Signature = 340
+ Attribute_Signature = 341
+ Overload_List = 342
+ Simple_Name_Identifier = 343
+ Simple_Name_Subtype = 344
+ Protected_Type_Body = 345
+ Protected_Type_Declaration = 346
+ Use_Flag = 347
+ End_Has_Reserved_Id = 348
+ End_Has_Identifier = 349
+ End_Has_Postponed = 350
+ Has_Label = 351
+ Has_Begin = 352
+ Has_End = 353
+ Has_Is = 354
+ Has_Pure = 355
+ Has_Body = 356
+ Has_Parameter = 357
+ Has_Component = 358
+ Has_Identifier_List = 359
+ Has_Mode = 360
+ Has_Class = 361
+ Has_Delay_Mechanism = 362
+ Suspend_Flag = 363
+ Stop_Flag = 364
+ Is_Ref = 365
+ Is_Forward_Ref = 366
+ Psl_Property = 367
+ Psl_Sequence = 368
+ Psl_Declaration = 369
+ Psl_Expression = 370
+ Psl_Boolean = 371
+ PSL_Clock = 372
+ PSL_NFA = 373
+ PSL_Nbr_States = 374
+ PSL_Clock_Sensitivity = 375
+ PSL_EOS_Flag = 376
+ PSL_Abort_Flag = 377
+ Count_Expression = 378
+ Clock_Expression = 379
+ Default_Clock = 380
+ Foreign_Node = 381
+ Suspend_State_Index = 382
+ Suspend_State_Chain = 383
def Get_Boolean(node, field):
@@ -2069,6 +2070,12 @@ def Has_Instantiated_Unit(kind: IirKind) -> bool:
@export
+@BindToLibGHDL("vhdl__nodes_meta__has_instantiated_header")
+def Has_Instantiated_Header(kind: IirKind) -> bool:
+ """"""
+
+
+@export
@BindToLibGHDL("vhdl__nodes_meta__has_generic_map_aspect_chain")
def Has_Generic_Map_Aspect_Chain(kind: IirKind) -> bool:
""""""
diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb
index 07ed95bfd..c69bf2682 100644
--- a/src/vhdl/vhdl-nodes.adb
+++ b/src/vhdl/vhdl-nodes.adb
@@ -5238,6 +5238,22 @@ package body Vhdl.Nodes is
Set_Field1 (Target, Unit);
end Set_Instantiated_Unit;
+ function Get_Instantiated_Header (Target : Iir) return Iir is
+ begin
+ pragma Assert (Target /= Null_Iir);
+ pragma Assert (Has_Instantiated_Header (Get_Kind (Target)),
+ "no field Instantiated_Header");
+ return Get_Field4 (Target);
+ end Get_Instantiated_Header;
+
+ procedure Set_Instantiated_Header (Target : Iir; Hdr : Iir) is
+ begin
+ pragma Assert (Target /= Null_Iir);
+ pragma Assert (Has_Instantiated_Header (Get_Kind (Target)),
+ "no field Instantiated_Header");
+ Set_Field4 (Target, Hdr);
+ end Set_Instantiated_Header;
+
function Get_Generic_Map_Aspect_Chain (Target : Iir) return Iir is
begin
pragma Assert (Target /= Null_Iir);
diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads
index 529790b9a..65aadfa76 100644
--- a/src/vhdl/vhdl-nodes.ads
+++ b/src/vhdl/vhdl-nodes.ads
@@ -3490,6 +3490,10 @@ package Vhdl.Nodes is
-- Get/Set_Label (Field3)
-- Get/Set_Identifier (Alias Field3)
--
+ -- If the instantiated unit contains generic types or packages, this is
+ -- the instantiated unit.
+ -- Get/Set_Instantiated_Header (Field4)
+ --
-- Get/Set_Default_Binding_Indication (Field5)
--
-- Get/Set_Generic_Map_Aspect_Chain (Field8)
@@ -8919,6 +8923,10 @@ package Vhdl.Nodes is
function Get_Instantiated_Unit (Target : Iir) return Iir;
procedure Set_Instantiated_Unit (Target : Iir; Unit : Iir);
+ -- Field: Field4
+ function Get_Instantiated_Header (Target : Iir) return Iir;
+ procedure Set_Instantiated_Header (Target : Iir; Hdr : Iir);
+
-- Generic map aspect list.
-- Field: Field8 Chain
function Get_Generic_Map_Aspect_Chain (Target : Iir) return Iir;
diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb
index 526b6554b..47bffb7b3 100644
--- a/src/vhdl/vhdl-nodes_meta.adb
+++ b/src/vhdl/vhdl-nodes_meta.adb
@@ -256,6 +256,7 @@ package body Vhdl.Nodes_Meta is
Field_Report_Expression => Type_Iir,
Field_Severity_Expression => Type_Iir,
Field_Instantiated_Unit => Type_Iir,
+ Field_Instantiated_Header => Type_Iir,
Field_Generic_Map_Aspect_Chain => Type_Iir,
Field_Port_Map_Aspect_Chain => Type_Iir,
Field_Configuration_Name => Type_Iir,
@@ -888,6 +889,8 @@ package body Vhdl.Nodes_Meta is
return "severity_expression";
when Field_Instantiated_Unit =>
return "instantiated_unit";
+ when Field_Instantiated_Header =>
+ return "instantiated_header";
when Field_Generic_Map_Aspect_Chain =>
return "generic_map_aspect_chain";
when Field_Port_Map_Aspect_Chain =>
@@ -2314,6 +2317,8 @@ package body Vhdl.Nodes_Meta is
return Attr_None;
when Field_Instantiated_Unit =>
return Attr_None;
+ when Field_Instantiated_Header =>
+ return Attr_None;
when Field_Generic_Map_Aspect_Chain =>
return Attr_Chain;
when Field_Port_Map_Aspect_Chain =>
@@ -4601,6 +4606,7 @@ package body Vhdl.Nodes_Meta is
Field_Parent,
Field_Instantiated_Unit,
Field_Chain,
+ Field_Instantiated_Header,
Field_Default_Binding_Indication,
Field_Generic_Map_Aspect_Chain,
Field_Port_Map_Aspect_Chain,
@@ -5583,106 +5589,106 @@ package body Vhdl.Nodes_Meta is
Iir_Kind_If_Generate_Statement => 1744,
Iir_Kind_Case_Generate_Statement => 1753,
Iir_Kind_For_Generate_Statement => 1762,
- Iir_Kind_Component_Instantiation_Statement => 1773,
- Iir_Kind_Psl_Default_Clock => 1776,
- Iir_Kind_Generate_Statement_Body => 1787,
- Iir_Kind_If_Generate_Else_Clause => 1793,
- Iir_Kind_Simple_Simultaneous_Statement => 1800,
- Iir_Kind_Simultaneous_Null_Statement => 1804,
- Iir_Kind_Simultaneous_Procedural_Statement => 1815,
- Iir_Kind_Simultaneous_Case_Statement => 1824,
- Iir_Kind_Simultaneous_If_Statement => 1833,
- Iir_Kind_Simultaneous_Elsif => 1839,
- Iir_Kind_Simple_Signal_Assignment_Statement => 1850,
- Iir_Kind_Conditional_Signal_Assignment_Statement => 1861,
- Iir_Kind_Selected_Waveform_Assignment_Statement => 1873,
- Iir_Kind_Signal_Force_Assignment_Statement => 1883,
- Iir_Kind_Signal_Release_Assignment_Statement => 1892,
- Iir_Kind_Null_Statement => 1896,
- Iir_Kind_Assertion_Statement => 1903,
- Iir_Kind_Report_Statement => 1909,
- Iir_Kind_Wait_Statement => 1917,
- Iir_Kind_Variable_Assignment_Statement => 1924,
- Iir_Kind_Conditional_Variable_Assignment_Statement => 1931,
- Iir_Kind_Return_Statement => 1937,
- Iir_Kind_For_Loop_Statement => 1948,
- Iir_Kind_While_Loop_Statement => 1959,
- Iir_Kind_Next_Statement => 1966,
- Iir_Kind_Exit_Statement => 1973,
- Iir_Kind_Case_Statement => 1982,
- Iir_Kind_Procedure_Call_Statement => 1988,
- Iir_Kind_Break_Statement => 1995,
- Iir_Kind_If_Statement => 2005,
- Iir_Kind_Suspend_State_Statement => 2009,
- Iir_Kind_Elsif => 2015,
- Iir_Kind_Character_Literal => 2022,
- Iir_Kind_Simple_Name => 2029,
- Iir_Kind_Selected_Name => 2037,
- Iir_Kind_Operator_Symbol => 2042,
- Iir_Kind_Reference_Name => 2047,
- Iir_Kind_External_Constant_Name => 2056,
- Iir_Kind_External_Signal_Name => 2066,
- Iir_Kind_External_Variable_Name => 2076,
- Iir_Kind_Selected_By_All_Name => 2082,
- Iir_Kind_Parenthesis_Name => 2087,
- Iir_Kind_Package_Pathname => 2091,
- Iir_Kind_Absolute_Pathname => 2092,
- Iir_Kind_Relative_Pathname => 2093,
- Iir_Kind_Pathname_Element => 2098,
- Iir_Kind_Base_Attribute => 2100,
- Iir_Kind_Subtype_Attribute => 2105,
- Iir_Kind_Element_Attribute => 2110,
- Iir_Kind_Across_Attribute => 2115,
- Iir_Kind_Through_Attribute => 2120,
- Iir_Kind_Nature_Reference_Attribute => 2124,
- Iir_Kind_Left_Type_Attribute => 2129,
- Iir_Kind_Right_Type_Attribute => 2134,
- Iir_Kind_High_Type_Attribute => 2139,
- Iir_Kind_Low_Type_Attribute => 2144,
- Iir_Kind_Ascending_Type_Attribute => 2149,
- Iir_Kind_Image_Attribute => 2155,
- Iir_Kind_Value_Attribute => 2161,
- Iir_Kind_Pos_Attribute => 2167,
- Iir_Kind_Val_Attribute => 2173,
- Iir_Kind_Succ_Attribute => 2179,
- Iir_Kind_Pred_Attribute => 2185,
- Iir_Kind_Leftof_Attribute => 2191,
- Iir_Kind_Rightof_Attribute => 2197,
- Iir_Kind_Signal_Slew_Attribute => 2205,
- Iir_Kind_Quantity_Slew_Attribute => 2213,
- Iir_Kind_Ramp_Attribute => 2221,
- Iir_Kind_Zoh_Attribute => 2229,
- Iir_Kind_Ltf_Attribute => 2237,
- Iir_Kind_Ztf_Attribute => 2247,
- Iir_Kind_Dot_Attribute => 2254,
- Iir_Kind_Integ_Attribute => 2261,
- Iir_Kind_Quantity_Delayed_Attribute => 2269,
- Iir_Kind_Above_Attribute => 2277,
- Iir_Kind_Delayed_Attribute => 2286,
- Iir_Kind_Stable_Attribute => 2295,
- Iir_Kind_Quiet_Attribute => 2304,
- Iir_Kind_Transaction_Attribute => 2313,
- Iir_Kind_Event_Attribute => 2317,
- Iir_Kind_Active_Attribute => 2321,
- Iir_Kind_Last_Event_Attribute => 2325,
- Iir_Kind_Last_Active_Attribute => 2329,
- Iir_Kind_Last_Value_Attribute => 2333,
- Iir_Kind_Driving_Attribute => 2337,
- Iir_Kind_Driving_Value_Attribute => 2341,
- Iir_Kind_Behavior_Attribute => 2341,
- Iir_Kind_Structure_Attribute => 2341,
- Iir_Kind_Simple_Name_Attribute => 2348,
- Iir_Kind_Instance_Name_Attribute => 2353,
- Iir_Kind_Path_Name_Attribute => 2358,
- Iir_Kind_Left_Array_Attribute => 2365,
- Iir_Kind_Right_Array_Attribute => 2372,
- Iir_Kind_High_Array_Attribute => 2379,
- Iir_Kind_Low_Array_Attribute => 2386,
- Iir_Kind_Length_Array_Attribute => 2393,
- Iir_Kind_Ascending_Array_Attribute => 2400,
- Iir_Kind_Range_Array_Attribute => 2407,
- Iir_Kind_Reverse_Range_Array_Attribute => 2414,
- Iir_Kind_Attribute_Name => 2423
+ Iir_Kind_Component_Instantiation_Statement => 1774,
+ Iir_Kind_Psl_Default_Clock => 1777,
+ Iir_Kind_Generate_Statement_Body => 1788,
+ Iir_Kind_If_Generate_Else_Clause => 1794,
+ Iir_Kind_Simple_Simultaneous_Statement => 1801,
+ Iir_Kind_Simultaneous_Null_Statement => 1805,
+ Iir_Kind_Simultaneous_Procedural_Statement => 1816,
+ Iir_Kind_Simultaneous_Case_Statement => 1825,
+ Iir_Kind_Simultaneous_If_Statement => 1834,
+ Iir_Kind_Simultaneous_Elsif => 1840,
+ Iir_Kind_Simple_Signal_Assignment_Statement => 1851,
+ Iir_Kind_Conditional_Signal_Assignment_Statement => 1862,
+ Iir_Kind_Selected_Waveform_Assignment_Statement => 1874,
+ Iir_Kind_Signal_Force_Assignment_Statement => 1884,
+ Iir_Kind_Signal_Release_Assignment_Statement => 1893,
+ Iir_Kind_Null_Statement => 1897,
+ Iir_Kind_Assertion_Statement => 1904,
+ Iir_Kind_Report_Statement => 1910,
+ Iir_Kind_Wait_Statement => 1918,
+ Iir_Kind_Variable_Assignment_Statement => 1925,
+ Iir_Kind_Conditional_Variable_Assignment_Statement => 1932,
+ Iir_Kind_Return_Statement => 1938,
+ Iir_Kind_For_Loop_Statement => 1949,
+ Iir_Kind_While_Loop_Statement => 1960,
+ Iir_Kind_Next_Statement => 1967,
+ Iir_Kind_Exit_Statement => 1974,
+ Iir_Kind_Case_Statement => 1983,
+ Iir_Kind_Procedure_Call_Statement => 1989,
+ Iir_Kind_Break_Statement => 1996,
+ Iir_Kind_If_Statement => 2006,
+ Iir_Kind_Suspend_State_Statement => 2010,
+ Iir_Kind_Elsif => 2016,
+ Iir_Kind_Character_Literal => 2023,
+ Iir_Kind_Simple_Name => 2030,
+ Iir_Kind_Selected_Name => 2038,
+ Iir_Kind_Operator_Symbol => 2043,
+ Iir_Kind_Reference_Name => 2048,
+ Iir_Kind_External_Constant_Name => 2057,
+ Iir_Kind_External_Signal_Name => 2067,
+ Iir_Kind_External_Variable_Name => 2077,
+ Iir_Kind_Selected_By_All_Name => 2083,
+ Iir_Kind_Parenthesis_Name => 2088,
+ Iir_Kind_Package_Pathname => 2092,
+ Iir_Kind_Absolute_Pathname => 2093,
+ Iir_Kind_Relative_Pathname => 2094,
+ Iir_Kind_Pathname_Element => 2099,
+ Iir_Kind_Base_Attribute => 2101,
+ Iir_Kind_Subtype_Attribute => 2106,
+ Iir_Kind_Element_Attribute => 2111,
+ Iir_Kind_Across_Attribute => 2116,
+ Iir_Kind_Through_Attribute => 2121,
+ Iir_Kind_Nature_Reference_Attribute => 2125,
+ Iir_Kind_Left_Type_Attribute => 2130,
+ Iir_Kind_Right_Type_Attribute => 2135,
+ Iir_Kind_High_Type_Attribute => 2140,
+ Iir_Kind_Low_Type_Attribute => 2145,
+ Iir_Kind_Ascending_Type_Attribute => 2150,
+ Iir_Kind_Image_Attribute => 2156,
+ Iir_Kind_Value_Attribute => 2162,
+ Iir_Kind_Pos_Attribute => 2168,
+ Iir_Kind_Val_Attribute => 2174,
+ Iir_Kind_Succ_Attribute => 2180,
+ Iir_Kind_Pred_Attribute => 2186,
+ Iir_Kind_Leftof_Attribute => 2192,
+ Iir_Kind_Rightof_Attribute => 2198,
+ Iir_Kind_Signal_Slew_Attribute => 2206,
+ Iir_Kind_Quantity_Slew_Attribute => 2214,
+ Iir_Kind_Ramp_Attribute => 2222,
+ Iir_Kind_Zoh_Attribute => 2230,
+ Iir_Kind_Ltf_Attribute => 2238,
+ Iir_Kind_Ztf_Attribute => 2248,
+ Iir_Kind_Dot_Attribute => 2255,
+ Iir_Kind_Integ_Attribute => 2262,
+ Iir_Kind_Quantity_Delayed_Attribute => 2270,
+ Iir_Kind_Above_Attribute => 2278,
+ Iir_Kind_Delayed_Attribute => 2287,
+ Iir_Kind_Stable_Attribute => 2296,
+ Iir_Kind_Quiet_Attribute => 2305,
+ Iir_Kind_Transaction_Attribute => 2314,
+ Iir_Kind_Event_Attribute => 2318,
+ Iir_Kind_Active_Attribute => 2322,
+ Iir_Kind_Last_Event_Attribute => 2326,
+ Iir_Kind_Last_Active_Attribute => 2330,
+ Iir_Kind_Last_Value_Attribute => 2334,
+ Iir_Kind_Driving_Attribute => 2338,
+ Iir_Kind_Driving_Value_Attribute => 2342,
+ Iir_Kind_Behavior_Attribute => 2342,
+ Iir_Kind_Structure_Attribute => 2342,
+ Iir_Kind_Simple_Name_Attribute => 2349,
+ Iir_Kind_Instance_Name_Attribute => 2354,
+ Iir_Kind_Path_Name_Attribute => 2359,
+ Iir_Kind_Left_Array_Attribute => 2366,
+ Iir_Kind_Right_Array_Attribute => 2373,
+ Iir_Kind_High_Array_Attribute => 2380,
+ Iir_Kind_Low_Array_Attribute => 2387,
+ Iir_Kind_Length_Array_Attribute => 2394,
+ Iir_Kind_Ascending_Array_Attribute => 2401,
+ Iir_Kind_Range_Array_Attribute => 2408,
+ Iir_Kind_Reverse_Range_Array_Attribute => 2415,
+ Iir_Kind_Attribute_Name => 2424
);
function Get_Fields_First (K : Iir_Kind) return Fields_Index is
@@ -6449,6 +6455,8 @@ package body Vhdl.Nodes_Meta is
return Get_Severity_Expression (N);
when Field_Instantiated_Unit =>
return Get_Instantiated_Unit (N);
+ when Field_Instantiated_Header =>
+ return Get_Instantiated_Header (N);
when Field_Generic_Map_Aspect_Chain =>
return Get_Generic_Map_Aspect_Chain (N);
when Field_Port_Map_Aspect_Chain =>
@@ -6917,6 +6925,8 @@ package body Vhdl.Nodes_Meta is
Set_Severity_Expression (N, V);
when Field_Instantiated_Unit =>
Set_Instantiated_Unit (N, V);
+ when Field_Instantiated_Header =>
+ Set_Instantiated_Header (N, V);
when Field_Generic_Map_Aspect_Chain =>
Set_Generic_Map_Aspect_Chain (N, V);
when Field_Port_Map_Aspect_Chain =>
@@ -10833,6 +10843,11 @@ package body Vhdl.Nodes_Meta is
return K = Iir_Kind_Component_Instantiation_Statement;
end Has_Instantiated_Unit;
+ function Has_Instantiated_Header (K : Iir_Kind) return Boolean is
+ begin
+ return K = Iir_Kind_Component_Instantiation_Statement;
+ end Has_Instantiated_Header;
+
function Has_Generic_Map_Aspect_Chain (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 3092597a7..965fba9e6 100644
--- a/src/vhdl/vhdl-nodes_meta.ads
+++ b/src/vhdl/vhdl-nodes_meta.ads
@@ -300,6 +300,7 @@ package Vhdl.Nodes_Meta is
Field_Report_Expression,
Field_Severity_Expression,
Field_Instantiated_Unit,
+ Field_Instantiated_Header,
Field_Generic_Map_Aspect_Chain,
Field_Port_Map_Aspect_Chain,
Field_Configuration_Name,
@@ -900,6 +901,7 @@ package Vhdl.Nodes_Meta is
function Has_Report_Expression (K : Iir_Kind) return Boolean;
function Has_Severity_Expression (K : Iir_Kind) return Boolean;
function Has_Instantiated_Unit (K : Iir_Kind) return Boolean;
+ function Has_Instantiated_Header (K : Iir_Kind) return Boolean;
function Has_Generic_Map_Aspect_Chain (K : Iir_Kind) return Boolean;
function Has_Port_Map_Aspect_Chain (K : Iir_Kind) return Boolean;
function Has_Configuration_Name (K : Iir_Kind) return Boolean;
diff --git a/src/vhdl/vhdl-sem_inst.adb b/src/vhdl/vhdl-sem_inst.adb
index 4c250d2f4..4e7e1aa42 100644
--- a/src/vhdl/vhdl-sem_inst.adb
+++ b/src/vhdl/vhdl-sem_inst.adb
@@ -163,6 +163,7 @@ package body Vhdl.Sem_Inst is
end if;
end Relocate;
+ -- Create a new Source_File for ORIG instantiated by INST.
procedure Create_Relocation (Inst : Iir; Orig : Iir)
is
use Files_Map;
@@ -925,8 +926,8 @@ package body Vhdl.Sem_Inst is
pragma Assert (Inst_El = Null_Iir);
end Set_Instance_On_Chain;
- -- In the instance, replace references (and inner references) to interface
- -- package declaration to the associated package.
+ -- In ASSOC (which is the association for interface INTER), adjust
+ -- references to the instance.
procedure Instantiate_Generic_Map (Assoc : Iir; Inter: Iir)
is
Assoc_Formal : Iir;
@@ -951,7 +952,7 @@ package body Vhdl.Sem_Inst is
| Iir_Kind_Selected_Element =>
Formal := Get_Prefix (Formal);
when others =>
- Error_Kind ("instantiate_generic_map_chain", Formal);
+ Error_Kind ("instantiate_generic_map", Formal);
end case;
end loop;
end if;
@@ -972,8 +973,7 @@ package body Vhdl.Sem_Inst is
return;
end if;
Formal_Type := Get_Type (Assoc_Formal);
- if Get_Kind (Formal_Type)
- = Iir_Kind_Interface_Type_Definition
+ if Get_Kind (Formal_Type) = Iir_Kind_Interface_Type_Definition
then
-- Type of the formal is an interface type.
-- Check if the interface type was declared in the same