diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-03-28 09:02:16 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-03-28 09:02:16 +0100 |
commit | ceda8dddc57cd3e41f187d6589804b76090a6f04 (patch) | |
tree | 029f48330e33584b3db1f12c38305a3e8405e204 /src/synth | |
parent | 27ef55a7192ea3a61c1756f29ce1c0de1e3edb4c (diff) | |
download | ghdl-ceda8dddc57cd3e41f187d6589804b76090a6f04.tar.gz ghdl-ceda8dddc57cd3e41f187d6589804b76090a6f04.tar.bz2 ghdl-ceda8dddc57cd3e41f187d6589804b76090a6f04.zip |
synth: do not emit warning for unassigned but unused signals.
Diffstat (limited to 'src/synth')
-rw-r--r-- | src/synth/synth-decls.adb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb index d61a67241..263070ff4 100644 --- a/src/synth/synth-decls.adb +++ b/src/synth/synth-decls.adb @@ -913,14 +913,20 @@ package body Synth.Decls is raise Internal_Error; end case; if Drv = No_Net then + if Is_Connected (Get_Output (Gate, 0)) then + -- No warning if the signal is not used. + -- TODO: maybe simply remove it. + if Def_Val = No_Net then + Warning_Msg_Synth + (+Decl, "%n is never assigned and has no default value", + (1 => +Decl)); + else + Warning_Msg_Synth (+Decl, "%n is never assigned", (1 => +Decl)); + end if; + end if; if Def_Val = No_Net then - Warning_Msg_Synth - (+Decl, "%n is never assigned and has no default value", - (1 => +Decl)); Def_Val := Build_Const_X (Get_Build (Syn_Inst), Get_Width (Gate_Net)); - else - Warning_Msg_Synth (+Decl, "%n is never assigned", (1 => +Decl)); end if; Connect (Get_Input (Gate, 0), Def_Val); end if; |