From fa2d17a019c850e7d8d29783a0303850f5f0fee5 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 1 Jul 2019 18:19:48 +0200 Subject: ghdlsynth: add option to select the output format. --- src/ghdldrv/ghdlsynth.adb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb index 8a961b4fb..233db4867 100644 --- a/src/ghdldrv/ghdlsynth.adb +++ b/src/ghdldrv/ghdlsynth.adb @@ -34,9 +34,12 @@ with Netlists.Dump; with Netlists.Disp_Vhdl; package body Ghdlsynth is + type Out_Format is (Format_Raw, Format_Vhdl); + -- Command --synth type Command_Synth is new Command_Lib with record Disp_Inline : Boolean := True; + Oformat : Out_Format := Format_Vhdl; end record; function Decode_Command (Cmd : Command_Synth; Name : String) return Boolean; @@ -71,6 +74,12 @@ package body Ghdlsynth is if Option = "--disp-noinline" then Cmd.Disp_Inline := False; Res := Option_Ok; + elsif Option = "--out=raw" then + Cmd.Oformat := Format_Raw; + Res := Option_Ok; + elsif Option = "--out=vhdl" then + Cmd.Oformat := Format_Vhdl; + Res := Option_Ok; else Decode_Option (Command_Lib (Cmd), Option, Arg, Res); end if; @@ -133,12 +142,13 @@ package body Ghdlsynth is Res : Netlists.Module; begin Res := Ghdl_Synth (Args); - if False then - Netlists.Dump.Flag_Disp_Inline := Cmd.Disp_Inline; - Netlists.Dump.Disp_Module (Res); - else - Netlists.Disp_Vhdl.Disp_Vhdl (Res); - end if; + case Cmd.Oformat is + when Format_Raw => + Netlists.Dump.Flag_Disp_Inline := Cmd.Disp_Inline; + Netlists.Dump.Disp_Module (Res); + when Format_Vhdl => + Netlists.Disp_Vhdl.Disp_Vhdl (Res); + end case; end Perform_Action; procedure Register_Commands is -- cgit v1.2.3