Change elaboration to better support top level and unconnected ports.
This patch changes the module elaboration slightly to allow passing the appropriate information for unconnected and top level ports. This allows the vlog95 generator to get the basic structure correct.
This commit is contained in:
parent
5ba1814e64
commit
042f405707
18
elaborate.cc
18
elaborate.cc
|
|
@ -1229,6 +1229,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
// unconnected port.
|
||||
|
||||
for (unsigned idx = 0 ; idx < pins.size() ; idx += 1) {
|
||||
bool unconnected_port = false;
|
||||
|
||||
// Skip unconnected module ports. This happens when a
|
||||
// null parameter is passed in.
|
||||
|
|
@ -1289,11 +1290,9 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
unconnected_port = true;
|
||||
}
|
||||
|
||||
|
||||
// Inside the module, the port is zero or more signals
|
||||
// that were already elaborated. List all those signals
|
||||
// and the NetNet equivalents, for all the instances.
|
||||
|
|
@ -1332,7 +1331,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const
|
|||
// If I find that the port is unconnected inside the
|
||||
// module, then there is nothing to connect. Skip the
|
||||
// argument.
|
||||
if (prts_vector_width == 0) {
|
||||
if ((prts_vector_width == 0) || unconnected_port) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -4650,6 +4649,17 @@ Design* elaborate(list<perm_string>roots)
|
|||
delete des;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Some of the generators need to have the ports correctly
|
||||
// defined for the root modules. This code does that.
|
||||
for (unsigned idx = 0; idx < rmod->port_count(); idx += 1) {
|
||||
vector<PEIdent*> mport = rmod->get_port(idx);
|
||||
for (unsigned pin = 0; pin < mport.size(); pin += 1) {
|
||||
// This really does more than we need and adds extra
|
||||
// stuff to the design that should be cleaned later.
|
||||
(void) mport[pin]->elaborate_port(des, scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now that the structure and parameters are taken care of,
|
||||
|
|
|
|||
Loading…
Reference in New Issue