aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-10 18:19:18 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-10 18:19:23 +0100
commit1f65e819edaa21227b7e428deca239beb9b38ce2 (patch)
treef83738b0ab467af17b36d66092a57f639e8879b1
parent947e9b02a14e82093ec995acb3bc51cc93c893bc (diff)
downloadghdl-1f65e819edaa21227b7e428deca239beb9b38ce2.tar.gz
ghdl-1f65e819edaa21227b7e428deca239beb9b38ce2.tar.bz2
ghdl-1f65e819edaa21227b7e428deca239beb9b38ce2.zip
synthesis: add option --vendor-library= for synthesis.
-rw-r--r--python/libghdl/thin/errorout.py58
-rw-r--r--python/libghdl/thin/vhdl/nodes.py4
-rw-r--r--python/libghdl/thin/vhdl/nodes_meta.py286
-rw-r--r--src/ghdldrv/ghdlmain.adb39
-rw-r--r--src/ghdldrv/ghdlmain.ads6
-rw-r--r--src/ghdldrv/ghdlsynth.adb71
-rw-r--r--src/vhdl/vhdl-configuration.adb31
-rw-r--r--src/vhdl/vhdl-nodes.adb16
-rw-r--r--src/vhdl/vhdl-nodes.ads9
-rw-r--r--src/vhdl/vhdl-nodes_meta.adb435
-rw-r--r--src/vhdl/vhdl-nodes_meta.ads2
-rw-r--r--src/vhdl/vhdl-scanner.adb11
-rw-r--r--src/vhdl/vhdl-utils.adb6
13 files changed, 545 insertions, 429 deletions
diff --git a/python/libghdl/thin/errorout.py b/python/libghdl/thin/errorout.py
index cbe6d030e..72df62b06 100644
--- a/python/libghdl/thin/errorout.py
+++ b/python/libghdl/thin/errorout.py
@@ -7,31 +7,33 @@ Enable_Warning = libghdl.errorout__enable_warning
class Msgid:
Msgid_Note = 0
Warnid_Library = 1
- Warnid_Missing_Xref = 2
- Warnid_Default_Binding = 3
- Warnid_Binding = 4
- Warnid_Port = 5
- Warnid_Reserved_Word = 6
- Warnid_Pragma = 7
- Warnid_Nested_Comment = 8
- Warnid_Directive = 9
- Warnid_Parenthesis = 10
- Warnid_Vital_Generic = 11
- Warnid_Delayed_Checks = 12
- Warnid_Body = 13
- Warnid_Specs = 14
- Warnid_Universal = 15
- Warnid_Port_Bounds = 16
- Warnid_Runtime_Error = 17
- Warnid_Delta_Cycle = 18
- Warnid_Shared = 19
- Warnid_Hide = 20
- Warnid_Unused = 21
- Warnid_Others = 22
- Warnid_Pure = 23
- Warnid_Analyze_Assert = 24
- Warnid_Attribute = 25
- Warnid_Static = 26
- Msgid_Warning = 27
- Msgid_Error = 28
- Msgid_Fatal = 29
+ Warnid_Deprecated_Option = 2
+ Warnid_Unexpected_Option = 3
+ Warnid_Missing_Xref = 4
+ Warnid_Default_Binding = 5
+ Warnid_Binding = 6
+ Warnid_Port = 7
+ Warnid_Reserved_Word = 8
+ Warnid_Pragma = 9
+ Warnid_Nested_Comment = 10
+ Warnid_Directive = 11
+ Warnid_Parenthesis = 12
+ Warnid_Vital_Generic = 13
+ Warnid_Delayed_Checks = 14
+ Warnid_Body = 15
+ Warnid_Specs = 16
+ Warnid_Universal = 17
+ Warnid_Port_Bounds = 18
+ Warnid_Runtime_Error = 19
+ Warnid_Delta_Cycle = 20
+ Warnid_Shared = 21
+ Warnid_Hide = 22
+ Warnid_Unused = 23
+ Warnid_Others = 24
+ Warnid_Pure = 25
+ Warnid_Analyze_Assert = 26
+ Warnid_Attribute = 27
+ Warnid_Static = 28
+ Msgid_Warning = 29
+ Msgid_Error = 30
+ Msgid_Fatal = 31
diff --git a/python/libghdl/thin/vhdl/nodes.py b/python/libghdl/thin/vhdl/nodes.py
index 2e4f2a030..e99602691 100644
--- a/python/libghdl/thin/vhdl/nodes.py
+++ b/python/libghdl/thin/vhdl/nodes.py
@@ -2265,6 +2265,10 @@ Get_Elab_Flag = libghdl.vhdl__nodes__get_elab_flag
Set_Elab_Flag = libghdl.vhdl__nodes__set_elab_flag
+Get_Vendor_Library_Flag = libghdl.vhdl__nodes__get_vendor_library_flag
+
+Set_Vendor_Library_Flag = libghdl.vhdl__nodes__set_vendor_library_flag
+
Get_Configuration_Mark_Flag = libghdl.vhdl__nodes__get_configuration_mark_flag
Set_Configuration_Mark_Flag = libghdl.vhdl__nodes__set_configuration_mark_flag
diff --git a/python/libghdl/thin/vhdl/nodes_meta.py b/python/libghdl/thin/vhdl/nodes_meta.py
index 05ea7754e..d6387d3ca 100644
--- a/python/libghdl/thin/vhdl/nodes_meta.py
+++ b/python/libghdl/thin/vhdl/nodes_meta.py
@@ -278,147 +278,148 @@ class fields:
Has_Signal_Flag = 214
Purity_State = 215
Elab_Flag = 216
- Configuration_Mark_Flag = 217
- Configuration_Done_Flag = 218
- Index_Constraint_Flag = 219
- Hide_Implicit_Flag = 220
- Assertion_Condition = 221
- Report_Expression = 222
- Severity_Expression = 223
- Instantiated_Unit = 224
- Generic_Map_Aspect_Chain = 225
- Port_Map_Aspect_Chain = 226
- Configuration_Name = 227
- Component_Configuration = 228
- Configuration_Specification = 229
- Default_Binding_Indication = 230
- Default_Configuration_Declaration = 231
- Expression = 232
- Conditional_Expression_Chain = 233
- Allocator_Designated_Type = 234
- Selected_Waveform_Chain = 235
- Conditional_Waveform_Chain = 236
- Guard_Expression = 237
- Guard_Decl = 238
- Guard_Sensitivity_List = 239
- Signal_Attribute_Chain = 240
- Block_Block_Configuration = 241
- Package_Header = 242
- Block_Header = 243
- Uninstantiated_Package_Name = 244
- Uninstantiated_Package_Decl = 245
- Instance_Source_File = 246
- Generate_Block_Configuration = 247
- Generate_Statement_Body = 248
- Alternative_Label = 249
- Generate_Else_Clause = 250
- Condition = 251
- Else_Clause = 252
- Parameter_Specification = 253
- Parent = 254
- Loop_Label = 255
- Exit_Flag = 256
- Next_Flag = 257
- Component_Name = 258
- Instantiation_List = 259
- Entity_Aspect = 260
- Default_Entity_Aspect = 261
- Binding_Indication = 262
- Named_Entity = 263
- Alias_Declaration = 264
- Referenced_Name = 265
- Expr_Staticness = 266
- Error_Origin = 267
- Operand = 268
- Left = 269
- Right = 270
- Unit_Name = 271
- Name = 272
- Group_Template_Name = 273
- Name_Staticness = 274
- Prefix = 275
- Signature_Prefix = 276
- External_Pathname = 277
- Pathname_Suffix = 278
- Pathname_Expression = 279
- In_Formal_Flag = 280
- Slice_Subtype = 281
- Suffix = 282
- Index_Subtype = 283
- Parameter = 284
- Parameter_2 = 285
- Parameter_3 = 286
- Parameter_4 = 287
- Attr_Chain = 288
- Signal_Attribute_Declaration = 289
- Actual_Type = 290
- Actual_Type_Definition = 291
- Association_Chain = 292
- Individual_Association_Chain = 293
- Subprogram_Association_Chain = 294
- Aggregate_Info = 295
- Sub_Aggregate_Info = 296
- Aggr_Dynamic_Flag = 297
- Aggr_Min_Length = 298
- Aggr_Low_Limit = 299
- Aggr_High_Limit = 300
- Aggr_Others_Flag = 301
- Aggr_Named_Flag = 302
- Aggregate_Expand_Flag = 303
- Association_Choices_Chain = 304
- Case_Statement_Alternative_Chain = 305
- Choice_Staticness = 306
- Procedure_Call = 307
- Implementation = 308
- Parameter_Association_Chain = 309
- Method_Object = 310
- Subtype_Type_Mark = 311
- Subnature_Nature_Mark = 312
- Type_Conversion_Subtype = 313
- Type_Mark = 314
- File_Type_Mark = 315
- Return_Type_Mark = 316
- Has_Disconnect_Flag = 317
- Has_Active_Flag = 318
- Is_Within_Flag = 319
- Type_Marks_List = 320
- Implicit_Alias_Flag = 321
- Alias_Signature = 322
- Attribute_Signature = 323
- Overload_List = 324
- Simple_Name_Identifier = 325
- Simple_Name_Subtype = 326
- Protected_Type_Body = 327
- Protected_Type_Declaration = 328
- Use_Flag = 329
- End_Has_Reserved_Id = 330
- End_Has_Identifier = 331
- End_Has_Postponed = 332
- Has_Label = 333
- Has_Begin = 334
- Has_End = 335
- Has_Is = 336
- Has_Pure = 337
- Has_Body = 338
- Has_Parameter = 339
- Has_Component = 340
- Has_Identifier_List = 341
- Has_Mode = 342
- Has_Class = 343
- Has_Delay_Mechanism = 344
- Suspend_Flag = 345
- Is_Ref = 346
- Is_Forward_Ref = 347
- Psl_Property = 348
- Psl_Sequence = 349
- Psl_Declaration = 350
- Psl_Expression = 351
- Psl_Boolean = 352
- PSL_Clock = 353
- PSL_NFA = 354
- PSL_Nbr_States = 355
- PSL_Clock_Sensitivity = 356
- PSL_EOS_Flag = 357
+ Vendor_Library_Flag = 217
+ Configuration_Mark_Flag = 218
+ Configuration_Done_Flag = 219
+ Index_Constraint_Flag = 220
+ Hide_Implicit_Flag = 221
+ Assertion_Condition = 222
+ Report_Expression = 223
+ Severity_Expression = 224
+ Instantiated_Unit = 225
+ Generic_Map_Aspect_Chain = 226
+ Port_Map_Aspect_Chain = 227
+ Configuration_Name = 228
+ Component_Configuration = 229
+ Configuration_Specification = 230
+ Default_Binding_Indication = 231
+ Default_Configuration_Declaration = 232
+ Expression = 233
+ Conditional_Expression_Chain = 234
+ Allocator_Designated_Type = 235
+ Selected_Waveform_Chain = 236
+ Conditional_Waveform_Chain = 237
+ Guard_Expression = 238
+ Guard_Decl = 239
+ Guard_Sensitivity_List = 240
+ Signal_Attribute_Chain = 241
+ Block_Block_Configuration = 242
+ Package_Header = 243
+ Block_Header = 244
+ Uninstantiated_Package_Name = 245
+ Uninstantiated_Package_Decl = 246
+ Instance_Source_File = 247
+ Generate_Block_Configuration = 248
+ Generate_Statement_Body = 249
+ Alternative_Label = 250
+ Generate_Else_Clause = 251
+ Condition = 252
+ Else_Clause = 253
+ Parameter_Specification = 254
+ Parent = 255
+ Loop_Label = 256
+ Exit_Flag = 257
+ Next_Flag = 258
+ Component_Name = 259
+ Instantiation_List = 260
+ Entity_Aspect = 261
+ Default_Entity_Aspect = 262
+ Binding_Indication = 263
+ Named_Entity = 264
+ Alias_Declaration = 265
+ Referenced_Name = 266
+ Expr_Staticness = 267
+ Error_Origin = 268
+ Operand = 269
+ Left = 270
+ Right = 271
+ Unit_Name = 272
+ Name = 273
+ Group_Template_Name = 274
+ Name_Staticness = 275
+ Prefix = 276
+ Signature_Prefix = 277
+ External_Pathname = 278
+ Pathname_Suffix = 279
+ Pathname_Expression = 280
+ In_Formal_Flag = 281
+ Slice_Subtype = 282
+ Suffix = 283
+ Index_Subtype = 284
+ Parameter = 285
+ Parameter_2 = 286
+ Parameter_3 = 287
+ Parameter_4 = 288
+ Attr_Chain = 289
+ Signal_Attribute_Declaration = 290
+ Actual_Type = 291
+ Actual_Type_Definition = 292
+ Association_Chain = 293
+ Individual_Association_Chain = 294
+ Subprogram_Association_Chain = 295
+ Aggregate_Info = 296
+ Sub_Aggregate_Info = 297
+ Aggr_Dynamic_Flag = 298
+ Aggr_Min_Length = 299
+ Aggr_Low_Limit = 300
+ Aggr_High_Limit = 301
+ Aggr_Others_Flag = 302
+ Aggr_Named_Flag = 303
+ Aggregate_Expand_Flag = 304
+ Association_Choices_Chain = 305
+ Case_Statement_Alternative_Chain = 306
+ Choice_Staticness = 307
+ Procedure_Call = 308
+ Implementation = 309
+ Parameter_Association_Chain = 310
+ Method_Object = 311
+ Subtype_Type_Mark = 312
+ Subnature_Nature_Mark = 313
+ Type_Conversion_Subtype = 314
+ Type_Mark = 315
+ File_Type_Mark = 316
+ Return_Type_Mark = 317
+ Has_Disconnect_Flag = 318
+ Has_Active_Flag = 319
+ Is_Within_Flag = 320
+ Type_Marks_List = 321
+ Implicit_Alias_Flag = 322
+ Alias_Signature = 323
+ Attribute_Signature = 324
+ Overload_List = 325
+ Simple_Name_Identifier = 326
+ Simple_Name_Subtype = 327
+ Protected_Type_Body = 328
+ Protected_Type_Declaration = 329
+ Use_Flag = 330
+ End_Has_Reserved_Id = 331
+ End_Has_Identifier = 332
+ End_Has_Postponed = 333
+ Has_Label = 334
+ Has_Begin = 335
+ Has_End = 336
+ Has_Is = 337
+ Has_Pure = 338
+ Has_Body = 339
+ Has_Parameter = 340
+ Has_Component = 341
+ Has_Identifier_List = 342
+ Has_Mode = 343
+ Has_Class = 344
+ Has_Delay_Mechanism = 345
+ Suspend_Flag = 346
+ Is_Ref = 347
+ Is_Forward_Ref = 348
+ Psl_Property = 349
+ Psl_Sequence = 350
+ Psl_Declaration = 351
+ Psl_Expression = 352
+ Psl_Boolean = 353
+ PSL_Clock = 354
+ PSL_NFA = 355
+ PSL_Nbr_States = 356
+ PSL_Clock_Sensitivity = 357
+ PSL_EOS_Flag = 358
Get_Boolean = libghdl.vhdl__nodes_meta__get_boolean
@@ -1135,6 +1136,9 @@ Has_Purity_State =\
Has_Elab_Flag =\
libghdl.vhdl__nodes_meta__has_elab_flag
+Has_Vendor_Library_Flag =\
+ libghdl.vhdl__nodes_meta__has_vendor_library_flag
+
Has_Configuration_Mark_Flag =\
libghdl.vhdl__nodes_meta__has_configuration_mark_flag
diff --git a/src/ghdldrv/ghdlmain.adb b/src/ghdldrv/ghdlmain.adb
index a6ff2a4a8..3aa3e403f 100644
--- a/src/ghdldrv/ghdlmain.adb
+++ b/src/ghdldrv/ghdlmain.adb
@@ -289,14 +289,12 @@ package body Ghdlmain is
return 0;
end Index;
- -- Decode command CMD_NAME and options from ARGS.
- -- Return the index of the first non-option argument.
- procedure Decode_Command_Options (Cmd_Name : String;
- Cmd : out Command_Acc;
- Args : Argument_List;
- First_Arg : out Natural)
+ -- Decode command CMD_NAME and return the command_type.
+ -- If the command is not known, emit an error message and
+ -- raise Option_Error.
+ function Find_Command_With_Error (Cmd_Name : String) return Command_Acc
is
- Arg_Index : Natural;
+ Cmd : Command_Acc;
begin
-- Decode command.
Cmd := Find_Command (Cmd_Name);
@@ -305,7 +303,16 @@ package body Ghdlmain is
raise Option_Error;
end if;
- Init (Cmd.all);
+ return Cmd;
+ end Find_Command_With_Error;
+
+ procedure Decode_Command_Options (Cmd : in out Command_Type'Class;
+ Args : Argument_List;
+ First_Arg : out Natural)
+ is
+ Arg_Index : Natural;
+ begin
+ Init (Cmd);
-- Decode options.
@@ -324,11 +331,10 @@ package body Ghdlmain is
raise Option_Error;
end if;
- Decode_Option (Cmd.all, Arg.all, "", Res);
+ Decode_Option (Cmd, Arg.all, "", Res);
case Res is
when Option_Unknown =>
- Error ("unknown option '" & Arg.all & "' for command '"
- & Cmd_Name & "'");
+ Error ("unknown option '" & Arg.all & "'");
raise Option_Error;
when Option_Err =>
raise Option_Error;
@@ -341,7 +347,7 @@ package body Ghdlmain is
raise Option_Error;
end if;
Decode_Option
- (Cmd.all, Arg.all, Args (Arg_Index + 1).all, Res);
+ (Cmd, Arg.all, Args (Arg_Index + 1).all, Res);
if Res /= Option_Arg then
raise Program_Error;
end if;
@@ -364,6 +370,15 @@ package body Ghdlmain is
end if;
end Decode_Command_Options;
+ procedure Decode_Command_Options (Cmd_Name : String;
+ Cmd : out Command_Acc;
+ Args : Argument_List;
+ First_Arg : out Natural) is
+ begin
+ Cmd := Find_Command_With_Error (Cmd_Name);
+ Decode_Command_Options (Cmd.all, Args, First_Arg);
+ end Decode_Command_Options;
+
Is_Windows : constant Boolean :=
Default_Paths.Shared_Library_Extension = ".dll";
diff --git a/src/ghdldrv/ghdlmain.ads b/src/ghdldrv/ghdlmain.ads
index 24bd185be..b009d7a93 100644
--- a/src/ghdldrv/ghdlmain.ads
+++ b/src/ghdldrv/ghdlmain.ads
@@ -84,6 +84,12 @@ package Ghdlmain is
-- Exec failed: either the program was not found, or failed.
Exec_Error : exception;
+ -- Decode options from ARGS for command CMD after initializing CMD.
+ -- Return the index of the first non-option argument.
+ procedure Decode_Command_Options (Cmd : in out Command_Type'Class;
+ Args : Argument_List;
+ First_Arg : out Natural);
+
-- Decode command CMD_NAME and options from ARGS.
-- Return the index of the first non-option argument.
procedure Decode_Command_Options (Cmd_Name : String;
diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb
index 3f2792f6a..3aeeed1a5 100644
--- a/src/ghdldrv/ghdlsynth.adb
+++ b/src/ghdldrv/ghdlsynth.adb
@@ -19,6 +19,7 @@
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Types; use Types;
+with Name_Table;
with Ghdllocal; use Ghdllocal;
with Ghdlcomp; use Ghdlcomp;
with Ghdlmain; use Ghdlmain;
@@ -53,6 +54,8 @@ package body Ghdlsynth is
type Out_Format is
(Format_Default, Format_Raw, Format_Dump, Format_Vhdl, Format_None);
+ type Name_Id_Array is array (Natural range <>) of Name_Id;
+
-- Command --synth
type Command_Synth is new Command_Lib with record
-- Control format of the output.
@@ -65,6 +68,9 @@ package body Ghdlsynth is
-- If True, a failure is expected. For tests.
Expect_Failure : Boolean := False;
+
+ Nbr_Vendor_Libraries : Natural := 0;
+ Vendor_Libraries : Name_Id_Array (1 .. 8) := (others => No_Name_Id);
end record;
function Decode_Command (Cmd : Command_Synth; Name : String)
return Boolean;
@@ -98,6 +104,8 @@ package body Ghdlsynth is
is
pragma Assert (Option'First = 1);
begin
+ Res := Option_Ok;
+
if Option'Last > 3
and then Option (2) = 'g'
and then Is_Generic_Override_Option (Option)
@@ -107,45 +115,54 @@ package body Ghdlsynth is
Cmd.Top_Encoding := Name_Hash;
elsif Option = "--top-name=asis" then
Cmd.Top_Encoding := Name_Asis;
+ elsif Option'Last > 17
+ and then Option (1 .. 17) = "--vendor-library="
+ then
+ if Cmd.Nbr_Vendor_Libraries >= Cmd.Vendor_Libraries'Last then
+ -- FIXME: use a table/vector ?
+ Errorout.Error_Msg_Option ("too many vendor libraries");
+ Res := Option_Err;
+ else
+ declare
+ Name : String := Option (18 .. Option'Last);
+ Err : Boolean;
+ begin
+ Vhdl.Scanner.Convert_Identifier (Name, Err);
+ if Err then
+ Res := Option_Err;
+ else
+ Cmd.Nbr_Vendor_Libraries := Cmd.Nbr_Vendor_Libraries + 1;
+ Cmd.Vendor_Libraries (Cmd.Nbr_Vendor_Libraries) :=
+ Name_Table.Get_Identifier (Name);
+ end if;
+ end;
+ end if;
elsif Option = "--expect-failure" then
Cmd.Expect_Failure := True;
- Res := Option_Ok;
elsif Option = "--disp-noinline" then
Cmd.Disp_Inline := False;
- Res := Option_Ok;
elsif Option = "--disp-noid" then
Cmd.Disp_Id := False;
- Res := Option_Ok;
elsif Option = "--out=raw" then
Cmd.Oformat := Format_Raw;
- Res := Option_Ok;
elsif Option = "--out=dump" then
Cmd.Oformat := Format_Dump;
- Res := Option_Ok;
elsif Option = "--out=none" then
Cmd.Oformat := Format_None;
- Res := Option_Ok;
elsif Option = "--out=vhdl" then
Cmd.Oformat := Format_Vhdl;
- Res := Option_Ok;
elsif Option = "-di" then
Flag_Debug_Noinference := True;
- Res := Option_Ok;
elsif Option = "-dc" then
Flag_Debug_Nocleanup := True;
- Res := Option_Ok;
elsif Option = "-dm" then
Flag_Debug_Nomemory := True;
- Res := Option_Ok;
elsif Option = "-de" then
Flag_Debug_Noexpand := True;
- Res := Option_Ok;
elsif Option = "-t" then
Flag_Trace_Statements := True;
- Res := Option_Ok;
elsif Option = "-i" then
Flag_Debug_Init := True;
- Res := Option_Ok;
else
Decode_Option (Command_Lib (Cmd), Option, Arg, Res);
end if;
@@ -153,8 +170,8 @@ package body Ghdlsynth is
-- Init, analyze and configure.
-- Return the top configuration.
- function Ghdl_Synth_Configure (Init : Boolean; Args : Argument_List)
- return Node
+ function Ghdl_Synth_Configure
+ (Init : Boolean; Cmd : Command_Synth; Args : Argument_List) return Node
is
use Vhdl.Errors;
use Vhdl.Configuration;
@@ -196,6 +213,17 @@ package body Ghdlsynth is
Vhdl.Canon.Canon_Flag_Inertial_Associations := False;
end if;
+ -- Mark vendor libraries.
+ for I in 1 .. Cmd.Nbr_Vendor_Libraries loop
+ declare
+ Lib : Node;
+ begin
+ Lib := Libraries.Get_Library
+ (Cmd.Vendor_Libraries (I), No_Location);
+ Set_Vendor_Library_Flag (Lib, True);
+ end;
+ end loop;
+
Flags.Flag_Elaborate_With_Outdated := E_Opt >= Args'First;
-- Analyze files (if any)
@@ -322,7 +350,7 @@ package body Ghdlsynth is
use Vhdl.Configuration;
Args : Argument_List (1 .. Argc);
Res : Module;
- Cmd : Command_Acc;
+ Cmd : Command_Synth;
First_Arg : Natural;
Config : Node;
Inst : Synth_Instance_Acc;
@@ -337,22 +365,21 @@ package body Ghdlsynth is
end loop;
-- Find the command. This is a little bit convoluted...
- Decode_Command_Options ("--synth", Cmd, Args, First_Arg);
+ Decode_Command_Options (Cmd, Args, First_Arg);
-- Do the real work!
Config := Ghdl_Synth_Configure
- (Init /= 0, Args (First_Arg .. Args'Last));
+ (Init /= 0, Cmd, Args (First_Arg .. Args'Last));
if Config = Null_Iir then
return No_Module;
end if;
- Synthesis.Synth_Design
- (Config, Command_Synth (Cmd.all).Top_Encoding, Res, Inst);
+ Synthesis.Synth_Design (Config, Cmd.Top_Encoding, Res, Inst);
if Res = No_Module then
return No_Module;
end if;
- Disp_Design (Command_Synth (Cmd.all), Format_None, Res, Config, Inst);
+ Disp_Design (Cmd, Format_None, Res, Config, Inst);
-- De-elaborate all packages, so that they could be re-used for
-- synthesis of a second design.
@@ -382,7 +409,7 @@ package body Ghdlsynth is
Inst : Synth_Instance_Acc;
Config : Iir;
begin
- Config := Ghdl_Synth_Configure (True, Args);
+ Config := Ghdl_Synth_Configure (True, Cmd, Args);
if Config = Null_Iir then
if Cmd.Expect_Failure then
diff --git a/src/vhdl/vhdl-configuration.adb b/src/vhdl/vhdl-configuration.adb
index d583597e2..8865b0ae3 100644
--- a/src/vhdl/vhdl-configuration.adb
+++ b/src/vhdl/vhdl-configuration.adb
@@ -539,6 +539,19 @@ package body Vhdl.Configuration is
end loop;
end Check_Binding_Indication;
+ function Is_In_Vendor_Library (Inst : Iir) return Boolean
+ is
+ Parent : Iir;
+ begin
+ Parent := Strip_Denoting_Name (Inst);
+ loop
+ Parent := Get_Parent (Parent);
+ if Get_Kind (Parent) = Iir_Kind_Library_Declaration then
+ return Get_Vendor_Library_Flag (Parent);
+ end if;
+ end loop;
+ end Is_In_Vendor_Library;
+
-- CONF is either a configuration specification or a component
-- configuration.
-- If ADD_DEFAULT is true, then the default configuration for the design
@@ -548,18 +561,22 @@ package body Vhdl.Configuration is
Bind : constant Iir_Binding_Indication := Get_Binding_Indication (Conf);
Aspect : Iir;
Inst : Iir;
+ Comp : Iir;
begin
if Bind = Null_Iir then
if Is_Warning_Enabled (Warnid_Binding) then
Inst := Get_Nth_Element (Get_Instantiation_List (Conf), 0);
Inst := Strip_Denoting_Name (Inst);
- Report_Start_Group;
- Warning_Msg_Elab (Warnid_Binding, Conf,
- "instance %i of component %i is not bound",
- (+Inst, +Get_Instantiated_Unit (Inst)));
- Warning_Msg_Elab (Warnid_Binding, Current_Configuration,
- "(in %n)", +Current_Configuration);
- Report_End_Group;
+ Comp := Get_Instantiated_Unit (Inst);
+ if not Is_In_Vendor_Library (Comp) then
+ Report_Start_Group;
+ Warning_Msg_Elab (Warnid_Binding, Conf,
+ "instance %i of component %i is not bound",
+ (+Inst, +Comp));
+ Warning_Msg_Elab (Warnid_Binding, Current_Configuration,
+ "(in %n)", +Current_Configuration);
+ Report_End_Group;
+ end if;
end if;
return;
end if;
diff --git a/src/vhdl/vhdl-nodes.adb b/src/vhdl/vhdl-nodes.adb
index 518270114..fed51ba7e 100644
--- a/src/vhdl/vhdl-nodes.adb
+++ b/src/vhdl/vhdl-nodes.adb
@@ -4857,6 +4857,22 @@ package body Vhdl.Nodes is
Set_Flag3 (Design, Flag);
end Set_Elab_Flag;
+ function Get_Vendor_Library_Flag (Lib : Iir) return Boolean is
+ begin
+ pragma Assert (Lib /= Null_Iir);
+ pragma Assert (Has_Vendor_Library_Flag (Get_Kind (Lib)),
+ "no field Vendor_Library_Flag");
+ return Get_Flag1 (Lib);
+ end Get_Vendor_Library_Flag;
+
+ procedure Set_Vendor_Library_Flag (Lib : Iir; Flag : Boolean) is
+ begin
+ pragma Assert (Lib /= Null_Iir);
+ pragma Assert (Has_Vendor_Library_Flag (Get_Kind (Lib)),
+ "no field Vendor_Library_Flag");
+ Set_Flag1 (Lib, Flag);
+ end Set_Vendor_Library_Flag;
+
function Get_Configuration_Mark_Flag (Design : Iir) return Boolean is
begin
pragma Assert (Design /= Null_Iir);
diff --git a/src/vhdl/vhdl-nodes.ads b/src/vhdl/vhdl-nodes.ads
index 104cf529a..a9ba20275 100644
--- a/src/vhdl/vhdl-nodes.ads
+++ b/src/vhdl/vhdl-nodes.ads
@@ -1122,6 +1122,11 @@ package Vhdl.Nodes is
-- Get/Set_Elab_Flag (Flag3)
--
-- Get/Set_Visible_Flag (Flag4)
+ --
+ -- Set on vendor libraries to turn off warnings on unbounded instantiation.
+ -- The vendor libraries are those providing components/entities for
+ -- hard-macros.
+ -- Get/Set_Vendor_Library_Flag (Flag1)
-- Iir_Kind_Component_Declaration (Medium)
--
@@ -8013,6 +8018,10 @@ package Vhdl.Nodes is
function Get_Elab_Flag (Design : Iir) return Boolean;
procedure Set_Elab_Flag (Design : Iir; Flag : Boolean);
+ -- Field: Flag1
+ function Get_Vendor_Library_Flag (Lib : Iir) return Boolean;
+ procedure Set_Vendor_Library_Flag (Lib : Iir; Flag : Boolean);
+
-- Used only by configuration to mark a design unit as already inserted in
-- the list of units. Used to avoid double insertion.
-- Field: Flag4
diff --git a/src/vhdl/vhdl-nodes_meta.adb b/src/vhdl/vhdl-nodes_meta.adb
index c4e5e7d1a..48a05f0aa 100644
--- a/src/vhdl/vhdl-nodes_meta.adb
+++ b/src/vhdl/vhdl-nodes_meta.adb
@@ -236,6 +236,7 @@ package body Vhdl.Nodes_Meta is
Field_Has_Signal_Flag => Type_Boolean,
Field_Purity_State => Type_Iir_Pure_State,
Field_Elab_Flag => Type_Boolean,
+ Field_Vendor_Library_Flag => Type_Boolean,
Field_Configuration_Mark_Flag => Type_Boolean,
Field_Configuration_Done_Flag => Type_Boolean,
Field_Index_Constraint_Flag => Type_Boolean,
@@ -821,6 +822,8 @@ package body Vhdl.Nodes_Meta is
return "purity_state";
when Field_Elab_Flag =>
return "elab_flag";
+ when Field_Vendor_Library_Flag =>
+ return "vendor_library_flag";
when Field_Configuration_Mark_Flag =>
return "configuration_mark_flag";
when Field_Configuration_Done_Flag =>
@@ -2163,6 +2166,8 @@ package body Vhdl.Nodes_Meta is
return Attr_None;
when Field_Elab_Flag =>
return Attr_None;
+ when Field_Vendor_Library_Flag =>
+ return Attr_None;
when Field_Configuration_Mark_Flag =>
return Attr_None;
when Field_Configuration_Done_Flag =>
@@ -3241,6 +3246,7 @@ package body Vhdl.Nodes_Meta is
Field_Identifier,
Field_Date,
Field_Library_Directory,
+ Field_Vendor_Library_Flag,
Field_Elab_Flag,
Field_Visible_Flag,
Field_Design_File_Chain,
@@ -5151,216 +5157,216 @@ package body Vhdl.Nodes_Meta is
Iir_Kind_Subnature_Declaration => 678,
Iir_Kind_Package_Header => 680,
Iir_Kind_Unit_Declaration => 689,
- Iir_Kind_Library_Declaration => 696,
- Iir_Kind_Component_Declaration => 706,
- Iir_Kind_Attribute_Declaration => 713,
- Iir_Kind_Group_Template_Declaration => 719,
- Iir_Kind_Group_Declaration => 726,
- Iir_Kind_Element_Declaration => 733,
- Iir_Kind_Nature_Element_Declaration => 740,
- Iir_Kind_Non_Object_Alias_Declaration => 748,
- Iir_Kind_Psl_Declaration => 756,
- Iir_Kind_Psl_Endpoint_Declaration => 770,
- Iir_Kind_Enumeration_Literal => 781,
- Iir_Kind_Function_Declaration => 806,
- Iir_Kind_Procedure_Declaration => 830,
- Iir_Kind_Function_Body => 840,
- Iir_Kind_Procedure_Body => 851,
- Iir_Kind_Terminal_Declaration => 860,
- Iir_Kind_Object_Alias_Declaration => 871,
- Iir_Kind_Free_Quantity_Declaration => 883,
- Iir_Kind_Spectrum_Quantity_Declaration => 896,
- Iir_Kind_Noise_Quantity_Declaration => 908,
- Iir_Kind_Across_Quantity_Declaration => 924,
- Iir_Kind_Through_Quantity_Declaration => 940,
- Iir_Kind_File_Declaration => 954,
- Iir_Kind_Guard_Signal_Declaration => 967,
- Iir_Kind_Signal_Declaration => 984,
- Iir_Kind_Variable_Declaration => 997,
- Iir_Kind_Constant_Declaration => 1011,
- Iir_Kind_Iterator_Declaration => 1022,
- Iir_Kind_Interface_Constant_Declaration => 1038,
- Iir_Kind_Interface_Variable_Declaration => 1054,
- Iir_Kind_Interface_Signal_Declaration => 1075,
- Iir_Kind_Interface_File_Declaration => 1091,
- Iir_Kind_Interface_Quantity_Declaration => 1107,
- Iir_Kind_Interface_Terminal_Declaration => 1119,
- Iir_Kind_Interface_Type_Declaration => 1129,
- Iir_Kind_Interface_Package_Declaration => 1141,
- Iir_Kind_Interface_Function_Declaration => 1158,
- Iir_Kind_Interface_Procedure_Declaration => 1171,
- Iir_Kind_Anonymous_Signal_Declaration => 1180,
- Iir_Kind_Signal_Attribute_Declaration => 1183,
- Iir_Kind_Identity_Operator => 1187,
- Iir_Kind_Negation_Operator => 1191,
- Iir_Kind_Absolute_Operator => 1195,
- Iir_Kind_Not_Operator => 1199,
- Iir_Kind_Implicit_Condition_Operator => 1203,
- Iir_Kind_Condition_Operator => 1207,
- Iir_Kind_Reduction_And_Operator => 1211,
- Iir_Kind_Reduction_Or_Operator => 1215,
- Iir_Kind_Reduction_Nand_Operator => 1219,
- Iir_Kind_Reduction_Nor_Operator => 1223,
- Iir_Kind_Reduction_Xor_Operator => 1227,
- Iir_Kind_Reduction_Xnor_Operator => 1231,
- Iir_Kind_And_Operator => 1236,
- Iir_Kind_Or_Operator => 1241,
- Iir_Kind_Nand_Operator => 1246,
- Iir_Kind_Nor_Operator => 1251,
- Iir_Kind_Xor_Operator => 1256,
- Iir_Kind_Xnor_Operator => 1261,
- Iir_Kind_Equality_Operator => 1266,
- Iir_Kind_Inequality_Operator => 1271,
- Iir_Kind_Less_Than_Operator => 1276,
- Iir_Kind_Less_Than_Or_Equal_Operator => 1281,
- Iir_Kind_Greater_Than_Operator => 1286,
- Iir_Kind_Greater_Than_Or_Equal_Operator => 1291,
- Iir_Kind_Match_Equality_Operator => 1296,
- Iir_Kind_Match_Inequality_Operator => 1301,
- Iir_Kind_Match_Less_Than_Operator => 1306,
- Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1311,
- Iir_Kind_Match_Greater_Than_Operator => 1316,
- Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1321,
- Iir_Kind_Sll_Operator => 1326,
- Iir_Kind_Sla_Operator => 1331,
- Iir_Kind_Srl_Operator => 1336,
- Iir_Kind_Sra_Operator => 1341,
- Iir_Kind_Rol_Operator => 1346,
- Iir_Kind_Ror_Operator => 1351,
- Iir_Kind_Addition_Operator => 1356,
- Iir_Kind_Substraction_Operator => 1361,
- Iir_Kind_Concatenation_Operator => 1366,
- Iir_Kind_Multiplication_Operator => 1371,
- Iir_Kind_Division_Operator => 1376,
- Iir_Kind_Modulus_Operator => 1381,
- Iir_Kind_Remainder_Operator => 1386,
- Iir_Kind_Exponentiation_Operator => 1391,
- Iir_Kind_Function_Call => 1399,
- Iir_Kind_Aggregate => 1406,
- Iir_Kind_Parenthesis_Expression => 1409,
- Iir_Kind_Qualified_Expression => 1413,
- Iir_Kind_Type_Conversion => 1418,
- Iir_Kind_Allocator_By_Expression => 1422,
- Iir_Kind_Allocator_By_Subtype => 1427,
- Iir_Kind_Selected_Element => 1435,
- Iir_Kind_Dereference => 1440,
- Iir_Kind_Implicit_Dereference => 1445,
- Iir_Kind_Slice_Name => 1452,
- Iir_Kind_Indexed_Name => 1458,
- Iir_Kind_Psl_Expression => 1460,
- Iir_Kind_Sensitized_Process_Statement => 1481,
- Iir_Kind_Process_Statement => 1501,
- Iir_Kind_Concurrent_Simple_Signal_Assignment => 1514,
- Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1527,
- Iir_Kind_Concurrent_Selected_Signal_Assignment => 1541,
- Iir_Kind_Concurrent_Assertion_Statement => 1549,
- Iir_Kind_Concurrent_Procedure_Call_Statement => 1556,
- Iir_Kind_Concurrent_Break_Statement => 1564,
- Iir_Kind_Psl_Assert_Directive => 1577,
- Iir_Kind_Psl_Assume_Directive => 1588,
- Iir_Kind_Psl_Cover_Directive => 1600,
- Iir_Kind_Psl_Restrict_Directive => 1611,
- Iir_Kind_Block_Statement => 1625,
- Iir_Kind_If_Generate_Statement => 1636,
- Iir_Kind_Case_Generate_Statement => 1645,
- Iir_Kind_For_Generate_Statement => 1654,
- Iir_Kind_Component_Instantiation_Statement => 1665,
- Iir_Kind_Psl_Default_Clock => 1669,
- Iir_Kind_Generate_Statement_Body => 1680,
- Iir_Kind_If_Generate_Else_Clause => 1686,
- Iir_Kind_Simple_Simultaneous_Statement => 1693,
- Iir_Kind_Simultaneous_Null_Statement => 1697,
- Iir_Kind_Simultaneous_Procedural_Statement => 1708,
- Iir_Kind_Simultaneous_Case_Statement => 1717,
- Iir_Kind_Simultaneous_If_Statement => 1726,
- Iir_Kind_Simultaneous_Elsif => 1732,
- Iir_Kind_Simple_Signal_Assignment_Statement => 1743,
- Iir_Kind_Conditional_Signal_Assignment_Statement => 1754,
- Iir_Kind_Selected_Waveform_Assignment_Statement => 1766,
- Iir_Kind_Null_Statement => 1770,
- Iir_Kind_Assertion_Statement => 1777,
- Iir_Kind_Report_Statement => 1783,
- Iir_Kind_Wait_Statement => 1791,
- Iir_Kind_Variable_Assignment_Statement => 1798,
- Iir_Kind_Conditional_Variable_Assignment_Statement => 1805,
- Iir_Kind_Return_Statement => 1811,
- Iir_Kind_For_Loop_Statement => 1822,
- Iir_Kind_While_Loop_Statement => 1833,
- Iir_Kind_Next_Statement => 1840,
- Iir_Kind_Exit_Statement => 1847,
- Iir_Kind_Case_Statement => 1855,
- Iir_Kind_Procedure_Call_Statement => 1861,
- Iir_Kind_Break_Statement => 1868,
- Iir_Kind_If_Statement => 1878,
- Iir_Kind_Elsif => 1884,
- Iir_Kind_Character_Literal => 1892,
- Iir_Kind_Simple_Name => 1900,
- Iir_Kind_Selected_Name => 1909,
- Iir_Kind_Operator_Symbol => 1915,
- Iir_Kind_Reference_Name => 1920,
- Iir_Kind_External_Constant_Name => 1928,
- Iir_Kind_External_Signal_Name => 1936,
- Iir_Kind_External_Variable_Name => 1945,
- Iir_Kind_Selected_By_All_Name => 1951,
- Iir_Kind_Parenthesis_Name => 1956,
- Iir_Kind_Package_Pathname => 1960,
- Iir_Kind_Absolute_Pathname => 1961,
- Iir_Kind_Relative_Pathname => 1962,
- Iir_Kind_Pathname_Element => 1967,
- Iir_Kind_Base_Attribute => 1969,
- Iir_Kind_Subtype_Attribute => 1974,
- Iir_Kind_Element_Attribute => 1979,
- Iir_Kind_Across_Attribute => 1984,
- Iir_Kind_Through_Attribute => 1989,
- Iir_Kind_Nature_Reference_Attribute => 1993,
- Iir_Kind_Left_Type_Attribute => 1998,
- Iir_Kind_Right_Type_Attribute => 2003,
- Iir_Kind_High_Type_Attribute => 2008,
- Iir_Kind_Low_Type_Attribute => 2013,
- Iir_Kind_Ascending_Type_Attribute => 2018,
- Iir_Kind_Image_Attribute => 2024,
- Iir_Kind_Value_Attribute => 2030,
- Iir_Kind_Pos_Attribute => 2036,
- Iir_Kind_Val_Attribute => 2042,
- Iir_Kind_Succ_Attribute => 2048,
- Iir_Kind_Pred_Attribute => 2054,
- Iir_Kind_Leftof_Attribute => 2060,
- Iir_Kind_Rightof_Attribute => 2066,
- Iir_Kind_Signal_Slew_Attribute => 2074,
- Iir_Kind_Quantity_Slew_Attribute => 2082,
- Iir_Kind_Ramp_Attribute => 2090,
- Iir_Kind_Zoh_Attribute => 2098,
- Iir_Kind_Ltf_Attribute => 2106,
- Iir_Kind_Ztf_Attribute => 2116,
- Iir_Kind_Dot_Attribute => 2123,
- Iir_Kind_Integ_Attribute => 2130,
- Iir_Kind_Above_Attribute => 2138,
- Iir_Kind_Quantity_Delayed_Attribute => 2146,
- Iir_Kind_Delayed_Attribute => 2155,
- Iir_Kind_Stable_Attribute => 2164,
- Iir_Kind_Quiet_Attribute => 2173,
- Iir_Kind_Transaction_Attribute => 2182,
- Iir_Kind_Event_Attribute => 2186,
- Iir_Kind_Active_Attribute => 2190,
- Iir_Kind_Last_Event_Attribute => 2194,
- Iir_Kind_Last_Active_Attribute => 2198,
- Iir_Kind_Last_Value_Attribute => 2202,
- Iir_Kind_Driving_Attribute => 2206,
- Iir_Kind_Driving_Value_Attribute => 2210,
- Iir_Kind_Behavior_Attribute => 2210,
- Iir_Kind_Structure_Attribute => 2210,
- Iir_Kind_Simple_Name_Attribute => 2217,
- Iir_Kind_Instance_Name_Attribute => 2222,
- Iir_Kind_Path_Name_Attribute => 2227,
- Iir_Kind_Left_Array_Attribute => 2234,
- Iir_Kind_Right_Array_Attribute => 2241,
- Iir_Kind_High_Array_Attribute => 2248,
- Iir_Kind_Low_Array_Attribute => 2255,
- Iir_Kind_Length_Array_Attribute => 2262,
- Iir_Kind_Ascending_Array_Attribute => 2269,
- Iir_Kind_Range_Array_Attribute => 2276,
- Iir_Kind_Reverse_Range_Array_Attribute => 2283,
- Iir_Kind_Attribute_Name => 2292
+ Iir_Kind_Library_Declaration => 697,
+ Iir_Kind_Component_Declaration => 707,
+ Iir_Kind_Attribute_Declaration => 714,
+ Iir_Kind_Group_Template_Declaration => 720,
+ Iir_Kind_Group_Declaration => 727,
+ Iir_Kind_Element_Declaration => 734,
+ Iir_Kind_Nature_Element_Declaration => 741,
+ Iir_Kind_Non_Object_Alias_Declaration => 749,
+ Iir_Kind_Psl_Declaration => 757,
+ Iir_Kind_Psl_Endpoint_Declaration => 771,
+ Iir_Kind_Enumeration_Literal => 782,
+ Iir_Kind_Function_Declaration => 807,
+ Iir_Kind_Procedure_Declaration => 831,
+ Iir_Kind_Function_Body => 841,
+ Iir_Kind_Procedure_Body => 852,
+ Iir_Kind_Terminal_Declaration => 861,
+ Iir_Kind_Object_Alias_Declaration => 872,
+ Iir_Kind_Free_Quantity_Declaration => 884,
+ Iir_Kind_Spectrum_Quantity_Declaration => 897,
+ Iir_Kind_Noise_Quantity_Declaration => 909,
+ Iir_Kind_Across_Quantity_Declaration => 925,
+ Iir_Kind_Through_Quantity_Declaration => 941,
+ Iir_Kind_File_Declaration => 955,
+ Iir_Kind_Guard_Signal_Declaration => 968,
+ Iir_Kind_Signal_Declaration => 985,
+ Iir_Kind_Variable_Declaration => 998,
+ Iir_Kind_Constant_Declaration => 1012,
+ Iir_Kind_Iterator_Declaration => 1023,
+ Iir_Kind_Interface_Constant_Declaration => 1039,
+ Iir_Kind_Interface_Variable_Declaration => 1055,
+ Iir_Kind_Interface_Signal_Declaration => 1076,
+ Iir_Kind_Interface_File_Declaration => 1092,
+ Iir_Kind_Interface_Quantity_Declaration => 1108,
+ Iir_Kind_Interface_Terminal_Declaration => 1120,
+ Iir_Kind_Interface_Type_Declaration => 1130,
+ Iir_Kind_Interface_Package_Declaration => 1142,
+ Iir_Kind_Interface_Function_Declaration => 1159,
+ Iir_Kind_Interface_Procedure_Declaration => 1172,
+ Iir_Kind_Anonymous_Signal_Declaration => 1181,
+ Iir_Kind_Signal_Attribute_Declaration => 1184,
+ Iir_Kind_Identity_Operator => 1188,
+ Iir_Kind_Negation_Operator => 1192,
+ Iir_Kind_Absolute_Operator => 1196,
+ Iir_Kind_Not_Operator => 1200,
+ Iir_Kind_Implicit_Condition_Operator => 1204,
+ Iir_Kind_Condition_Operator => 1208,
+ Iir_Kind_Reduction_And_Operator => 1212,
+ Iir_Kind_Reduction_Or_Operator => 1216,
+ Iir_Kind_Reduction_Nand_Operator => 1220,
+ Iir_Kind_Reduction_Nor_Operator => 1224,
+ Iir_Kind_Reduction_Xor_Operator => 1228,
+ Iir_Kind_Reduction_Xnor_Operator => 1232,
+ Iir_Kind_And_Operator => 1237,
+ Iir_Kind_Or_Operator => 1242,
+ Iir_Kind_Nand_Operator => 1247,
+ Iir_Kind_Nor_Operator => 1252,
+ Iir_Kind_Xor_Operator => 1257,
+ Iir_Kind_Xnor_Operator => 1262,
+ Iir_Kind_Equality_Operator => 1267,
+ Iir_Kind_Inequality_Operator => 1272,
+ Iir_Kind_Less_Than_Operator => 1277,
+ Iir_Kind_Less_Than_Or_Equal_Operator => 1282,
+ Iir_Kind_Greater_Than_Operator => 1287,
+ Iir_Kind_Greater_Than_Or_Equal_Operator => 1292,
+ Iir_Kind_Match_Equality_Operator => 1297,
+ Iir_Kind_Match_Inequality_Operator => 1302,
+ Iir_Kind_Match_Less_Than_Operator => 1307,
+ Iir_Kind_Match_Less_Than_Or_Equal_Operator => 1312,
+ Iir_Kind_Match_Greater_Than_Operator => 1317,
+ Iir_Kind_Match_Greater_Than_Or_Equal_Operator => 1322,
+ Iir_Kind_Sll_Operator => 1327,
+ Iir_Kind_Sla_Operator => 1332,
+ Iir_Kind_Srl_Operator => 1337,
+ Iir_Kind_Sra_Operator => 1342,
+ Iir_Kind_Rol_Operator => 1347,
+ Iir_Kind_Ror_Operator => 1352,
+ Iir_Kind_Addition_Operator => 1357,
+ Iir_Kind_Substraction_Operator => 1362,
+ Iir_Kind_Concatenation_Operator => 1367,
+ Iir_Kind_Multiplication_Operator => 1372,
+ Iir_Kind_Division_Operator => 1377,
+ Iir_Kind_Modulus_Operator => 1382,
+ Iir_Kind_Remainder_Operator => 1387,
+ Iir_Kind_Exponentiation_Operator => 1392,
+ Iir_Kind_Function_Call => 1400,
+ Iir_Kind_Aggregate => 1407,
+ Iir_Kind_Parenthesis_Expression => 1410,
+ Iir_Kind_Qualified_Expression => 1414,
+ Iir_Kind_Type_Conversion => 1419,
+ Iir_Kind_Allocator_By_Expression => 1423,
+ Iir_Kind_Allocator_By_Subtype => 1428,
+ Iir_Kind_Selected_Element => 1436,
+ Iir_Kind_Dereference => 1441,
+ Iir_Kind_Implicit_Dereference => 1446,
+ Iir_Kind_Slice_Name => 1453,
+ Iir_Kind_Indexed_Name => 1459,
+ Iir_Kind_Psl_Expression => 1461,
+ Iir_Kind_Sensitized_Process_Statement => 1482,
+ Iir_Kind_Process_Statement => 1502,
+ Iir_Kind_Concurrent_Simple_Signal_Assignment => 1515,
+ Iir_Kind_Concurrent_Conditional_Signal_Assignment => 1528,
+ Iir_Kind_Concurrent_Selected_Signal_Assignment => 1542,
+ Iir_Kind_Concurrent_Assertion_Statement => 1550,
+ Iir_Kind_Concurrent_Procedure_Call_Statement => 1557,
+ Iir_Kind_Concurrent_Break_Statement => 1565,
+ Iir_Kind_Psl_Assert_Directive => 1578,
+ Iir_Kind_Psl_Assume_Directive => 1589,
+ Iir_Kind_Psl_Cover_Directive => 1601,
+ Iir_Kind_Psl_Restrict_Directive => 1612,
+ Iir_Kind_Block_Statement => 1626,
+ Iir_Kind_If_Generate_Statement => 1637,
+ Iir_Kind_Case_Generate_Statement => 1646,
+ Iir_Kind_For_Generate_Statement => 1655,
+ Iir_Kind_Component_Instantiation_Statement => 1666,
+ Iir_Kind_Psl_Default_Clock => 1670,
+ Iir_Kind_Generate_Statement_Body => 1681,
+ Iir_Kind_If_Generate_Else_Clause => 1687,
+ Iir_Kind_Simple_Simultaneous_Statement => 1694,
+ Iir_Kind_Simultaneous_Null_Statement => 1698,
+ Iir_Kind_Simultaneous_Procedural_Statement => 1709,
+ Iir_Kind_Simultaneous_Case_Statement => 1718,
+ Iir_Kind_Simultaneous_If_Statement => 1727,
+ Iir_Kind_Simultaneous_Elsif => 1733,
+ Iir_Kind_Simple_Signal_Assignment_Statement => 1744,
+ Iir_Kind_Conditional_Signal_Assignment_Statement => 1755,
+ Iir_Kind_Selected_Waveform_Assignment_Statement => 1767,
+ Iir_Kind_Null_Statement => 1771,
+ Iir_Kind_Assertion_Statement => 1778,
+ Iir_Kind_Report_Statement => 1784,
+ Iir_Kind_Wait_Statement => 1792,
+ Iir_Kind_Variable_Assignment_Statement => 1799,
+ Iir_Kind_Conditional_Variable_Assignment_Statement => 1806,
+ Iir_Kind_Return_Statement => 1812,
+ Iir_Kind_For_Loop_Statement => 1823,
+ Iir_Kind_While_Loop_Statement => 1834,
+ Iir_Kind_Next_Statement => 1841,
+ Iir_Kind_Exit_Statement => 1848,
+ Iir_Kind_Case_Statement => 1856,
+ Iir_Kind_Procedure_Call_Statement => 1862,
+ Iir_Kind_Break_Statement => 1869,
+ Iir_Kind_If_Statement => 1879,
+ Iir_Kind_Elsif => 1885,
+ Iir_Kind_Character_Literal => 1893,
+ Iir_Kind_Simple_Name => 1901,
+ Iir_Kind_Selected_Name => 1910,
+ Iir_Kind_Operator_Symbol => 1916,
+ Iir_Kind_Reference_Name => 1921,
+ Iir_Kind_External_Constant_Name => 1929,
+ Iir_Kind_External_Signal_Name => 1937,
+ Iir_Kind_External_Variable_Name => 1946,
+ Iir_Kind_Selected_By_All_Name => 1952,
+ Iir_Kind_Parenthesis_Name => 1957,
+ Iir_Kind_Package_Pathname => 1961,
+ Iir_Kind_Absolute_Pathname => 1962,
+ Iir_Kind_Relative_Pathname => 1963,
+ Iir_Kind_Pathname_Element => 1968,
+ Iir_Kind_Base_Attribute => 1970,
+ Iir_Kind_Subtype_Attribute => 1975,
+ Iir_Kind_Element_Attribute => 1980,
+ Iir_Kind_Across_Attribute => 1985,
+ Iir_Kind_Through_Attribute => 1990,
+ Iir_Kind_Nature_Reference_Attribute => 1994,
+ Iir_Kind_Left_Type_Attribute => 1999,
+ Iir_Kind_Right_Type_Attribute => 2004,
+ Iir_Kind_High_Type_Attribute => 2009,
+ Iir_Kind_Low_Type_Attribute => 2014,
+ Iir_Kind_Ascending_Type_Attribute => 2019,
+ Iir_Kind_Image_Attribute => 2025,
+ Iir_Kind_Value_Attribute => 2031,
+ Iir_Kind_Pos_Attribute => 2037,
+ Iir_Kind_Val_Attribute => 2043,
+ Iir_Kind_Succ_Attribute => 2049,
+ Iir_Kind_Pred_Attribute => 2055,
+ Iir_Kind_Leftof_Attribute => 2061,
+ Iir_Kind_Rightof_Attribute => 2067,
+ Iir_Kind_Signal_Slew_Attribute => 2075,
+ Iir_Kind_Quantity_Slew_Attribute => 2083,
+ Iir_Kind_Ramp_Attribute => 2091,
+ Iir_Kind_Zoh_Attribute => 2099,
+ Iir_Kind_Ltf_Attribute => 2107,
+ Iir_Kind_Ztf_Attribute => 2117,
+ Iir_Kind_Dot_Attribute => 2124,
+ Iir_Kind_Integ_Attribute => 2131,
+ Iir_Kind_Above_Attribute => 2139,
+ Iir_Kind_Quantity_Delayed_Attribute => 2147,
+ Iir_Kind_Delayed_Attribute => 2156,
+ Iir_Kind_Stable_Attribute => 2165,
+ Iir_Kind_Quiet_Attribute => 2174,
+ Iir_Kind_Transaction_Attribute => 2183,
+ Iir_Kind_Event_Attribute => 2187,
+ Iir_Kind_Active_Attribute => 2191,
+ Iir_Kind_Last_Event_Attribute => 2195,
+ Iir_Kind_Last_Active_Attribute => 2199,
+ Iir_Kind_Last_Value_Attribute => 2203,
+ Iir_Kind_Driving_Attribute => 2207,
+ Iir_Kind_Driving_Value_Attribute => 2211,
+ Iir_Kind_Behavior_Attribute => 2211,
+ Iir_Kind_Structure_Attribute => 2211,
+ Iir_Kind_Simple_Name_Attribute => 2218,
+ Iir_Kind_Instance_Name_Attribute => 2223,
+ Iir_Kind_Path_Name_Attribute => 2228,
+ Iir_Kind_Left_Array_Attribute => 2235,
+ Iir_Kind_Right_Array_Attribute => 2242,
+ Iir_Kind_High_Array_Attribute => 2249,
+ Iir_Kind_Low_Array_Attribute => 2256,
+ Iir_Kind_Length_Array_Attribute => 2263,
+ Iir_Kind_Ascending_Array_Attribute => 2270,
+ Iir_Kind_Range_Array_Attribute => 2277,
+ Iir_Kind_Reverse_Range_Array_Attribute => 2284,
+ Iir_Kind_Attribute_Name => 2293
);
function Get_Fields_First (K : Iir_Kind) return Fields_Index is
@@ -5455,6 +5461,8 @@ package body Vhdl.Nodes_Meta is
return Get_Has_Signal_Flag (N);
when Field_Elab_Flag =>
return Get_Elab_Flag (N);
+ when Field_Vendor_Library_Flag =>
+ return Get_Vendor_Library_Flag (N);
when Field_Configuration_Mark_Flag =>
return Get_Configuration_Mark_Flag (N);
when Field_Configuration_Done_Flag =>
@@ -5595,6 +5603,8 @@ package body Vhdl.Nodes_Meta is
Set_Has_Signal_Flag (N, V);
when Field_Elab_Flag =>
Set_Elab_Flag (N, V);
+ when Field_Vendor_Library_Flag =>
+ Set_Vendor_Library_Flag (N, V);
when Field_Configuration_Mark_Flag =>
Set_Configuration_Mark_Flag (N, V);
when Field_Configuration_Done_Flag =>
@@ -10124,6 +10134,11 @@ package body Vhdl.Nodes_Meta is
end case;
end Has_Elab_Flag;
+ function Has_Vendor_Library_Flag (K : Iir_Kind) return Boolean is
+ begin
+ return K = Iir_Kind_Library_Declaration;
+ end Has_Vendor_Library_Flag;
+
function Has_Configuration_Mark_Flag (K : Iir_Kind) return Boolean is
begin
return K = Iir_Kind_Design_Unit;
diff --git a/src/vhdl/vhdl-nodes_meta.ads b/src/vhdl/vhdl-nodes_meta.ads
index 7da2ac823..82bf5dbdb 100644
--- a/src/vhdl/vhdl-nodes_meta.ads
+++ b/src/vhdl/vhdl-nodes_meta.ads
@@ -278,6 +278,7 @@ package Vhdl.Nodes_Meta is
Field_Has_Signal_Flag,
Field_Purity_State,
Field_Elab_Flag,
+ Field_Vendor_Library_Flag,
Field_Configuration_Mark_Flag,
Field_Configuration_Done_Flag,
Field_Index_Constraint_Flag,
@@ -841,6 +842,7 @@ package Vhdl.Nodes_Meta is
function Has_Has_Signal_Flag (K : Iir_Kind) return Boolean;
function Has_Purity_State (K : Iir_Kind) return Boolean;
function Has_Elab_Flag (K : Iir_Kind) return Boolean;
+ function Has_Vendor_Library_Flag (K : Iir_Kind) return Boolean;
function Has_Configuration_Mark_Flag (K : Iir_Kind) return Boolean;
function Has_Configuration_Done_Flag (K : Iir_Kind) return Boolean;
function Has_Index_Constraint_Flag (K : Iir_Kind) return Boolean;
diff --git a/src/vhdl/vhdl-scanner.adb b/src/vhdl/vhdl-scanner.adb
index eac8cfc92..955c00efc 100644
--- a/src/vhdl/vhdl-scanner.adb
+++ b/src/vhdl/vhdl-scanner.adb
@@ -1537,7 +1537,8 @@ package body Vhdl.Scanner is
procedure Convert_Identifier (Str : in out String; Err : out Boolean)
is
- pragma Assert (Str'First = 1);
+ F : constant Integer := Str'First;
+
procedure Error_Bad is
begin
Error_Msg_Option ("bad character in identifier");
@@ -1557,14 +1558,14 @@ package body Vhdl.Scanner is
return;
end if;
- if Str (1) = '\' then
+ if Str (F) = '\' then
-- Extended identifier.
if Vhdl_Std = Vhdl_87 then
Error_Msg_Option ("extended identifiers not allowed in vhdl87");
return;
end if;
- if Str'Length < 3 then
+ if Str'Last < F + 2 then
Error_Msg_Option ("extended identifier is too short");
return;
end if;
@@ -1572,7 +1573,7 @@ package body Vhdl.Scanner is
Error_Msg_Option ("extended identifier must finish with a '\'");
return;
end if;
- for I in 2 .. Str'Last - 1 loop
+ for I in F + 1 .. Str'Last - 1 loop
C := Str (I);
case Characters_Kind (C) is
when Format_Effector =>
@@ -1595,7 +1596,7 @@ package body Vhdl.Scanner is
end loop;
else
-- Identifier
- for I in 1 .. Str'Length loop
+ for I in F .. Str'Last loop
C := Str (I);
case Characters_Kind (C) is
when Upper_Case_Letter =>
diff --git a/src/vhdl/vhdl-utils.adb b/src/vhdl/vhdl-utils.adb
index 35cbef34a..40b4f7947 100644
--- a/src/vhdl/vhdl-utils.adb
+++ b/src/vhdl/vhdl-utils.adb
@@ -1408,8 +1408,7 @@ package body Vhdl.Utils is
end Get_Entity_Identifier_Of_Architecture;
function Is_Component_Instantiation
- (Inst : Iir_Component_Instantiation_Statement)
- return Boolean is
+ (Inst : Iir_Component_Instantiation_Statement) return Boolean is
begin
case Get_Kind (Get_Instantiated_Unit (Inst)) is
when Iir_Kinds_Denoting_Name =>
@@ -1423,8 +1422,7 @@ package body Vhdl.Utils is
end Is_Component_Instantiation;
function Is_Entity_Instantiation
- (Inst : Iir_Component_Instantiation_Statement)
- return Boolean is
+ (Inst : Iir_Component_Instantiation_Statement) return Boolean is
begin
case Get_Kind (Get_Instantiated_Unit (Inst)) is
when Iir_Kinds_Denoting_Name =>