aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-01-08 20:35:40 +0100
committerTristan Gingold <tgingold@free.fr>2020-01-09 21:13:51 +0100
commit5bc69198283d48faa67eaaa0430144023f2ad176 (patch)
treed46120c15447ea02c6f3372487a9fbce1b2af16d
parent91e5fab3e69fdcdbc04c3280c3ab9f3c8c8d5c51 (diff)
downloadghdl-5bc69198283d48faa67eaaa0430144023f2ad176.tar.gz
ghdl-5bc69198283d48faa67eaaa0430144023f2ad176.tar.bz2
ghdl-5bc69198283d48faa67eaaa0430144023f2ad176.zip
synth: simplify support of inertial associations.
-rw-r--r--src/ghdldrv/ghdlprint.adb1
-rw-r--r--src/ghdldrv/ghdlsynth.adb4
-rw-r--r--src/synth/synth-decls.adb10
-rw-r--r--src/synth/synth-insts.adb8
-rw-r--r--src/vhdl/vhdl-canon.adb2
-rw-r--r--src/vhdl/vhdl-canon.ads4
6 files changed, 24 insertions, 5 deletions
diff --git a/src/ghdldrv/ghdlprint.adb b/src/ghdldrv/ghdlprint.adb
index 8510adabe..b02c93fdd 100644
--- a/src/ghdldrv/ghdlprint.adb
+++ b/src/ghdldrv/ghdlprint.adb
@@ -1059,6 +1059,7 @@ package body Ghdlprint is
Vhdl.Canon.Canon_Flag_Configurations := False;
Vhdl.Canon.Canon_Flag_Specification_Lists := False;
Vhdl.Canon.Canon_Flag_Associations := False;
+ Vhdl.Canon.Canon_Flag_Inertial_Associations := False;
-- Parse all files.
for I in Args'Range loop
diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb
index c87405ca3..cc10d0daf 100644
--- a/src/ghdldrv/ghdlsynth.adb
+++ b/src/ghdldrv/ghdlsynth.adb
@@ -176,6 +176,10 @@ package body Ghdlsynth is
-- Do not canon concurrent statements.
Vhdl.Canon.Canon_Flag_Concurrent_Stmts := False;
+
+ -- Do not create concurrent signal assignment for inertial
+ -- association. They are handled directly.
+ Vhdl.Canon.Canon_Flag_Inertial_Associations := False;
end if;
Flags.Flag_Elaborate_With_Outdated := E_Opt >= Args'First;
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb
index 737af2110..f5c60d766 100644
--- a/src/synth/synth-decls.adb
+++ b/src/synth/synth-decls.adb
@@ -677,8 +677,9 @@ package body Synth.Decls is
Create_Object (Syn_Inst, Decl, Res);
end;
when Iir_Kind_Anonymous_Signal_Declaration =>
- Create_Wire_Object (Syn_Inst, Wire_Signal, Decl);
- Create_Var_Wire (Syn_Inst, Decl, null);
+ -- Anonymous signals created by inertial associations are
+ -- simply ignored.
+ null;
when Iir_Kind_Procedure_Declaration
| Iir_Kind_Function_Declaration =>
Synth_Subprogram_Declaration (Syn_Inst, Decl);
@@ -790,10 +791,11 @@ package body Synth.Decls is
end if;
when Iir_Kind_Constant_Declaration =>
null;
- when Iir_Kind_Signal_Declaration
- | Iir_Kind_Anonymous_Signal_Declaration =>
+ when Iir_Kind_Signal_Declaration =>
pragma Assert (not Is_Subprg);
Finalize_Signal (Syn_Inst, Decl);
+ when Iir_Kind_Anonymous_Signal_Declaration =>
+ null;
when Iir_Kind_Object_Alias_Declaration =>
null;
when Iir_Kind_Procedure_Declaration
diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb
index 7ebf8cc23..60db8d921 100644
--- a/src/synth/synth-insts.adb
+++ b/src/synth/synth-insts.adb
@@ -541,6 +541,14 @@ package body Synth.Insts is
Actual := Get_Default_Value (Inter);
when Iir_Kind_Association_Element_By_Expression =>
Actual := Get_Actual (Assoc);
+ if Get_Kind (Actual) = Iir_Kind_Reference_Name then
+ -- Skip inserted anonymous signal declaration.
+ -- FIXME: simply do not insert it ?
+ Actual := Get_Named_Entity (Actual);
+ pragma Assert
+ (Get_Kind (Actual) = Iir_Kind_Anonymous_Signal_Declaration);
+ Actual := Get_Expression (Actual);
+ end if;
when Iir_Kind_Association_Element_By_Individual =>
Synth_Individual_Input_Assoc (Inp, Syn_Inst, Assoc, Inter_Inst);
return;
diff --git a/src/vhdl/vhdl-canon.adb b/src/vhdl/vhdl-canon.adb
index e06b795ab..3cd7bf736 100644
--- a/src/vhdl/vhdl-canon.adb
+++ b/src/vhdl/vhdl-canon.adb
@@ -2989,7 +2989,7 @@ package body Vhdl.Canon is
Canon_Expression (Get_Expression (Decl));
end if;
-- Create a signal assignment.
- if Canon_Flag_Associations then
+ if Canon_Flag_Inertial_Associations then
declare
Parent : constant Node := Get_Parent (Decl);
Asgn : Iir;
diff --git a/src/vhdl/vhdl-canon.ads b/src/vhdl/vhdl-canon.ads
index 477928bcb..50099ba3c 100644
--- a/src/vhdl/vhdl-canon.ads
+++ b/src/vhdl/vhdl-canon.ads
@@ -34,6 +34,10 @@ package Vhdl.Canon is
-- association with a non globally expression).
Canon_Flag_Associations : Boolean := True;
+ -- If true, create a concurrent signal assignment for internal
+ -- associations.
+ Canon_Flag_Inertial_Associations : Boolean := True;
+
-- If true, canon lists in specifications.
Canon_Flag_Specification_Lists : Boolean := True;