diff options
-rw-r--r-- | pyGHDL/libghdl/vhdl/nodes.py | 517 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap2.adb | 2 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap3.adb | 8 | ||||
-rw-r--r-- | src/vhdl/translate/trans-rtis.adb | 3 | ||||
-rw-r--r-- | src/vhdl/vhdl-elocations.adb | 1 | ||||
-rw-r--r-- | src/vhdl/vhdl-elocations.ads | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-errors.adb | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-evaluation.adb | 3 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.adb | 1 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes.ads | 21 | ||||
-rw-r--r-- | src/vhdl/vhdl-nodes_meta.adb | 539 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_types.adb | 7 | ||||
-rw-r--r-- | src/vhdl/vhdl-utils.adb | 2 |
13 files changed, 589 insertions, 519 deletions
diff --git a/pyGHDL/libghdl/vhdl/nodes.py b/pyGHDL/libghdl/vhdl/nodes.py index 2d0d857d4..181dd4525 100644 --- a/pyGHDL/libghdl/vhdl/nodes.py +++ b/pyGHDL/libghdl/vhdl/nodes.py @@ -109,263 +109,264 @@ class Iir_Kind(IntEnum): Array_Subtype_Definition = 62 Record_Subtype_Definition = 63 Access_Subtype_Definition = 64 - Physical_Subtype_Definition = 65 - Floating_Subtype_Definition = 66 - Integer_Subtype_Definition = 67 - Enumeration_Subtype_Definition = 68 - Enumeration_Type_Definition = 69 - Integer_Type_Definition = 70 - Floating_Type_Definition = 71 - Physical_Type_Definition = 72 - Range_Expression = 73 - Protected_Type_Body = 74 - Wildcard_Type_Definition = 75 - Foreign_Vector_Type_Definition = 76 - Subtype_Definition = 77 - Scalar_Nature_Definition = 78 - Record_Nature_Definition = 79 - Array_Nature_Definition = 80 - Array_Subnature_Definition = 81 - Overload_List = 82 - Foreign_Module = 83 - Entity_Declaration = 84 - Configuration_Declaration = 85 - Context_Declaration = 86 - Package_Declaration = 87 - Package_Instantiation_Declaration = 88 - Vmode_Declaration = 89 - Vprop_Declaration = 90 - Vunit_Declaration = 91 - Package_Body = 92 - Architecture_Body = 93 - Type_Declaration = 94 - Anonymous_Type_Declaration = 95 - Subtype_Declaration = 96 - Nature_Declaration = 97 - Subnature_Declaration = 98 - Package_Header = 99 - Unit_Declaration = 100 - Library_Declaration = 101 - Component_Declaration = 102 - Attribute_Declaration = 103 - Group_Template_Declaration = 104 - Group_Declaration = 105 - Element_Declaration = 106 - Nature_Element_Declaration = 107 - Non_Object_Alias_Declaration = 108 - Psl_Declaration = 109 - Psl_Endpoint_Declaration = 110 - Enumeration_Literal = 111 - Function_Declaration = 112 - Procedure_Declaration = 113 - Function_Body = 114 - Procedure_Body = 115 - Function_Instantiation_Declaration = 116 - Procedure_Instantiation_Declaration = 117 - Terminal_Declaration = 118 - Object_Alias_Declaration = 119 - Free_Quantity_Declaration = 120 - Spectrum_Quantity_Declaration = 121 - Noise_Quantity_Declaration = 122 - Across_Quantity_Declaration = 123 - Through_Quantity_Declaration = 124 - File_Declaration = 125 - Guard_Signal_Declaration = 126 - Signal_Declaration = 127 - Variable_Declaration = 128 - Constant_Declaration = 129 - Iterator_Declaration = 130 - Interface_Constant_Declaration = 131 - Interface_Variable_Declaration = 132 - Interface_Signal_Declaration = 133 - Interface_File_Declaration = 134 - Interface_Quantity_Declaration = 135 - Interface_Terminal_Declaration = 136 - Interface_Type_Declaration = 137 - Interface_Package_Declaration = 138 - Interface_Function_Declaration = 139 - Interface_Procedure_Declaration = 140 - Attribute_Implicit_Declaration = 141 - Suspend_State_Declaration = 142 - Identity_Operator = 143 - Negation_Operator = 144 - Absolute_Operator = 145 - Not_Operator = 146 - Implicit_Condition_Operator = 147 - Condition_Operator = 148 - Reduction_And_Operator = 149 - Reduction_Or_Operator = 150 - Reduction_Nand_Operator = 151 - Reduction_Nor_Operator = 152 - Reduction_Xor_Operator = 153 - Reduction_Xnor_Operator = 154 - And_Operator = 155 - Or_Operator = 156 - Nand_Operator = 157 - Nor_Operator = 158 - Xor_Operator = 159 - Xnor_Operator = 160 - Equality_Operator = 161 - Inequality_Operator = 162 - Less_Than_Operator = 163 - Less_Than_Or_Equal_Operator = 164 - Greater_Than_Operator = 165 - Greater_Than_Or_Equal_Operator = 166 - Match_Equality_Operator = 167 - Match_Inequality_Operator = 168 - Match_Less_Than_Operator = 169 - Match_Less_Than_Or_Equal_Operator = 170 - Match_Greater_Than_Operator = 171 - Match_Greater_Than_Or_Equal_Operator = 172 - Sll_Operator = 173 - Sla_Operator = 174 - Srl_Operator = 175 - Sra_Operator = 176 - Rol_Operator = 177 - Ror_Operator = 178 - Addition_Operator = 179 - Substraction_Operator = 180 - Concatenation_Operator = 181 - Multiplication_Operator = 182 - Division_Operator = 183 - Modulus_Operator = 184 - Remainder_Operator = 185 - Exponentiation_Operator = 186 - Function_Call = 187 - Aggregate = 188 - Parenthesis_Expression = 189 - Qualified_Expression = 190 - Type_Conversion = 191 - Allocator_By_Expression = 192 - Allocator_By_Subtype = 193 - Selected_Element = 194 - Dereference = 195 - Implicit_Dereference = 196 - Slice_Name = 197 - Indexed_Name = 198 - Psl_Prev = 199 - Psl_Stable = 200 - Psl_Rose = 201 - Psl_Fell = 202 - Psl_Onehot = 203 - Psl_Onehot0 = 204 - Psl_Expression = 205 - Sensitized_Process_Statement = 206 - Process_Statement = 207 - Concurrent_Simple_Signal_Assignment = 208 - Concurrent_Conditional_Signal_Assignment = 209 - Concurrent_Selected_Signal_Assignment = 210 - Concurrent_Assertion_Statement = 211 - Concurrent_Procedure_Call_Statement = 212 - Concurrent_Break_Statement = 213 - Psl_Assert_Directive = 214 - Psl_Assume_Directive = 215 - Psl_Cover_Directive = 216 - Psl_Restrict_Directive = 217 - Block_Statement = 218 - If_Generate_Statement = 219 - Case_Generate_Statement = 220 - For_Generate_Statement = 221 - Component_Instantiation_Statement = 222 - Psl_Default_Clock = 223 - Generate_Statement_Body = 224 - If_Generate_Else_Clause = 225 - Simple_Simultaneous_Statement = 226 - Simultaneous_Null_Statement = 227 - Simultaneous_Procedural_Statement = 228 - Simultaneous_Case_Statement = 229 - Simultaneous_If_Statement = 230 - Simultaneous_Elsif = 231 - Simple_Signal_Assignment_Statement = 232 - Conditional_Signal_Assignment_Statement = 233 - Selected_Waveform_Assignment_Statement = 234 - Signal_Force_Assignment_Statement = 235 - Signal_Release_Assignment_Statement = 236 - Null_Statement = 237 - Assertion_Statement = 238 - Report_Statement = 239 - Wait_Statement = 240 - Variable_Assignment_Statement = 241 - Conditional_Variable_Assignment_Statement = 242 - Return_Statement = 243 - For_Loop_Statement = 244 - While_Loop_Statement = 245 - Next_Statement = 246 - Exit_Statement = 247 - Case_Statement = 248 - Procedure_Call_Statement = 249 - Break_Statement = 250 - If_Statement = 251 - Suspend_State_Statement = 252 - Elsif = 253 - Character_Literal = 254 - Simple_Name = 255 - Selected_Name = 256 - Operator_Symbol = 257 - Reference_Name = 258 - External_Constant_Name = 259 - External_Signal_Name = 260 - External_Variable_Name = 261 - Selected_By_All_Name = 262 - Parenthesis_Name = 263 - Package_Pathname = 264 - Absolute_Pathname = 265 - Relative_Pathname = 266 - Pathname_Element = 267 - Base_Attribute = 268 - Subtype_Attribute = 269 - Element_Attribute = 270 - Across_Attribute = 271 - Through_Attribute = 272 - Nature_Reference_Attribute = 273 - Left_Type_Attribute = 274 - Right_Type_Attribute = 275 - High_Type_Attribute = 276 - Low_Type_Attribute = 277 - Ascending_Type_Attribute = 278 - Image_Attribute = 279 - Value_Attribute = 280 - Pos_Attribute = 281 - Val_Attribute = 282 - Succ_Attribute = 283 - Pred_Attribute = 284 - Leftof_Attribute = 285 - Rightof_Attribute = 286 - Signal_Slew_Attribute = 287 - Quantity_Slew_Attribute = 288 - Ramp_Attribute = 289 - Zoh_Attribute = 290 - Ltf_Attribute = 291 - Ztf_Attribute = 292 - Dot_Attribute = 293 - Integ_Attribute = 294 - Quantity_Delayed_Attribute = 295 - Above_Attribute = 296 - Delayed_Attribute = 297 - Stable_Attribute = 298 - Quiet_Attribute = 299 - Transaction_Attribute = 300 - Event_Attribute = 301 - Active_Attribute = 302 - Last_Event_Attribute = 303 - Last_Active_Attribute = 304 - Last_Value_Attribute = 305 - Driving_Attribute = 306 - Driving_Value_Attribute = 307 - Behavior_Attribute = 308 - Structure_Attribute = 309 - Simple_Name_Attribute = 310 - Instance_Name_Attribute = 311 - Path_Name_Attribute = 312 - Left_Array_Attribute = 313 - Right_Array_Attribute = 314 - High_Array_Attribute = 315 - Low_Array_Attribute = 316 - Length_Array_Attribute = 317 - Ascending_Array_Attribute = 318 - Range_Array_Attribute = 319 - Reverse_Range_Array_Attribute = 320 - Attribute_Name = 321 + File_Subtype_Definition = 65 + Physical_Subtype_Definition = 66 + Floating_Subtype_Definition = 67 + Integer_Subtype_Definition = 68 + Enumeration_Subtype_Definition = 69 + Enumeration_Type_Definition = 70 + Integer_Type_Definition = 71 + Floating_Type_Definition = 72 + Physical_Type_Definition = 73 + Range_Expression = 74 + Protected_Type_Body = 75 + Wildcard_Type_Definition = 76 + Foreign_Vector_Type_Definition = 77 + Subtype_Definition = 78 + Scalar_Nature_Definition = 79 + Record_Nature_Definition = 80 + Array_Nature_Definition = 81 + Array_Subnature_Definition = 82 + Overload_List = 83 + Foreign_Module = 84 + Entity_Declaration = 85 + Configuration_Declaration = 86 + Context_Declaration = 87 + Package_Declaration = 88 + Package_Instantiation_Declaration = 89 + Vmode_Declaration = 90 + Vprop_Declaration = 91 + Vunit_Declaration = 92 + Package_Body = 93 + Architecture_Body = 94 + Type_Declaration = 95 + Anonymous_Type_Declaration = 96 + Subtype_Declaration = 97 + Nature_Declaration = 98 + Subnature_Declaration = 99 + Package_Header = 100 + Unit_Declaration = 101 + Library_Declaration = 102 + Component_Declaration = 103 + Attribute_Declaration = 104 + Group_Template_Declaration = 105 + Group_Declaration = 106 + Element_Declaration = 107 + Nature_Element_Declaration = 108 + Non_Object_Alias_Declaration = 109 + Psl_Declaration = 110 + Psl_Endpoint_Declaration = 111 + Enumeration_Literal = 112 + Function_Declaration = 113 + Procedure_Declaration = 114 + Function_Body = 115 + Procedure_Body = 116 + Function_Instantiation_Declaration = 117 + Procedure_Instantiation_Declaration = 118 + Terminal_Declaration = 119 + Object_Alias_Declaration = 120 + Free_Quantity_Declaration = 121 + Spectrum_Quantity_Declaration = 122 + Noise_Quantity_Declaration = 123 + Across_Quantity_Declaration = 124 + Through_Quantity_Declaration = 125 + File_Declaration = 126 + Guard_Signal_Declaration = 127 + Signal_Declaration = 128 + Variable_Declaration = 129 + Constant_Declaration = 130 + Iterator_Declaration = 131 + Interface_Constant_Declaration = 132 + Interface_Variable_Declaration = 133 + Interface_Signal_Declaration = 134 + Interface_File_Declaration = 135 + Interface_Quantity_Declaration = 136 + Interface_Terminal_Declaration = 137 + Interface_Type_Declaration = 138 + Interface_Package_Declaration = 139 + Interface_Function_Declaration = 140 + Interface_Procedure_Declaration = 141 + Attribute_Implicit_Declaration = 142 + Suspend_State_Declaration = 143 + Identity_Operator = 144 + Negation_Operator = 145 + Absolute_Operator = 146 + Not_Operator = 147 + Implicit_Condition_Operator = 148 + Condition_Operator = 149 + Reduction_And_Operator = 150 + Reduction_Or_Operator = 151 + Reduction_Nand_Operator = 152 + Reduction_Nor_Operator = 153 + Reduction_Xor_Operator = 154 + Reduction_Xnor_Operator = 155 + And_Operator = 156 + Or_Operator = 157 + Nand_Operator = 158 + Nor_Operator = 159 + Xor_Operator = 160 + Xnor_Operator = 161 + Equality_Operator = 162 + Inequality_Operator = 163 + Less_Than_Operator = 164 + Less_Than_Or_Equal_Operator = 165 + Greater_Than_Operator = 166 + Greater_Than_Or_Equal_Operator = 167 + Match_Equality_Operator = 168 + Match_Inequality_Operator = 169 + Match_Less_Than_Operator = 170 + Match_Less_Than_Or_Equal_Operator = 171 + Match_Greater_Than_Operator = 172 + Match_Greater_Than_Or_Equal_Operator = 173 + Sll_Operator = 174 + Sla_Operator = 175 + Srl_Operator = 176 + Sra_Operator = 177 + Rol_Operator = 178 + Ror_Operator = 179 + Addition_Operator = 180 + Substraction_Operator = 181 + Concatenation_Operator = 182 + Multiplication_Operator = 183 + Division_Operator = 184 + Modulus_Operator = 185 + Remainder_Operator = 186 + Exponentiation_Operator = 187 + Function_Call = 188 + Aggregate = 189 + Parenthesis_Expression = 190 + Qualified_Expression = 191 + Type_Conversion = 192 + Allocator_By_Expression = 193 + Allocator_By_Subtype = 194 + Selected_Element = 195 + Dereference = 196 + Implicit_Dereference = 197 + Slice_Name = 198 + Indexed_Name = 199 + Psl_Prev = 200 + Psl_Stable = 201 + Psl_Rose = 202 + Psl_Fell = 203 + Psl_Onehot = 204 + Psl_Onehot0 = 205 + Psl_Expression = 206 + Sensitized_Process_Statement = 207 + Process_Statement = 208 + Concurrent_Simple_Signal_Assignment = 209 + Concurrent_Conditional_Signal_Assignment = 210 + Concurrent_Selected_Signal_Assignment = 211 + Concurrent_Assertion_Statement = 212 + Concurrent_Procedure_Call_Statement = 213 + Concurrent_Break_Statement = 214 + Psl_Assert_Directive = 215 + Psl_Assume_Directive = 216 + Psl_Cover_Directive = 217 + Psl_Restrict_Directive = 218 + Block_Statement = 219 + If_Generate_Statement = 220 + Case_Generate_Statement = 221 + For_Generate_Statement = 222 + Component_Instantiation_Statement = 223 + Psl_Default_Clock = 224 + Generate_Statement_Body = 225 + If_Generate_Else_Clause = 226 + Simple_Simultaneous_Statement = 227 + Simultaneous_Null_Statement = 228 + Simultaneous_Procedural_Statement = 229 + Simultaneous_Case_Statement = 230 + Simultaneous_If_Statement = 231 + Simultaneous_Elsif = 232 + Simple_Signal_Assignment_Statement = 233 + Conditional_Signal_Assignment_Statement = 234 + Selected_Waveform_Assignment_Statement = 235 + Signal_Force_Assignment_Statement = 236 + Signal_Release_Assignment_Statement = 237 + Null_Statement = 238 + Assertion_Statement = 239 + Report_Statement = 240 + Wait_Statement = 241 + Variable_Assignment_Statement = 242 + Conditional_Variable_Assignment_Statement = 243 + Return_Statement = 244 + For_Loop_Statement = 245 + While_Loop_Statement = 246 + Next_Statement = 247 + Exit_Statement = 248 + Case_Statement = 249 + Procedure_Call_Statement = 250 + Break_Statement = 251 + If_Statement = 252 + Suspend_State_Statement = 253 + Elsif = 254 + Character_Literal = 255 + Simple_Name = 256 + Selected_Name = 257 + Operator_Symbol = 258 + Reference_Name = 259 + External_Constant_Name = 260 + External_Signal_Name = 261 + External_Variable_Name = 262 + Selected_By_All_Name = 263 + Parenthesis_Name = 264 + Package_Pathname = 265 + Absolute_Pathname = 266 + Relative_Pathname = 267 + Pathname_Element = 268 + Base_Attribute = 269 + Subtype_Attribute = 270 + Element_Attribute = 271 + Across_Attribute = 272 + Through_Attribute = 273 + Nature_Reference_Attribute = 274 + Left_Type_Attribute = 275 + Right_Type_Attribute = 276 + High_Type_Attribute = 277 + Low_Type_Attribute = 278 + Ascending_Type_Attribute = 279 + Image_Attribute = 280 + Value_Attribute = 281 + Pos_Attribute = 282 + Val_Attribute = 283 + Succ_Attribute = 284 + Pred_Attribute = 285 + Leftof_Attribute = 286 + Rightof_Attribute = 287 + Signal_Slew_Attribute = 288 + Quantity_Slew_Attribute = 289 + Ramp_Attribute = 290 + Zoh_Attribute = 291 + Ltf_Attribute = 292 + Ztf_Attribute = 293 + Dot_Attribute = 294 + Integ_Attribute = 295 + Quantity_Delayed_Attribute = 296 + Above_Attribute = 297 + Delayed_Attribute = 298 + Stable_Attribute = 299 + Quiet_Attribute = 300 + Transaction_Attribute = 301 + Event_Attribute = 302 + Active_Attribute = 303 + Last_Event_Attribute = 304 + Last_Active_Attribute = 305 + Last_Value_Attribute = 306 + Driving_Attribute = 307 + Driving_Value_Attribute = 308 + Behavior_Attribute = 309 + Structure_Attribute = 310 + Simple_Name_Attribute = 311 + Instance_Name_Attribute = 312 + Path_Name_Attribute = 313 + Left_Array_Attribute = 314 + Right_Array_Attribute = 315 + High_Array_Attribute = 316 + Low_Array_Attribute = 317 + Length_Array_Attribute = 318 + Ascending_Array_Attribute = 319 + Range_Array_Attribute = 320 + Reverse_Range_Array_Attribute = 321 + Attribute_Name = 322 @export @@ -441,6 +442,7 @@ class Iir_Kinds: Iir_Kind.Array_Subtype_Definition, Iir_Kind.Record_Subtype_Definition, Iir_Kind.Access_Subtype_Definition, + Iir_Kind.File_Subtype_Definition, Iir_Kind.Physical_Subtype_Definition, Iir_Kind.Floating_Subtype_Definition, Iir_Kind.Integer_Subtype_Definition, @@ -455,6 +457,7 @@ class Iir_Kinds: Iir_Kind.Array_Subtype_Definition, Iir_Kind.Record_Subtype_Definition, Iir_Kind.Access_Subtype_Definition, + Iir_Kind.File_Subtype_Definition, Iir_Kind.Physical_Subtype_Definition, Iir_Kind.Floating_Subtype_Definition, Iir_Kind.Integer_Subtype_Definition, diff --git a/src/vhdl/translate/trans-chap2.adb b/src/vhdl/translate/trans-chap2.adb index 9e7e32915..e105dc6ab 100644 --- a/src/vhdl/translate/trans-chap2.adb +++ b/src/vhdl/translate/trans-chap2.adb @@ -373,6 +373,8 @@ package body Trans.Chap2 is null; when Iir_Kind_File_Type_Definition => return True; + when Iir_Kind_File_Subtype_Definition => + null; when Iir_Kind_Protected_Type_Declaration => -- We suppose there is at least one method. return True; diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 139a90f00..627ae2532 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -2541,6 +2541,11 @@ package body Trans.Chap3 is Set_Info (Def, Get_Info (Get_Parent_Type (Def))); end; + when Iir_Kind_File_Subtype_Definition => + -- Same as parent. + Free_Info (Def); + Set_Info (Def, Get_Info (Get_Parent_Type (Def))); + when others => Error_Kind ("translate_subtype_definition", Def); end case; @@ -2792,7 +2797,8 @@ package body Trans.Chap3 is Elab_Composite_Subtype_Layout (Def); end if; - when Iir_Kind_Access_Subtype_Definition => + when Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition => null; when others => diff --git a/src/vhdl/translate/trans-rtis.adb b/src/vhdl/translate/trans-rtis.adb index 80871cfd8..b56364e2e 100644 --- a/src/vhdl/translate/trans-rtis.adb +++ b/src/vhdl/translate/trans-rtis.adb @@ -1838,7 +1838,8 @@ package body Trans.Rtis is Generate_Fileacc_Type_Definition (Atype); when Iir_Kind_Record_Subtype_Definition => Generate_Composite_Subtype_Definition (Atype); - when Iir_Kind_Access_Subtype_Definition => + when Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition => -- FIXME: No separate infos (yet). Info.Type_Rti := Get_Info (Get_Base_Type (Atype)).Type_Rti; when Iir_Kind_Record_Type_Definition => diff --git a/src/vhdl/vhdl-elocations.adb b/src/vhdl/vhdl-elocations.adb index b5950bdd7..d2e5d5a10 100644 --- a/src/vhdl/vhdl-elocations.adb +++ b/src/vhdl/vhdl-elocations.adb @@ -255,6 +255,7 @@ package body Vhdl.Elocations is | Iir_Kind_Array_Subtype_Definition | Iir_Kind_Record_Subtype_Definition | Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Physical_Subtype_Definition | Iir_Kind_Floating_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition diff --git a/src/vhdl/vhdl-elocations.ads b/src/vhdl/vhdl-elocations.ads index 2f7d430e5..89dd60869 100644 --- a/src/vhdl/vhdl-elocations.ads +++ b/src/vhdl/vhdl-elocations.ads @@ -357,6 +357,8 @@ package Vhdl.Elocations is -- Iir_Kind_File_Type_Definition (None) + -- Iir_Kind_File_Subtype_Definition (None) + -- Iir_Kind_Incomplete_Type_Definition (None) -- Iir_Kind_Interface_Type_Definition (None) diff --git a/src/vhdl/vhdl-errors.adb b/src/vhdl/vhdl-errors.adb index c2bb046bd..a5e75f212 100644 --- a/src/vhdl/vhdl-errors.adb +++ b/src/vhdl/vhdl-errors.adb @@ -318,6 +318,8 @@ package body Vhdl.Errors is return Disp_Type (Node, "physical subtype"); when Iir_Kind_File_Type_Definition => return Disp_Type (Node, "file type"); + when Iir_Kind_File_Subtype_Definition => + return Disp_Type (Node, "file subtype"); when Iir_Kind_Access_Type_Definition => return Disp_Type (Node, "access type"); when Iir_Kind_Access_Subtype_Definition => diff --git a/src/vhdl/vhdl-evaluation.adb b/src/vhdl/vhdl-evaluation.adb index 935f6e8ed..638ca0aaf 100644 --- a/src/vhdl/vhdl-evaluation.adb +++ b/src/vhdl/vhdl-evaluation.adb @@ -4302,7 +4302,8 @@ package body Vhdl.Evaluation is -- FIXME: do it. return True; - when Iir_Kind_File_Type_Definition => + when Iir_Kind_File_Type_Definition + | Iir_Kind_File_Subtype_Definition => return True; when Iir_Kind_Integer_Type_Definition diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb index 9a12aae6c..1ba32f6f6 100644 --- a/src/vhdl/vhdl-nodes.adb +++ b/src/vhdl/vhdl-nodes.adb @@ -1039,6 +1039,7 @@ package body Vhdl.Nodes is | Iir_Kind_Protected_Type_Declaration | Iir_Kind_Record_Type_Definition | Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Physical_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition | Iir_Kind_Enumeration_Subtype_Definition diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads index f352542a1..e375ffbc9 100644 --- a/src/vhdl/vhdl-nodes.ads +++ b/src/vhdl/vhdl-nodes.ads @@ -2926,6 +2926,24 @@ package Vhdl.Nodes is -- -- Get/Set_Signal_Type_Flag (Flag2) + -- Iir_Kind_File_Subtype_Definition (Short) + -- + -- Get/Set_Subtype_Type_Mark (Field2) + -- + -- Get/Set_Type_Declarator (Field3) + -- + -- Get/Set_Parent_Type (Field4) + -- + -- Get/Set_Resolved_Flag (Flag1) + -- + -- Get/Set_Signal_Type_Flag (Flag2) + -- + -- True if this is the std.textio.text file type, which may require special + -- handling. + -- Get/Set_Text_File_Flag (Flag4) + -- + -- Get/Set_Type_Staticness (State1) + -- Iir_Kind_Array_Element_Resolution (Short) -- -- LRM08 6.3 Subtype declarations @@ -4966,6 +4984,7 @@ package Vhdl.Nodes is Iir_Kind_Array_Subtype_Definition, -- composite, array, st Iir_Kind_Record_Subtype_Definition, -- composite, st Iir_Kind_Access_Subtype_Definition, -- st + Iir_Kind_File_Subtype_Definition, Iir_Kind_Physical_Subtype_Definition, -- scalar, st, rng Iir_Kind_Floating_Subtype_Definition, -- scalar, st, rng Iir_Kind_Integer_Subtype_Definition, -- scalar, disc, st, rng @@ -6611,6 +6630,7 @@ package Vhdl.Nodes is --Iir_Kind_Array_Subtype_Definition --Iir_Kind_Record_Subtype_Definition --Iir_Kind_Access_Subtype_Definition + --Iir_Kind_File_Subtype_Definition --Iir_Kind_Physical_Subtype_Definition --Iir_Kind_Floating_Subtype_Definition --Iir_Kind_Integer_Subtype_Definition @@ -6624,6 +6644,7 @@ package Vhdl.Nodes is Iir_Kind_Array_Subtype_Definition .. --Iir_Kind_Record_Subtype_Definition --Iir_Kind_Access_Subtype_Definition + --Iir_Kind_File_Subtype_Definition --Iir_Kind_Physical_Subtype_Definition --Iir_Kind_Floating_Subtype_Definition --Iir_Kind_Integer_Subtype_Definition diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb index 310f31d86..782f21e20 100644 --- a/src/vhdl/vhdl-nodes_meta.adb +++ b/src/vhdl/vhdl-nodes_meta.adb @@ -1309,6 +1309,8 @@ package body Vhdl.Nodes_Meta is return "record_subtype_definition"; when Iir_Kind_Access_Subtype_Definition => return "access_subtype_definition"; + when Iir_Kind_File_Subtype_Definition => + return "file_subtype_definition"; when Iir_Kind_Physical_Subtype_Definition => return "physical_subtype_definition"; when Iir_Kind_Floating_Subtype_Definition => @@ -3055,6 +3057,14 @@ package body Vhdl.Nodes_Meta is Field_Type_Declarator, Field_Parent_Type, Field_Designated_Subtype_Indication, + -- Iir_Kind_File_Subtype_Definition + Field_Resolved_Flag, + Field_Signal_Type_Flag, + Field_Text_File_Flag, + Field_Type_Staticness, + Field_Subtype_Type_Mark, + Field_Type_Declarator, + Field_Parent_Type, -- Iir_Kind_Physical_Subtype_Definition Field_Resolved_Flag, Field_Is_Ref, @@ -5395,263 +5405,264 @@ package body Vhdl.Nodes_Meta is Iir_Kind_Array_Subtype_Definition => 370, Iir_Kind_Record_Subtype_Definition => 383, Iir_Kind_Access_Subtype_Definition => 391, - Iir_Kind_Physical_Subtype_Definition => 401, - Iir_Kind_Floating_Subtype_Definition => 412, - Iir_Kind_Integer_Subtype_Definition => 422, - Iir_Kind_Enumeration_Subtype_Definition => 432, - Iir_Kind_Enumeration_Type_Definition => 443, - Iir_Kind_Integer_Type_Definition => 451, - Iir_Kind_Floating_Type_Definition => 459, - Iir_Kind_Physical_Type_Definition => 470, - Iir_Kind_Range_Expression => 478, - Iir_Kind_Protected_Type_Body => 486, - Iir_Kind_Wildcard_Type_Definition => 490, - Iir_Kind_Foreign_Vector_Type_Definition => 491, - Iir_Kind_Subtype_Definition => 498, - Iir_Kind_Scalar_Nature_Definition => 506, - Iir_Kind_Record_Nature_Definition => 519, - Iir_Kind_Array_Nature_Definition => 533, - Iir_Kind_Array_Subnature_Definition => 548, - Iir_Kind_Overload_List => 549, - Iir_Kind_Foreign_Module => 554, - Iir_Kind_Entity_Declaration => 567, - Iir_Kind_Configuration_Declaration => 577, - Iir_Kind_Context_Declaration => 583, - Iir_Kind_Package_Declaration => 598, - Iir_Kind_Package_Instantiation_Declaration => 612, - Iir_Kind_Vmode_Declaration => 624, - Iir_Kind_Vprop_Declaration => 636, - Iir_Kind_Vunit_Declaration => 649, - Iir_Kind_Package_Body => 657, - Iir_Kind_Architecture_Body => 670, - Iir_Kind_Type_Declaration => 677, - Iir_Kind_Anonymous_Type_Declaration => 683, - Iir_Kind_Subtype_Declaration => 691, - Iir_Kind_Nature_Declaration => 697, - Iir_Kind_Subnature_Declaration => 704, - Iir_Kind_Package_Header => 706, - Iir_Kind_Unit_Declaration => 715, - Iir_Kind_Library_Declaration => 723, - Iir_Kind_Component_Declaration => 733, - Iir_Kind_Attribute_Declaration => 740, - Iir_Kind_Group_Template_Declaration => 746, - Iir_Kind_Group_Declaration => 753, - Iir_Kind_Element_Declaration => 761, - Iir_Kind_Nature_Element_Declaration => 768, - Iir_Kind_Non_Object_Alias_Declaration => 776, - Iir_Kind_Psl_Declaration => 784, - Iir_Kind_Psl_Endpoint_Declaration => 798, - Iir_Kind_Enumeration_Literal => 810, - Iir_Kind_Function_Declaration => 836, - Iir_Kind_Procedure_Declaration => 859, - Iir_Kind_Function_Body => 869, - Iir_Kind_Procedure_Body => 880, - Iir_Kind_Function_Instantiation_Declaration => 891, - Iir_Kind_Procedure_Instantiation_Declaration => 901, - Iir_Kind_Terminal_Declaration => 911, - Iir_Kind_Object_Alias_Declaration => 923, - Iir_Kind_Free_Quantity_Declaration => 935, - Iir_Kind_Spectrum_Quantity_Declaration => 948, - Iir_Kind_Noise_Quantity_Declaration => 960, - Iir_Kind_Across_Quantity_Declaration => 976, - Iir_Kind_Through_Quantity_Declaration => 992, - Iir_Kind_File_Declaration => 1007, - Iir_Kind_Guard_Signal_Declaration => 1021, - Iir_Kind_Signal_Declaration => 1038, - Iir_Kind_Variable_Declaration => 1051, - Iir_Kind_Constant_Declaration => 1065, - Iir_Kind_Iterator_Declaration => 1077, - Iir_Kind_Interface_Constant_Declaration => 1094, - Iir_Kind_Interface_Variable_Declaration => 1110, - Iir_Kind_Interface_Signal_Declaration => 1131, - Iir_Kind_Interface_File_Declaration => 1147, - Iir_Kind_Interface_Quantity_Declaration => 1163, - Iir_Kind_Interface_Terminal_Declaration => 1175, - Iir_Kind_Interface_Type_Declaration => 1187, - Iir_Kind_Interface_Package_Declaration => 1200, - Iir_Kind_Interface_Function_Declaration => 1219, - Iir_Kind_Interface_Procedure_Declaration => 1234, - Iir_Kind_Attribute_Implicit_Declaration => 1237, - Iir_Kind_Suspend_State_Declaration => 1240, - Iir_Kind_Identity_Operator => 1244, - Iir_Kind_Negation_Operator => 1248, - Iir_Kind_Absolute_Operator => 1252, - Iir_Kind_Not_Operator => 1256, - Iir_Kind_Implicit_Condition_Operator => 1260, - Iir_Kind_Condition_Operator => 1264, - Iir_Kind_Reduction_And_Operator => 1268, - Iir_Kind_Reduction_Or_Operator => 1272, - Iir_Kind_Reduction_Nand_Operator => 1276, - Iir_Kind_Reduction_Nor_Operator => 1280, - Iir_Kind_Reduction_Xor_Operator => 1284, - Iir_Kind_Reduction_Xnor_Operator => 1288, - Iir_Kind_And_Operator => 1293, - Iir_Kind_Or_Operator => 1298, - Iir_Kind_Nand_Operator => 1303, - Iir_Kind_Nor_Operator => 1308, - Iir_Kind_Xor_Operator => 1313, - Iir_Kind_Xnor_Operator => 1318, - Iir_Kind_Equality_Operator => 1323, - Iir_Kind_Inequality_Operator => 1328, - Iir_Kind_Less_Than_Operator => 1333, - Iir_Kind_Less_Than_Or_Equal_Operator => 1338, - Iir_Kind_Greater_Than_Operator => 1343, - Iir_Kind_Greater_Than_Or_Equal_Operator => 1348, - Iir_Kind_Match_Equality_Operator => 1353, - Iir_Kind_Match_Inequality_Operator => 1358, - Iir_Kind_Match_Less_Than_Operator => 1363, - Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1368, - Iir_Kind_Match_Greater_Than_Operator => 1373, - Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1378, - Iir_Kind_Sll_Operator => 1383, - Iir_Kind_Sla_Operator => 1388, - Iir_Kind_Srl_Operator => 1393, - Iir_Kind_Sra_Operator => 1398, - Iir_Kind_Rol_Operator => 1403, - Iir_Kind_Ror_Operator => 1408, - Iir_Kind_Addition_Operator => 1413, - Iir_Kind_Substraction_Operator => 1418, - Iir_Kind_Concatenation_Operator => 1423, - Iir_Kind_Multiplication_Operator => 1428, - Iir_Kind_Division_Operator => 1433, - Iir_Kind_Modulus_Operator => 1438, - Iir_Kind_Remainder_Operator => 1443, - Iir_Kind_Exponentiation_Operator => 1448, - Iir_Kind_Function_Call => 1456, - Iir_Kind_Aggregate => 1464, - Iir_Kind_Parenthesis_Expression => 1467, - Iir_Kind_Qualified_Expression => 1471, - Iir_Kind_Type_Conversion => 1476, - Iir_Kind_Allocator_By_Expression => 1481, - Iir_Kind_Allocator_By_Subtype => 1487, - Iir_Kind_Selected_Element => 1495, - Iir_Kind_Dereference => 1500, - Iir_Kind_Implicit_Dereference => 1505, - Iir_Kind_Slice_Name => 1512, - Iir_Kind_Indexed_Name => 1518, - Iir_Kind_Psl_Prev => 1524, - Iir_Kind_Psl_Stable => 1529, - Iir_Kind_Psl_Rose => 1534, - Iir_Kind_Psl_Fell => 1539, - Iir_Kind_Psl_Onehot => 1542, - Iir_Kind_Psl_Onehot0 => 1545, - Iir_Kind_Psl_Expression => 1547, - Iir_Kind_Sensitized_Process_Statement => 1569, - Iir_Kind_Process_Statement => 1590, - Iir_Kind_Concurrent_Simple_Signal_Assignment => 1603, - Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1616, - Iir_Kind_Concurrent_Selected_Signal_Assignment => 1630, - Iir_Kind_Concurrent_Assertion_Statement => 1638, - Iir_Kind_Concurrent_Procedure_Call_Statement => 1645, - Iir_Kind_Concurrent_Break_Statement => 1653, - Iir_Kind_Psl_Assert_Directive => 1667, - Iir_Kind_Psl_Assume_Directive => 1679, - Iir_Kind_Psl_Cover_Directive => 1691, - Iir_Kind_Psl_Restrict_Directive => 1702, - Iir_Kind_Block_Statement => 1716, - Iir_Kind_If_Generate_Statement => 1727, - Iir_Kind_Case_Generate_Statement => 1736, - Iir_Kind_For_Generate_Statement => 1745, - Iir_Kind_Component_Instantiation_Statement => 1756, - Iir_Kind_Psl_Default_Clock => 1759, - Iir_Kind_Generate_Statement_Body => 1770, - Iir_Kind_If_Generate_Else_Clause => 1776, - Iir_Kind_Simple_Simultaneous_Statement => 1783, - Iir_Kind_Simultaneous_Null_Statement => 1787, - Iir_Kind_Simultaneous_Procedural_Statement => 1798, - Iir_Kind_Simultaneous_Case_Statement => 1807, - Iir_Kind_Simultaneous_If_Statement => 1816, - Iir_Kind_Simultaneous_Elsif => 1822, - Iir_Kind_Simple_Signal_Assignment_Statement => 1833, - Iir_Kind_Conditional_Signal_Assignment_Statement => 1844, - Iir_Kind_Selected_Waveform_Assignment_Statement => 1856, - Iir_Kind_Signal_Force_Assignment_Statement => 1866, - Iir_Kind_Signal_Release_Assignment_Statement => 1875, - Iir_Kind_Null_Statement => 1879, - Iir_Kind_Assertion_Statement => 1886, - Iir_Kind_Report_Statement => 1892, - Iir_Kind_Wait_Statement => 1900, - Iir_Kind_Variable_Assignment_Statement => 1907, - Iir_Kind_Conditional_Variable_Assignment_Statement => 1914, - Iir_Kind_Return_Statement => 1920, - Iir_Kind_For_Loop_Statement => 1931, - Iir_Kind_While_Loop_Statement => 1942, - Iir_Kind_Next_Statement => 1949, - Iir_Kind_Exit_Statement => 1956, - Iir_Kind_Case_Statement => 1965, - Iir_Kind_Procedure_Call_Statement => 1971, - Iir_Kind_Break_Statement => 1978, - Iir_Kind_If_Statement => 1988, - Iir_Kind_Suspend_State_Statement => 1992, - Iir_Kind_Elsif => 1998, - Iir_Kind_Character_Literal => 2005, - Iir_Kind_Simple_Name => 2012, - Iir_Kind_Selected_Name => 2020, - Iir_Kind_Operator_Symbol => 2025, - Iir_Kind_Reference_Name => 2030, - Iir_Kind_External_Constant_Name => 2039, - Iir_Kind_External_Signal_Name => 2048, - Iir_Kind_External_Variable_Name => 2058, - Iir_Kind_Selected_By_All_Name => 2064, - Iir_Kind_Parenthesis_Name => 2069, - Iir_Kind_Package_Pathname => 2073, - Iir_Kind_Absolute_Pathname => 2074, - Iir_Kind_Relative_Pathname => 2075, - Iir_Kind_Pathname_Element => 2080, - Iir_Kind_Base_Attribute => 2082, - Iir_Kind_Subtype_Attribute => 2087, - Iir_Kind_Element_Attribute => 2092, - Iir_Kind_Across_Attribute => 2097, - Iir_Kind_Through_Attribute => 2102, - Iir_Kind_Nature_Reference_Attribute => 2106, - Iir_Kind_Left_Type_Attribute => 2111, - Iir_Kind_Right_Type_Attribute => 2116, - Iir_Kind_High_Type_Attribute => 2121, - Iir_Kind_Low_Type_Attribute => 2126, - Iir_Kind_Ascending_Type_Attribute => 2131, - Iir_Kind_Image_Attribute => 2137, - Iir_Kind_Value_Attribute => 2143, - Iir_Kind_Pos_Attribute => 2149, - Iir_Kind_Val_Attribute => 2155, - Iir_Kind_Succ_Attribute => 2161, - Iir_Kind_Pred_Attribute => 2167, - Iir_Kind_Leftof_Attribute => 2173, - Iir_Kind_Rightof_Attribute => 2179, - Iir_Kind_Signal_Slew_Attribute => 2187, - Iir_Kind_Quantity_Slew_Attribute => 2195, - Iir_Kind_Ramp_Attribute => 2203, - Iir_Kind_Zoh_Attribute => 2211, - Iir_Kind_Ltf_Attribute => 2219, - Iir_Kind_Ztf_Attribute => 2229, - Iir_Kind_Dot_Attribute => 2236, - Iir_Kind_Integ_Attribute => 2243, - Iir_Kind_Quantity_Delayed_Attribute => 2251, - Iir_Kind_Above_Attribute => 2259, - Iir_Kind_Delayed_Attribute => 2268, - Iir_Kind_Stable_Attribute => 2277, - Iir_Kind_Quiet_Attribute => 2286, - Iir_Kind_Transaction_Attribute => 2295, - Iir_Kind_Event_Attribute => 2299, - Iir_Kind_Active_Attribute => 2303, - Iir_Kind_Last_Event_Attribute => 2307, - Iir_Kind_Last_Active_Attribute => 2311, - Iir_Kind_Last_Value_Attribute => 2315, - Iir_Kind_Driving_Attribute => 2319, - Iir_Kind_Driving_Value_Attribute => 2323, - Iir_Kind_Behavior_Attribute => 2323, - Iir_Kind_Structure_Attribute => 2323, - Iir_Kind_Simple_Name_Attribute => 2330, - Iir_Kind_Instance_Name_Attribute => 2335, - Iir_Kind_Path_Name_Attribute => 2340, - Iir_Kind_Left_Array_Attribute => 2347, - Iir_Kind_Right_Array_Attribute => 2354, - Iir_Kind_High_Array_Attribute => 2361, - Iir_Kind_Low_Array_Attribute => 2368, - Iir_Kind_Length_Array_Attribute => 2375, - Iir_Kind_Ascending_Array_Attribute => 2382, - Iir_Kind_Range_Array_Attribute => 2389, - Iir_Kind_Reverse_Range_Array_Attribute => 2396, - Iir_Kind_Attribute_Name => 2405 + Iir_Kind_File_Subtype_Definition => 398, + Iir_Kind_Physical_Subtype_Definition => 408, + Iir_Kind_Floating_Subtype_Definition => 419, + Iir_Kind_Integer_Subtype_Definition => 429, + Iir_Kind_Enumeration_Subtype_Definition => 439, + Iir_Kind_Enumeration_Type_Definition => 450, + Iir_Kind_Integer_Type_Definition => 458, + Iir_Kind_Floating_Type_Definition => 466, + Iir_Kind_Physical_Type_Definition => 477, + Iir_Kind_Range_Expression => 485, + Iir_Kind_Protected_Type_Body => 493, + Iir_Kind_Wildcard_Type_Definition => 497, + Iir_Kind_Foreign_Vector_Type_Definition => 498, + Iir_Kind_Subtype_Definition => 505, + Iir_Kind_Scalar_Nature_Definition => 513, + Iir_Kind_Record_Nature_Definition => 526, + Iir_Kind_Array_Nature_Definition => 540, + Iir_Kind_Array_Subnature_Definition => 555, + Iir_Kind_Overload_List => 556, + Iir_Kind_Foreign_Module => 561, + Iir_Kind_Entity_Declaration => 574, + Iir_Kind_Configuration_Declaration => 584, + Iir_Kind_Context_Declaration => 590, + Iir_Kind_Package_Declaration => 605, + Iir_Kind_Package_Instantiation_Declaration => 619, + Iir_Kind_Vmode_Declaration => 631, + Iir_Kind_Vprop_Declaration => 643, + Iir_Kind_Vunit_Declaration => 656, + Iir_Kind_Package_Body => 664, + Iir_Kind_Architecture_Body => 677, + Iir_Kind_Type_Declaration => 684, + Iir_Kind_Anonymous_Type_Declaration => 690, + Iir_Kind_Subtype_Declaration => 698, + Iir_Kind_Nature_Declaration => 704, + Iir_Kind_Subnature_Declaration => 711, + Iir_Kind_Package_Header => 713, + Iir_Kind_Unit_Declaration => 722, + Iir_Kind_Library_Declaration => 730, + Iir_Kind_Component_Declaration => 740, + Iir_Kind_Attribute_Declaration => 747, + Iir_Kind_Group_Template_Declaration => 753, + Iir_Kind_Group_Declaration => 760, + Iir_Kind_Element_Declaration => 768, + Iir_Kind_Nature_Element_Declaration => 775, + Iir_Kind_Non_Object_Alias_Declaration => 783, + Iir_Kind_Psl_Declaration => 791, + Iir_Kind_Psl_Endpoint_Declaration => 805, + Iir_Kind_Enumeration_Literal => 817, + Iir_Kind_Function_Declaration => 843, + Iir_Kind_Procedure_Declaration => 866, + Iir_Kind_Function_Body => 876, + Iir_Kind_Procedure_Body => 887, + Iir_Kind_Function_Instantiation_Declaration => 898, + Iir_Kind_Procedure_Instantiation_Declaration => 908, + Iir_Kind_Terminal_Declaration => 918, + Iir_Kind_Object_Alias_Declaration => 930, + Iir_Kind_Free_Quantity_Declaration => 942, + Iir_Kind_Spectrum_Quantity_Declaration => 955, + Iir_Kind_Noise_Quantity_Declaration => 967, + Iir_Kind_Across_Quantity_Declaration => 983, + Iir_Kind_Through_Quantity_Declaration => 999, + Iir_Kind_File_Declaration => 1014, + Iir_Kind_Guard_Signal_Declaration => 1028, + Iir_Kind_Signal_Declaration => 1045, + Iir_Kind_Variable_Declaration => 1058, + Iir_Kind_Constant_Declaration => 1072, + Iir_Kind_Iterator_Declaration => 1084, + Iir_Kind_Interface_Constant_Declaration => 1101, + Iir_Kind_Interface_Variable_Declaration => 1117, + Iir_Kind_Interface_Signal_Declaration => 1138, + Iir_Kind_Interface_File_Declaration => 1154, + Iir_Kind_Interface_Quantity_Declaration => 1170, + Iir_Kind_Interface_Terminal_Declaration => 1182, + Iir_Kind_Interface_Type_Declaration => 1194, + Iir_Kind_Interface_Package_Declaration => 1207, + Iir_Kind_Interface_Function_Declaration => 1226, + Iir_Kind_Interface_Procedure_Declaration => 1241, + Iir_Kind_Attribute_Implicit_Declaration => 1244, + Iir_Kind_Suspend_State_Declaration => 1247, + Iir_Kind_Identity_Operator => 1251, + Iir_Kind_Negation_Operator => 1255, + Iir_Kind_Absolute_Operator => 1259, + Iir_Kind_Not_Operator => 1263, + Iir_Kind_Implicit_Condition_Operator => 1267, + Iir_Kind_Condition_Operator => 1271, + Iir_Kind_Reduction_And_Operator => 1275, + Iir_Kind_Reduction_Or_Operator => 1279, + Iir_Kind_Reduction_Nand_Operator => 1283, + Iir_Kind_Reduction_Nor_Operator => 1287, + Iir_Kind_Reduction_Xor_Operator => 1291, + Iir_Kind_Reduction_Xnor_Operator => 1295, + Iir_Kind_And_Operator => 1300, + Iir_Kind_Or_Operator => 1305, + Iir_Kind_Nand_Operator => 1310, + Iir_Kind_Nor_Operator => 1315, + Iir_Kind_Xor_Operator => 1320, + Iir_Kind_Xnor_Operator => 1325, + Iir_Kind_Equality_Operator => 1330, + Iir_Kind_Inequality_Operator => 1335, + Iir_Kind_Less_Than_Operator => 1340, + Iir_Kind_Less_Than_Or_Equal_Operator => 1345, + Iir_Kind_Greater_Than_Operator => 1350, + Iir_Kind_Greater_Than_Or_Equal_Operator => 1355, + Iir_Kind_Match_Equality_Operator => 1360, + Iir_Kind_Match_Inequality_Operator => 1365, + Iir_Kind_Match_Less_Than_Operator => 1370, + Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1375, + Iir_Kind_Match_Greater_Than_Operator => 1380, + Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1385, + Iir_Kind_Sll_Operator => 1390, + Iir_Kind_Sla_Operator => 1395, + Iir_Kind_Srl_Operator => 1400, + Iir_Kind_Sra_Operator => 1405, + Iir_Kind_Rol_Operator => 1410, + Iir_Kind_Ror_Operator => 1415, + Iir_Kind_Addition_Operator => 1420, + Iir_Kind_Substraction_Operator => 1425, + Iir_Kind_Concatenation_Operator => 1430, + Iir_Kind_Multiplication_Operator => 1435, + Iir_Kind_Division_Operator => 1440, + Iir_Kind_Modulus_Operator => 1445, + Iir_Kind_Remainder_Operator => 1450, + Iir_Kind_Exponentiation_Operator => 1455, + Iir_Kind_Function_Call => 1463, + Iir_Kind_Aggregate => 1471, + Iir_Kind_Parenthesis_Expression => 1474, + Iir_Kind_Qualified_Expression => 1478, + Iir_Kind_Type_Conversion => 1483, + Iir_Kind_Allocator_By_Expression => 1488, + Iir_Kind_Allocator_By_Subtype => 1494, + Iir_Kind_Selected_Element => 1502, + Iir_Kind_Dereference => 1507, + Iir_Kind_Implicit_Dereference => 1512, + Iir_Kind_Slice_Name => 1519, + Iir_Kind_Indexed_Name => 1525, + Iir_Kind_Psl_Prev => 1531, + Iir_Kind_Psl_Stable => 1536, + Iir_Kind_Psl_Rose => 1541, + Iir_Kind_Psl_Fell => 1546, + Iir_Kind_Psl_Onehot => 1549, + Iir_Kind_Psl_Onehot0 => 1552, + Iir_Kind_Psl_Expression => 1554, + Iir_Kind_Sensitized_Process_Statement => 1576, + Iir_Kind_Process_Statement => 1597, + Iir_Kind_Concurrent_Simple_Signal_Assignment => 1610, + Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1623, + Iir_Kind_Concurrent_Selected_Signal_Assignment => 1637, + Iir_Kind_Concurrent_Assertion_Statement => 1645, + Iir_Kind_Concurrent_Procedure_Call_Statement => 1652, + Iir_Kind_Concurrent_Break_Statement => 1660, + Iir_Kind_Psl_Assert_Directive => 1674, + Iir_Kind_Psl_Assume_Directive => 1686, + Iir_Kind_Psl_Cover_Directive => 1698, + Iir_Kind_Psl_Restrict_Directive => 1709, + Iir_Kind_Block_Statement => 1723, + Iir_Kind_If_Generate_Statement => 1734, + Iir_Kind_Case_Generate_Statement => 1743, + Iir_Kind_For_Generate_Statement => 1752, + Iir_Kind_Component_Instantiation_Statement => 1763, + Iir_Kind_Psl_Default_Clock => 1766, + Iir_Kind_Generate_Statement_Body => 1777, + Iir_Kind_If_Generate_Else_Clause => 1783, + Iir_Kind_Simple_Simultaneous_Statement => 1790, + Iir_Kind_Simultaneous_Null_Statement => 1794, + Iir_Kind_Simultaneous_Procedural_Statement => 1805, + Iir_Kind_Simultaneous_Case_Statement => 1814, + Iir_Kind_Simultaneous_If_Statement => 1823, + Iir_Kind_Simultaneous_Elsif => 1829, + Iir_Kind_Simple_Signal_Assignment_Statement => 1840, + Iir_Kind_Conditional_Signal_Assignment_Statement => 1851, + Iir_Kind_Selected_Waveform_Assignment_Statement => 1863, + Iir_Kind_Signal_Force_Assignment_Statement => 1873, + Iir_Kind_Signal_Release_Assignment_Statement => 1882, + Iir_Kind_Null_Statement => 1886, + Iir_Kind_Assertion_Statement => 1893, + Iir_Kind_Report_Statement => 1899, + Iir_Kind_Wait_Statement => 1907, + Iir_Kind_Variable_Assignment_Statement => 1914, + Iir_Kind_Conditional_Variable_Assignment_Statement => 1921, + Iir_Kind_Return_Statement => 1927, + Iir_Kind_For_Loop_Statement => 1938, + Iir_Kind_While_Loop_Statement => 1949, + Iir_Kind_Next_Statement => 1956, + Iir_Kind_Exit_Statement => 1963, + Iir_Kind_Case_Statement => 1972, + Iir_Kind_Procedure_Call_Statement => 1978, + Iir_Kind_Break_Statement => 1985, + Iir_Kind_If_Statement => 1995, + Iir_Kind_Suspend_State_Statement => 1999, + Iir_Kind_Elsif => 2005, + Iir_Kind_Character_Literal => 2012, + Iir_Kind_Simple_Name => 2019, + Iir_Kind_Selected_Name => 2027, + Iir_Kind_Operator_Symbol => 2032, + Iir_Kind_Reference_Name => 2037, + Iir_Kind_External_Constant_Name => 2046, + Iir_Kind_External_Signal_Name => 2055, + Iir_Kind_External_Variable_Name => 2065, + Iir_Kind_Selected_By_All_Name => 2071, + Iir_Kind_Parenthesis_Name => 2076, + Iir_Kind_Package_Pathname => 2080, + Iir_Kind_Absolute_Pathname => 2081, + Iir_Kind_Relative_Pathname => 2082, + Iir_Kind_Pathname_Element => 2087, + Iir_Kind_Base_Attribute => 2089, + Iir_Kind_Subtype_Attribute => 2094, + Iir_Kind_Element_Attribute => 2099, + Iir_Kind_Across_Attribute => 2104, + Iir_Kind_Through_Attribute => 2109, + Iir_Kind_Nature_Reference_Attribute => 2113, + Iir_Kind_Left_Type_Attribute => 2118, + Iir_Kind_Right_Type_Attribute => 2123, + Iir_Kind_High_Type_Attribute => 2128, + Iir_Kind_Low_Type_Attribute => 2133, + Iir_Kind_Ascending_Type_Attribute => 2138, + Iir_Kind_Image_Attribute => 2144, + Iir_Kind_Value_Attribute => 2150, + Iir_Kind_Pos_Attribute => 2156, + Iir_Kind_Val_Attribute => 2162, + Iir_Kind_Succ_Attribute => 2168, + Iir_Kind_Pred_Attribute => 2174, + Iir_Kind_Leftof_Attribute => 2180, + Iir_Kind_Rightof_Attribute => 2186, + Iir_Kind_Signal_Slew_Attribute => 2194, + Iir_Kind_Quantity_Slew_Attribute => 2202, + Iir_Kind_Ramp_Attribute => 2210, + Iir_Kind_Zoh_Attribute => 2218, + Iir_Kind_Ltf_Attribute => 2226, + Iir_Kind_Ztf_Attribute => 2236, + Iir_Kind_Dot_Attribute => 2243, + Iir_Kind_Integ_Attribute => 2250, + Iir_Kind_Quantity_Delayed_Attribute => 2258, + Iir_Kind_Above_Attribute => 2266, + Iir_Kind_Delayed_Attribute => 2275, + Iir_Kind_Stable_Attribute => 2284, + Iir_Kind_Quiet_Attribute => 2293, + Iir_Kind_Transaction_Attribute => 2302, + Iir_Kind_Event_Attribute => 2306, + Iir_Kind_Active_Attribute => 2310, + Iir_Kind_Last_Event_Attribute => 2314, + Iir_Kind_Last_Active_Attribute => 2318, + Iir_Kind_Last_Value_Attribute => 2322, + Iir_Kind_Driving_Attribute => 2326, + Iir_Kind_Driving_Value_Attribute => 2330, + Iir_Kind_Behavior_Attribute => 2330, + Iir_Kind_Structure_Attribute => 2330, + Iir_Kind_Simple_Name_Attribute => 2337, + Iir_Kind_Instance_Name_Attribute => 2342, + Iir_Kind_Path_Name_Attribute => 2347, + Iir_Kind_Left_Array_Attribute => 2354, + Iir_Kind_Right_Array_Attribute => 2361, + Iir_Kind_High_Array_Attribute => 2368, + Iir_Kind_Low_Array_Attribute => 2375, + Iir_Kind_Length_Array_Attribute => 2382, + Iir_Kind_Ascending_Array_Attribute => 2389, + Iir_Kind_Range_Array_Attribute => 2396, + Iir_Kind_Reverse_Range_Array_Attribute => 2403, + Iir_Kind_Attribute_Name => 2412 ); function Get_Fields_First (K : Iir_Kind) return Fields_Index is @@ -9481,6 +9492,7 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Array_Subtype_Definition | Iir_Kind_Record_Subtype_Definition | Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Physical_Subtype_Definition | Iir_Kind_Floating_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition @@ -9874,6 +9886,7 @@ package body Vhdl.Nodes_Meta is when Iir_Kind_Array_Subtype_Definition | Iir_Kind_Record_Subtype_Definition | Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Physical_Subtype_Definition | Iir_Kind_Floating_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition @@ -10021,7 +10034,13 @@ package body Vhdl.Nodes_Meta is function Has_Text_File_Flag (K : Iir_Kind) return Boolean is begin - return K = Iir_Kind_File_Type_Definition; + case K is + when Iir_Kind_File_Type_Definition + | Iir_Kind_File_Subtype_Definition => + return True; + when others => + return False; + end case; end Has_Text_File_Flag; function Has_Only_Characters_Flag (K : Iir_Kind) return Boolean is @@ -10061,6 +10080,7 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Array_Subtype_Definition | Iir_Kind_Record_Subtype_Definition | Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Physical_Subtype_Definition | Iir_Kind_Floating_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition @@ -10605,6 +10625,7 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Array_Subtype_Definition | Iir_Kind_Record_Subtype_Definition | Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Physical_Subtype_Definition | Iir_Kind_Floating_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition @@ -10634,6 +10655,7 @@ package body Vhdl.Nodes_Meta is | Iir_Kind_Array_Subtype_Definition | Iir_Kind_Record_Subtype_Definition | Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Physical_Subtype_Definition | Iir_Kind_Floating_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition @@ -12170,6 +12192,7 @@ package body Vhdl.Nodes_Meta is when Iir_Kind_Array_Subtype_Definition | Iir_Kind_Record_Subtype_Definition | Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Physical_Subtype_Definition | Iir_Kind_Floating_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition diff --git a/src/vhdl/vhdl-sem_types.adb b/src/vhdl/vhdl-sem_types.adb index eb3b7e9a7..dbc4230fb 100644 --- a/src/vhdl/vhdl-sem_types.adb +++ b/src/vhdl/vhdl-sem_types.adb @@ -521,7 +521,8 @@ package body Vhdl.Sem_Types is procedure Check_No_File_Type (El_Type : Iir; Loc : Iir) is begin case Get_Kind (El_Type) is - when Iir_Kind_File_Type_Definition => + when Iir_Kind_File_Type_Definition + | Iir_Kind_File_Subtype_Definition => Error_Msg_Sem (+Loc, "file type element not allowed in a composite type"); when Iir_Kind_Protected_Type_Declaration => @@ -1551,6 +1552,10 @@ package body Vhdl.Sem_Types is Set_Constraint_State (Res, Get_Constraint_State (Def)); Copy_Record_Elements_Declaration_List (Res, Def); + when Iir_Kind_File_Type_Definition => + Res := Create_Iir (Iir_Kind_File_Subtype_Definition); + Set_Text_File_Flag (Res, Get_Text_File_Flag (Def)); + when others => -- FIXME: todo (protected type ?) Error_Kind ("copy_subtype_indication", Def); diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb index 8c94903a0..9b7e84c04 100644 --- a/src/vhdl/vhdl-utils.adb +++ b/src/vhdl/vhdl-utils.adb @@ -1039,6 +1039,7 @@ package body Vhdl.Utils is | Iir_Kind_Error => return Res; when Iir_Kind_Access_Subtype_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Integer_Subtype_Definition | Iir_Kind_Floating_Subtype_Definition | Iir_Kind_Enumeration_Subtype_Definition @@ -1342,6 +1343,7 @@ package body Vhdl.Utils is return True; when Iir_Kind_Incomplete_Type_Definition | Iir_Kind_File_Type_Definition + | Iir_Kind_File_Subtype_Definition | Iir_Kind_Interface_Type_Definition => Error_Kind ("are_bounds_locally_static", Def); end case; |