aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synthesis.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-02-15 08:42:07 +0100
committerTristan Gingold <tgingold@free.fr>2017-02-15 08:44:02 +0100
commitc0bf4d10a71599b8d35ca13fd5a062fae6863c2b (patch)
treea67a797d4692da95d186be0f38c769fd0f0c5dc3 /src/synth/synthesis.adb
parent59b6bb2d77a9ecf08fbb4dee1a670388c3ccd32f (diff)
downloadghdl-c0bf4d10a71599b8d35ca13fd5a062fae6863c2b.tar.gz
ghdl-c0bf4d10a71599b8d35ca13fd5a062fae6863c2b.tar.bz2
ghdl-c0bf4d10a71599b8d35ca13fd5a062fae6863c2b.zip
synth: defer gates removal after at end of entity synthesis.
Diffstat (limited to 'src/synth/synthesis.adb')
-rw-r--r--src/synth/synthesis.adb6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/synth/synthesis.adb b/src/synth/synthesis.adb
index 6361db001..6c767ce2d 100644
--- a/src/synth/synthesis.adb
+++ b/src/synth/synthesis.adb
@@ -22,6 +22,7 @@ with Types; use Types;
with Name_Table; use Name_Table;
with Netlists.Builders; use Netlists.Builders;
+with Netlists.Utils;
with Iirs_Utils; use Iirs_Utils;
with Elaboration; use Elaboration;
@@ -221,7 +222,10 @@ package body Synthesis is
Synth_Declarations (Syn_Inst, Get_Declaration_Chain (Arch));
Synth_Statements (Syn_Inst, Get_Concurrent_Statement_Chain (Arch));
- Remove_Free_Instances (Syn_Inst.M);
+ -- 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);
return Syn_Inst;
end Synth_Entity;