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.
This commit is contained in:
Stephen Williams 2009-12-09 17:17:52 -08:00
parent 782c55f7b5
commit 69f3219f49
1 changed files with 11 additions and 4 deletions

View File

@ -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<string,bool> 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.