aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap/tribuf.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-08-19 13:04:06 +0200
committerClifford Wolf <clifford@clifford.at>2019-08-19 13:04:06 +0200
commit1e3dd0a2da1c8a6a34d2a664f938a90fc83e81a9 (patch)
tree7b7830c5da434964fd40792c393c45a31b8ad080 /passes/techmap/tribuf.cc
parentf20be90436b32e853d68c7e102a65d43f3843d91 (diff)
parent3edb0abed88565447d5193f78261400655aa843a (diff)
downloadyosys-1e3dd0a2da1c8a6a34d2a664f938a90fc83e81a9.tar.gz
yosys-1e3dd0a2da1c8a6a34d2a664f938a90fc83e81a9.tar.bz2
yosys-1e3dd0a2da1c8a6a34d2a664f938a90fc83e81a9.zip
Merge branch 'master' of github.com:YosysHQ/yosys into clifford/pmgen
Diffstat (limited to 'passes/techmap/tribuf.cc')
-rw-r--r--passes/techmap/tribuf.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/passes/techmap/tribuf.cc b/passes/techmap/tribuf.cc
index 587cb9038..41fdc8f3d 100644
--- a/passes/techmap/tribuf.cc
+++ b/passes/techmap/tribuf.cc
@@ -63,38 +63,38 @@ struct TribufWorker {
for (auto cell : module->selected_cells())
{
- if (cell->type == "$tribuf")
- tribuf_cells[sigmap(cell->getPort("\\Y"))].push_back(cell);
+ if (cell->type == ID($tribuf))
+ tribuf_cells[sigmap(cell->getPort(ID::Y))].push_back(cell);
- if (cell->type == "$_TBUF_")
- tribuf_cells[sigmap(cell->getPort("\\Y"))].push_back(cell);
+ if (cell->type == ID($_TBUF_))
+ tribuf_cells[sigmap(cell->getPort(ID::Y))].push_back(cell);
- if (cell->type.in("$mux", "$_MUX_"))
+ if (cell->type.in(ID($mux), ID($_MUX_)))
{
- IdString en_port = cell->type == "$mux" ? "\\EN" : "\\E";
- IdString tri_type = cell->type == "$mux" ? "$tribuf" : "$_TBUF_";
+ 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;
}
}
@@ -118,11 +118,11 @@ struct TribufWorker {
SigSpec pmux_b, pmux_s;
for (auto cell : it.second) {
- if (cell->type == "$tribuf")
- pmux_s.append(cell->getPort("\\EN"));
+ if (cell->type == ID($tribuf))
+ 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);
}