mirror of
https://github.com/YosysHQ/yosys
synced 2025-05-11 09:44:44 +00:00
100%
This commit is contained in:
parent
eeb15ea2a2
commit
65d50db4ef
13 changed files with 74 additions and 67 deletions
|
@ -1895,9 +1895,9 @@ void dump_cell(std::ostream &f, std::string indent, RTLIL::Cell *cell)
|
|||
for (auto it = cell->parameters.begin(); it != cell->parameters.end(); ++it) {
|
||||
if (it != cell->parameters.begin())
|
||||
f << stringf(",");
|
||||
f << stringf("\n%s .%s(", indent.c_str(), id(it->first).c_str());
|
||||
if (it->second.size() > 0)
|
||||
dump_const(f, it->second);
|
||||
f << stringf("\n%s .%s(", indent.c_str(), id((*it).first).c_str());
|
||||
if ((*it).second.size() > 0)
|
||||
dump_const(f, (*it).second);
|
||||
f << stringf(")");
|
||||
}
|
||||
f << stringf("\n%s" ")", indent.c_str());
|
||||
|
@ -1915,36 +1915,36 @@ void dump_cell(std::ostream &f, std::string indent, RTLIL::Cell *cell)
|
|||
char str[16];
|
||||
snprintf(str, 16, "$%d", i);
|
||||
for (auto it = cell->connections().begin(); it != cell->connections().end(); ++it) {
|
||||
if (it->first != str)
|
||||
if ((*it).first != str)
|
||||
continue;
|
||||
if (!first_arg)
|
||||
f << stringf(",");
|
||||
first_arg = false;
|
||||
f << stringf("\n%s ", indent.c_str());
|
||||
dump_sigspec(f, it->second);
|
||||
numbered_ports.insert(it->first);
|
||||
dump_sigspec(f, (*it).second);
|
||||
numbered_ports.insert((*it).first);
|
||||
goto found_numbered_port;
|
||||
}
|
||||
break;
|
||||
found_numbered_port:;
|
||||
}
|
||||
for (auto it = cell->connections().begin(); it != cell->connections().end(); ++it) {
|
||||
if (numbered_ports.count(it->first))
|
||||
if (numbered_ports.count((*it).first))
|
||||
continue;
|
||||
if (!first_arg)
|
||||
f << stringf(",");
|
||||
first_arg = false;
|
||||
f << stringf("\n%s .%s(", indent.c_str(), id(it->first).c_str());
|
||||
if (it->second.size() > 0)
|
||||
dump_sigspec(f, it->second);
|
||||
f << stringf("\n%s .%s(", indent.c_str(), id((*it).first).c_str());
|
||||
if ((*it).second.size() > 0)
|
||||
dump_sigspec(f, (*it).second);
|
||||
f << stringf(")");
|
||||
}
|
||||
f << stringf("\n%s" ");\n", indent.c_str());
|
||||
|
||||
if (defparam && cell->parameters.size() > 0) {
|
||||
for (auto it = cell->parameters.begin(); it != cell->parameters.end(); ++it) {
|
||||
f << stringf("%sdefparam %s.%s = ", indent.c_str(), cell_name.c_str(), id(it->first).c_str());
|
||||
dump_const(f, it->second);
|
||||
f << stringf("%sdefparam %s.%s = ", indent.c_str(), cell_name.c_str(), id((*it).first).c_str());
|
||||
dump_const(f, (*it).second);
|
||||
f << stringf(";\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue