From 69f3219f490bc1729b035319b2621823761d1a50 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Wed, 9 Dec 2009 17:17:52 -0800 Subject: [PATCH] Suppress redundant warning messages about input coerced to inout A message for each signal name at a given source/line need only have this message emitted once. --- elab_net.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/elab_net.cc b/elab_net.cc index 510f78a1d..18154557b 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -441,11 +441,18 @@ NetNet* PEIdent::elaborate_lnet_common_(Design*des, NetScope*scope, } if (sig->port_type() == NetNet::PINPUT) { - cerr << get_fileline() << ": warning: L-value ``" - << sig->name() << "'' is also an input port." << endl; - cerr << sig->get_fileline() << ": warning: input " - << sig->name() << "; is coerced to inout." << endl; sig->port_type(NetNet::PINOUT); + // This map mask prevents an error message being + // repeated endlessly. + static map mask_map; + bool&flag = mask_map[sig->get_fileline() + ":" + string(sig->name())]; + if (! flag) { + cerr << get_fileline() << ": warning: L-value ``" + << sig->name() << "'' is also an input port." << endl; + cerr << sig->get_fileline() << ": warning: input " + << sig->name() << "; is coerced to inout." << endl; + flag = true; + } } // Default part select is the entire word.