aboutsummaryrefslogtreecommitdiffstats
path: root/passes/opt/muxpack.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-08-15 14:50:10 -0700
committerEddie Hung <eddie@fpgeh.com>2019-08-15 14:50:10 -0700
commit52355f5185fe42e28775e897f458b38a439c0ec5 (patch)
tree83d8984e70806c9bcc8cd6d72ea81456ca76aba6 /passes/opt/muxpack.cc
parent6cd8cace0c1d2a9f7b1f1cd56a223c38a5ea799a (diff)
downloadyosys-52355f5185fe42e28775e897f458b38a439c0ec5.tar.gz
yosys-52355f5185fe42e28775e897f458b38a439c0ec5.tar.bz2
yosys-52355f5185fe42e28775e897f458b38a439c0ec5.zip
Use more ID::{A,B,Y,blackbox,whitebox}
Diffstat (limited to 'passes/opt/muxpack.cc')
-rw-r--r--passes/opt/muxpack.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/passes/opt/muxpack.cc b/passes/opt/muxpack.cc
index cf6752b6e..97c88f423 100644
--- a/passes/opt/muxpack.cc
+++ b/passes/opt/muxpack.cc
@@ -38,19 +38,19 @@ struct ExclusiveDatabase
pool<Cell*> reduce_or;
for (auto cell : module->cells()) {
if (cell->type == ID($eq)) {
- nonconst_sig = sigmap(cell->getPort(ID(A)));
- const_sig = sigmap(cell->getPort(ID(B)));
+ nonconst_sig = sigmap(cell->getPort(ID::A));
+ const_sig = sigmap(cell->getPort(ID::B));
if (!const_sig.is_fully_const()) {
if (!nonconst_sig.is_fully_const())
continue;
std::swap(nonconst_sig, const_sig);
}
- y_port = sigmap(cell->getPort(ID(Y)));
+ y_port = sigmap(cell->getPort(ID::Y));
}
else if (cell->type == ID($logic_not)) {
- nonconst_sig = sigmap(cell->getPort(ID(A)));
+ nonconst_sig = sigmap(cell->getPort(ID::A));
const_sig = Const(State::S0, GetSize(nonconst_sig));
- y_port = sigmap(cell->getPort(ID(Y)));
+ y_port = sigmap(cell->getPort(ID::Y));
}
else if (cell->type == ID($reduce_or)) {
reduce_or.insert(cell);
@@ -66,7 +66,7 @@ struct ExclusiveDatabase
for (auto cell : reduce_or) {
nonconst_sig = SigSpec();
std::vector<Const> values;
- SigSpec a_port = sigmap(cell->getPort(ID(A)));
+ SigSpec a_port = sigmap(cell->getPort(ID::A));
for (auto bit : a_port) {
auto it = sig_cmp_prev.find(bit);
if (it == sig_cmp_prev.end()) {
@@ -84,7 +84,7 @@ struct ExclusiveDatabase
}
if (nonconst_sig.empty())
continue;
- y_port = sigmap(cell->getPort(ID(Y)));
+ y_port = sigmap(cell->getPort(ID::Y));
sig_cmp_prev[y_port] = std::make_pair(nonconst_sig,std::move(values));
}
}
@@ -145,11 +145,11 @@ struct MuxpackWorker
{
if (cell->type.in(ID($mux), ID($pmux)) && !cell->get_bool_attribute(ID(keep)))
{
- SigSpec a_sig = sigmap(cell->getPort(ID(A)));
+ SigSpec a_sig = sigmap(cell->getPort(ID::A));
SigSpec b_sig;
if (cell->type == ID($mux))
- b_sig = sigmap(cell->getPort(ID(B)));
- SigSpec y_sig = sigmap(cell->getPort(ID(Y)));
+ b_sig = sigmap(cell->getPort(ID::B));
+ SigSpec y_sig = sigmap(cell->getPort(ID::Y));
if (sig_chain_next.count(a_sig))
for (auto a_bit : a_sig.bits())
@@ -186,9 +186,9 @@ struct MuxpackWorker
{
log_debug("Considering %s (%s)\n", log_id(cell), log_id(cell->type));
- SigSpec a_sig = sigmap(cell->getPort(ID(A)));
+ SigSpec a_sig = sigmap(cell->getPort(ID::A));
if (cell->type == ID($mux)) {
- SigSpec b_sig = sigmap(cell->getPort(ID(B)));
+ SigSpec b_sig = sigmap(cell->getPort(ID::B));
if (sig_chain_prev.count(a_sig) + sig_chain_prev.count(b_sig) != 1)
goto start_cell;
@@ -230,7 +230,7 @@ struct MuxpackWorker
{
chain.push_back(c);
- SigSpec y_sig = sigmap(c->getPort(ID(Y)));
+ SigSpec y_sig = sigmap(c->getPort(ID::Y));
if (sig_chain_next.count(y_sig) == 0)
break;
@@ -270,28 +270,28 @@ struct MuxpackWorker
pmux_count += 1;
first_cell->type = ID($pmux);
- SigSpec b_sig = first_cell->getPort(ID(B));
+ SigSpec b_sig = first_cell->getPort(ID::B);
SigSpec s_sig = first_cell->getPort(ID(S));
for (int i = 1; i < cases; i++) {
Cell* prev_cell = chain[cursor+i-1];
Cell* cursor_cell = chain[cursor+i];
- if (sigmap(prev_cell->getPort(ID(Y))) == sigmap(cursor_cell->getPort(ID(A)))) {
- b_sig.append(cursor_cell->getPort(ID(B)));
+ if (sigmap(prev_cell->getPort(ID::Y)) == sigmap(cursor_cell->getPort(ID::A))) {
+ b_sig.append(cursor_cell->getPort(ID::B));
s_sig.append(cursor_cell->getPort(ID(S)));
}
else {
log_assert(cursor_cell->type == ID($mux));
- b_sig.append(cursor_cell->getPort(ID(A)));
+ b_sig.append(cursor_cell->getPort(ID::A));
s_sig.append(module->LogicNot(NEW_ID, cursor_cell->getPort(ID(S))));
}
remove_cells.insert(cursor_cell);
}
- first_cell->setPort(ID(B), b_sig);
+ first_cell->setPort(ID::B, b_sig);
first_cell->setPort(ID(S), s_sig);
first_cell->setParam(ID(S_WIDTH), GetSize(s_sig));
- first_cell->setPort(ID(Y), last_cell->getPort(ID(Y)));
+ first_cell->setPort(ID::Y, last_cell->getPort(ID::Y));
cursor += cases;
}