summaryrefslogtreecommitdiff
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-03-03 20:53:24 +0100
committerClifford Wolf <clifford@clifford.at>2013-03-03 20:53:24 +0100
commitd4680fd5a02bf09872080096ab106abbb6f7e519 (patch)
tree00ea354a47161f8ed6184b58b14d166c8738356d /passes
parent40646d3516c27210fed90666e448c0915690e3a1 (diff)
Added design->select() api and use it in extract pass
Diffstat (limited to 'passes')
-rw-r--r--passes/extract/extract.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/passes/extract/extract.cc b/passes/extract/extract.cc
index 3e5e4afb..e6bb1ca3 100644
--- a/passes/extract/extract.cc
+++ b/passes/extract/extract.cc
@@ -156,7 +156,7 @@ namespace
return true;
}
- void replace(RTLIL::Module *needle, RTLIL::Module *haystack, SubCircuit::Solver::Result &match)
+ RTLIL::Cell *replace(RTLIL::Module *needle, RTLIL::Module *haystack, SubCircuit::Solver::Result &match)
{
SigMap sigmap(needle);
SigSet<std::pair<std::string, int>> sig2port;
@@ -202,6 +202,8 @@ namespace
haystack->cells.erase(haystack_cell->name);
delete haystack_cell;
}
+
+ return cell;
}
}
@@ -451,7 +453,9 @@ struct ExtractPass : public Pass {
log(" %s:%s", it2.first.c_str(), it2.second.c_str());
log("\n");
}
- replace(needle_map.at(result.needleGraphId), haystack_map.at(result.haystackGraphId), result);
+ RTLIL::Cell *new_cell = replace(needle_map.at(result.needleGraphId), haystack_map.at(result.haystackGraphId), result);
+ design->select(haystack_map.at(result.haystackGraphId), new_cell);
+ log(" new cell: %s\n", id2cstr(new_cell->name));
}
}
}