3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-18 01:02:19 +00:00

Transform all "\\*" identifiers into ID()

This commit is contained in:
Eddie Hung 2019-08-15 10:19:29 -07:00
parent 9f98241010
commit 78ba8b8574
25 changed files with 782 additions and 782 deletions

View file

@ -64,37 +64,37 @@ struct TribufWorker {
for (auto cell : module->selected_cells())
{
if (cell->type == ID($tribuf))
tribuf_cells[sigmap(cell->getPort("\\Y"))].push_back(cell);
tribuf_cells[sigmap(cell->getPort(ID(\\Y)))].push_back(cell);
if (cell->type == ID($_TBUF_))
tribuf_cells[sigmap(cell->getPort("\\Y"))].push_back(cell);
tribuf_cells[sigmap(cell->getPort(ID(\\Y)))].push_back(cell);
if (cell->type.in(ID($mux), ID($_MUX_)))
{
IdString en_port = cell->type == ID($mux) ? "\\EN" : "\\E";
IdString en_port = cell->type == ID($mux) ? ID(\\EN) : ID(\\E);
IdString tri_type = cell->type == ID($mux) ? ID($tribuf) : ID($_TBUF_);
if (is_all_z(cell->getPort("\\A")) && is_all_z(cell->getPort("\\B"))) {
if (is_all_z(cell->getPort(ID(\\A))) && is_all_z(cell->getPort(ID(\\B)))) {
module->remove(cell);
continue;
}
if (is_all_z(cell->getPort("\\A"))) {
cell->setPort("\\A", cell->getPort("\\B"));
cell->setPort(en_port, cell->getPort("\\S"));
cell->unsetPort("\\B");
cell->unsetPort("\\S");
if (is_all_z(cell->getPort(ID(\\A)))) {
cell->setPort(ID(\\A), cell->getPort(ID(\\B)));
cell->setPort(en_port, cell->getPort(ID(\\S)));
cell->unsetPort(ID(\\B));
cell->unsetPort(ID(\\S));
cell->type = tri_type;
tribuf_cells[sigmap(cell->getPort("\\Y"))].push_back(cell);
tribuf_cells[sigmap(cell->getPort(ID(\\Y)))].push_back(cell);
continue;
}
if (is_all_z(cell->getPort("\\B"))) {
cell->setPort(en_port, module->Not(NEW_ID, cell->getPort("\\S")));
cell->unsetPort("\\B");
cell->unsetPort("\\S");
if (is_all_z(cell->getPort(ID(\\B)))) {
cell->setPort(en_port, module->Not(NEW_ID, cell->getPort(ID(\\S))));
cell->unsetPort(ID(\\B));
cell->unsetPort(ID(\\S));
cell->type = tri_type;
tribuf_cells[sigmap(cell->getPort("\\Y"))].push_back(cell);
tribuf_cells[sigmap(cell->getPort(ID(\\Y)))].push_back(cell);
continue;
}
}
@ -119,10 +119,10 @@ struct TribufWorker {
SigSpec pmux_b, pmux_s;
for (auto cell : it.second) {
if (cell->type == ID($tribuf))
pmux_s.append(cell->getPort("\\EN"));
pmux_s.append(cell->getPort(ID(\\EN)));
else
pmux_s.append(cell->getPort("\\E"));
pmux_b.append(cell->getPort("\\A"));
pmux_s.append(cell->getPort(ID(\\E)));
pmux_b.append(cell->getPort(ID(\\A)));
module->remove(cell);
}