aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-09-17 08:06:11 +0200
committerTristan Gingold <tgingold@free.fr>2019-09-17 08:06:11 +0200
commit2019f1903faf77efdcc03c927aa353b9e3307d5d (patch)
tree6e3e1c6c9dd22512740163442623b1597970a77f /src
parentde899bb8cb6e2f43a3e80a6a273d6a459b08e401 (diff)
downloadghdl-2019f1903faf77efdcc03c927aa353b9e3307d5d.tar.gz
ghdl-2019f1903faf77efdcc03c927aa353b9e3307d5d.tar.bz2
ghdl-2019f1903faf77efdcc03c927aa353b9e3307d5d.zip
synth: add debug flag -dc to not clean.
Diffstat (limited to 'src')
-rw-r--r--src/ghdldrv/ghdlsynth.adb3
-rw-r--r--src/synth/synth-flags.ads2
-rw-r--r--src/synth/synth-insts.adb5
3 files changed, 9 insertions, 1 deletions
diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb
index f6539d2c4..a260b2cd7 100644
--- a/src/ghdldrv/ghdlsynth.adb
+++ b/src/ghdldrv/ghdlsynth.adb
@@ -97,6 +97,9 @@ package body Ghdlsynth is
elsif Option = "-di" then
Flag_Debug_Noinference := True;
Res := Option_Ok;
+ elsif Option = "-dc" then
+ Flag_Debug_Nocleanup := True;
+ Res := Option_Ok;
else
Decode_Option (Command_Lib (Cmd), Option, Arg, Res);
end if;
diff --git a/src/synth/synth-flags.ads b/src/synth/synth-flags.ads
index c5d11f83c..d87826f4d 100644
--- a/src/synth/synth-flags.ads
+++ b/src/synth/synth-flags.ads
@@ -20,4 +20,6 @@
package Synth.Flags is
Flag_Debug_Noinference : Boolean := False;
+
+ Flag_Debug_Nocleanup : Boolean := False;
end Synth.Flags;
diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb
index 5df7d4303..6e04fc2a8 100644
--- a/src/synth/synth-insts.adb
+++ b/src/synth/synth-insts.adb
@@ -32,6 +32,7 @@ with Vhdl.Utils; use Vhdl.Utils;
with Vhdl.Annotations; use Vhdl.Annotations;
with Vhdl.Errors;
+with Synth.Flags;
with Synth.Values; use Synth.Values;
with Synth.Environment; use Synth.Environment;
with Synth.Stmts; use Synth.Stmts;
@@ -805,7 +806,9 @@ package body Synth.Insts is
-- Remove unused gates. This is not only an optimization but also
-- a correctness point: there might be some unsynthesizable gates, like
-- the one created for 'rising_egde (clk) and not rst'.
- Netlists.Utils.Remove_Unused_Instances (Syn_Inst.M);
+ if not Flags.Flag_Debug_Nocleanup then
+ Netlists.Utils.Remove_Unused_Instances (Syn_Inst.M);
+ end if;
end Synth_Instance;
procedure Synth_All_Instances