diff options
-rw-r--r-- | src/vhdl/canon.adb | 22 | ||||
-rw-r--r-- | src/vhdl/iirs.adb | 33 | ||||
-rw-r--r-- | src/vhdl/iirs.ads | 12 | ||||
-rw-r--r-- | src/vhdl/nodes_meta.adb | 490 | ||||
-rw-r--r-- | src/vhdl/nodes_meta.ads | 6 | ||||
-rw-r--r-- | src/vhdl/sem.adb | 12 | ||||
-rw-r--r-- | src/vhdl/sem_specs.adb | 50 | ||||
-rw-r--r-- | src/vhdl/sem_specs.ads | 5 | ||||
-rw-r--r-- | src/vhdl/sem_stmts.adb | 2 |
9 files changed, 271 insertions, 361 deletions
diff --git a/src/vhdl/canon.adb b/src/vhdl/canon.adb index 69d0ae9ec..c148a3724 100644 --- a/src/vhdl/canon.adb +++ b/src/vhdl/canon.adb @@ -22,6 +22,7 @@ with Flags; with Name_Table; with Sem; with Sem_Inst; +with Sem_Specs; with Iir_Chains; use Iir_Chains; with PSL.Nodes; with PSL.Rewrites; @@ -2087,6 +2088,7 @@ package body Canon is Get_Kind (Cfg) = Iir_Kind_Component_Configuration; Bind : Iir; + Comp : Iir; Instances : Iir_List; Entity_Aspect : Iir; Block : Iir_Block_Configuration; @@ -2121,10 +2123,13 @@ package body Canon is if Entity_Aspect /= Null_Iir then Add_Binding_Indication_Dependence (Top, Bind); Entity := Get_Entity_From_Entity_Aspect (Entity_Aspect); + Comp := Get_Named_Entity (Get_Component_Name (Cfg)); + Map_Chain := Get_Generic_Map_Aspect_Chain (Bind); if Map_Chain = Null_Iir then - if Is_Config then - Map_Chain := Get_Default_Generic_Map_Aspect_Chain (Bind); + if Is_Config and then Is_Valid (Entity) then + Map_Chain := Sem_Specs.Create_Default_Map_Aspect + (Comp, Entity, Sem_Specs.Map_Generic, Bind); end if; else Map_Chain := Canon_Association_Chain @@ -2134,8 +2139,9 @@ package body Canon is Map_Chain := Get_Port_Map_Aspect_Chain (Bind); if Map_Chain = Null_Iir then - if Is_Config then - Map_Chain := Get_Default_Port_Map_Aspect_Chain (Bind); + if Is_Config and then Is_Valid (Entity) then + Map_Chain := Sem_Specs.Create_Default_Map_Aspect + (Comp, Entity, Sem_Specs.Map_Port, Bind); end if; else Map_Chain := Canon_Association_Chain @@ -2269,6 +2275,7 @@ package body Canon is Cs_Chain : Iir; Res_Binding : Iir_Binding_Indication; Entity : Iir; + Comp : Iir; Instance_List : Iir_List; Conf_Instance_List : Iir_List; Instance : Iir; @@ -2304,11 +2311,13 @@ package body Canon is Set_Binding_Indication (Res, Res_Binding); Entity := Get_Entity_From_Entity_Aspect (Get_Entity_Aspect (Cs_Binding)); + Comp := Get_Named_Entity (Get_Component_Name (Conf_Spec)); -- Merge generic map aspect. Cs_Chain := Get_Generic_Map_Aspect_Chain (Cs_Binding); if Cs_Chain = Null_Iir then - Cs_Chain := Get_Default_Generic_Map_Aspect_Chain (Cs_Binding); + Cs_Chain := Sem_Specs.Create_Default_Map_Aspect + (Comp, Entity, Sem_Specs.Map_Generic, Cs_Binding); end if; Set_Generic_Map_Aspect_Chain (Res_Binding, @@ -2319,7 +2328,8 @@ package body Canon is -- merge port map aspect Cs_Chain := Get_Port_Map_Aspect_Chain (Cs_Binding); if Cs_Chain = Null_Iir then - Cs_Chain := Get_Default_Port_Map_Aspect_Chain (Cs_Binding); + Cs_Chain := Sem_Specs.Create_Default_Map_Aspect + (Comp, Entity, Sem_Specs.Map_Port, Cs_Binding); end if; Set_Port_Map_Aspect_Chain (Res_Binding, diff --git a/src/vhdl/iirs.adb b/src/vhdl/iirs.adb index c1a733a5f..f2cab3eec 100644 --- a/src/vhdl/iirs.adb +++ b/src/vhdl/iirs.adb @@ -4334,39 +4334,6 @@ package body Iirs is Set_Field1 (Target, Aspect); end Set_Default_Entity_Aspect; - function Get_Default_Generic_Map_Aspect_Chain (Target : Iir) return Iir is - begin - pragma Assert (Target /= Null_Iir); - pragma Assert (Has_Default_Generic_Map_Aspect_Chain (Get_Kind (Target)), - "no field Default_Generic_Map_Aspect_Chain"); - return Get_Field6 (Target); - end Get_Default_Generic_Map_Aspect_Chain; - - procedure Set_Default_Generic_Map_Aspect_Chain (Target : Iir; Chain : Iir) - is - begin - pragma Assert (Target /= Null_Iir); - pragma Assert (Has_Default_Generic_Map_Aspect_Chain (Get_Kind (Target)), - "no field Default_Generic_Map_Aspect_Chain"); - Set_Field6 (Target, Chain); - end Set_Default_Generic_Map_Aspect_Chain; - - function Get_Default_Port_Map_Aspect_Chain (Target : Iir) return Iir is - begin - pragma Assert (Target /= Null_Iir); - pragma Assert (Has_Default_Port_Map_Aspect_Chain (Get_Kind (Target)), - "no field Default_Port_Map_Aspect_Chain"); - return Get_Field7 (Target); - end Get_Default_Port_Map_Aspect_Chain; - - procedure Set_Default_Port_Map_Aspect_Chain (Target : Iir; Chain : Iir) is - begin - pragma Assert (Target /= Null_Iir); - pragma Assert (Has_Default_Port_Map_Aspect_Chain (Get_Kind (Target)), - "no field Default_Port_Map_Aspect_Chain"); - Set_Field7 (Target, Chain); - end Set_Default_Port_Map_Aspect_Chain; - function Get_Binding_Indication (Target : Iir) return Iir is begin pragma Assert (Target /= Null_Iir); diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads index 9310185c5..5e6ab16d9 100644 --- a/src/vhdl/iirs.ads +++ b/src/vhdl/iirs.ads @@ -589,10 +589,6 @@ package Iirs is -- declaration by semantic. -- Get/Set_Entity_Aspect (Field3) -- - -- Get/Set_Default_Generic_Map_Aspect_Chain (Field6) - -- - -- Get/Set_Default_Port_Map_Aspect_Chain (Field7) - -- -- Get/Set_Generic_Map_Aspect_Chain (Field8) -- -- Get/Set_Port_Map_Aspect_Chain (Field9) @@ -6783,14 +6779,6 @@ package Iirs is function Get_Default_Entity_Aspect (Target : Iir) return Iir; procedure Set_Default_Entity_Aspect (Target : Iir; Aspect : Iir); - -- Field: Field6 Chain - function Get_Default_Generic_Map_Aspect_Chain (Target : Iir) return Iir; - procedure Set_Default_Generic_Map_Aspect_Chain (Target : Iir; Chain : Iir); - - -- Field: Field7 Chain - function Get_Default_Port_Map_Aspect_Chain (Target : Iir) return Iir; - procedure Set_Default_Port_Map_Aspect_Chain (Target : Iir; Chain : Iir); - -- Field: Field3 function Get_Binding_Indication (Target : Iir) return Iir; procedure Set_Binding_Indication (Target : Iir; Binding : Iir); diff --git a/src/vhdl/nodes_meta.adb b/src/vhdl/nodes_meta.adb index 98c34d187..ece6c7044 100644 --- a/src/vhdl/nodes_meta.adb +++ b/src/vhdl/nodes_meta.adb @@ -251,8 +251,6 @@ package body Nodes_Meta is Field_Instantiation_List => Type_Iir_List, Field_Entity_Aspect => Type_Iir, Field_Default_Entity_Aspect => Type_Iir, - Field_Default_Generic_Map_Aspect_Chain => Type_Iir, - Field_Default_Port_Map_Aspect_Chain => Type_Iir, Field_Binding_Indication => Type_Iir, Field_Named_Entity => Type_Iir, Field_Alias_Declaration => Type_Iir, @@ -818,10 +816,6 @@ package body Nodes_Meta is return "entity_aspect"; when Field_Default_Entity_Aspect => return "default_entity_aspect"; - when Field_Default_Generic_Map_Aspect_Chain => - return "default_generic_map_aspect_chain"; - when Field_Default_Port_Map_Aspect_Chain => - return "default_port_map_aspect_chain"; when Field_Binding_Indication => return "binding_indication"; when Field_Named_Entity => @@ -2008,10 +2002,6 @@ package body Nodes_Meta is return Attr_None; when Field_Default_Entity_Aspect => return Attr_None; - when Field_Default_Generic_Map_Aspect_Chain => - return Attr_Chain; - when Field_Default_Port_Map_Aspect_Chain => - return Attr_Chain; when Field_Binding_Indication => return Attr_None; when Field_Named_Entity => @@ -2419,8 +2409,6 @@ package body Nodes_Meta is -- Iir_Kind_Binding_Indication Field_Default_Entity_Aspect, Field_Entity_Aspect, - Field_Default_Generic_Map_Aspect_Chain, - Field_Default_Port_Map_Aspect_Chain, Field_Generic_Map_Aspect_Chain, Field_Port_Map_Aspect_Chain, -- Iir_Kind_Entity_Class @@ -4355,235 +4343,235 @@ package body Nodes_Meta is Iir_Kind_Block_Configuration => 171, Iir_Kind_Block_Header => 175, Iir_Kind_Component_Configuration => 181, - Iir_Kind_Binding_Indication => 187, - Iir_Kind_Entity_Class => 189, - Iir_Kind_Attribute_Value => 197, - Iir_Kind_Signature => 200, - Iir_Kind_Aggregate_Info => 207, - Iir_Kind_Procedure_Call => 211, - Iir_Kind_Record_Element_Constraint => 217, - Iir_Kind_Array_Element_Resolution => 219, - Iir_Kind_Record_Resolution => 220, - Iir_Kind_Record_Element_Resolution => 223, - Iir_Kind_Attribute_Specification => 231, - Iir_Kind_Disconnection_Specification => 236, - Iir_Kind_Configuration_Specification => 241, - Iir_Kind_Access_Type_Definition => 249, - Iir_Kind_Incomplete_Type_Definition => 257, - Iir_Kind_Interface_Type_Definition => 264, - Iir_Kind_File_Type_Definition => 271, - Iir_Kind_Protected_Type_Declaration => 280, - Iir_Kind_Record_Type_Definition => 290, - Iir_Kind_Array_Type_Definition => 302, - Iir_Kind_Array_Subtype_Definition => 317, - Iir_Kind_Record_Subtype_Definition => 328, - Iir_Kind_Access_Subtype_Definition => 336, - Iir_Kind_Physical_Subtype_Definition => 346, - Iir_Kind_Floating_Subtype_Definition => 357, - Iir_Kind_Integer_Subtype_Definition => 367, - Iir_Kind_Enumeration_Subtype_Definition => 377, - Iir_Kind_Enumeration_Type_Definition => 387, - Iir_Kind_Integer_Type_Definition => 395, - Iir_Kind_Floating_Type_Definition => 403, - Iir_Kind_Physical_Type_Definition => 414, - Iir_Kind_Range_Expression => 422, - Iir_Kind_Protected_Type_Body => 429, - Iir_Kind_Wildcard_Type_Definition => 434, - Iir_Kind_Subtype_Definition => 439, - Iir_Kind_Scalar_Nature_Definition => 443, - Iir_Kind_Overload_List => 444, - Iir_Kind_Type_Declaration => 451, - Iir_Kind_Anonymous_Type_Declaration => 457, - Iir_Kind_Subtype_Declaration => 464, - Iir_Kind_Nature_Declaration => 470, - Iir_Kind_Subnature_Declaration => 476, - Iir_Kind_Package_Declaration => 491, - Iir_Kind_Package_Instantiation_Declaration => 504, - Iir_Kind_Package_Body => 512, - Iir_Kind_Configuration_Declaration => 521, - Iir_Kind_Entity_Declaration => 533, - Iir_Kind_Architecture_Body => 545, - Iir_Kind_Context_Declaration => 551, - Iir_Kind_Package_Header => 553, - Iir_Kind_Unit_Declaration => 561, - Iir_Kind_Library_Declaration => 568, - Iir_Kind_Component_Declaration => 578, - Iir_Kind_Attribute_Declaration => 585, - Iir_Kind_Group_Template_Declaration => 591, - Iir_Kind_Group_Declaration => 598, - Iir_Kind_Element_Declaration => 605, - Iir_Kind_Non_Object_Alias_Declaration => 613, - Iir_Kind_Psl_Declaration => 621, - Iir_Kind_Psl_Endpoint_Declaration => 635, - Iir_Kind_Terminal_Declaration => 641, - Iir_Kind_Free_Quantity_Declaration => 650, - Iir_Kind_Across_Quantity_Declaration => 662, - Iir_Kind_Through_Quantity_Declaration => 674, - Iir_Kind_Enumeration_Literal => 685, - Iir_Kind_Function_Declaration => 710, - Iir_Kind_Procedure_Declaration => 734, - Iir_Kind_Function_Body => 744, - Iir_Kind_Procedure_Body => 755, - Iir_Kind_Object_Alias_Declaration => 766, - Iir_Kind_File_Declaration => 780, - Iir_Kind_Guard_Signal_Declaration => 793, - Iir_Kind_Signal_Declaration => 810, - Iir_Kind_Variable_Declaration => 823, - Iir_Kind_Constant_Declaration => 837, - Iir_Kind_Iterator_Declaration => 848, - Iir_Kind_Interface_Constant_Declaration => 864, - Iir_Kind_Interface_Variable_Declaration => 880, - Iir_Kind_Interface_Signal_Declaration => 901, - Iir_Kind_Interface_File_Declaration => 917, - Iir_Kind_Interface_Type_Declaration => 927, - Iir_Kind_Interface_Package_Declaration => 938, - Iir_Kind_Interface_Function_Declaration => 955, - Iir_Kind_Interface_Procedure_Declaration => 968, - Iir_Kind_Signal_Attribute_Declaration => 971, - Iir_Kind_Identity_Operator => 975, - Iir_Kind_Negation_Operator => 979, - Iir_Kind_Absolute_Operator => 983, - Iir_Kind_Not_Operator => 987, - Iir_Kind_Condition_Operator => 991, - Iir_Kind_Reduction_And_Operator => 995, - Iir_Kind_Reduction_Or_Operator => 999, - Iir_Kind_Reduction_Nand_Operator => 1003, - Iir_Kind_Reduction_Nor_Operator => 1007, - Iir_Kind_Reduction_Xor_Operator => 1011, - Iir_Kind_Reduction_Xnor_Operator => 1015, - Iir_Kind_And_Operator => 1020, - Iir_Kind_Or_Operator => 1025, - Iir_Kind_Nand_Operator => 1030, - Iir_Kind_Nor_Operator => 1035, - Iir_Kind_Xor_Operator => 1040, - Iir_Kind_Xnor_Operator => 1045, - Iir_Kind_Equality_Operator => 1050, - Iir_Kind_Inequality_Operator => 1055, - Iir_Kind_Less_Than_Operator => 1060, - Iir_Kind_Less_Than_Or_Equal_Operator => 1065, - Iir_Kind_Greater_Than_Operator => 1070, - Iir_Kind_Greater_Than_Or_Equal_Operator => 1075, - Iir_Kind_Match_Equality_Operator => 1080, - Iir_Kind_Match_Inequality_Operator => 1085, - Iir_Kind_Match_Less_Than_Operator => 1090, - Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1095, - Iir_Kind_Match_Greater_Than_Operator => 1100, - Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1105, - Iir_Kind_Sll_Operator => 1110, - Iir_Kind_Sla_Operator => 1115, - Iir_Kind_Srl_Operator => 1120, - Iir_Kind_Sra_Operator => 1125, - Iir_Kind_Rol_Operator => 1130, - Iir_Kind_Ror_Operator => 1135, - Iir_Kind_Addition_Operator => 1140, - Iir_Kind_Substraction_Operator => 1145, - Iir_Kind_Concatenation_Operator => 1150, - Iir_Kind_Multiplication_Operator => 1155, - Iir_Kind_Division_Operator => 1160, - Iir_Kind_Modulus_Operator => 1165, - Iir_Kind_Remainder_Operator => 1170, - Iir_Kind_Exponentiation_Operator => 1175, - Iir_Kind_Function_Call => 1183, - Iir_Kind_Aggregate => 1189, - Iir_Kind_Parenthesis_Expression => 1192, - Iir_Kind_Qualified_Expression => 1196, - Iir_Kind_Type_Conversion => 1201, - Iir_Kind_Allocator_By_Expression => 1205, - Iir_Kind_Allocator_By_Subtype => 1210, - Iir_Kind_Selected_Element => 1216, - Iir_Kind_Dereference => 1221, - Iir_Kind_Implicit_Dereference => 1226, - Iir_Kind_Slice_Name => 1233, - Iir_Kind_Indexed_Name => 1239, - Iir_Kind_Psl_Expression => 1241, - Iir_Kind_Sensitized_Process_Statement => 1261, - Iir_Kind_Process_Statement => 1281, - Iir_Kind_Concurrent_Simple_Signal_Assignment => 1292, - Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1303, - Iir_Kind_Concurrent_Selected_Signal_Assignment => 1315, - Iir_Kind_Concurrent_Assertion_Statement => 1323, - Iir_Kind_Concurrent_Procedure_Call_Statement => 1330, - Iir_Kind_Psl_Assert_Statement => 1343, - Iir_Kind_Psl_Cover_Statement => 1356, - Iir_Kind_Block_Statement => 1369, - Iir_Kind_If_Generate_Statement => 1379, - Iir_Kind_Case_Generate_Statement => 1388, - Iir_Kind_For_Generate_Statement => 1397, - Iir_Kind_Component_Instantiation_Statement => 1407, - Iir_Kind_Psl_Default_Clock => 1411, - Iir_Kind_Simple_Simultaneous_Statement => 1418, - Iir_Kind_Generate_Statement_Body => 1429, - Iir_Kind_If_Generate_Else_Clause => 1434, - Iir_Kind_Simple_Signal_Assignment_Statement => 1443, - Iir_Kind_Conditional_Signal_Assignment_Statement => 1452, - Iir_Kind_Null_Statement => 1456, - Iir_Kind_Assertion_Statement => 1463, - Iir_Kind_Report_Statement => 1469, - Iir_Kind_Wait_Statement => 1476, - Iir_Kind_Variable_Assignment_Statement => 1482, - Iir_Kind_Conditional_Variable_Assignment_Statement => 1488, - Iir_Kind_Return_Statement => 1494, - Iir_Kind_For_Loop_Statement => 1503, - Iir_Kind_While_Loop_Statement => 1511, - Iir_Kind_Next_Statement => 1517, - Iir_Kind_Exit_Statement => 1523, - Iir_Kind_Case_Statement => 1531, - Iir_Kind_Procedure_Call_Statement => 1537, - Iir_Kind_If_Statement => 1546, - Iir_Kind_Elsif => 1551, - Iir_Kind_Character_Literal => 1559, - Iir_Kind_Simple_Name => 1567, - Iir_Kind_Selected_Name => 1576, - Iir_Kind_Operator_Symbol => 1582, - Iir_Kind_Reference_Name => 1585, - Iir_Kind_Selected_By_All_Name => 1591, - Iir_Kind_Parenthesis_Name => 1596, - Iir_Kind_External_Constant_Name => 1604, - Iir_Kind_External_Signal_Name => 1612, - Iir_Kind_External_Variable_Name => 1620, - Iir_Kind_Package_Pathname => 1624, - Iir_Kind_Absolute_Pathname => 1625, - Iir_Kind_Relative_Pathname => 1626, - Iir_Kind_Pathname_Element => 1631, - Iir_Kind_Base_Attribute => 1633, - Iir_Kind_Left_Type_Attribute => 1638, - Iir_Kind_Right_Type_Attribute => 1643, - Iir_Kind_High_Type_Attribute => 1648, - Iir_Kind_Low_Type_Attribute => 1653, - Iir_Kind_Ascending_Type_Attribute => 1658, - Iir_Kind_Image_Attribute => 1664, - Iir_Kind_Value_Attribute => 1670, - Iir_Kind_Pos_Attribute => 1676, - Iir_Kind_Val_Attribute => 1682, - Iir_Kind_Succ_Attribute => 1688, - Iir_Kind_Pred_Attribute => 1694, - Iir_Kind_Leftof_Attribute => 1700, - Iir_Kind_Rightof_Attribute => 1706, - Iir_Kind_Delayed_Attribute => 1715, - Iir_Kind_Stable_Attribute => 1724, - Iir_Kind_Quiet_Attribute => 1733, - Iir_Kind_Transaction_Attribute => 1742, - Iir_Kind_Event_Attribute => 1746, - Iir_Kind_Active_Attribute => 1750, - Iir_Kind_Last_Event_Attribute => 1754, - Iir_Kind_Last_Active_Attribute => 1758, - Iir_Kind_Last_Value_Attribute => 1762, - Iir_Kind_Driving_Attribute => 1766, - Iir_Kind_Driving_Value_Attribute => 1770, - Iir_Kind_Behavior_Attribute => 1770, - Iir_Kind_Structure_Attribute => 1770, - Iir_Kind_Simple_Name_Attribute => 1777, - Iir_Kind_Instance_Name_Attribute => 1782, - Iir_Kind_Path_Name_Attribute => 1787, - Iir_Kind_Left_Array_Attribute => 1794, - Iir_Kind_Right_Array_Attribute => 1801, - Iir_Kind_High_Array_Attribute => 1808, - Iir_Kind_Low_Array_Attribute => 1815, - Iir_Kind_Length_Array_Attribute => 1822, - Iir_Kind_Ascending_Array_Attribute => 1829, - Iir_Kind_Range_Array_Attribute => 1836, - Iir_Kind_Reverse_Range_Array_Attribute => 1843, - Iir_Kind_Attribute_Name => 1852 + Iir_Kind_Binding_Indication => 185, + Iir_Kind_Entity_Class => 187, + Iir_Kind_Attribute_Value => 195, + Iir_Kind_Signature => 198, + Iir_Kind_Aggregate_Info => 205, + Iir_Kind_Procedure_Call => 209, + Iir_Kind_Record_Element_Constraint => 215, + Iir_Kind_Array_Element_Resolution => 217, + Iir_Kind_Record_Resolution => 218, + Iir_Kind_Record_Element_Resolution => 221, + Iir_Kind_Attribute_Specification => 229, + Iir_Kind_Disconnection_Specification => 234, + Iir_Kind_Configuration_Specification => 239, + Iir_Kind_Access_Type_Definition => 247, + Iir_Kind_Incomplete_Type_Definition => 255, + Iir_Kind_Interface_Type_Definition => 262, + Iir_Kind_File_Type_Definition => 269, + Iir_Kind_Protected_Type_Declaration => 278, + Iir_Kind_Record_Type_Definition => 288, + Iir_Kind_Array_Type_Definition => 300, + Iir_Kind_Array_Subtype_Definition => 315, + Iir_Kind_Record_Subtype_Definition => 326, + Iir_Kind_Access_Subtype_Definition => 334, + Iir_Kind_Physical_Subtype_Definition => 344, + Iir_Kind_Floating_Subtype_Definition => 355, + Iir_Kind_Integer_Subtype_Definition => 365, + Iir_Kind_Enumeration_Subtype_Definition => 375, + Iir_Kind_Enumeration_Type_Definition => 385, + Iir_Kind_Integer_Type_Definition => 393, + Iir_Kind_Floating_Type_Definition => 401, + Iir_Kind_Physical_Type_Definition => 412, + Iir_Kind_Range_Expression => 420, + Iir_Kind_Protected_Type_Body => 427, + Iir_Kind_Wildcard_Type_Definition => 432, + Iir_Kind_Subtype_Definition => 437, + Iir_Kind_Scalar_Nature_Definition => 441, + Iir_Kind_Overload_List => 442, + Iir_Kind_Type_Declaration => 449, + Iir_Kind_Anonymous_Type_Declaration => 455, + Iir_Kind_Subtype_Declaration => 462, + Iir_Kind_Nature_Declaration => 468, + Iir_Kind_Subnature_Declaration => 474, + Iir_Kind_Package_Declaration => 489, + Iir_Kind_Package_Instantiation_Declaration => 502, + Iir_Kind_Package_Body => 510, + Iir_Kind_Configuration_Declaration => 519, + Iir_Kind_Entity_Declaration => 531, + Iir_Kind_Architecture_Body => 543, + Iir_Kind_Context_Declaration => 549, + Iir_Kind_Package_Header => 551, + Iir_Kind_Unit_Declaration => 559, + Iir_Kind_Library_Declaration => 566, + Iir_Kind_Component_Declaration => 576, + Iir_Kind_Attribute_Declaration => 583, + Iir_Kind_Group_Template_Declaration => 589, + Iir_Kind_Group_Declaration => 596, + Iir_Kind_Element_Declaration => 603, + Iir_Kind_Non_Object_Alias_Declaration => 611, + Iir_Kind_Psl_Declaration => 619, + Iir_Kind_Psl_Endpoint_Declaration => 633, + Iir_Kind_Terminal_Declaration => 639, + Iir_Kind_Free_Quantity_Declaration => 648, + Iir_Kind_Across_Quantity_Declaration => 660, + Iir_Kind_Through_Quantity_Declaration => 672, + Iir_Kind_Enumeration_Literal => 683, + Iir_Kind_Function_Declaration => 708, + Iir_Kind_Procedure_Declaration => 732, + Iir_Kind_Function_Body => 742, + Iir_Kind_Procedure_Body => 753, + Iir_Kind_Object_Alias_Declaration => 764, + Iir_Kind_File_Declaration => 778, + Iir_Kind_Guard_Signal_Declaration => 791, + Iir_Kind_Signal_Declaration => 808, + Iir_Kind_Variable_Declaration => 821, + Iir_Kind_Constant_Declaration => 835, + Iir_Kind_Iterator_Declaration => 846, + Iir_Kind_Interface_Constant_Declaration => 862, + Iir_Kind_Interface_Variable_Declaration => 878, + Iir_Kind_Interface_Signal_Declaration => 899, + Iir_Kind_Interface_File_Declaration => 915, + Iir_Kind_Interface_Type_Declaration => 925, + Iir_Kind_Interface_Package_Declaration => 936, + Iir_Kind_Interface_Function_Declaration => 953, + Iir_Kind_Interface_Procedure_Declaration => 966, + Iir_Kind_Signal_Attribute_Declaration => 969, + Iir_Kind_Identity_Operator => 973, + Iir_Kind_Negation_Operator => 977, + Iir_Kind_Absolute_Operator => 981, + Iir_Kind_Not_Operator => 985, + Iir_Kind_Condition_Operator => 989, + Iir_Kind_Reduction_And_Operator => 993, + Iir_Kind_Reduction_Or_Operator => 997, + Iir_Kind_Reduction_Nand_Operator => 1001, + Iir_Kind_Reduction_Nor_Operator => 1005, + Iir_Kind_Reduction_Xor_Operator => 1009, + Iir_Kind_Reduction_Xnor_Operator => 1013, + Iir_Kind_And_Operator => 1018, + Iir_Kind_Or_Operator => 1023, + Iir_Kind_Nand_Operator => 1028, + Iir_Kind_Nor_Operator => 1033, + Iir_Kind_Xor_Operator => 1038, + Iir_Kind_Xnor_Operator => 1043, + Iir_Kind_Equality_Operator => 1048, + Iir_Kind_Inequality_Operator => 1053, + Iir_Kind_Less_Than_Operator => 1058, + Iir_Kind_Less_Than_Or_Equal_Operator => 1063, + Iir_Kind_Greater_Than_Operator => 1068, + Iir_Kind_Greater_Than_Or_Equal_Operator => 1073, + Iir_Kind_Match_Equality_Operator => 1078, + Iir_Kind_Match_Inequality_Operator => 1083, + Iir_Kind_Match_Less_Than_Operator => 1088, + Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1093, + Iir_Kind_Match_Greater_Than_Operator => 1098, + Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1103, + Iir_Kind_Sll_Operator => 1108, + Iir_Kind_Sla_Operator => 1113, + Iir_Kind_Srl_Operator => 1118, + Iir_Kind_Sra_Operator => 1123, + Iir_Kind_Rol_Operator => 1128, + Iir_Kind_Ror_Operator => 1133, + Iir_Kind_Addition_Operator => 1138, + Iir_Kind_Substraction_Operator => 1143, + Iir_Kind_Concatenation_Operator => 1148, + Iir_Kind_Multiplication_Operator => 1153, + Iir_Kind_Division_Operator => 1158, + Iir_Kind_Modulus_Operator => 1163, + Iir_Kind_Remainder_Operator => 1168, + Iir_Kind_Exponentiation_Operator => 1173, + Iir_Kind_Function_Call => 1181, + Iir_Kind_Aggregate => 1187, + Iir_Kind_Parenthesis_Expression => 1190, + Iir_Kind_Qualified_Expression => 1194, + Iir_Kind_Type_Conversion => 1199, + Iir_Kind_Allocator_By_Expression => 1203, + Iir_Kind_Allocator_By_Subtype => 1208, + Iir_Kind_Selected_Element => 1214, + Iir_Kind_Dereference => 1219, + Iir_Kind_Implicit_Dereference => 1224, + Iir_Kind_Slice_Name => 1231, + Iir_Kind_Indexed_Name => 1237, + Iir_Kind_Psl_Expression => 1239, + Iir_Kind_Sensitized_Process_Statement => 1259, + Iir_Kind_Process_Statement => 1279, + Iir_Kind_Concurrent_Simple_Signal_Assignment => 1290, + Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1301, + Iir_Kind_Concurrent_Selected_Signal_Assignment => 1313, + Iir_Kind_Concurrent_Assertion_Statement => 1321, + Iir_Kind_Concurrent_Procedure_Call_Statement => 1328, + Iir_Kind_Psl_Assert_Statement => 1341, + Iir_Kind_Psl_Cover_Statement => 1354, + Iir_Kind_Block_Statement => 1367, + Iir_Kind_If_Generate_Statement => 1377, + Iir_Kind_Case_Generate_Statement => 1386, + Iir_Kind_For_Generate_Statement => 1395, + Iir_Kind_Component_Instantiation_Statement => 1405, + Iir_Kind_Psl_Default_Clock => 1409, + Iir_Kind_Simple_Simultaneous_Statement => 1416, + Iir_Kind_Generate_Statement_Body => 1427, + Iir_Kind_If_Generate_Else_Clause => 1432, + Iir_Kind_Simple_Signal_Assignment_Statement => 1441, + Iir_Kind_Conditional_Signal_Assignment_Statement => 1450, + Iir_Kind_Null_Statement => 1454, + Iir_Kind_Assertion_Statement => 1461, + Iir_Kind_Report_Statement => 1467, + Iir_Kind_Wait_Statement => 1474, + Iir_Kind_Variable_Assignment_Statement => 1480, + Iir_Kind_Conditional_Variable_Assignment_Statement => 1486, + Iir_Kind_Return_Statement => 1492, + Iir_Kind_For_Loop_Statement => 1501, + Iir_Kind_While_Loop_Statement => 1509, + Iir_Kind_Next_Statement => 1515, + Iir_Kind_Exit_Statement => 1521, + Iir_Kind_Case_Statement => 1529, + Iir_Kind_Procedure_Call_Statement => 1535, + Iir_Kind_If_Statement => 1544, + Iir_Kind_Elsif => 1549, + Iir_Kind_Character_Literal => 1557, + Iir_Kind_Simple_Name => 1565, + Iir_Kind_Selected_Name => 1574, + Iir_Kind_Operator_Symbol => 1580, + Iir_Kind_Reference_Name => 1583, + Iir_Kind_Selected_By_All_Name => 1589, + Iir_Kind_Parenthesis_Name => 1594, + Iir_Kind_External_Constant_Name => 1602, + Iir_Kind_External_Signal_Name => 1610, + Iir_Kind_External_Variable_Name => 1618, + Iir_Kind_Package_Pathname => 1622, + Iir_Kind_Absolute_Pathname => 1623, + Iir_Kind_Relative_Pathname => 1624, + Iir_Kind_Pathname_Element => 1629, + Iir_Kind_Base_Attribute => 1631, + Iir_Kind_Left_Type_Attribute => 1636, + Iir_Kind_Right_Type_Attribute => 1641, + Iir_Kind_High_Type_Attribute => 1646, + Iir_Kind_Low_Type_Attribute => 1651, + Iir_Kind_Ascending_Type_Attribute => 1656, + Iir_Kind_Image_Attribute => 1662, + Iir_Kind_Value_Attribute => 1668, + Iir_Kind_Pos_Attribute => 1674, + Iir_Kind_Val_Attribute => 1680, + Iir_Kind_Succ_Attribute => 1686, + Iir_Kind_Pred_Attribute => 1692, + Iir_Kind_Leftof_Attribute => 1698, + Iir_Kind_Rightof_Attribute => 1704, + Iir_Kind_Delayed_Attribute => 1713, + Iir_Kind_Stable_Attribute => 1722, + Iir_Kind_Quiet_Attribute => 1731, + Iir_Kind_Transaction_Attribute => 1740, + Iir_Kind_Event_Attribute => 1744, + Iir_Kind_Active_Attribute => 1748, + Iir_Kind_Last_Event_Attribute => 1752, + Iir_Kind_Last_Active_Attribute => 1756, + Iir_Kind_Last_Value_Attribute => 1760, + Iir_Kind_Driving_Attribute => 1764, + Iir_Kind_Driving_Value_Attribute => 1768, + Iir_Kind_Behavior_Attribute => 1768, + Iir_Kind_Structure_Attribute => 1768, + Iir_Kind_Simple_Name_Attribute => 1775, + Iir_Kind_Instance_Name_Attribute => 1780, + Iir_Kind_Path_Name_Attribute => 1785, + Iir_Kind_Left_Array_Attribute => 1792, + Iir_Kind_Right_Array_Attribute => 1799, + Iir_Kind_High_Array_Attribute => 1806, + Iir_Kind_Low_Array_Attribute => 1813, + Iir_Kind_Length_Array_Attribute => 1820, + Iir_Kind_Ascending_Array_Attribute => 1827, + Iir_Kind_Range_Array_Attribute => 1834, + Iir_Kind_Reverse_Range_Array_Attribute => 1841, + Iir_Kind_Attribute_Name => 1850 ); function Get_Fields (K : Iir_Kind) return Fields_Array @@ -5219,10 +5207,6 @@ package body Nodes_Meta is return Get_Entity_Aspect (N); when Field_Default_Entity_Aspect => return Get_Default_Entity_Aspect (N); - when Field_Default_Generic_Map_Aspect_Chain => - return Get_Default_Generic_Map_Aspect_Chain (N); - when Field_Default_Port_Map_Aspect_Chain => - return Get_Default_Port_Map_Aspect_Chain (N); when Field_Binding_Indication => return Get_Binding_Indication (N); when Field_Named_Entity => @@ -5623,10 +5607,6 @@ package body Nodes_Meta is Set_Entity_Aspect (N, V); when Field_Default_Entity_Aspect => Set_Default_Entity_Aspect (N, V); - when Field_Default_Generic_Map_Aspect_Chain => - Set_Default_Generic_Map_Aspect_Chain (N, V); - when Field_Default_Port_Map_Aspect_Chain => - Set_Default_Port_Map_Aspect_Chain (N, V); when Field_Binding_Indication => Set_Binding_Indication (N, V); when Field_Named_Entity => @@ -9204,18 +9184,6 @@ package body Nodes_Meta is return K = Iir_Kind_Binding_Indication; end Has_Default_Entity_Aspect; - function Has_Default_Generic_Map_Aspect_Chain (K : Iir_Kind) - return Boolean is - begin - return K = Iir_Kind_Binding_Indication; - end Has_Default_Generic_Map_Aspect_Chain; - - function Has_Default_Port_Map_Aspect_Chain (K : Iir_Kind) - return Boolean is - begin - return K = Iir_Kind_Binding_Indication; - end Has_Default_Port_Map_Aspect_Chain; - function Has_Binding_Indication (K : Iir_Kind) return Boolean is begin case K is diff --git a/src/vhdl/nodes_meta.ads b/src/vhdl/nodes_meta.ads index ea92cb2f4..bd878c4bc 100644 --- a/src/vhdl/nodes_meta.ads +++ b/src/vhdl/nodes_meta.ads @@ -291,8 +291,6 @@ package Nodes_Meta is Field_Instantiation_List, Field_Entity_Aspect, Field_Default_Entity_Aspect, - Field_Default_Generic_Map_Aspect_Chain, - Field_Default_Port_Map_Aspect_Chain, Field_Binding_Indication, Field_Named_Entity, Field_Alias_Declaration, @@ -804,10 +802,6 @@ package Nodes_Meta is function Has_Instantiation_List (K : Iir_Kind) return Boolean; function Has_Entity_Aspect (K : Iir_Kind) return Boolean; function Has_Default_Entity_Aspect (K : Iir_Kind) return Boolean; - function Has_Default_Generic_Map_Aspect_Chain (K : Iir_Kind) - return Boolean; - function Has_Default_Port_Map_Aspect_Chain (K : Iir_Kind) - return Boolean; function Has_Binding_Indication (K : Iir_Kind) return Boolean; function Has_Named_Entity (K : Iir_Kind) return Boolean; function Has_Alias_Declaration (K : Iir_Kind) return Boolean; diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb index 6c364c39c..789cb4378 100644 --- a/src/vhdl/sem.adb +++ b/src/vhdl/sem.adb @@ -1210,7 +1210,7 @@ package body Sem is Sem_Scopes.Add_Component_Declarations (Comp); Binding := Get_Binding_Indication (Conf); if Binding /= Null_Iir then - Sem_Binding_Indication (Binding, Comp, Conf, Primary_Entity_Aspect); + Sem_Binding_Indication (Binding, Conf, Primary_Entity_Aspect); if Primary_Entity_Aspect /= Null_Iir then -- LRM93 5.2.1 Binding Indication @@ -1229,21 +1229,13 @@ package body Sem is -- Create a default binding indication. Entity := Get_Visible_Entity_Declaration (Comp); Binding := Sem_Create_Default_Binding_Indication - (Comp, Entity, Conf, False); + (Comp, Entity, Conf, False, False); if Binding /= Null_Iir then -- Remap to defaults. Set_Default_Entity_Aspect (Binding, Get_Entity_Aspect (Binding)); Set_Entity_Aspect (Binding, Null_Iir); - Set_Default_Generic_Map_Aspect_Chain - (Binding, Get_Generic_Map_Aspect_Chain (Binding)); - Set_Generic_Map_Aspect_Chain (Binding, Null_Iir); - - Set_Default_Port_Map_Aspect_Chain - (Binding, Get_Port_Map_Aspect_Chain (Binding)); - Set_Port_Map_Aspect_Chain (Binding, Null_Iir); - Set_Binding_Indication (Conf, Binding); end if; end if; diff --git a/src/vhdl/sem_specs.adb b/src/vhdl/sem_specs.adb index 802f5aed7..c88ff51d0 100644 --- a/src/vhdl/sem_specs.adb +++ b/src/vhdl/sem_specs.adb @@ -1111,7 +1111,6 @@ package body Sem_Specs is end Sem_Entity_Aspect; procedure Sem_Binding_Indication (Bind : Iir_Binding_Indication; - Comp : Iir_Component_Declaration; Parent : Iir; Primary_Entity_Aspect : Iir) is @@ -1187,20 +1186,7 @@ package body Sem_Specs is -- If the generic map aspect or port map aspect of a binding -- indication is not present, then the default rules as described -- in 5.2.2 apply. - if Get_Generic_Map_Aspect_Chain (Bind) = Null_Iir - and then Primary_Entity_Aspect = Null_Iir - then - Set_Default_Generic_Map_Aspect_Chain - (Bind, - Create_Default_Map_Aspect (Comp, Entity, Map_Generic, Parent)); - end if; - if Get_Port_Map_Aspect_Chain (Bind) = Null_Iir - and then Primary_Entity_Aspect = Null_Iir - then - Set_Default_Port_Map_Aspect_Chain - (Bind, - Create_Default_Map_Aspect (Comp, Entity, Map_Port, Parent)); - end if; + -- GHDL: done in canon end if; end Sem_Binding_Indication; @@ -1439,8 +1425,8 @@ package body Sem_Specs is -- Extend scope of component interface declaration. Sem_Scopes.Open_Scope_Extension; Sem_Scopes.Add_Component_Declarations (Component); - Sem_Binding_Indication (Get_Binding_Indication (Conf), - Component, Conf, Primary_Entity_Aspect); + Sem_Binding_Indication + (Get_Binding_Indication (Conf), Conf, Primary_Entity_Aspect); -- FIXME: check default port and generic association. Sem_Scopes.Close_Scope_Extension; end Sem_Configuration_Specification; @@ -1449,7 +1435,8 @@ package body Sem_Specs is (Comp : Iir_Component_Declaration; Entity_Unit : Iir_Design_Unit; Parent : Iir; - Force : Boolean) + Force : Boolean; + Create_Map_Aspect : Boolean) return Iir_Binding_Indication is Entity : Iir_Entity_Declaration; @@ -1530,19 +1517,22 @@ package body Sem_Specs is Set_Entity_Name (Aspect, Entity_Name); Set_Entity_Aspect (Res, Aspect); - -- LRM 5.2.2 - -- The default binding indication includes a default generic map aspect - -- if the design entity implied by the entity aspect contains formal - -- generics. - Set_Generic_Map_Aspect_Chain - (Res, Create_Default_Map_Aspect (Comp, Entity, Map_Generic, Parent)); + if Create_Map_Aspect then + -- LRM 5.2.2 + -- The default binding indication includes a default generic map + -- aspect if the design entity implied by the entity aspect contains + -- formal generics. + Set_Generic_Map_Aspect_Chain + (Res, + Create_Default_Map_Aspect (Comp, Entity, Map_Generic, Parent)); - -- LRM 5.2.2 - -- The default binding indication includes a default port map aspect - -- if the design entity implied by the entity aspect contains formal - -- ports. - Set_Port_Map_Aspect_Chain - (Res, Create_Default_Map_Aspect (Comp, Entity, Map_Port, Parent)); + -- LRM 5.2.2 + -- The default binding indication includes a default port map aspect + -- if the design entity implied by the entity aspect contains formal + -- ports. + Set_Port_Map_Aspect_Chain + (Res, Create_Default_Map_Aspect (Comp, Entity, Map_Port, Parent)); + end if; return Res; end Sem_Create_Default_Binding_Indication; diff --git a/src/vhdl/sem_specs.ads b/src/vhdl/sem_specs.ads index 0a175da34..50049e671 100644 --- a/src/vhdl/sem_specs.ads +++ b/src/vhdl/sem_specs.ads @@ -51,7 +51,6 @@ package Sem_Specs is -- component configuration PARENT. -- PRIMARY_ENTITY_ASPECT is not Null_Iir for an incremental binding. procedure Sem_Binding_Indication (Bind : Iir_Binding_Indication; - Comp : Iir_Component_Declaration; Parent : Iir; Primary_Entity_Aspect : Iir); @@ -69,12 +68,14 @@ package Sem_Specs is -- If ENTITY_UNIT is NULL_IIR, the component is not bound. -- If FORCE is True, a binding indication will be created even if the -- component is not bound (this is an open binding indication). + -- If CREATE_MAP_ASPECT is true, port and generic map aspect are created. -- PARENT is used to report error. function Sem_Create_Default_Binding_Indication (Comp : Iir_Component_Declaration; Entity_Unit : Iir_Design_Unit; Parent : Iir; - Force : Boolean) + Force : Boolean; + Create_Map_Aspect : Boolean) return Iir_Binding_Indication; -- Create a default generic or port map aspect that associates all elements diff --git a/src/vhdl/sem_stmts.adb b/src/vhdl/sem_stmts.adb index 9abe1b92f..f26e432c9 100644 --- a/src/vhdl/sem_stmts.adb +++ b/src/vhdl/sem_stmts.adb @@ -1524,7 +1524,7 @@ package body Sem_Stmts is or else Get_Date (Entity_Unit) in Date_Valid) then Bind := Sem_Create_Default_Binding_Indication - (Decl, Entity_Unit, Stmt, False); + (Decl, Entity_Unit, Stmt, False, True); Set_Default_Binding_Indication (Stmt, Bind); end if; end if; |