From 3d8cc349b675ddfcd41008ba8f7b17a49da9e184 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 31 May 2020 07:37:34 +0200 Subject: synth: refine -dm debug option. Add -dm2 --- src/ghdldrv/ghdlsynth.adb | 6 +++++- src/synth/netlists-inference.adb | 2 +- src/synth/synth-flags.ads | 5 ++++- src/synth/synth-insts.adb | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb index dd2b40503..08d980581 100644 --- a/src/ghdldrv/ghdlsynth.adb +++ b/src/ghdldrv/ghdlsynth.adb @@ -164,7 +164,11 @@ package body Ghdlsynth is elsif Option = "-dc" then Flag_Debug_Nocleanup := True; elsif Option = "-dm" then - Flag_Debug_Nomemory := True; + Flag_Debug_Nomemory1 := True; + Flag_Debug_Nomemory2 := True; + elsif Option = "-dm2" then + -- Reduce muxes, but do not create memories. + Flag_Debug_Nomemory2 := True; elsif Option = "-de" then Flag_Debug_Noexpand := True; elsif Option = "-t" then diff --git a/src/synth/netlists-inference.adb b/src/synth/netlists-inference.adb index 700cf09ba..a57b50bbb 100644 --- a/src/synth/netlists-inference.adb +++ b/src/synth/netlists-inference.adb @@ -453,7 +453,7 @@ package body Netlists.Inference is Res : Net; begin if Off = 0 - and then not Synth.Flags.Flag_Debug_Nomemory + and then not Synth.Flags.Flag_Debug_Nomemory1 and then Can_Infere_RAM (Data, Prev_Val) then -- Maybe it is a RAM. diff --git a/src/synth/synth-flags.ads b/src/synth/synth-flags.ads index 032c2321d..0586ba58c 100644 --- a/src/synth/synth-flags.ads +++ b/src/synth/synth-flags.ads @@ -48,7 +48,10 @@ package Synth.Flags is Flag_Debug_Nocleanup : Boolean := False; - Flag_Debug_Nomemory : Boolean := False; + -- Do not reduce muxes in dyn extract/insert chains. + Flag_Debug_Nomemory1 : Boolean := False; + + Flag_Debug_Nomemory2 : Boolean := False; Flag_Debug_Noexpand : Boolean := False; diff --git a/src/synth/synth-insts.adb b/src/synth/synth-insts.adb index 01af9c63a..da1cc329c 100644 --- a/src/synth/synth-insts.adb +++ b/src/synth/synth-insts.adb @@ -1535,7 +1535,7 @@ package body Synth.Insts is Netlists.Cleanup.Remove_Output_Gates (Inst.M); end if; - if not Synth.Flags.Flag_Debug_Nomemory then + if not Synth.Flags.Flag_Debug_Nomemory2 then Netlists.Memories.Extract_Memories2 (Get_Build (Syn_Inst), Inst.M); -- Remove remaining clock edge gates. Netlists.Cleanup.Mark_And_Sweep (Inst.M); -- cgit v1.2.3