diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-08-11 05:49:44 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-08-11 05:49:44 +0200 |
commit | a46b01b05ffe8835d5e16af68e0a5ce441d71c08 (patch) | |
tree | 55dffd3252c10348de0e3509e0e22bb52acd6f8f /src/vhdl | |
parent | 184c2eb7f97f412ab6d658271ecacd7b6cae1837 (diff) | |
download | ghdl-a46b01b05ffe8835d5e16af68e0a5ce441d71c08.tar.gz ghdl-a46b01b05ffe8835d5e16af68e0a5ce441d71c08.tar.bz2 ghdl-a46b01b05ffe8835d5e16af68e0a5ce441d71c08.zip |
vhdl: improve reprint of inertial association.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-canon.adb | 64 | ||||
-rw-r--r-- | src/vhdl/vhdl-canon.ads | 3 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 4 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes_meta.adb | 308 | ||||
-rw-r--r-- | src/vhdl/vhdl-prints.adb | 6 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem.adb | 2 |
6 files changed, 206 insertions, 181 deletions
diff --git a/src/vhdl/vhdl-canon.adb b/src/vhdl/vhdl-canon.adb index 6dd40560b..c1cd2d13f 100644 --- a/src/vhdl/vhdl-canon.adb +++ b/src/vhdl/vhdl-canon.adb @@ -232,6 +232,7 @@ package body Vhdl.Canon is when Iir_Kind_Interface_Signal_Declaration | Iir_Kind_Signal_Declaration | Iir_Kind_Guard_Signal_Declaration + | Iir_Kind_Anonymous_Signal_Declaration | Iir_Kinds_Signal_Attribute | Iir_Kind_External_Signal_Name => -- LRM 8.1 @@ -308,7 +309,8 @@ package body Vhdl.Canon is end; when Iir_Kind_Simple_Name - | Iir_Kind_Selected_Name => + | Iir_Kind_Selected_Name + | Iir_Kind_Reference_Name => Canon_Extract_Sensitivity (Get_Named_Entity (Expr), Sensitivity_List, Is_Target); @@ -2799,32 +2801,40 @@ package body Vhdl.Canon is Canon_Expression (Get_Expression (Decl)); end if; -- Create a signal assignment. - declare - Parent : constant Node := Get_Parent (Decl); - Asgn : Iir; - We : Iir; - Name : Iir; - begin - Asgn := Create_Iir - (Iir_Kind_Concurrent_Simple_Signal_Assignment); - Location_Copy (Asgn, Decl); - Set_Parent (Asgn, Parent); - Name := Build_Simple_Name (Decl, Decl); - Set_Type (Name, Get_Type (Decl)); - Set_Target (Asgn, Name); - Set_Delay_Mechanism (Asgn, Iir_Inertial_Delay); - - We := Create_Iir (Iir_Kind_Waveform_Element); - Location_Copy (We, Decl); - Set_We_Value (We, Get_Expression (Decl)); - Set_Expression (Decl, Null_Iir); - - Set_Waveform_Chain (Asgn, We); - - -- Prepend. - Set_Chain (Asgn, Get_Concurrent_Statement_Chain (Parent)); - Set_Concurrent_Statement_Chain (Parent, Asgn); - end; + if Canon_Flag_Associations then + declare + Parent : constant Node := Get_Parent (Decl); + Asgn : Iir; + We : Iir; + Name : Iir; + begin + Asgn := Create_Iir + (Iir_Kind_Concurrent_Simple_Signal_Assignment); + Location_Copy (Asgn, Decl); + Set_Parent (Asgn, Parent); + + Name := Create_Iir (Iir_Kind_Reference_Name); + Location_Copy (Name, Decl); + Set_Referenced_Name (Name, Decl); + Set_Named_Entity (Name, Decl); + Set_Type (Name, Get_Type (Decl)); + Set_Expr_Staticness (Name, None); + + Set_Target (Asgn, Name); + Set_Delay_Mechanism (Asgn, Iir_Inertial_Delay); + + We := Create_Iir (Iir_Kind_Waveform_Element); + Location_Copy (We, Decl); + Set_We_Value (We, Get_Expression (Decl)); + Set_Expression (Decl, Null_Iir); + + Set_Waveform_Chain (Asgn, We); + + -- Prepend. + Set_Chain (Asgn, Get_Concurrent_Statement_Chain (Parent)); + Set_Concurrent_Statement_Chain (Parent, Asgn); + end; + end if; when Iir_Kind_Iterator_Declaration => null; diff --git a/src/vhdl/vhdl-canon.ads b/src/vhdl/vhdl-canon.ads index 9b79a19a0..477928bcb 100644 --- a/src/vhdl/vhdl-canon.ads +++ b/src/vhdl/vhdl-canon.ads @@ -30,7 +30,8 @@ package Vhdl.Canon is -- If true, canon configuration. Canon_Flag_Configurations : Boolean := True; - -- If true, canon associations (reorder, add open associations). + -- If true, canon associations (reorder, add open associations, signal + -- association with a non globally expression). Canon_Flag_Associations : Boolean := True; -- If true, canon lists in specifications. diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index 7a2cfaf28..aa6c1aa47 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -1660,6 +1660,8 @@ package Vhdl.Nodes is -- Get/Set_After_Drivers_Flag (Flag5) -- -- Get/Set_Is_Ref (Flag12) + -- + -- Get/Set_Expr_Staticness (State1) -- Iir_Kind_Signal_Attribute_Declaration (Short) -- @@ -3754,6 +3756,8 @@ package Vhdl.Nodes is -- Get/Set_Referenced_Name (Field2) -- -- Get/Set_Is_Forward_Ref (Flag1) + -- + -- Get/Set_Expr_Staticness (State1) -- Iir_Kind_Selected_Name (Short) -- diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb index 002b60cc0..9b3723c58 100644 --- a/src/vhdl/vhdl-nodes_meta.adb +++ b/src/vhdl/vhdl-nodes_meta.adb @@ -3344,6 +3344,7 @@ package body Vhdl.Nodes_Meta is Field_Identifier, Field_Is_Ref, Field_After_Drivers_Flag, + Field_Expr_Staticness, Field_Parent, Field_Chain, Field_Default_Value, @@ -4122,6 +4123,7 @@ package body Vhdl.Nodes_Meta is Field_Base_Name, -- Iir_Kind_Reference_Name Field_Is_Forward_Ref, + Field_Expr_Staticness, Field_Type, Field_Named_Entity, Field_Referenced_Name, @@ -4577,158 +4579,158 @@ package body Vhdl.Nodes_Meta is Iir_Kind_Interface_Package_Declaration => 969, Iir_Kind_Interface_Function_Declaration => 986, Iir_Kind_Interface_Procedure_Declaration => 999, - Iir_Kind_Anonymous_Signal_Declaration => 1007, - Iir_Kind_Signal_Attribute_Declaration => 1010, - Iir_Kind_Identity_Operator => 1014, - Iir_Kind_Negation_Operator => 1018, - Iir_Kind_Absolute_Operator => 1022, - Iir_Kind_Not_Operator => 1026, - Iir_Kind_Implicit_Condition_Operator => 1030, - Iir_Kind_Condition_Operator => 1034, - Iir_Kind_Reduction_And_Operator => 1038, - Iir_Kind_Reduction_Or_Operator => 1042, - Iir_Kind_Reduction_Nand_Operator => 1046, - Iir_Kind_Reduction_Nor_Operator => 1050, - Iir_Kind_Reduction_Xor_Operator => 1054, - Iir_Kind_Reduction_Xnor_Operator => 1058, - Iir_Kind_And_Operator => 1063, - Iir_Kind_Or_Operator => 1068, - Iir_Kind_Nand_Operator => 1073, - Iir_Kind_Nor_Operator => 1078, - Iir_Kind_Xor_Operator => 1083, - Iir_Kind_Xnor_Operator => 1088, - Iir_Kind_Equality_Operator => 1093, - Iir_Kind_Inequality_Operator => 1098, - Iir_Kind_Less_Than_Operator => 1103, - Iir_Kind_Less_Than_Or_Equal_Operator => 1108, - Iir_Kind_Greater_Than_Operator => 1113, - Iir_Kind_Greater_Than_Or_Equal_Operator => 1118, - Iir_Kind_Match_Equality_Operator => 1123, - Iir_Kind_Match_Inequality_Operator => 1128, - Iir_Kind_Match_Less_Than_Operator => 1133, - Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1138, - Iir_Kind_Match_Greater_Than_Operator => 1143, - Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1148, - Iir_Kind_Sll_Operator => 1153, - Iir_Kind_Sla_Operator => 1158, - Iir_Kind_Srl_Operator => 1163, - Iir_Kind_Sra_Operator => 1168, - Iir_Kind_Rol_Operator => 1173, - Iir_Kind_Ror_Operator => 1178, - Iir_Kind_Addition_Operator => 1183, - Iir_Kind_Substraction_Operator => 1188, - Iir_Kind_Concatenation_Operator => 1193, - Iir_Kind_Multiplication_Operator => 1198, - Iir_Kind_Division_Operator => 1203, - Iir_Kind_Modulus_Operator => 1208, - Iir_Kind_Remainder_Operator => 1213, - Iir_Kind_Exponentiation_Operator => 1218, - Iir_Kind_Function_Call => 1226, - Iir_Kind_Aggregate => 1233, - Iir_Kind_Parenthesis_Expression => 1236, - Iir_Kind_Qualified_Expression => 1240, - Iir_Kind_Type_Conversion => 1245, - Iir_Kind_Allocator_By_Expression => 1249, - Iir_Kind_Allocator_By_Subtype => 1254, - Iir_Kind_Selected_Element => 1262, - Iir_Kind_Dereference => 1267, - Iir_Kind_Implicit_Dereference => 1272, - Iir_Kind_Slice_Name => 1279, - Iir_Kind_Indexed_Name => 1285, - Iir_Kind_Psl_Expression => 1287, - Iir_Kind_Sensitized_Process_Statement => 1308, - Iir_Kind_Process_Statement => 1328, - Iir_Kind_Concurrent_Simple_Signal_Assignment => 1340, - Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1352, - Iir_Kind_Concurrent_Selected_Signal_Assignment => 1365, - Iir_Kind_Concurrent_Assertion_Statement => 1373, - Iir_Kind_Concurrent_Procedure_Call_Statement => 1380, - Iir_Kind_Psl_Assert_Directive => 1393, - Iir_Kind_Psl_Assume_Directive => 1404, - Iir_Kind_Psl_Cover_Directive => 1416, - Iir_Kind_Psl_Restrict_Directive => 1427, - Iir_Kind_Block_Statement => 1441, - Iir_Kind_If_Generate_Statement => 1452, - Iir_Kind_Case_Generate_Statement => 1461, - Iir_Kind_For_Generate_Statement => 1470, - Iir_Kind_Component_Instantiation_Statement => 1481, - Iir_Kind_Psl_Default_Clock => 1485, - Iir_Kind_Simple_Simultaneous_Statement => 1492, - Iir_Kind_Generate_Statement_Body => 1503, - Iir_Kind_If_Generate_Else_Clause => 1509, - Iir_Kind_Simple_Signal_Assignment_Statement => 1519, - Iir_Kind_Conditional_Signal_Assignment_Statement => 1529, - Iir_Kind_Selected_Waveform_Assignment_Statement => 1540, - Iir_Kind_Null_Statement => 1544, - Iir_Kind_Assertion_Statement => 1551, - Iir_Kind_Report_Statement => 1557, - Iir_Kind_Wait_Statement => 1565, - Iir_Kind_Variable_Assignment_Statement => 1572, - Iir_Kind_Conditional_Variable_Assignment_Statement => 1579, - Iir_Kind_Return_Statement => 1585, - Iir_Kind_For_Loop_Statement => 1594, - Iir_Kind_While_Loop_Statement => 1603, - Iir_Kind_Next_Statement => 1610, - Iir_Kind_Exit_Statement => 1617, - Iir_Kind_Case_Statement => 1625, - Iir_Kind_Procedure_Call_Statement => 1631, - Iir_Kind_If_Statement => 1641, - Iir_Kind_Elsif => 1647, - Iir_Kind_Character_Literal => 1655, - Iir_Kind_Simple_Name => 1663, - Iir_Kind_Selected_Name => 1672, - Iir_Kind_Operator_Symbol => 1678, - Iir_Kind_Reference_Name => 1682, - Iir_Kind_External_Constant_Name => 1690, - Iir_Kind_External_Signal_Name => 1698, - Iir_Kind_External_Variable_Name => 1707, - Iir_Kind_Selected_By_All_Name => 1713, - Iir_Kind_Parenthesis_Name => 1718, - Iir_Kind_Package_Pathname => 1722, - Iir_Kind_Absolute_Pathname => 1723, - Iir_Kind_Relative_Pathname => 1724, - Iir_Kind_Pathname_Element => 1729, - Iir_Kind_Base_Attribute => 1731, - Iir_Kind_Subtype_Attribute => 1736, - Iir_Kind_Element_Attribute => 1741, - Iir_Kind_Left_Type_Attribute => 1746, - Iir_Kind_Right_Type_Attribute => 1751, - Iir_Kind_High_Type_Attribute => 1756, - Iir_Kind_Low_Type_Attribute => 1761, - Iir_Kind_Ascending_Type_Attribute => 1766, - Iir_Kind_Image_Attribute => 1772, - Iir_Kind_Value_Attribute => 1778, - Iir_Kind_Pos_Attribute => 1784, - Iir_Kind_Val_Attribute => 1790, - Iir_Kind_Succ_Attribute => 1796, - Iir_Kind_Pred_Attribute => 1802, - Iir_Kind_Leftof_Attribute => 1808, - Iir_Kind_Rightof_Attribute => 1814, - Iir_Kind_Delayed_Attribute => 1823, - Iir_Kind_Stable_Attribute => 1832, - Iir_Kind_Quiet_Attribute => 1841, - Iir_Kind_Transaction_Attribute => 1850, - Iir_Kind_Event_Attribute => 1854, - Iir_Kind_Active_Attribute => 1858, - Iir_Kind_Last_Event_Attribute => 1862, - Iir_Kind_Last_Active_Attribute => 1866, - Iir_Kind_Last_Value_Attribute => 1870, - Iir_Kind_Driving_Attribute => 1874, - Iir_Kind_Driving_Value_Attribute => 1878, - Iir_Kind_Behavior_Attribute => 1878, - Iir_Kind_Structure_Attribute => 1878, - Iir_Kind_Simple_Name_Attribute => 1885, - Iir_Kind_Instance_Name_Attribute => 1890, - Iir_Kind_Path_Name_Attribute => 1895, - Iir_Kind_Left_Array_Attribute => 1902, - Iir_Kind_Right_Array_Attribute => 1909, - Iir_Kind_High_Array_Attribute => 1916, - Iir_Kind_Low_Array_Attribute => 1923, - Iir_Kind_Length_Array_Attribute => 1930, - Iir_Kind_Ascending_Array_Attribute => 1937, - Iir_Kind_Range_Array_Attribute => 1944, - Iir_Kind_Reverse_Range_Array_Attribute => 1951, - Iir_Kind_Attribute_Name => 1960 + Iir_Kind_Anonymous_Signal_Declaration => 1008, + Iir_Kind_Signal_Attribute_Declaration => 1011, + Iir_Kind_Identity_Operator => 1015, + Iir_Kind_Negation_Operator => 1019, + Iir_Kind_Absolute_Operator => 1023, + Iir_Kind_Not_Operator => 1027, + Iir_Kind_Implicit_Condition_Operator => 1031, + Iir_Kind_Condition_Operator => 1035, + Iir_Kind_Reduction_And_Operator => 1039, + Iir_Kind_Reduction_Or_Operator => 1043, + Iir_Kind_Reduction_Nand_Operator => 1047, + Iir_Kind_Reduction_Nor_Operator => 1051, + Iir_Kind_Reduction_Xor_Operator => 1055, + Iir_Kind_Reduction_Xnor_Operator => 1059, + Iir_Kind_And_Operator => 1064, + Iir_Kind_Or_Operator => 1069, + Iir_Kind_Nand_Operator => 1074, + Iir_Kind_Nor_Operator => 1079, + Iir_Kind_Xor_Operator => 1084, + Iir_Kind_Xnor_Operator => 1089, + Iir_Kind_Equality_Operator => 1094, + Iir_Kind_Inequality_Operator => 1099, + Iir_Kind_Less_Than_Operator => 1104, + Iir_Kind_Less_Than_Or_Equal_Operator => 1109, + Iir_Kind_Greater_Than_Operator => 1114, + Iir_Kind_Greater_Than_Or_Equal_Operator => 1119, + Iir_Kind_Match_Equality_Operator => 1124, + Iir_Kind_Match_Inequality_Operator => 1129, + Iir_Kind_Match_Less_Than_Operator => 1134, + Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1139, + Iir_Kind_Match_Greater_Than_Operator => 1144, + Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1149, + Iir_Kind_Sll_Operator => 1154, + Iir_Kind_Sla_Operator => 1159, + Iir_Kind_Srl_Operator => 1164, + Iir_Kind_Sra_Operator => 1169, + Iir_Kind_Rol_Operator => 1174, + Iir_Kind_Ror_Operator => 1179, + Iir_Kind_Addition_Operator => 1184, + Iir_Kind_Substraction_Operator => 1189, + Iir_Kind_Concatenation_Operator => 1194, + Iir_Kind_Multiplication_Operator => 1199, + Iir_Kind_Division_Operator => 1204, + Iir_Kind_Modulus_Operator => 1209, + Iir_Kind_Remainder_Operator => 1214, + Iir_Kind_Exponentiation_Operator => 1219, + Iir_Kind_Function_Call => 1227, + Iir_Kind_Aggregate => 1234, + Iir_Kind_Parenthesis_Expression => 1237, + Iir_Kind_Qualified_Expression => 1241, + Iir_Kind_Type_Conversion => 1246, + Iir_Kind_Allocator_By_Expression => 1250, + Iir_Kind_Allocator_By_Subtype => 1255, + Iir_Kind_Selected_Element => 1263, + Iir_Kind_Dereference => 1268, + Iir_Kind_Implicit_Dereference => 1273, + Iir_Kind_Slice_Name => 1280, + Iir_Kind_Indexed_Name => 1286, + Iir_Kind_Psl_Expression => 1288, + Iir_Kind_Sensitized_Process_Statement => 1309, + Iir_Kind_Process_Statement => 1329, + Iir_Kind_Concurrent_Simple_Signal_Assignment => 1341, + Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1353, + Iir_Kind_Concurrent_Selected_Signal_Assignment => 1366, + Iir_Kind_Concurrent_Assertion_Statement => 1374, + Iir_Kind_Concurrent_Procedure_Call_Statement => 1381, + Iir_Kind_Psl_Assert_Directive => 1394, + Iir_Kind_Psl_Assume_Directive => 1405, + Iir_Kind_Psl_Cover_Directive => 1417, + Iir_Kind_Psl_Restrict_Directive => 1428, + Iir_Kind_Block_Statement => 1442, + Iir_Kind_If_Generate_Statement => 1453, + Iir_Kind_Case_Generate_Statement => 1462, + Iir_Kind_For_Generate_Statement => 1471, + Iir_Kind_Component_Instantiation_Statement => 1482, + Iir_Kind_Psl_Default_Clock => 1486, + Iir_Kind_Simple_Simultaneous_Statement => 1493, + Iir_Kind_Generate_Statement_Body => 1504, + Iir_Kind_If_Generate_Else_Clause => 1510, + Iir_Kind_Simple_Signal_Assignment_Statement => 1520, + Iir_Kind_Conditional_Signal_Assignment_Statement => 1530, + Iir_Kind_Selected_Waveform_Assignment_Statement => 1541, + Iir_Kind_Null_Statement => 1545, + Iir_Kind_Assertion_Statement => 1552, + Iir_Kind_Report_Statement => 1558, + Iir_Kind_Wait_Statement => 1566, + Iir_Kind_Variable_Assignment_Statement => 1573, + Iir_Kind_Conditional_Variable_Assignment_Statement => 1580, + Iir_Kind_Return_Statement => 1586, + Iir_Kind_For_Loop_Statement => 1595, + Iir_Kind_While_Loop_Statement => 1604, + Iir_Kind_Next_Statement => 1611, + Iir_Kind_Exit_Statement => 1618, + Iir_Kind_Case_Statement => 1626, + Iir_Kind_Procedure_Call_Statement => 1632, + Iir_Kind_If_Statement => 1642, + Iir_Kind_Elsif => 1648, + Iir_Kind_Character_Literal => 1656, + Iir_Kind_Simple_Name => 1664, + Iir_Kind_Selected_Name => 1673, + Iir_Kind_Operator_Symbol => 1679, + Iir_Kind_Reference_Name => 1684, + Iir_Kind_External_Constant_Name => 1692, + Iir_Kind_External_Signal_Name => 1700, + Iir_Kind_External_Variable_Name => 1709, + Iir_Kind_Selected_By_All_Name => 1715, + Iir_Kind_Parenthesis_Name => 1720, + Iir_Kind_Package_Pathname => 1724, + Iir_Kind_Absolute_Pathname => 1725, + Iir_Kind_Relative_Pathname => 1726, + Iir_Kind_Pathname_Element => 1731, + Iir_Kind_Base_Attribute => 1733, + Iir_Kind_Subtype_Attribute => 1738, + Iir_Kind_Element_Attribute => 1743, + Iir_Kind_Left_Type_Attribute => 1748, + Iir_Kind_Right_Type_Attribute => 1753, + Iir_Kind_High_Type_Attribute => 1758, + Iir_Kind_Low_Type_Attribute => 1763, + Iir_Kind_Ascending_Type_Attribute => 1768, + Iir_Kind_Image_Attribute => 1774, + Iir_Kind_Value_Attribute => 1780, + Iir_Kind_Pos_Attribute => 1786, + Iir_Kind_Val_Attribute => 1792, + Iir_Kind_Succ_Attribute => 1798, + Iir_Kind_Pred_Attribute => 1804, + Iir_Kind_Leftof_Attribute => 1810, + Iir_Kind_Rightof_Attribute => 1816, + Iir_Kind_Delayed_Attribute => 1825, + Iir_Kind_Stable_Attribute => 1834, + Iir_Kind_Quiet_Attribute => 1843, + Iir_Kind_Transaction_Attribute => 1852, + Iir_Kind_Event_Attribute => 1856, + Iir_Kind_Active_Attribute => 1860, + Iir_Kind_Last_Event_Attribute => 1864, + Iir_Kind_Last_Active_Attribute => 1868, + Iir_Kind_Last_Value_Attribute => 1872, + Iir_Kind_Driving_Attribute => 1876, + Iir_Kind_Driving_Value_Attribute => 1880, + Iir_Kind_Behavior_Attribute => 1880, + Iir_Kind_Structure_Attribute => 1880, + Iir_Kind_Simple_Name_Attribute => 1887, + Iir_Kind_Instance_Name_Attribute => 1892, + Iir_Kind_Path_Name_Attribute => 1897, + Iir_Kind_Left_Array_Attribute => 1904, + Iir_Kind_Right_Array_Attribute => 1911, + Iir_Kind_High_Array_Attribute => 1918, + Iir_Kind_Low_Array_Attribute => 1925, + Iir_Kind_Length_Array_Attribute => 1932, + Iir_Kind_Ascending_Array_Attribute => 1939, + Iir_Kind_Range_Array_Attribute => 1946, + Iir_Kind_Reverse_Range_Array_Attribute => 1953, + Iir_Kind_Attribute_Name => 1962 ); function Get_Fields_First (K : Iir_Kind) return Fields_Index is @@ -9549,6 +9551,7 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Interface_Variable_Declaration | Iir_Kind_Interface_Signal_Declaration | Iir_Kind_Interface_File_Declaration + | Iir_Kind_Anonymous_Signal_Declaration | Iir_Kind_Identity_Operator | Iir_Kind_Negation_Operator | Iir_Kind_Absolute_Operator @@ -9608,6 +9611,7 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Character_Literal | Iir_Kind_Simple_Name | Iir_Kind_Selected_Name + | Iir_Kind_Reference_Name | Iir_Kind_External_Constant_Name | Iir_Kind_External_Signal_Name | Iir_Kind_External_Variable_Name diff --git a/src/vhdl/vhdl-prints.adb b/src/vhdl/vhdl-prints.adb index 83e08ee1c..b66bb57ed 100644 --- a/src/vhdl/vhdl-prints.adb +++ b/src/vhdl/vhdl-prints.adb @@ -3513,9 +3513,13 @@ package body Vhdl.Prints is Act : constant Iir := Get_Expression (Expr); begin if Act /= Null_Iir then + -- There is still an expression, so the anonymous signal + -- was not yet declared. Print (Ctxt, Act); else - Disp_Identifier (Ctxt, Expr); + -- Cannot use Disp_Identifier as the identifier is not in + -- the sources. + Disp_Ident (Ctxt, Get_Identifier (Expr)); end if; end; diff --git a/src/vhdl/vhdl-sem.adb b/src/vhdl/vhdl-sem.adb index acd69a86e..daa0395b3 100644 --- a/src/vhdl/vhdl-sem.adb +++ b/src/vhdl/vhdl-sem.adb @@ -497,6 +497,7 @@ package body Vhdl.Sem is Location_Copy (Sig, Actual); Set_Expression (Sig, Actual); Set_Type (Sig, Get_Type (Formal)); + Set_Expr_Staticness (Sig, None); -- Declare it. Add_Implicit_Declaration (Sig); @@ -508,6 +509,7 @@ package body Vhdl.Sem is Set_Referenced_Name (Res, Sig); Set_Named_Entity (Res, Sig); Set_Type (Res, Get_Type (Sig)); + Set_Expr_Staticness (Res, None); return Res; end Sem_Insert_Anonymous_Signal; |