From fb72fae0a907684c00bb19950ad9a20c21732f77 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 16 Aug 2019 11:50:59 +0200 Subject: vhdl: declare verification units (WIP). --- python/libghdl/thin/std_names.py | 54 +-- python/libghdl/thin/vhdl/nodes.py | 433 +++++++++++----------- python/libghdl/thin/vhdl/nodes_meta.py | 502 +++++++++++++------------ src/synth/synthesis.adb | 2 + src/vhdl/vhdl-configuration.adb | 2 + src/vhdl/vhdl-elocations.adb | 7 +- src/vhdl/vhdl-elocations.ads | 4 + src/vhdl/vhdl-elocations_meta.adb | 12 +- src/vhdl/vhdl-errors.adb | 6 + src/vhdl/vhdl-nodes.adb | 57 ++- src/vhdl/vhdl-nodes.ads | 64 +++- src/vhdl/vhdl-nodes_meta.adb | 655 ++++++++++++++++++++------------- src/vhdl/vhdl-nodes_meta.ads | 6 + src/vhdl/vhdl-prints.adb | 13 + src/vhdl/vhdl-sem.adb | 3 + 15 files changed, 1061 insertions(+), 759 deletions(-) diff --git a/python/libghdl/thin/std_names.py b/python/libghdl/thin/std_names.py index 0cc9749b3..68f8aad32 100644 --- a/python/libghdl/thin/std_names.py +++ b/python/libghdl/thin/std_names.py @@ -733,30 +733,30 @@ class Name: Prev = 935 Rose = 936 Strong = 937 - W = 941 - Whilenot = 942 - Within = 943 - X = 944 - Last_PSL = 944 - First_Edif = 945 - Celltype = 955 - View = 956 - Viewtype = 957 - Direction = 958 - Contents = 959 - Net = 960 - Viewref = 961 - Cellref = 962 - Libraryref = 963 - Portinstance = 964 - Joined = 965 - Portref = 966 - Instanceref = 967 - Design = 968 - Designator = 969 - Owner = 970 - Member = 971 - Number = 972 - Rename = 973 - Userdata = 974 - Last_Edif = 974 + W = 938 + Whilenot = 939 + Within = 940 + X = 941 + Last_PSL = 941 + First_Edif = 942 + Celltype = 952 + View = 953 + Viewtype = 954 + Direction = 955 + Contents = 956 + Net = 957 + Viewref = 958 + Cellref = 959 + Libraryref = 960 + Portinstance = 961 + Joined = 962 + Portref = 963 + Instanceref = 964 + Design = 965 + Designator = 966 + Owner = 967 + Member = 968 + Number = 969 + Rename = 970 + Userdata = 971 + Last_Edif = 971 diff --git a/python/libghdl/thin/vhdl/nodes.py b/python/libghdl/thin/vhdl/nodes.py index 3e2ff1972..cd8e269c9 100644 --- a/python/libghdl/thin/vhdl/nodes.py +++ b/python/libghdl/thin/vhdl/nodes.py @@ -85,205 +85,208 @@ class Iir_Kind: Subtype_Definition = 70 Scalar_Nature_Definition = 71 Overload_List = 72 - Type_Declaration = 73 - Anonymous_Type_Declaration = 74 - Subtype_Declaration = 75 - Nature_Declaration = 76 - Subnature_Declaration = 77 - Entity_Declaration = 78 - Configuration_Declaration = 79 - Context_Declaration = 80 - Package_Declaration = 81 - Package_Instantiation_Declaration = 82 - Package_Body = 83 - Architecture_Body = 84 - Package_Header = 85 - Unit_Declaration = 86 - Library_Declaration = 87 - Component_Declaration = 88 - Attribute_Declaration = 89 - Group_Template_Declaration = 90 - Group_Declaration = 91 - Element_Declaration = 92 - Non_Object_Alias_Declaration = 93 - Psl_Declaration = 94 - Psl_Endpoint_Declaration = 95 - Terminal_Declaration = 96 - Free_Quantity_Declaration = 97 - Across_Quantity_Declaration = 98 - Through_Quantity_Declaration = 99 - Enumeration_Literal = 100 - Function_Declaration = 101 - Procedure_Declaration = 102 - Function_Body = 103 - Procedure_Body = 104 - Object_Alias_Declaration = 105 - File_Declaration = 106 - Guard_Signal_Declaration = 107 - Signal_Declaration = 108 - Variable_Declaration = 109 - Constant_Declaration = 110 - Iterator_Declaration = 111 - Interface_Constant_Declaration = 112 - Interface_Variable_Declaration = 113 - Interface_Signal_Declaration = 114 - Interface_File_Declaration = 115 - Interface_Type_Declaration = 116 - Interface_Package_Declaration = 117 - Interface_Function_Declaration = 118 - Interface_Procedure_Declaration = 119 - Anonymous_Signal_Declaration = 120 - Signal_Attribute_Declaration = 121 - Identity_Operator = 122 - Negation_Operator = 123 - Absolute_Operator = 124 - Not_Operator = 125 - Implicit_Condition_Operator = 126 - Condition_Operator = 127 - Reduction_And_Operator = 128 - Reduction_Or_Operator = 129 - Reduction_Nand_Operator = 130 - Reduction_Nor_Operator = 131 - Reduction_Xor_Operator = 132 - Reduction_Xnor_Operator = 133 - And_Operator = 134 - Or_Operator = 135 - Nand_Operator = 136 - Nor_Operator = 137 - Xor_Operator = 138 - Xnor_Operator = 139 - Equality_Operator = 140 - Inequality_Operator = 141 - Less_Than_Operator = 142 - Less_Than_Or_Equal_Operator = 143 - Greater_Than_Operator = 144 - Greater_Than_Or_Equal_Operator = 145 - Match_Equality_Operator = 146 - Match_Inequality_Operator = 147 - Match_Less_Than_Operator = 148 - Match_Less_Than_Or_Equal_Operator = 149 - Match_Greater_Than_Operator = 150 - Match_Greater_Than_Or_Equal_Operator = 151 - Sll_Operator = 152 - Sla_Operator = 153 - Srl_Operator = 154 - Sra_Operator = 155 - Rol_Operator = 156 - Ror_Operator = 157 - Addition_Operator = 158 - Substraction_Operator = 159 - Concatenation_Operator = 160 - Multiplication_Operator = 161 - Division_Operator = 162 - Modulus_Operator = 163 - Remainder_Operator = 164 - Exponentiation_Operator = 165 - Function_Call = 166 - Aggregate = 167 - Parenthesis_Expression = 168 - Qualified_Expression = 169 - Type_Conversion = 170 - Allocator_By_Expression = 171 - Allocator_By_Subtype = 172 - Selected_Element = 173 - Dereference = 174 - Implicit_Dereference = 175 - Slice_Name = 176 - Indexed_Name = 177 - Psl_Expression = 178 - Sensitized_Process_Statement = 179 - Process_Statement = 180 - Concurrent_Simple_Signal_Assignment = 181 - Concurrent_Conditional_Signal_Assignment = 182 - Concurrent_Selected_Signal_Assignment = 183 - Concurrent_Assertion_Statement = 184 - Concurrent_Procedure_Call_Statement = 185 - Psl_Assert_Directive = 186 - Psl_Assume_Directive = 187 - Psl_Cover_Directive = 188 - Psl_Restrict_Directive = 189 - Block_Statement = 190 - If_Generate_Statement = 191 - Case_Generate_Statement = 192 - For_Generate_Statement = 193 - Component_Instantiation_Statement = 194 - Psl_Default_Clock = 195 - Simple_Simultaneous_Statement = 196 - Generate_Statement_Body = 197 - If_Generate_Else_Clause = 198 - Simple_Signal_Assignment_Statement = 199 - Conditional_Signal_Assignment_Statement = 200 - Selected_Waveform_Assignment_Statement = 201 - Null_Statement = 202 - Assertion_Statement = 203 - Report_Statement = 204 - Wait_Statement = 205 - Variable_Assignment_Statement = 206 - Conditional_Variable_Assignment_Statement = 207 - Return_Statement = 208 - For_Loop_Statement = 209 - While_Loop_Statement = 210 - Next_Statement = 211 - Exit_Statement = 212 - Case_Statement = 213 - Procedure_Call_Statement = 214 - If_Statement = 215 - Elsif = 216 - Character_Literal = 217 - Simple_Name = 218 - Selected_Name = 219 - Operator_Symbol = 220 - Reference_Name = 221 - External_Constant_Name = 222 - External_Signal_Name = 223 - External_Variable_Name = 224 - Selected_By_All_Name = 225 - Parenthesis_Name = 226 - Package_Pathname = 227 - Absolute_Pathname = 228 - Relative_Pathname = 229 - Pathname_Element = 230 - Base_Attribute = 231 - Subtype_Attribute = 232 - Element_Attribute = 233 - Left_Type_Attribute = 234 - Right_Type_Attribute = 235 - High_Type_Attribute = 236 - Low_Type_Attribute = 237 - Ascending_Type_Attribute = 238 - Image_Attribute = 239 - Value_Attribute = 240 - Pos_Attribute = 241 - Val_Attribute = 242 - Succ_Attribute = 243 - Pred_Attribute = 244 - Leftof_Attribute = 245 - Rightof_Attribute = 246 - Delayed_Attribute = 247 - Stable_Attribute = 248 - Quiet_Attribute = 249 - Transaction_Attribute = 250 - Event_Attribute = 251 - Active_Attribute = 252 - Last_Event_Attribute = 253 - Last_Active_Attribute = 254 - Last_Value_Attribute = 255 - Driving_Attribute = 256 - Driving_Value_Attribute = 257 - Behavior_Attribute = 258 - Structure_Attribute = 259 - Simple_Name_Attribute = 260 - Instance_Name_Attribute = 261 - Path_Name_Attribute = 262 - Left_Array_Attribute = 263 - Right_Array_Attribute = 264 - High_Array_Attribute = 265 - Low_Array_Attribute = 266 - Length_Array_Attribute = 267 - Ascending_Array_Attribute = 268 - Range_Array_Attribute = 269 - Reverse_Range_Array_Attribute = 270 - Attribute_Name = 271 + Entity_Declaration = 73 + Configuration_Declaration = 74 + Context_Declaration = 75 + Package_Declaration = 76 + Package_Instantiation_Declaration = 77 + Vmode_Declaration = 78 + Vprop_Declaration = 79 + Vunit_Declaration = 80 + Package_Body = 81 + Architecture_Body = 82 + Type_Declaration = 83 + Anonymous_Type_Declaration = 84 + Subtype_Declaration = 85 + Nature_Declaration = 86 + Subnature_Declaration = 87 + Package_Header = 88 + Unit_Declaration = 89 + Library_Declaration = 90 + Component_Declaration = 91 + Attribute_Declaration = 92 + Group_Template_Declaration = 93 + Group_Declaration = 94 + Element_Declaration = 95 + Non_Object_Alias_Declaration = 96 + Psl_Declaration = 97 + Psl_Endpoint_Declaration = 98 + Terminal_Declaration = 99 + Free_Quantity_Declaration = 100 + Across_Quantity_Declaration = 101 + Through_Quantity_Declaration = 102 + Enumeration_Literal = 103 + Function_Declaration = 104 + Procedure_Declaration = 105 + Function_Body = 106 + Procedure_Body = 107 + Object_Alias_Declaration = 108 + File_Declaration = 109 + Guard_Signal_Declaration = 110 + Signal_Declaration = 111 + Variable_Declaration = 112 + Constant_Declaration = 113 + Iterator_Declaration = 114 + Interface_Constant_Declaration = 115 + Interface_Variable_Declaration = 116 + Interface_Signal_Declaration = 117 + Interface_File_Declaration = 118 + Interface_Type_Declaration = 119 + Interface_Package_Declaration = 120 + Interface_Function_Declaration = 121 + Interface_Procedure_Declaration = 122 + Anonymous_Signal_Declaration = 123 + Signal_Attribute_Declaration = 124 + Identity_Operator = 125 + Negation_Operator = 126 + Absolute_Operator = 127 + Not_Operator = 128 + Implicit_Condition_Operator = 129 + Condition_Operator = 130 + Reduction_And_Operator = 131 + Reduction_Or_Operator = 132 + Reduction_Nand_Operator = 133 + Reduction_Nor_Operator = 134 + Reduction_Xor_Operator = 135 + Reduction_Xnor_Operator = 136 + And_Operator = 137 + Or_Operator = 138 + Nand_Operator = 139 + Nor_Operator = 140 + Xor_Operator = 141 + Xnor_Operator = 142 + Equality_Operator = 143 + Inequality_Operator = 144 + Less_Than_Operator = 145 + Less_Than_Or_Equal_Operator = 146 + Greater_Than_Operator = 147 + Greater_Than_Or_Equal_Operator = 148 + Match_Equality_Operator = 149 + Match_Inequality_Operator = 150 + Match_Less_Than_Operator = 151 + Match_Less_Than_Or_Equal_Operator = 152 + Match_Greater_Than_Operator = 153 + Match_Greater_Than_Or_Equal_Operator = 154 + Sll_Operator = 155 + Sla_Operator = 156 + Srl_Operator = 157 + Sra_Operator = 158 + Rol_Operator = 159 + Ror_Operator = 160 + Addition_Operator = 161 + Substraction_Operator = 162 + Concatenation_Operator = 163 + Multiplication_Operator = 164 + Division_Operator = 165 + Modulus_Operator = 166 + Remainder_Operator = 167 + Exponentiation_Operator = 168 + Function_Call = 169 + Aggregate = 170 + Parenthesis_Expression = 171 + Qualified_Expression = 172 + Type_Conversion = 173 + Allocator_By_Expression = 174 + Allocator_By_Subtype = 175 + Selected_Element = 176 + Dereference = 177 + Implicit_Dereference = 178 + Slice_Name = 179 + Indexed_Name = 180 + Psl_Expression = 181 + Sensitized_Process_Statement = 182 + Process_Statement = 183 + Concurrent_Simple_Signal_Assignment = 184 + Concurrent_Conditional_Signal_Assignment = 185 + Concurrent_Selected_Signal_Assignment = 186 + Concurrent_Assertion_Statement = 187 + Concurrent_Procedure_Call_Statement = 188 + Psl_Assert_Directive = 189 + Psl_Assume_Directive = 190 + Psl_Cover_Directive = 191 + Psl_Restrict_Directive = 192 + Block_Statement = 193 + If_Generate_Statement = 194 + Case_Generate_Statement = 195 + For_Generate_Statement = 196 + Component_Instantiation_Statement = 197 + Psl_Default_Clock = 198 + Simple_Simultaneous_Statement = 199 + Generate_Statement_Body = 200 + If_Generate_Else_Clause = 201 + Simple_Signal_Assignment_Statement = 202 + Conditional_Signal_Assignment_Statement = 203 + Selected_Waveform_Assignment_Statement = 204 + Null_Statement = 205 + Assertion_Statement = 206 + Report_Statement = 207 + Wait_Statement = 208 + Variable_Assignment_Statement = 209 + Conditional_Variable_Assignment_Statement = 210 + Return_Statement = 211 + For_Loop_Statement = 212 + While_Loop_Statement = 213 + Next_Statement = 214 + Exit_Statement = 215 + Case_Statement = 216 + Procedure_Call_Statement = 217 + If_Statement = 218 + Elsif = 219 + Character_Literal = 220 + Simple_Name = 221 + Selected_Name = 222 + Operator_Symbol = 223 + Reference_Name = 224 + External_Constant_Name = 225 + External_Signal_Name = 226 + External_Variable_Name = 227 + Selected_By_All_Name = 228 + Parenthesis_Name = 229 + Package_Pathname = 230 + Absolute_Pathname = 231 + Relative_Pathname = 232 + Pathname_Element = 233 + Base_Attribute = 234 + Subtype_Attribute = 235 + Element_Attribute = 236 + Left_Type_Attribute = 237 + Right_Type_Attribute = 238 + High_Type_Attribute = 239 + Low_Type_Attribute = 240 + Ascending_Type_Attribute = 241 + Image_Attribute = 242 + Value_Attribute = 243 + Pos_Attribute = 244 + Val_Attribute = 245 + Succ_Attribute = 246 + Pred_Attribute = 247 + Leftof_Attribute = 248 + Rightof_Attribute = 249 + Delayed_Attribute = 250 + Stable_Attribute = 251 + Quiet_Attribute = 252 + Transaction_Attribute = 253 + Event_Attribute = 254 + Active_Attribute = 255 + Last_Event_Attribute = 256 + Last_Active_Attribute = 257 + Last_Value_Attribute = 258 + Driving_Attribute = 259 + Driving_Value_Attribute = 260 + Behavior_Attribute = 261 + Structure_Attribute = 262 + Simple_Name_Attribute = 263 + Instance_Name_Attribute = 264 + Path_Name_Attribute = 265 + Left_Array_Attribute = 266 + Right_Array_Attribute = 267 + High_Array_Attribute = 268 + Low_Array_Attribute = 269 + Length_Array_Attribute = 270 + Ascending_Array_Attribute = 271 + Range_Array_Attribute = 272 + Reverse_Range_Array_Attribute = 273 + Attribute_Name = 274 class Iir_Kinds: @@ -306,6 +309,9 @@ class Iir_Kinds: Iir_Kind.Context_Declaration, Iir_Kind.Package_Declaration, Iir_Kind.Package_Instantiation_Declaration, + Iir_Kind.Vmode_Declaration, + Iir_Kind.Vprop_Declaration, + Iir_Kind.Vunit_Declaration, Iir_Kind.Package_Body, Iir_Kind.Architecture_Body] @@ -336,13 +342,6 @@ class Iir_Kinds: Iir_Kind.Subtype_Declaration, Iir_Kind.Nature_Declaration, Iir_Kind.Subnature_Declaration, - Iir_Kind.Entity_Declaration, - Iir_Kind.Configuration_Declaration, - Iir_Kind.Context_Declaration, - Iir_Kind.Package_Declaration, - Iir_Kind.Package_Instantiation_Declaration, - Iir_Kind.Package_Body, - Iir_Kind.Architecture_Body, Iir_Kind.Package_Header, Iir_Kind.Unit_Declaration, Iir_Kind.Library_Declaration, @@ -412,7 +411,10 @@ class Iir_Kinds: Iir_Kind.Configuration_Declaration, Iir_Kind.Context_Declaration, Iir_Kind.Package_Declaration, - Iir_Kind.Package_Instantiation_Declaration] + Iir_Kind.Package_Instantiation_Declaration, + Iir_Kind.Vmode_Declaration, + Iir_Kind.Vprop_Declaration, + Iir_Kind.Vunit_Declaration] Record_Choice = [ Iir_Kind.Choice_By_Others, @@ -423,6 +425,11 @@ class Iir_Kinds: Iir_Kind.Enumeration_Literal, Iir_Kind.Function_Declaration] + Verification_Unit = [ + Iir_Kind.Vmode_Declaration, + Iir_Kind.Vprop_Declaration, + Iir_Kind.Vunit_Declaration] + Secondary_Unit = [ Iir_Kind.Package_Body, Iir_Kind.Architecture_Body] @@ -1477,6 +1484,18 @@ Get_Need_Instance_Bodies = libghdl.vhdl__nodes__get_need_instance_bodies Set_Need_Instance_Bodies = libghdl.vhdl__nodes__set_need_instance_bodies +Get_Hierarchical_Name = libghdl.vhdl__nodes__get_hierarchical_name + +Set_Hierarchical_Name = libghdl.vhdl__nodes__set_hierarchical_name + +Get_Inherit_Spec_Chain = libghdl.vhdl__nodes__get_inherit_spec_chain + +Set_Inherit_Spec_Chain = libghdl.vhdl__nodes__set_inherit_spec_chain + +Get_Vunit_Item_Chain = libghdl.vhdl__nodes__get_vunit_item_chain + +Set_Vunit_Item_Chain = libghdl.vhdl__nodes__set_vunit_item_chain + Get_Block_Configuration = libghdl.vhdl__nodes__get_block_configuration Set_Block_Configuration = libghdl.vhdl__nodes__set_block_configuration diff --git a/python/libghdl/thin/vhdl/nodes_meta.py b/python/libghdl/thin/vhdl/nodes_meta.py index 97a8cab8b..d1fa8aba4 100644 --- a/python/libghdl/thin/vhdl/nodes_meta.py +++ b/python/libghdl/thin/vhdl/nodes_meta.py @@ -142,251 +142,254 @@ class fields: Need_Body = 78 Macro_Expanded_Flag = 79 Need_Instance_Bodies = 80 - Block_Configuration = 81 - Concurrent_Statement_Chain = 82 - Chain = 83 - Port_Chain = 84 - Generic_Chain = 85 - Type = 86 - Subtype_Indication = 87 - Discrete_Range = 88 - Type_Definition = 89 - Subtype_Definition = 90 - Incomplete_Type_Declaration = 91 - Interface_Type_Subprograms = 92 - Nature = 93 - Mode = 94 - Guarded_Signal_Flag = 95 - Signal_Kind = 96 - Base_Name = 97 - Interface_Declaration_Chain = 98 - Subprogram_Specification = 99 - Sequential_Statement_Chain = 100 - Subprogram_Body = 101 - Overload_Number = 102 - Subprogram_Depth = 103 - Subprogram_Hash = 104 - Impure_Depth = 105 - Return_Type = 106 - Implicit_Definition = 107 - Default_Value = 108 - Deferred_Declaration = 109 - Deferred_Declaration_Flag = 110 - Shared_Flag = 111 - Design_Unit = 112 - Block_Statement = 113 - Signal_Driver = 114 - Declaration_Chain = 115 - File_Logical_Name = 116 - File_Open_Kind = 117 - Element_Position = 118 - Use_Clause_Chain = 119 - Context_Reference_Chain = 120 - Selected_Name = 121 - Type_Declarator = 122 - Complete_Type_Definition = 123 - Incomplete_Type_Ref_Chain = 124 - Associated_Type = 125 - Enumeration_Literal_List = 126 - Entity_Class_Entry_Chain = 127 - Group_Constituent_List = 128 - Unit_Chain = 129 - Primary_Unit = 130 - Identifier = 131 - Label = 132 - Visible_Flag = 133 - Range_Constraint = 134 - Direction = 135 - Left_Limit = 136 - Right_Limit = 137 - Left_Limit_Expr = 138 - Right_Limit_Expr = 139 - Base_Type = 140 - Resolution_Indication = 141 - Record_Element_Resolution_Chain = 142 - Tolerance = 143 - Plus_Terminal = 144 - Minus_Terminal = 145 - Simultaneous_Left = 146 - Simultaneous_Right = 147 - Text_File_Flag = 148 - Only_Characters_Flag = 149 - Is_Character_Type = 150 - Type_Staticness = 151 - Constraint_State = 152 - Index_Subtype_List = 153 - Index_Subtype_Definition_List = 154 - Element_Subtype_Indication = 155 - Element_Subtype = 156 - Index_Constraint_List = 157 - Array_Element_Constraint = 158 - Elements_Declaration_List = 159 - Owned_Elements_Chain = 160 - Designated_Type = 161 - Designated_Subtype_Indication = 162 - Index_List = 163 - Reference = 164 - Nature_Declarator = 165 - Across_Type = 166 - Through_Type = 167 - Target = 168 - Waveform_Chain = 169 - Guard = 170 - Delay_Mechanism = 171 - Reject_Time_Expression = 172 - Sensitivity_List = 173 - Process_Origin = 174 - Package_Origin = 175 - Condition_Clause = 176 - Timeout_Clause = 177 - Postponed_Flag = 178 - Callees_List = 179 - Passive_Flag = 180 - Resolution_Function_Flag = 181 - Wait_State = 182 - All_Sensitized_State = 183 - Seen_Flag = 184 - Pure_Flag = 185 - Foreign_Flag = 186 - Resolved_Flag = 187 - Signal_Type_Flag = 188 - Has_Signal_Flag = 189 - Purity_State = 190 - Elab_Flag = 191 - Configuration_Mark_Flag = 192 - Configuration_Done_Flag = 193 - Index_Constraint_Flag = 194 - Hide_Implicit_Flag = 195 - Assertion_Condition = 196 - Report_Expression = 197 - Severity_Expression = 198 - Instantiated_Unit = 199 - Generic_Map_Aspect_Chain = 200 - Port_Map_Aspect_Chain = 201 - Configuration_Name = 202 - Component_Configuration = 203 - Configuration_Specification = 204 - Default_Binding_Indication = 205 - Default_Configuration_Declaration = 206 - Expression = 207 - Conditional_Expression = 208 - Allocator_Designated_Type = 209 - Selected_Waveform_Chain = 210 - Conditional_Waveform_Chain = 211 - Guard_Expression = 212 - Guard_Decl = 213 - Guard_Sensitivity_List = 214 - Signal_Attribute_Chain = 215 - Block_Block_Configuration = 216 - Package_Header = 217 - Block_Header = 218 - Uninstantiated_Package_Name = 219 - Uninstantiated_Package_Decl = 220 - Instance_Source_File = 221 - Generate_Block_Configuration = 222 - Generate_Statement_Body = 223 - Alternative_Label = 224 - Generate_Else_Clause = 225 - Condition = 226 - Else_Clause = 227 - Parameter_Specification = 228 - Parent = 229 - Loop_Label = 230 - Component_Name = 231 - Instantiation_List = 232 - Entity_Aspect = 233 - Default_Entity_Aspect = 234 - Binding_Indication = 235 - Named_Entity = 236 - Alias_Declaration = 237 - Referenced_Name = 238 - Expr_Staticness = 239 - Error_Origin = 240 - Operand = 241 - Left = 242 - Right = 243 - Unit_Name = 244 - Name = 245 - Group_Template_Name = 246 - Name_Staticness = 247 - Prefix = 248 - Signature_Prefix = 249 - External_Pathname = 250 - Pathname_Suffix = 251 - Pathname_Expression = 252 - In_Formal_Flag = 253 - Slice_Subtype = 254 - Suffix = 255 - Index_Subtype = 256 - Parameter = 257 - Attr_Chain = 258 - Signal_Attribute_Declaration = 259 - Actual_Type = 260 - Actual_Type_Definition = 261 - Association_Chain = 262 - Individual_Association_Chain = 263 - Subprogram_Association_Chain = 264 - Aggregate_Info = 265 - Sub_Aggregate_Info = 266 - Aggr_Dynamic_Flag = 267 - Aggr_Min_Length = 268 - Aggr_Low_Limit = 269 - Aggr_High_Limit = 270 - Aggr_Others_Flag = 271 - Aggr_Named_Flag = 272 - Aggregate_Expand_Flag = 273 - Association_Choices_Chain = 274 - Case_Statement_Alternative_Chain = 275 - Choice_Staticness = 276 - Procedure_Call = 277 - Implementation = 278 - Parameter_Association_Chain = 279 - Method_Object = 280 - Subtype_Type_Mark = 281 - Type_Conversion_Subtype = 282 - Type_Mark = 283 - File_Type_Mark = 284 - Return_Type_Mark = 285 - Has_Disconnect_Flag = 286 - Has_Active_Flag = 287 - Is_Within_Flag = 288 - Type_Marks_List = 289 - Implicit_Alias_Flag = 290 - Alias_Signature = 291 - Attribute_Signature = 292 - Overload_List = 293 - Simple_Name_Identifier = 294 - Simple_Name_Subtype = 295 - Protected_Type_Body = 296 - Protected_Type_Declaration = 297 - Use_Flag = 298 - End_Has_Reserved_Id = 299 - End_Has_Identifier = 300 - End_Has_Postponed = 301 - Has_Label = 302 - Has_Begin = 303 - Has_End = 304 - Has_Is = 305 - Has_Pure = 306 - Has_Body = 307 - Has_Parameter = 308 - Has_Component = 309 - Has_Identifier_List = 310 - Has_Mode = 311 - Has_Class = 312 - Suspend_Flag = 313 - Is_Ref = 314 - Is_Forward_Ref = 315 - Psl_Property = 316 - Psl_Sequence = 317 - Psl_Declaration = 318 - Psl_Expression = 319 - Psl_Boolean = 320 - PSL_Clock = 321 - PSL_NFA = 322 - PSL_Nbr_States = 323 - PSL_Clock_Sensitivity = 324 - PSL_EOS_Flag = 325 + Hierarchical_Name = 81 + Inherit_Spec_Chain = 82 + Vunit_Item_Chain = 83 + Block_Configuration = 84 + Concurrent_Statement_Chain = 85 + Chain = 86 + Port_Chain = 87 + Generic_Chain = 88 + Type = 89 + Subtype_Indication = 90 + Discrete_Range = 91 + Type_Definition = 92 + Subtype_Definition = 93 + Incomplete_Type_Declaration = 94 + Interface_Type_Subprograms = 95 + Nature = 96 + Mode = 97 + Guarded_Signal_Flag = 98 + Signal_Kind = 99 + Base_Name = 100 + Interface_Declaration_Chain = 101 + Subprogram_Specification = 102 + Sequential_Statement_Chain = 103 + Subprogram_Body = 104 + Overload_Number = 105 + Subprogram_Depth = 106 + Subprogram_Hash = 107 + Impure_Depth = 108 + Return_Type = 109 + Implicit_Definition = 110 + Default_Value = 111 + Deferred_Declaration = 112 + Deferred_Declaration_Flag = 113 + Shared_Flag = 114 + Design_Unit = 115 + Block_Statement = 116 + Signal_Driver = 117 + Declaration_Chain = 118 + File_Logical_Name = 119 + File_Open_Kind = 120 + Element_Position = 121 + Use_Clause_Chain = 122 + Context_Reference_Chain = 123 + Selected_Name = 124 + Type_Declarator = 125 + Complete_Type_Definition = 126 + Incomplete_Type_Ref_Chain = 127 + Associated_Type = 128 + Enumeration_Literal_List = 129 + Entity_Class_Entry_Chain = 130 + Group_Constituent_List = 131 + Unit_Chain = 132 + Primary_Unit = 133 + Identifier = 134 + Label = 135 + Visible_Flag = 136 + Range_Constraint = 137 + Direction = 138 + Left_Limit = 139 + Right_Limit = 140 + Left_Limit_Expr = 141 + Right_Limit_Expr = 142 + Base_Type = 143 + Resolution_Indication = 144 + Record_Element_Resolution_Chain = 145 + Tolerance = 146 + Plus_Terminal = 147 + Minus_Terminal = 148 + Simultaneous_Left = 149 + Simultaneous_Right = 150 + Text_File_Flag = 151 + Only_Characters_Flag = 152 + Is_Character_Type = 153 + Type_Staticness = 154 + Constraint_State = 155 + Index_Subtype_List = 156 + Index_Subtype_Definition_List = 157 + Element_Subtype_Indication = 158 + Element_Subtype = 159 + Index_Constraint_List = 160 + Array_Element_Constraint = 161 + Elements_Declaration_List = 162 + Owned_Elements_Chain = 163 + Designated_Type = 164 + Designated_Subtype_Indication = 165 + Index_List = 166 + Reference = 167 + Nature_Declarator = 168 + Across_Type = 169 + Through_Type = 170 + Target = 171 + Waveform_Chain = 172 + Guard = 173 + Delay_Mechanism = 174 + Reject_Time_Expression = 175 + Sensitivity_List = 176 + Process_Origin = 177 + Package_Origin = 178 + Condition_Clause = 179 + Timeout_Clause = 180 + Postponed_Flag = 181 + Callees_List = 182 + Passive_Flag = 183 + Resolution_Function_Flag = 184 + Wait_State = 185 + All_Sensitized_State = 186 + Seen_Flag = 187 + Pure_Flag = 188 + Foreign_Flag = 189 + Resolved_Flag = 190 + Signal_Type_Flag = 191 + Has_Signal_Flag = 192 + Purity_State = 193 + Elab_Flag = 194 + Configuration_Mark_Flag = 195 + Configuration_Done_Flag = 196 + Index_Constraint_Flag = 197 + Hide_Implicit_Flag = 198 + Assertion_Condition = 199 + Report_Expression = 200 + Severity_Expression = 201 + Instantiated_Unit = 202 + Generic_Map_Aspect_Chain = 203 + Port_Map_Aspect_Chain = 204 + Configuration_Name = 205 + Component_Configuration = 206 + Configuration_Specification = 207 + Default_Binding_Indication = 208 + Default_Configuration_Declaration = 209 + Expression = 210 + Conditional_Expression = 211 + Allocator_Designated_Type = 212 + Selected_Waveform_Chain = 213 + Conditional_Waveform_Chain = 214 + Guard_Expression = 215 + Guard_Decl = 216 + Guard_Sensitivity_List = 217 + Signal_Attribute_Chain = 218 + Block_Block_Configuration = 219 + Package_Header = 220 + Block_Header = 221 + Uninstantiated_Package_Name = 222 + Uninstantiated_Package_Decl = 223 + Instance_Source_File = 224 + Generate_Block_Configuration = 225 + Generate_Statement_Body = 226 + Alternative_Label = 227 + Generate_Else_Clause = 228 + Condition = 229 + Else_Clause = 230 + Parameter_Specification = 231 + Parent = 232 + Loop_Label = 233 + Component_Name = 234 + Instantiation_List = 235 + Entity_Aspect = 236 + Default_Entity_Aspect = 237 + Binding_Indication = 238 + Named_Entity = 239 + Alias_Declaration = 240 + Referenced_Name = 241 + Expr_Staticness = 242 + Error_Origin = 243 + Operand = 244 + Left = 245 + Right = 246 + Unit_Name = 247 + Name = 248 + Group_Template_Name = 249 + Name_Staticness = 250 + Prefix = 251 + Signature_Prefix = 252 + External_Pathname = 253 + Pathname_Suffix = 254 + Pathname_Expression = 255 + In_Formal_Flag = 256 + Slice_Subtype = 257 + Suffix = 258 + Index_Subtype = 259 + Parameter = 260 + Attr_Chain = 261 + Signal_Attribute_Declaration = 262 + Actual_Type = 263 + Actual_Type_Definition = 264 + Association_Chain = 265 + Individual_Association_Chain = 266 + Subprogram_Association_Chain = 267 + Aggregate_Info = 268 + Sub_Aggregate_Info = 269 + Aggr_Dynamic_Flag = 270 + Aggr_Min_Length = 271 + Aggr_Low_Limit = 272 + Aggr_High_Limit = 273 + Aggr_Others_Flag = 274 + Aggr_Named_Flag = 275 + Aggregate_Expand_Flag = 276 + Association_Choices_Chain = 277 + Case_Statement_Alternative_Chain = 278 + Choice_Staticness = 279 + Procedure_Call = 280 + Implementation = 281 + Parameter_Association_Chain = 282 + Method_Object = 283 + Subtype_Type_Mark = 284 + Type_Conversion_Subtype = 285 + Type_Mark = 286 + File_Type_Mark = 287 + Return_Type_Mark = 288 + Has_Disconnect_Flag = 289 + Has_Active_Flag = 290 + Is_Within_Flag = 291 + Type_Marks_List = 292 + Implicit_Alias_Flag = 293 + Alias_Signature = 294 + Attribute_Signature = 295 + Overload_List = 296 + Simple_Name_Identifier = 297 + Simple_Name_Subtype = 298 + Protected_Type_Body = 299 + Protected_Type_Declaration = 300 + Use_Flag = 301 + End_Has_Reserved_Id = 302 + End_Has_Identifier = 303 + End_Has_Postponed = 304 + Has_Label = 305 + Has_Begin = 306 + Has_End = 307 + Has_Is = 308 + Has_Pure = 309 + Has_Body = 310 + Has_Parameter = 311 + Has_Component = 312 + Has_Identifier_List = 313 + Has_Mode = 314 + Has_Class = 315 + Suspend_Flag = 316 + Is_Ref = 317 + Is_Forward_Ref = 318 + Psl_Property = 319 + Psl_Sequence = 320 + Psl_Declaration = 321 + Psl_Expression = 322 + Psl_Boolean = 323 + PSL_Clock = 324 + PSL_NFA = 325 + PSL_Nbr_States = 326 + PSL_Clock_Sensitivity = 327 + PSL_EOS_Flag = 328 Get_Boolean = libghdl.vhdl__nodes_meta__get_boolean @@ -695,6 +698,15 @@ Has_Macro_Expanded_Flag =\ Has_Need_Instance_Bodies =\ libghdl.vhdl__nodes_meta__has_need_instance_bodies +Has_Hierarchical_Name =\ + libghdl.vhdl__nodes_meta__has_hierarchical_name + +Has_Inherit_Spec_Chain =\ + libghdl.vhdl__nodes_meta__has_inherit_spec_chain + +Has_Vunit_Item_Chain =\ + libghdl.vhdl__nodes_meta__has_vunit_item_chain + Has_Block_Configuration =\ libghdl.vhdl__nodes_meta__has_block_configuration diff --git a/src/synth/synthesis.adb b/src/synth/synthesis.adb index 7ebb9602e..a84b4976a 100644 --- a/src/synth/synthesis.adb +++ b/src/synth/synthesis.adb @@ -102,6 +102,8 @@ package body Synthesis is null; when Iir_Kind_Architecture_Body => null; + when Iir_Kinds_Verification_Unit => + null; end case; end if; Next (Dep_It); diff --git a/src/vhdl/vhdl-configuration.adb b/src/vhdl/vhdl-configuration.adb index 8911c93dd..34f1dfbe7 100644 --- a/src/vhdl/vhdl-configuration.adb +++ b/src/vhdl/vhdl-configuration.adb @@ -801,6 +801,7 @@ package body Vhdl.Configuration is when Iir_Kind_Package_Declaration | Iir_Kind_Package_Instantiation_Declaration | Iir_Kind_Package_Body + | Iir_Kinds_Verification_Unit | Iir_Kind_Context_Declaration => null; end case; @@ -901,6 +902,7 @@ package body Vhdl.Configuration is | Iir_Kind_Package_Instantiation_Declaration | Iir_Kind_Package_Body | Iir_Kind_Entity_Declaration + | Iir_Kinds_Verification_Unit | Iir_Kind_Context_Declaration => null; end case; diff --git a/src/vhdl/vhdl-elocations.adb b/src/vhdl/vhdl-elocations.adb index 6965457d6..a42d5e009 100644 --- a/src/vhdl/vhdl-elocations.adb +++ b/src/vhdl/vhdl-elocations.adb @@ -266,6 +266,9 @@ package body Vhdl.Elocations is | Iir_Kind_Subtype_Definition | Iir_Kind_Scalar_Nature_Definition | Iir_Kind_Overload_List + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Nature_Declaration | Iir_Kind_Subnature_Declaration | Iir_Kind_Unit_Declaration @@ -469,9 +472,9 @@ package body Vhdl.Elocations is | Iir_Kind_If_Statement | Iir_Kind_Elsif => return Format_L3; - when Iir_Kind_Type_Declaration + when Iir_Kind_Architecture_Body + | Iir_Kind_Type_Declaration | Iir_Kind_Subtype_Declaration - | Iir_Kind_Architecture_Body | Iir_Kind_Function_Body | Iir_Kind_Procedure_Body | Iir_Kind_Sensitized_Process_Statement diff --git a/src/vhdl/vhdl-elocations.ads b/src/vhdl/vhdl-elocations.ads index 84be78e93..fd2401289 100644 --- a/src/vhdl/vhdl-elocations.ads +++ b/src/vhdl/vhdl-elocations.ads @@ -177,6 +177,10 @@ package Vhdl.Elocations is -- -- Get/Set_End_Location (Field2) + -- Iir_Kind_Vunit_Declaration (None) + -- Iir_Kind_Vmode_Declaration (None) + -- Iir_Kind_Vprop_Declaration (None) + -- Iir_Kind_Library_Declaration (None) -- Iir_Kind_Component_Declaration (L6) diff --git a/src/vhdl/vhdl-elocations_meta.adb b/src/vhdl/vhdl-elocations_meta.adb index 0b993f62c..d8e8eb69a 100644 --- a/src/vhdl/vhdl-elocations_meta.adb +++ b/src/vhdl/vhdl-elocations_meta.adb @@ -153,9 +153,6 @@ package body Vhdl.Elocations_Meta is | Iir_Kind_Attribute_Specification | Iir_Kind_Protected_Type_Declaration | Iir_Kind_Protected_Type_Body - | Iir_Kind_Type_Declaration - | Iir_Kind_Anonymous_Type_Declaration - | Iir_Kind_Subtype_Declaration | Iir_Kind_Entity_Declaration | Iir_Kind_Configuration_Declaration | Iir_Kind_Context_Declaration @@ -163,6 +160,9 @@ package body Vhdl.Elocations_Meta is | Iir_Kind_Package_Instantiation_Declaration | Iir_Kind_Package_Body | Iir_Kind_Architecture_Body + | Iir_Kind_Type_Declaration + | Iir_Kind_Anonymous_Type_Declaration + | Iir_Kind_Subtype_Declaration | Iir_Kind_Component_Declaration | Iir_Kind_Attribute_Declaration | Iir_Kind_Group_Template_Declaration @@ -244,10 +244,10 @@ package body Vhdl.Elocations_Meta is function Has_Is_Location (K : Iir_Kind) return Boolean is begin case K is - when Iir_Kind_Type_Declaration - | Iir_Kind_Subtype_Declaration - | Iir_Kind_Entity_Declaration + when Iir_Kind_Entity_Declaration | Iir_Kind_Architecture_Body + | Iir_Kind_Type_Declaration + | Iir_Kind_Subtype_Declaration | Iir_Kind_Function_Body | Iir_Kind_Procedure_Body | Iir_Kind_Sensitized_Process_Statement diff --git a/src/vhdl/vhdl-errors.adb b/src/vhdl/vhdl-errors.adb index ada8258af..b9183fbbc 100644 --- a/src/vhdl/vhdl-errors.adb +++ b/src/vhdl/vhdl-errors.adb @@ -512,6 +512,12 @@ package body Vhdl.Errors is return Disp_Identifier (Node, "context"); when Iir_Kind_Package_Instantiation_Declaration => return Disp_Identifier (Node, "instantiation package"); + when Iir_Kind_Vmode_Declaration => + return Disp_Identifier (Node, "vmode"); + when Iir_Kind_Vprop_Declaration => + return Disp_Identifier (Node, "vprop"); + when Iir_Kind_Vunit_Declaration => + return Disp_Identifier (Node, "vunit"); when Iir_Kind_Package_Header => return "package header"; diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb index 0755f61dc..5bf1e00ed 100644 --- a/src/vhdl/vhdl-nodes.adb +++ b/src/vhdl/vhdl-nodes.adb @@ -1032,14 +1032,17 @@ package body Vhdl.Nodes is | Iir_Kind_Protected_Type_Body | Iir_Kind_Wildcard_Type_Definition | Iir_Kind_Overload_List + | Iir_Kind_Configuration_Declaration + | Iir_Kind_Context_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration + | Iir_Kind_Package_Body | Iir_Kind_Type_Declaration | Iir_Kind_Anonymous_Type_Declaration | Iir_Kind_Subtype_Declaration | Iir_Kind_Nature_Declaration | Iir_Kind_Subnature_Declaration - | Iir_Kind_Configuration_Declaration - | Iir_Kind_Context_Declaration - | Iir_Kind_Package_Body | Iir_Kind_Unit_Declaration | Iir_Kind_Library_Declaration | Iir_Kind_Attribute_Declaration @@ -2616,6 +2619,54 @@ package body Vhdl.Nodes is Set_Flag3 (Decl, Flag); end Set_Need_Instance_Bodies; + function Get_Hierarchical_Name (Vunit : Iir) return Iir is + begin + pragma Assert (Vunit /= Null_Iir); + pragma Assert (Has_Hierarchical_Name (Get_Kind (Vunit)), + "no field Hierarchical_Name"); + return Get_Field1 (Vunit); + end Get_Hierarchical_Name; + + procedure Set_Hierarchical_Name (Vunit : Iir; Name : Iir) is + begin + pragma Assert (Vunit /= Null_Iir); + pragma Assert (Has_Hierarchical_Name (Get_Kind (Vunit)), + "no field Hierarchical_Name"); + Set_Field1 (Vunit, Name); + end Set_Hierarchical_Name; + + function Get_Inherit_Spec_Chain (Vunit : Iir) return Iir is + begin + pragma Assert (Vunit /= Null_Iir); + pragma Assert (Has_Inherit_Spec_Chain (Get_Kind (Vunit)), + "no field Inherit_Spec_Chain"); + return Get_Field2 (Vunit); + end Get_Inherit_Spec_Chain; + + procedure Set_Inherit_Spec_Chain (Vunit : Iir; Chain : Iir) is + begin + pragma Assert (Vunit /= Null_Iir); + pragma Assert (Has_Inherit_Spec_Chain (Get_Kind (Vunit)), + "no field Inherit_Spec_Chain"); + Set_Field2 (Vunit, Chain); + end Set_Inherit_Spec_Chain; + + function Get_Vunit_Item_Chain (Vunit : Iir) return Iir is + begin + pragma Assert (Vunit /= Null_Iir); + pragma Assert (Has_Vunit_Item_Chain (Get_Kind (Vunit)), + "no field Vunit_Item_Chain"); + return Get_Field4 (Vunit); + end Get_Vunit_Item_Chain; + + procedure Set_Vunit_Item_Chain (Vunit : Iir; Chain : Iir) is + begin + pragma Assert (Vunit /= Null_Iir); + pragma Assert (Has_Vunit_Item_Chain (Get_Kind (Vunit)), + "no field Vunit_Item_Chain"); + Set_Field4 (Vunit, Chain); + end Set_Vunit_Item_Chain; + function Get_Block_Configuration (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 d34c325ae..744e5c88c 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -1052,6 +1052,31 @@ package Vhdl.Nodes is -- -- Get/Set_Visible_Flag (Flag4) + -- Iir_Kind_Vunit_Declaration (Short) + -- Iir_Kind_Vmode_Declaration (Short) + -- Iir_Kind_Vprop_Declaration (Short) + -- + -- Get/Set_Parent (Field0) + -- Get/Set_Design_Unit (Alias Field0) + -- + -- Get/Set_Identifier (Field3) + -- + -- Get/Set_Hierarchical_Name (Field1) + -- + -- Get/Set_Inherit_Spec_Chain (Field2) + -- + -- Get/Set_Vunit_Item_Chain (Field4) + -- + -- Get/Set_Visible_Flag (Flag4) + -- + -- Get/Set_Is_Within_Flag (Flag5) + -- + -- Get/Set_End_Has_Reserved_Id (Flag8) + -- + -- Get/Set_End_Has_Identifier (Flag9) + -- + -- Get/Set_Has_Begin (Flag10) + -- Iir_Kind_Component_Declaration (Medium) -- -- Get/Set_Parent (Field0) @@ -4236,18 +4261,22 @@ package Vhdl.Nodes is Iir_Kind_Overload_List, -- used internally by sem_expr. -- Declarations. - Iir_Kind_Type_Declaration, - Iir_Kind_Anonymous_Type_Declaration, - Iir_Kind_Subtype_Declaration, - Iir_Kind_Nature_Declaration, - Iir_Kind_Subnature_Declaration, Iir_Kind_Entity_Declaration, Iir_Kind_Configuration_Declaration, Iir_Kind_Context_Declaration, Iir_Kind_Package_Declaration, Iir_Kind_Package_Instantiation_Declaration, + Iir_Kind_Vmode_Declaration, + Iir_Kind_Vprop_Declaration, + Iir_Kind_Vunit_Declaration, Iir_Kind_Package_Body, Iir_Kind_Architecture_Body, + + Iir_Kind_Type_Declaration, + Iir_Kind_Anonymous_Type_Declaration, + Iir_Kind_Subtype_Declaration, + Iir_Kind_Nature_Declaration, + Iir_Kind_Subnature_Declaration, Iir_Kind_Package_Header, Iir_Kind_Unit_Declaration, Iir_Kind_Library_Declaration, @@ -5155,6 +5184,9 @@ package Vhdl.Nodes is --Iir_Kind_Context_Declaration --Iir_Kind_Package_Declaration --Iir_Kind_Package_Instantiation_Declaration + --Iir_Kind_Vmode_Declaration + --Iir_Kind_Vprop_Declaration + --Iir_Kind_Vunit_Declaration --Iir_Kind_Package_Body Iir_Kind_Architecture_Body; @@ -5163,7 +5195,10 @@ package Vhdl.Nodes is --Iir_Kind_Configuration_Declaration --Iir_Kind_Context_Declaration --Iir_Kind_Package_Declaration - Iir_Kind_Package_Instantiation_Declaration; + --Iir_Kind_Package_Instantiation_Declaration + --Iir_Kind_Vmode_Declaration + --Iir_Kind_Vprop_Declaration + Iir_Kind_Vunit_Declaration; subtype Iir_Kinds_Secondary_Unit is Iir_Kind range Iir_Kind_Package_Body .. @@ -5173,6 +5208,11 @@ package Vhdl.Nodes is Iir_Kind_Package_Declaration .. Iir_Kind_Package_Instantiation_Declaration; + subtype Iir_Kinds_Verification_Unit is Iir_Kind range + Iir_Kind_Vmode_Declaration .. + --Iir_Kind_Vprop_Declaration + Iir_Kind_Vunit_Declaration; + -- Note: does not include iir_kind_enumeration_literal since it is -- considered as a declaration. subtype Iir_Kinds_Literal is Iir_Kind range @@ -6496,6 +6536,18 @@ package Vhdl.Nodes is function Get_Need_Instance_Bodies (Decl : Iir) return Boolean; procedure Set_Need_Instance_Bodies (Decl : Iir; Flag : Boolean); + -- Field: Field1 + function Get_Hierarchical_Name (Vunit : Iir) return Iir; + procedure Set_Hierarchical_Name (Vunit : Iir; Name : Iir); + + -- Field: Field2 Chain + function Get_Inherit_Spec_Chain (Vunit : Iir) return Iir; + procedure Set_Inherit_Spec_Chain (Vunit : Iir; Chain : Iir); + + -- Field: Field4 Chain + function Get_Vunit_Item_Chain (Vunit : Iir) return Iir; + procedure Set_Vunit_Item_Chain (Vunit : Iir; Chain : Iir); + -- Field: Field5 function Get_Block_Configuration (Target : Iir) return Iir; procedure Set_Block_Configuration (Target : Iir; Block : Iir); diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb index 9b3723c58..ad17a56ee 100644 --- a/src/vhdl/vhdl-nodes_meta.adb +++ b/src/vhdl/vhdl-nodes_meta.adb @@ -100,6 +100,9 @@ package body Vhdl.Nodes_Meta is Field_Need_Body => Type_Boolean, Field_Macro_Expanded_Flag => Type_Boolean, Field_Need_Instance_Bodies => Type_Boolean, + Field_Hierarchical_Name => Type_Iir, + Field_Inherit_Spec_Chain => Type_Iir, + Field_Vunit_Item_Chain => Type_Iir, Field_Block_Configuration => Type_Iir, Field_Concurrent_Statement_Chain => Type_Iir, Field_Chain => Type_Iir, @@ -517,6 +520,12 @@ package body Vhdl.Nodes_Meta is return "macro_expanded_flag"; when Field_Need_Instance_Bodies => return "need_instance_bodies"; + when Field_Hierarchical_Name => + return "hierarchical_name"; + when Field_Inherit_Spec_Chain => + return "inherit_spec_chain"; + when Field_Vunit_Item_Chain => + return "vunit_item_chain"; when Field_Block_Configuration => return "block_configuration"; when Field_Concurrent_Statement_Chain => @@ -1159,16 +1168,6 @@ package body Vhdl.Nodes_Meta is return "scalar_nature_definition"; when Iir_Kind_Overload_List => return "overload_list"; - when Iir_Kind_Type_Declaration => - return "type_declaration"; - when Iir_Kind_Anonymous_Type_Declaration => - return "anonymous_type_declaration"; - when Iir_Kind_Subtype_Declaration => - return "subtype_declaration"; - when Iir_Kind_Nature_Declaration => - return "nature_declaration"; - when Iir_Kind_Subnature_Declaration => - return "subnature_declaration"; when Iir_Kind_Entity_Declaration => return "entity_declaration"; when Iir_Kind_Configuration_Declaration => @@ -1179,10 +1178,26 @@ package body Vhdl.Nodes_Meta is return "package_declaration"; when Iir_Kind_Package_Instantiation_Declaration => return "package_instantiation_declaration"; + when Iir_Kind_Vmode_Declaration => + return "vmode_declaration"; + when Iir_Kind_Vprop_Declaration => + return "vprop_declaration"; + when Iir_Kind_Vunit_Declaration => + return "vunit_declaration"; when Iir_Kind_Package_Body => return "package_body"; when Iir_Kind_Architecture_Body => return "architecture_body"; + when Iir_Kind_Type_Declaration => + return "type_declaration"; + when Iir_Kind_Anonymous_Type_Declaration => + return "anonymous_type_declaration"; + when Iir_Kind_Subtype_Declaration => + return "subtype_declaration"; + when Iir_Kind_Nature_Declaration => + return "nature_declaration"; + when Iir_Kind_Subnature_Declaration => + return "subnature_declaration"; when Iir_Kind_Package_Header => return "package_header"; when Iir_Kind_Unit_Declaration => @@ -1725,6 +1740,12 @@ package body Vhdl.Nodes_Meta is return Attr_None; when Field_Need_Instance_Bodies => return Attr_None; + when Field_Hierarchical_Name => + return Attr_None; + when Field_Inherit_Spec_Chain => + return Attr_Chain; + when Field_Vunit_Item_Chain => + return Attr_Chain; when Field_Block_Configuration => return Attr_None; when Field_Concurrent_Statement_Chain => @@ -2763,43 +2784,6 @@ package body Vhdl.Nodes_Meta is Field_Through_Type, -- Iir_Kind_Overload_List Field_Overload_List, - -- Iir_Kind_Type_Declaration - Field_Identifier, - Field_Visible_Flag, - Field_Use_Flag, - Field_Parent, - Field_Type_Definition, - Field_Chain, - Field_Incomplete_Type_Declaration, - -- Iir_Kind_Anonymous_Type_Declaration - Field_Identifier, - Field_Parent, - Field_Type_Definition, - Field_Chain, - Field_Subtype_Definition, - Field_Incomplete_Type_Declaration, - -- Iir_Kind_Subtype_Declaration - Field_Identifier, - Field_Visible_Flag, - Field_Use_Flag, - Field_Parent, - Field_Chain, - Field_Subtype_Indication, - Field_Type, - -- Iir_Kind_Nature_Declaration - Field_Identifier, - Field_Visible_Flag, - Field_Use_Flag, - Field_Parent, - Field_Nature, - Field_Chain, - -- Iir_Kind_Subnature_Declaration - Field_Identifier, - Field_Visible_Flag, - Field_Use_Flag, - Field_Parent, - Field_Nature, - Field_Chain, -- Iir_Kind_Entity_Declaration Field_Identifier, Field_Has_Begin, @@ -2861,6 +2845,39 @@ package body Vhdl.Nodes_Meta is Field_Chain, Field_Attribute_Value_Chain, Field_Instance_Package_Body, + -- Iir_Kind_Vmode_Declaration + Field_Identifier, + Field_Has_Begin, + Field_Visible_Flag, + Field_Is_Within_Flag, + Field_End_Has_Reserved_Id, + Field_End_Has_Identifier, + Field_Parent, + Field_Hierarchical_Name, + Field_Inherit_Spec_Chain, + Field_Vunit_Item_Chain, + -- Iir_Kind_Vprop_Declaration + Field_Identifier, + Field_Has_Begin, + Field_Visible_Flag, + Field_Is_Within_Flag, + Field_End_Has_Reserved_Id, + Field_End_Has_Identifier, + Field_Parent, + Field_Hierarchical_Name, + Field_Inherit_Spec_Chain, + Field_Vunit_Item_Chain, + -- Iir_Kind_Vunit_Declaration + Field_Identifier, + Field_Has_Begin, + Field_Visible_Flag, + Field_Is_Within_Flag, + Field_End_Has_Reserved_Id, + Field_End_Has_Identifier, + Field_Parent, + Field_Hierarchical_Name, + Field_Inherit_Spec_Chain, + Field_Vunit_Item_Chain, -- Iir_Kind_Package_Body Field_Identifier, Field_End_Has_Reserved_Id, @@ -2883,6 +2900,43 @@ package body Vhdl.Nodes_Meta is Field_Concurrent_Statement_Chain, Field_Attribute_Value_Chain, Field_Default_Configuration_Declaration, + -- Iir_Kind_Type_Declaration + Field_Identifier, + Field_Visible_Flag, + Field_Use_Flag, + Field_Parent, + Field_Type_Definition, + Field_Chain, + Field_Incomplete_Type_Declaration, + -- Iir_Kind_Anonymous_Type_Declaration + Field_Identifier, + Field_Parent, + Field_Type_Definition, + Field_Chain, + Field_Subtype_Definition, + Field_Incomplete_Type_Declaration, + -- Iir_Kind_Subtype_Declaration + Field_Identifier, + Field_Visible_Flag, + Field_Use_Flag, + Field_Parent, + Field_Chain, + Field_Subtype_Indication, + Field_Type, + -- Iir_Kind_Nature_Declaration + Field_Identifier, + Field_Visible_Flag, + Field_Use_Flag, + Field_Parent, + Field_Nature, + Field_Chain, + -- Iir_Kind_Subnature_Declaration + Field_Identifier, + Field_Visible_Flag, + Field_Use_Flag, + Field_Parent, + Field_Nature, + Field_Chain, -- Iir_Kind_Package_Header Field_Generic_Chain, Field_Generic_Map_Aspect_Chain, @@ -4532,205 +4586,208 @@ package body Vhdl.Nodes_Meta is Iir_Kind_Subtype_Definition => 464, Iir_Kind_Scalar_Nature_Definition => 468, Iir_Kind_Overload_List => 469, - Iir_Kind_Type_Declaration => 476, - Iir_Kind_Anonymous_Type_Declaration => 482, - Iir_Kind_Subtype_Declaration => 489, - Iir_Kind_Nature_Declaration => 495, - Iir_Kind_Subnature_Declaration => 501, - Iir_Kind_Entity_Declaration => 513, - Iir_Kind_Configuration_Declaration => 522, - Iir_Kind_Context_Declaration => 528, - Iir_Kind_Package_Declaration => 543, - Iir_Kind_Package_Instantiation_Declaration => 557, - Iir_Kind_Package_Body => 565, - Iir_Kind_Architecture_Body => 577, - Iir_Kind_Package_Header => 579, - Iir_Kind_Unit_Declaration => 588, - Iir_Kind_Library_Declaration => 595, - Iir_Kind_Component_Declaration => 605, - Iir_Kind_Attribute_Declaration => 612, - Iir_Kind_Group_Template_Declaration => 618, - Iir_Kind_Group_Declaration => 625, - Iir_Kind_Element_Declaration => 632, - Iir_Kind_Non_Object_Alias_Declaration => 640, - Iir_Kind_Psl_Declaration => 648, - Iir_Kind_Psl_Endpoint_Declaration => 662, - Iir_Kind_Terminal_Declaration => 669, - Iir_Kind_Free_Quantity_Declaration => 680, - Iir_Kind_Across_Quantity_Declaration => 692, - Iir_Kind_Through_Quantity_Declaration => 704, - Iir_Kind_Enumeration_Literal => 715, - Iir_Kind_Function_Declaration => 740, - Iir_Kind_Procedure_Declaration => 764, - Iir_Kind_Function_Body => 774, - Iir_Kind_Procedure_Body => 785, - Iir_Kind_Object_Alias_Declaration => 796, - Iir_Kind_File_Declaration => 810, - Iir_Kind_Guard_Signal_Declaration => 823, - Iir_Kind_Signal_Declaration => 840, - Iir_Kind_Variable_Declaration => 853, - Iir_Kind_Constant_Declaration => 867, - Iir_Kind_Iterator_Declaration => 878, - Iir_Kind_Interface_Constant_Declaration => 894, - Iir_Kind_Interface_Variable_Declaration => 910, - Iir_Kind_Interface_Signal_Declaration => 931, - Iir_Kind_Interface_File_Declaration => 947, - Iir_Kind_Interface_Type_Declaration => 957, - Iir_Kind_Interface_Package_Declaration => 969, - Iir_Kind_Interface_Function_Declaration => 986, - Iir_Kind_Interface_Procedure_Declaration => 999, - 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 + Iir_Kind_Entity_Declaration => 481, + Iir_Kind_Configuration_Declaration => 490, + Iir_Kind_Context_Declaration => 496, + Iir_Kind_Package_Declaration => 511, + Iir_Kind_Package_Instantiation_Declaration => 525, + Iir_Kind_Vmode_Declaration => 535, + Iir_Kind_Vprop_Declaration => 545, + Iir_Kind_Vunit_Declaration => 555, + Iir_Kind_Package_Body => 563, + Iir_Kind_Architecture_Body => 575, + Iir_Kind_Type_Declaration => 582, + Iir_Kind_Anonymous_Type_Declaration => 588, + Iir_Kind_Subtype_Declaration => 595, + Iir_Kind_Nature_Declaration => 601, + Iir_Kind_Subnature_Declaration => 607, + Iir_Kind_Package_Header => 609, + Iir_Kind_Unit_Declaration => 618, + Iir_Kind_Library_Declaration => 625, + Iir_Kind_Component_Declaration => 635, + Iir_Kind_Attribute_Declaration => 642, + Iir_Kind_Group_Template_Declaration => 648, + Iir_Kind_Group_Declaration => 655, + Iir_Kind_Element_Declaration => 662, + Iir_Kind_Non_Object_Alias_Declaration => 670, + Iir_Kind_Psl_Declaration => 678, + Iir_Kind_Psl_Endpoint_Declaration => 692, + Iir_Kind_Terminal_Declaration => 699, + Iir_Kind_Free_Quantity_Declaration => 710, + Iir_Kind_Across_Quantity_Declaration => 722, + Iir_Kind_Through_Quantity_Declaration => 734, + Iir_Kind_Enumeration_Literal => 745, + Iir_Kind_Function_Declaration => 770, + Iir_Kind_Procedure_Declaration => 794, + Iir_Kind_Function_Body => 804, + Iir_Kind_Procedure_Body => 815, + Iir_Kind_Object_Alias_Declaration => 826, + Iir_Kind_File_Declaration => 840, + Iir_Kind_Guard_Signal_Declaration => 853, + Iir_Kind_Signal_Declaration => 870, + Iir_Kind_Variable_Declaration => 883, + Iir_Kind_Constant_Declaration => 897, + Iir_Kind_Iterator_Declaration => 908, + Iir_Kind_Interface_Constant_Declaration => 924, + Iir_Kind_Interface_Variable_Declaration => 940, + Iir_Kind_Interface_Signal_Declaration => 961, + Iir_Kind_Interface_File_Declaration => 977, + Iir_Kind_Interface_Type_Declaration => 987, + Iir_Kind_Interface_Package_Declaration => 999, + Iir_Kind_Interface_Function_Declaration => 1016, + Iir_Kind_Interface_Procedure_Declaration => 1029, + Iir_Kind_Anonymous_Signal_Declaration => 1038, + Iir_Kind_Signal_Attribute_Declaration => 1041, + Iir_Kind_Identity_Operator => 1045, + Iir_Kind_Negation_Operator => 1049, + Iir_Kind_Absolute_Operator => 1053, + Iir_Kind_Not_Operator => 1057, + Iir_Kind_Implicit_Condition_Operator => 1061, + Iir_Kind_Condition_Operator => 1065, + Iir_Kind_Reduction_And_Operator => 1069, + Iir_Kind_Reduction_Or_Operator => 1073, + Iir_Kind_Reduction_Nand_Operator => 1077, + Iir_Kind_Reduction_Nor_Operator => 1081, + Iir_Kind_Reduction_Xor_Operator => 1085, + Iir_Kind_Reduction_Xnor_Operator => 1089, + Iir_Kind_And_Operator => 1094, + Iir_Kind_Or_Operator => 1099, + Iir_Kind_Nand_Operator => 1104, + Iir_Kind_Nor_Operator => 1109, + Iir_Kind_Xor_Operator => 1114, + Iir_Kind_Xnor_Operator => 1119, + Iir_Kind_Equality_Operator => 1124, + Iir_Kind_Inequality_Operator => 1129, + Iir_Kind_Less_Than_Operator => 1134, + Iir_Kind_Less_Than_Or_Equal_Operator => 1139, + Iir_Kind_Greater_Than_Operator => 1144, + Iir_Kind_Greater_Than_Or_Equal_Operator => 1149, + Iir_Kind_Match_Equality_Operator => 1154, + Iir_Kind_Match_Inequality_Operator => 1159, + Iir_Kind_Match_Less_Than_Operator => 1164, + Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1169, + Iir_Kind_Match_Greater_Than_Operator => 1174, + Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1179, + Iir_Kind_Sll_Operator => 1184, + Iir_Kind_Sla_Operator => 1189, + Iir_Kind_Srl_Operator => 1194, + Iir_Kind_Sra_Operator => 1199, + Iir_Kind_Rol_Operator => 1204, + Iir_Kind_Ror_Operator => 1209, + Iir_Kind_Addition_Operator => 1214, + Iir_Kind_Substraction_Operator => 1219, + Iir_Kind_Concatenation_Operator => 1224, + Iir_Kind_Multiplication_Operator => 1229, + Iir_Kind_Division_Operator => 1234, + Iir_Kind_Modulus_Operator => 1239, + Iir_Kind_Remainder_Operator => 1244, + Iir_Kind_Exponentiation_Operator => 1249, + Iir_Kind_Function_Call => 1257, + Iir_Kind_Aggregate => 1264, + Iir_Kind_Parenthesis_Expression => 1267, + Iir_Kind_Qualified_Expression => 1271, + Iir_Kind_Type_Conversion => 1276, + Iir_Kind_Allocator_By_Expression => 1280, + Iir_Kind_Allocator_By_Subtype => 1285, + Iir_Kind_Selected_Element => 1293, + Iir_Kind_Dereference => 1298, + Iir_Kind_Implicit_Dereference => 1303, + Iir_Kind_Slice_Name => 1310, + Iir_Kind_Indexed_Name => 1316, + Iir_Kind_Psl_Expression => 1318, + Iir_Kind_Sensitized_Process_Statement => 1339, + Iir_Kind_Process_Statement => 1359, + Iir_Kind_Concurrent_Simple_Signal_Assignment => 1371, + Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1383, + Iir_Kind_Concurrent_Selected_Signal_Assignment => 1396, + Iir_Kind_Concurrent_Assertion_Statement => 1404, + Iir_Kind_Concurrent_Procedure_Call_Statement => 1411, + Iir_Kind_Psl_Assert_Directive => 1424, + Iir_Kind_Psl_Assume_Directive => 1435, + Iir_Kind_Psl_Cover_Directive => 1447, + Iir_Kind_Psl_Restrict_Directive => 1458, + Iir_Kind_Block_Statement => 1472, + Iir_Kind_If_Generate_Statement => 1483, + Iir_Kind_Case_Generate_Statement => 1492, + Iir_Kind_For_Generate_Statement => 1501, + Iir_Kind_Component_Instantiation_Statement => 1512, + Iir_Kind_Psl_Default_Clock => 1516, + Iir_Kind_Simple_Simultaneous_Statement => 1523, + Iir_Kind_Generate_Statement_Body => 1534, + Iir_Kind_If_Generate_Else_Clause => 1540, + Iir_Kind_Simple_Signal_Assignment_Statement => 1550, + Iir_Kind_Conditional_Signal_Assignment_Statement => 1560, + Iir_Kind_Selected_Waveform_Assignment_Statement => 1571, + Iir_Kind_Null_Statement => 1575, + Iir_Kind_Assertion_Statement => 1582, + Iir_Kind_Report_Statement => 1588, + Iir_Kind_Wait_Statement => 1596, + Iir_Kind_Variable_Assignment_Statement => 1603, + Iir_Kind_Conditional_Variable_Assignment_Statement => 1610, + Iir_Kind_Return_Statement => 1616, + Iir_Kind_For_Loop_Statement => 1625, + Iir_Kind_While_Loop_Statement => 1634, + Iir_Kind_Next_Statement => 1641, + Iir_Kind_Exit_Statement => 1648, + Iir_Kind_Case_Statement => 1656, + Iir_Kind_Procedure_Call_Statement => 1662, + Iir_Kind_If_Statement => 1672, + Iir_Kind_Elsif => 1678, + Iir_Kind_Character_Literal => 1686, + Iir_Kind_Simple_Name => 1694, + Iir_Kind_Selected_Name => 1703, + Iir_Kind_Operator_Symbol => 1709, + Iir_Kind_Reference_Name => 1714, + Iir_Kind_External_Constant_Name => 1722, + Iir_Kind_External_Signal_Name => 1730, + Iir_Kind_External_Variable_Name => 1739, + Iir_Kind_Selected_By_All_Name => 1745, + Iir_Kind_Parenthesis_Name => 1750, + Iir_Kind_Package_Pathname => 1754, + Iir_Kind_Absolute_Pathname => 1755, + Iir_Kind_Relative_Pathname => 1756, + Iir_Kind_Pathname_Element => 1761, + Iir_Kind_Base_Attribute => 1763, + Iir_Kind_Subtype_Attribute => 1768, + Iir_Kind_Element_Attribute => 1773, + Iir_Kind_Left_Type_Attribute => 1778, + Iir_Kind_Right_Type_Attribute => 1783, + Iir_Kind_High_Type_Attribute => 1788, + Iir_Kind_Low_Type_Attribute => 1793, + Iir_Kind_Ascending_Type_Attribute => 1798, + Iir_Kind_Image_Attribute => 1804, + Iir_Kind_Value_Attribute => 1810, + Iir_Kind_Pos_Attribute => 1816, + Iir_Kind_Val_Attribute => 1822, + Iir_Kind_Succ_Attribute => 1828, + Iir_Kind_Pred_Attribute => 1834, + Iir_Kind_Leftof_Attribute => 1840, + Iir_Kind_Rightof_Attribute => 1846, + Iir_Kind_Delayed_Attribute => 1855, + Iir_Kind_Stable_Attribute => 1864, + Iir_Kind_Quiet_Attribute => 1873, + Iir_Kind_Transaction_Attribute => 1882, + Iir_Kind_Event_Attribute => 1886, + Iir_Kind_Active_Attribute => 1890, + Iir_Kind_Last_Event_Attribute => 1894, + Iir_Kind_Last_Active_Attribute => 1898, + Iir_Kind_Last_Value_Attribute => 1902, + Iir_Kind_Driving_Attribute => 1906, + Iir_Kind_Driving_Value_Attribute => 1910, + Iir_Kind_Behavior_Attribute => 1910, + Iir_Kind_Structure_Attribute => 1910, + Iir_Kind_Simple_Name_Attribute => 1917, + Iir_Kind_Instance_Name_Attribute => 1922, + Iir_Kind_Path_Name_Attribute => 1927, + Iir_Kind_Left_Array_Attribute => 1934, + Iir_Kind_Right_Array_Attribute => 1941, + Iir_Kind_High_Array_Attribute => 1948, + Iir_Kind_Low_Array_Attribute => 1955, + Iir_Kind_Length_Array_Attribute => 1962, + Iir_Kind_Ascending_Array_Attribute => 1969, + Iir_Kind_Range_Array_Attribute => 1976, + Iir_Kind_Reverse_Range_Array_Attribute => 1983, + Iir_Kind_Attribute_Name => 1992 ); function Get_Fields_First (K : Iir_Kind) return Fields_Index is @@ -5213,6 +5270,12 @@ package body Vhdl.Nodes_Meta is return Get_Package_Body (N); when Field_Instance_Package_Body => return Get_Instance_Package_Body (N); + when Field_Hierarchical_Name => + return Get_Hierarchical_Name (N); + when Field_Inherit_Spec_Chain => + return Get_Inherit_Spec_Chain (N); + when Field_Vunit_Item_Chain => + return Get_Vunit_Item_Chain (N); when Field_Block_Configuration => return Get_Block_Configuration (N); when Field_Concurrent_Statement_Chain => @@ -5607,6 +5670,12 @@ package body Vhdl.Nodes_Meta is Set_Package_Body (N, V); when Field_Instance_Package_Body => Set_Instance_Package_Body (N, V); + when Field_Hierarchical_Name => + Set_Hierarchical_Name (N, V); + when Field_Inherit_Spec_Chain => + Set_Inherit_Spec_Chain (N, V); + when Field_Vunit_Item_Chain => + Set_Vunit_Item_Chain (N, V); when Field_Block_Configuration => Set_Block_Configuration (N, V); when Field_Concurrent_Statement_Chain => @@ -7277,6 +7346,42 @@ package body Vhdl.Nodes_Meta is return K = Iir_Kind_Package_Declaration; end Has_Need_Instance_Bodies; + function Has_Hierarchical_Name (K : Iir_Kind) return Boolean is + begin + case K is + when Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration => + return True; + when others => + return False; + end case; + end Has_Hierarchical_Name; + + function Has_Inherit_Spec_Chain (K : Iir_Kind) return Boolean is + begin + case K is + when Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration => + return True; + when others => + return False; + end case; + end Has_Inherit_Spec_Chain; + + function Has_Vunit_Item_Chain (K : Iir_Kind) return Boolean is + begin + case K is + when Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration => + return True; + when others => + return False; + end case; + end Has_Vunit_Item_Chain; + function Has_Block_Configuration (K : Iir_Kind) return Boolean is begin case K is @@ -7333,14 +7438,14 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Disconnection_Specification | Iir_Kind_Configuration_Specification | Iir_Kind_Protected_Type_Body + | Iir_Kind_Package_Declaration + | Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Package_Body | Iir_Kind_Type_Declaration | Iir_Kind_Anonymous_Type_Declaration | Iir_Kind_Subtype_Declaration | Iir_Kind_Nature_Declaration | Iir_Kind_Subnature_Declaration - | Iir_Kind_Package_Declaration - | Iir_Kind_Package_Instantiation_Declaration - | Iir_Kind_Package_Body | Iir_Kind_Unit_Declaration | Iir_Kind_Library_Declaration | Iir_Kind_Component_Declaration @@ -7938,6 +8043,9 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Context_Declaration | Iir_Kind_Package_Declaration | Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Package_Body | Iir_Kind_Architecture_Body => return True; @@ -8108,18 +8216,21 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Record_Element_Constraint | Iir_Kind_Record_Element_Resolution | Iir_Kind_Protected_Type_Body - | Iir_Kind_Type_Declaration - | Iir_Kind_Anonymous_Type_Declaration - | Iir_Kind_Subtype_Declaration - | Iir_Kind_Nature_Declaration - | Iir_Kind_Subnature_Declaration | Iir_Kind_Entity_Declaration | Iir_Kind_Configuration_Declaration | Iir_Kind_Context_Declaration | Iir_Kind_Package_Declaration | Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Package_Body | Iir_Kind_Architecture_Body + | Iir_Kind_Type_Declaration + | Iir_Kind_Anonymous_Type_Declaration + | Iir_Kind_Subtype_Declaration + | Iir_Kind_Nature_Declaration + | Iir_Kind_Subnature_Declaration | Iir_Kind_Unit_Declaration | Iir_Kind_Library_Declaration | Iir_Kind_Component_Declaration @@ -8251,16 +8362,19 @@ package body Vhdl.Nodes_Meta is begin case K is when Iir_Kind_Record_Element_Constraint - | Iir_Kind_Type_Declaration - | Iir_Kind_Subtype_Declaration - | Iir_Kind_Nature_Declaration - | Iir_Kind_Subnature_Declaration | Iir_Kind_Entity_Declaration | Iir_Kind_Configuration_Declaration | Iir_Kind_Context_Declaration | Iir_Kind_Package_Declaration | Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Architecture_Body + | Iir_Kind_Type_Declaration + | Iir_Kind_Subtype_Declaration + | Iir_Kind_Nature_Declaration + | Iir_Kind_Subnature_Declaration | Iir_Kind_Unit_Declaration | Iir_Kind_Library_Declaration | Iir_Kind_Component_Declaration @@ -9331,18 +9445,21 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Disconnection_Specification | Iir_Kind_Configuration_Specification | Iir_Kind_Protected_Type_Body - | Iir_Kind_Type_Declaration - | Iir_Kind_Anonymous_Type_Declaration - | Iir_Kind_Subtype_Declaration - | Iir_Kind_Nature_Declaration - | Iir_Kind_Subnature_Declaration | Iir_Kind_Entity_Declaration | Iir_Kind_Configuration_Declaration | Iir_Kind_Context_Declaration | Iir_Kind_Package_Declaration | Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Package_Body | Iir_Kind_Architecture_Body + | Iir_Kind_Type_Declaration + | Iir_Kind_Anonymous_Type_Declaration + | Iir_Kind_Subtype_Declaration + | Iir_Kind_Nature_Declaration + | Iir_Kind_Subnature_Declaration | Iir_Kind_Unit_Declaration | Iir_Kind_Component_Declaration | Iir_Kind_Attribute_Declaration @@ -10352,6 +10469,9 @@ package body Vhdl.Nodes_Meta is case K is when Iir_Kind_Entity_Declaration | Iir_Kind_Package_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Architecture_Body | Iir_Kind_Enumeration_Literal | Iir_Kind_Function_Declaration @@ -10469,6 +10589,9 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Context_Declaration | Iir_Kind_Package_Declaration | Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Package_Body | Iir_Kind_Architecture_Body | Iir_Kind_Component_Declaration @@ -10498,6 +10621,9 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Context_Declaration | Iir_Kind_Package_Declaration | Iir_Kind_Package_Instantiation_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Package_Body | Iir_Kind_Architecture_Body | Iir_Kind_Component_Declaration @@ -10548,6 +10674,9 @@ package body Vhdl.Nodes_Meta is begin case K is when Iir_Kind_Entity_Declaration + | Iir_Kind_Vmode_Declaration + | Iir_Kind_Vprop_Declaration + | Iir_Kind_Vunit_Declaration | Iir_Kind_Generate_Statement_Body => return True; when others => diff --git a/src/vhdl/vhdl-nodes_meta.ads b/src/vhdl/vhdl-nodes_meta.ads index 34b54e8af..f9c324171 100644 --- a/src/vhdl/vhdl-nodes_meta.ads +++ b/src/vhdl/vhdl-nodes_meta.ads @@ -142,6 +142,9 @@ package Vhdl.Nodes_Meta is Field_Need_Body, Field_Macro_Expanded_Flag, Field_Need_Instance_Bodies, + Field_Hierarchical_Name, + Field_Inherit_Spec_Chain, + Field_Vunit_Item_Chain, Field_Block_Configuration, Field_Concurrent_Statement_Chain, Field_Chain, @@ -670,6 +673,9 @@ package Vhdl.Nodes_Meta is function Has_Need_Body (K : Iir_Kind) return Boolean; function Has_Macro_Expanded_Flag (K : Iir_Kind) return Boolean; function Has_Need_Instance_Bodies (K : Iir_Kind) return Boolean; + function Has_Hierarchical_Name (K : Iir_Kind) return Boolean; + function Has_Inherit_Spec_Chain (K : Iir_Kind) return Boolean; + function Has_Vunit_Item_Chain (K : Iir_Kind) return Boolean; function Has_Block_Configuration (K : Iir_Kind) return Boolean; function Has_Concurrent_Statement_Chain (K : Iir_Kind) return Boolean; function Has_Chain (K : Iir_Kind) return Boolean; diff --git a/src/vhdl/vhdl-prints.adb b/src/vhdl/vhdl-prints.adb index 09c6f5ff4..6023cbfe5 100644 --- a/src/vhdl/vhdl-prints.adb +++ b/src/vhdl/vhdl-prints.adb @@ -4264,6 +4264,13 @@ package body Vhdl.Prints is Disp_End (Ctxt, Decl, Tok_Context); end Disp_Context_Declaration; + procedure Disp_Verification_Unit + (Ctxt : in out Ctxt_Class; Unit: Iir; Tok : Token_Type) is + begin + -- TODO. + null; + end Disp_Verification_Unit; + procedure Disp_Design_Unit (Ctxt : in out Ctxt_Class; Unit: Iir_Design_Unit) is Decl: Iir; @@ -4286,6 +4293,12 @@ package body Vhdl.Prints is Disp_Configuration_Declaration (Ctxt, Decl); when Iir_Kind_Context_Declaration => Disp_Context_Declaration (Ctxt, Decl); + when Iir_Kind_Vunit_Declaration => + Disp_Verification_Unit (Ctxt, Decl, Tok_Vunit); + when Iir_Kind_Vmode_Declaration => + Disp_Verification_Unit (Ctxt, Decl, Tok_Vmode); + when Iir_Kind_Vprop_Declaration => + Disp_Verification_Unit (Ctxt, Decl, Tok_Vprop); end case; end Disp_Design_Unit; diff --git a/src/vhdl/vhdl-sem.adb b/src/vhdl/vhdl-sem.adb index daa0395b3..18aefeef4 100644 --- a/src/vhdl/vhdl-sem.adb +++ b/src/vhdl/vhdl-sem.adb @@ -3364,6 +3364,9 @@ package body Vhdl.Sem is Sem_Package_Instantiation_Declaration (Library_Unit); when Iir_Kind_Context_Declaration => Sem_Context_Declaration (Library_Unit); + when Iir_Kinds_Verification_Unit => + -- TODO. + raise Internal_Error; end case; end if; -- cgit v1.2.3