diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-10-09 10:49:01 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-10-09 10:50:33 +0200 |
commit | 9eeaf238a467c15149452ced197320f72d34556f (patch) | |
tree | 993c39488354d646e30c9730cc92f75184a87ea2 | |
parent | 38df4327795467d38d8fe0da327460a85df0df58 (diff) | |
download | ghdl-9eeaf238a467c15149452ced197320f72d34556f.tar.gz ghdl-9eeaf238a467c15149452ced197320f72d34556f.tar.bz2 ghdl-9eeaf238a467c15149452ced197320f72d34556f.zip |
synth-vhdl_decls.adb: also detect unassigned variables.
For ghdl/ghdl-yosys-plugin#159
-rw-r--r-- | src/synth/synth-vhdl_decls.adb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/synth/synth-vhdl_decls.adb b/src/synth/synth-vhdl_decls.adb index c6ada6dba..e2d130631 100644 --- a/src/synth/synth-vhdl_decls.adb +++ b/src/synth/synth-vhdl_decls.adb @@ -1084,6 +1084,7 @@ package body Synth.Vhdl_Decls is end loop; end Synth_Declarations; + -- Finalize a variable or a signal. procedure Finalize_Signal (Syn_Inst : Synth_Instance_Acc; Decl : Node) is use Netlists.Gates; @@ -1098,8 +1099,9 @@ package body Synth.Vhdl_Decls is pragma Assert (Is_Error (Syn_Inst)); return; end if; - if Vt.Val.Kind = Value_Net then + if Vt.Val.Kind /= Value_Wire then -- Could be a net for in ports. + -- Could be a static value for a variable of type file. return; end if; @@ -1155,16 +1157,7 @@ package body Synth.Vhdl_Decls is when Iir_Kind_Variable_Declaration | Iir_Kind_Interface_Variable_Declaration => if not Get_Instance_Const (Syn_Inst) then - declare - Vt : constant Valtyp := Get_Value (Syn_Inst, Decl); - begin - if Vt /= No_Valtyp - and then Vt.Val.Kind = Value_Wire - then - Finalize_Assignment (Get_Build (Syn_Inst), Vt.Val.W); - Free_Wire (Vt.Val.W); - end if; - end; + Finalize_Signal (Syn_Inst, Decl); end if; when Iir_Kind_Constant_Declaration => null; |