diff --git a/elaborate.cc b/elaborate.cc index 0faa7ed2a..f4f99f85f 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -1425,6 +1425,16 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const << prts[0]->name() << " is coerced to inout." << endl; } + if (!prts.empty() && (prts[0]->port_type() == NetNet::POUTPUT) + && (prts[0]->type() != NetNet::REG) + && prts[0]->pin(0).nexus()->has_floating_input() + && pins[idx]->is_collapsible_net(des, scope)) { + prts[0]->port_type(NetNet::PINOUT); + + cerr << pins[idx]->get_fileline() << ": warning: output port " + << prts[0]->name() << " is coerced to inout." << endl; + } + // Elaborate the expression that connects to the // module[s] port. sig is the thing outside the module // that connects to the port.