aboutsummaryrefslogtreecommitdiffstats
path: root/passes/sat/share.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-26 15:57:57 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-26 15:58:23 +0200
commitf8fdc47d3361c1a3445a9357ca26cfe75907d6b0 (patch)
treee4b1c2f97db2c317f8b986635141dfd7bb8e78d8 /passes/sat/share.cc
parentb7dda723022ad00c6c0089be888eab319953faa8 (diff)
downloadyosys-f8fdc47d3361c1a3445a9357ca26cfe75907d6b0.tar.gz
yosys-f8fdc47d3361c1a3445a9357ca26cfe75907d6b0.tar.bz2
yosys-f8fdc47d3361c1a3445a9357ca26cfe75907d6b0.zip
Manual fixes for new cell connections API
Diffstat (limited to 'passes/sat/share.cc')
-rw-r--r--passes/sat/share.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/passes/sat/share.cc b/passes/sat/share.cc
index 13ef695e7..0ee5af186 100644
--- a/passes/sat/share.cc
+++ b/passes/sat/share.cc
@@ -258,7 +258,9 @@ struct ShareWorker
RTLIL::Cell *unsigned_cell = c1->parameters.at("\\A_SIGNED").as_bool() ? c2 : c1;
if (unsigned_cell->get("\\A").to_sigbit_vector().back() != RTLIL::State::S0) {
unsigned_cell->parameters.at("\\A_WIDTH") = unsigned_cell->parameters.at("\\A_WIDTH").as_int() + 1;
- unsigned_cell->get("\\A").append_bit(RTLIL::State::S0);
+ RTLIL::SigSpec new_a = unsigned_cell->get("\\A");
+ new_a.append_bit(RTLIL::State::S0);
+ unsigned_cell->set("\\A", new_a);
}
unsigned_cell->parameters.at("\\A_SIGNED") = true;
unsigned_cell->check();
@@ -312,7 +314,10 @@ struct ShareWorker
if (score_flipped < score_unflipped)
{
- std::swap(c2->get("\\A"), c2->get("\\B"));
+ RTLIL::SigSpec tmp = c2->get("\\A");
+ c2->set("\\A", c2->get("\\B"));
+ c2->set("\\B", tmp);
+
std::swap(c2->parameters.at("\\A_WIDTH"), c2->parameters.at("\\B_WIDTH"));
std::swap(c2->parameters.at("\\A_SIGNED"), c2->parameters.at("\\B_SIGNED"));
modified_src_cells = true;
@@ -325,7 +330,9 @@ struct ShareWorker
RTLIL::Cell *unsigned_cell = c1->parameters.at("\\A_SIGNED").as_bool() ? c2 : c1;
if (unsigned_cell->get("\\A").to_sigbit_vector().back() != RTLIL::State::S0) {
unsigned_cell->parameters.at("\\A_WIDTH") = unsigned_cell->parameters.at("\\A_WIDTH").as_int() + 1;
- unsigned_cell->get("\\A").append_bit(RTLIL::State::S0);
+ RTLIL::SigSpec new_a = unsigned_cell->get("\\A");
+ new_a.append_bit(RTLIL::State::S0);
+ unsigned_cell->set("\\A", new_a);
}
unsigned_cell->parameters.at("\\A_SIGNED") = true;
modified_src_cells = true;
@@ -336,7 +343,9 @@ struct ShareWorker
RTLIL::Cell *unsigned_cell = c1->parameters.at("\\B_SIGNED").as_bool() ? c2 : c1;
if (unsigned_cell->get("\\B").to_sigbit_vector().back() != RTLIL::State::S0) {
unsigned_cell->parameters.at("\\B_WIDTH") = unsigned_cell->parameters.at("\\B_WIDTH").as_int() + 1;
- unsigned_cell->get("\\B").append_bit(RTLIL::State::S0);
+ RTLIL::SigSpec new_b = unsigned_cell->get("\\B");
+ new_b.append_bit(RTLIL::State::S0);
+ unsigned_cell->set("\\B", new_b);
}
unsigned_cell->parameters.at("\\B_SIGNED") = true;
modified_src_cells = true;