aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-06-11 16:05:27 -0700
committerEddie Hung <eddie@fpgeh.com>2019-06-11 16:05:27 -0700
commitd26646051c4ae9740decd5d76eec6a3afd63844a (patch)
tree6213f8f04492f2868737a4a8348abfd07e0f7c80 /passes/techmap
parent5174082208ef9bea22ad1ba62622947375b3e83b (diff)
downloadyosys-d26646051c4ae9740decd5d76eec6a3afd63844a.tar.gz
yosys-d26646051c4ae9740decd5d76eec6a3afd63844a.tar.bz2
yosys-d26646051c4ae9740decd5d76eec6a3afd63844a.zip
Revert "Merge remote-tracking branch 'origin/eddie/shregmap_improve' into xc7mux"
This reverts commit 5174082208ef9bea22ad1ba62622947375b3e83b, reversing changes made to 54379f9872ba3abdf5328994abcf5abfc7288c6b.
Diffstat (limited to 'passes/techmap')
-rw-r--r--passes/techmap/shregmap.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/passes/techmap/shregmap.cc b/passes/techmap/shregmap.cc
index 3adcd8968..46f6a79fb 100644
--- a/passes/techmap/shregmap.cc
+++ b/passes/techmap/shregmap.cc
@@ -294,8 +294,12 @@ struct ShregmapWorker
if (opts.init || sigbit_init.count(q_bit) == 0)
{
auto r = sigbit_chain_next.insert(std::make_pair(d_bit, cell));
- if (!r.second)
+ if (!r.second) {
sigbit_with_non_chain_users.insert(d_bit);
+ Wire *wire = module->addWire(NEW_ID);
+ module->connect(wire, d_bit);
+ sigbit_chain_next.insert(std::make_pair(wire, cell));
+ }
sigbit_chain_prev[q_bit] = cell;
continue;
@@ -315,14 +319,14 @@ struct ShregmapWorker
{
for (auto it : sigbit_chain_next)
{
- Cell *c1, *c2 = it.second;
-
if (opts.tech == nullptr && sigbit_with_non_chain_users.count(it.first))
goto start_cell;
- c1 = sigbit_chain_prev.at(it.first, nullptr);
- if (c1 != nullptr)
+ if (sigbit_chain_prev.count(it.first) != 0)
{
+ Cell *c1 = sigbit_chain_prev.at(it.first);
+ Cell *c2 = it.second;
+
if (c1->type != c2->type)
goto start_cell;
@@ -332,15 +336,6 @@ struct ShregmapWorker
IdString d_port = opts.ffcells.at(c1->type).first;
IdString q_port = opts.ffcells.at(c1->type).second;
- // If the previous cell's D has other non chain users,
- // then it is possible that this previous cell could
- // be a start of the chain
- SigBit d_bit = sigmap(c1->getPort(d_port).as_bit());
- if (sigbit_with_non_chain_users.count(d_bit)) {
- c2 = c1;
- goto start_cell;
- }
-
auto c1_conn = c1->connections();
auto c2_conn = c1->connections();
@@ -357,7 +352,7 @@ struct ShregmapWorker
}
start_cell:
- chain_start_cells.insert(c2);
+ chain_start_cells.insert(it.second);
}
}