From ceda8dddc57cd3e41f187d6589804b76090a6f04 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 28 Mar 2020 09:02:16 +0100 Subject: synth: do not emit warning for unassigned but unused signals. --- src/synth/synth-decls.adb | 16 +++++++++++----- 1 file 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; -- cgit v1.2.3