diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-01-11 07:58:25 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-01-11 07:58:25 +0100 |
commit | 24a15798311381e1352df93ba41e69247371ffc9 (patch) | |
tree | d6aa481b40a8a6df9037023b6d40bde1f02ee707 /src | |
parent | d85003f32eb6d1d2384c2748d2d4089cd1636d87 (diff) | |
download | ghdl-24a15798311381e1352df93ba41e69247371ffc9.tar.gz ghdl-24a15798311381e1352df93ba41e69247371ffc9.tar.bz2 ghdl-24a15798311381e1352df93ba41e69247371ffc9.zip |
synth: add --expect-failure for command --synth
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/ghdlsynth.adb | 19 | ||||
-rw-r--r-- | src/synth/synthesis.adb | 3 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/ghdldrv/ghdlsynth.adb b/src/ghdldrv/ghdlsynth.adb index cc10d0daf..243120b21 100644 --- a/src/ghdldrv/ghdlsynth.adb +++ b/src/ghdldrv/ghdlsynth.adb @@ -58,6 +58,7 @@ package body Ghdlsynth is Disp_Inline : Boolean := True; Disp_Id : Boolean := True; Oformat : Out_Format := Format_Default; + Expect_Failure : Boolean := False; end record; function Decode_Command (Cmd : Command_Synth; Name : String) return Boolean; @@ -96,6 +97,9 @@ package body Ghdlsynth is and then Is_Generic_Override_Option (Option) then Res := Decode_Generic_Override_Option (Option); + elsif Option = "--expect-failure" then + Cmd.Expect_Failure := True; + Res := Option_Ok; elsif Option = "--disp-noinline" then Cmd.Disp_Inline := False; Res := Option_Ok; @@ -333,6 +337,9 @@ package body Ghdlsynth is end if; Synthesis.Synth_Design (Config, Res, Inst); + if Res = No_Module then + return No_Module; + end if; Disp_Design (Command_Synth (Cmd.all), Format_None, Res, Config, Inst); @@ -367,13 +374,23 @@ package body Ghdlsynth is Config := Ghdl_Synth_Configure (True, Args); if Config = Null_Iir then - raise Errorout.Compilation_Error; + if Cmd.Expect_Failure then + return; + else + raise Errorout.Compilation_Error; + end if; end if; Netlists.Errors.Initialize; Synthesis.Synth_Design (Config, Res, Inst); if Res = No_Module then + if Cmd.Expect_Failure then + return; + else + raise Errorout.Compilation_Error; + end if; + elsif Cmd.Expect_Failure then raise Errorout.Compilation_Error; end if; diff --git a/src/synth/synthesis.adb b/src/synth/synthesis.adb index e2d72142e..6583460cf 100644 --- a/src/synth/synthesis.adb +++ b/src/synth/synthesis.adb @@ -58,7 +58,8 @@ package body Synthesis is Synth_Top_Entity (Global_Instance, Arch, Config, Inst); Synth_All_Instances; if Errorout.Nbr_Errors > 0 then - raise Compilation_Error; + M := No_Module; + return; end if; M := Get_Top_Module (Global_Instance); |