diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-07-01 18:19:48 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-07-01 18:19:48 +0200 |
commit | fa2d17a019c850e7d8d29783a0303850f5f0fee5 (patch) | |
tree | 02af5d4b49cb84bc252dedfc2fb20c4098b8657a /src | |
parent | 938e200a82436734e7e4e30b1b3b7bc6498691ad (diff) | |
download | ghdl-fa2d17a019c850e7d8d29783a0303850f5f0fee5.tar.gz ghdl-fa2d17a019c850e7d8d29783a0303850f5f0fee5.tar.bz2 ghdl-fa2d17a019c850e7d8d29783a0303850f5f0fee5.zip |
ghdlsynth: add option to select the output format.
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/ghdlsynth.adb | 22 |
1 files changed, 16 insertions, 6 deletions
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 |