mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-18 13:15:46 +00:00
WIP
This commit is contained in:
parent
afdae7b87e
commit
c3ffbf6fae
229 changed files with 3902 additions and 3835 deletions
|
|
@ -155,12 +155,12 @@ bool module2graph(SubCircuit::Graph &graph, RTLIL::Module *mod, bool constports,
|
|||
std::map<RTLIL::SigBit, bit_ref_t> sig_bit_ref;
|
||||
|
||||
if (sel && !sel->selected(mod)) {
|
||||
log(" Skipping module %s as it is not selected.\n", mod->name.unescape());
|
||||
log(" Skipping module %s as it is not selected.\n", design->twines.unescaped_str(mod->name));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mod->processes.size() > 0) {
|
||||
log(" Skipping module %s as it contains unprocessed processes.\n", mod->name.unescape());
|
||||
log(" Skipping module %s as it contains unprocessed processes.\n", design->twines.unescaped_str(mod->name));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -626,7 +626,7 @@ struct ExtractPass : public Pass {
|
|||
if (!mine_mode)
|
||||
for (auto module : map->modules()) {
|
||||
SubCircuit::Graph mod_graph;
|
||||
std::string graph_name = "needle_" + module->name.unescape();
|
||||
std::string graph_name = "needle_" + design->twines.unescaped_str(module->name);
|
||||
log("Creating needle graph %s.\n", graph_name);
|
||||
if (module2graph(mod_graph, module, constports)) {
|
||||
solver.addGraph(graph_name, mod_graph);
|
||||
|
|
@ -637,7 +637,7 @@ struct ExtractPass : public Pass {
|
|||
|
||||
for (auto module : design->modules()) {
|
||||
SubCircuit::Graph mod_graph;
|
||||
std::string graph_name = "haystack_" + module->name.unescape();
|
||||
std::string graph_name = "haystack_" + design->twines.unescaped_str(module->name);
|
||||
log("Creating haystack graph %s.\n", graph_name);
|
||||
if (module2graph(mod_graph, module, constports, design, mine_mode ? mine_max_fanout : -1, mine_mode ? &mine_split : nullptr)) {
|
||||
solver.addGraph(graph_name, mod_graph);
|
||||
|
|
@ -654,8 +654,8 @@ struct ExtractPass : public Pass {
|
|||
|
||||
for (auto needle : needle_list)
|
||||
for (auto &haystack_it : haystack_map) {
|
||||
log("Solving for %s in %s.\n", ("needle_" + needle->name.unescape()), haystack_it.first);
|
||||
solver.solve(results, "needle_" + needle->name.unescape(), haystack_it.first, false);
|
||||
log("Solving for %s in %s.\n", ("needle_" + design->twines.unescaped_str(needle->name)), haystack_it.first);
|
||||
solver.solve(results, "needle_" + design->twines.unescaped_str(needle->name), haystack_it.first, false);
|
||||
}
|
||||
log("Found %d matches.\n", GetSize(results));
|
||||
|
||||
|
|
@ -691,12 +691,12 @@ struct ExtractPass : public Pass {
|
|||
for (auto &result: results)
|
||||
{
|
||||
log("\nFrequent SubCircuit with %d nodes and %d matches:\n", int(result.nodes.size()), result.totalMatchesAfterLimits);
|
||||
log(" primary match in %s:", haystack_map.at(result.graphId)->name.unescape());
|
||||
log(" primary match in %s:", design->twines.unescaped_str(haystack_map.at(result.graphId)->name));
|
||||
for (auto &node : result.nodes)
|
||||
log(" %s", RTLIL::unescape_id(node.nodeId));
|
||||
log("\n");
|
||||
for (auto &it : result.matchesPerGraph)
|
||||
log(" matches in %s: %d\n", haystack_map.at(it.first)->name.unescape(), it.second);
|
||||
log(" matches in %s: %d\n", design->twines.unescaped_str(haystack_map.at(it.first)->name), it.second);
|
||||
|
||||
RTLIL::Module *mod = haystack_map.at(result.graphId);
|
||||
std::set<RTLIL::Cell*> cells;
|
||||
|
|
@ -717,7 +717,7 @@ struct ExtractPass : public Pass {
|
|||
|
||||
RTLIL::Module *newMod = new RTLIL::Module;
|
||||
newMod->design = map;
|
||||
newMod->name = stringf("\\needle%05d_%s_%dx", needleCounter++, haystack_map.at(result.graphId)->name.unescape(), result.totalMatchesAfterLimits);
|
||||
newMod->name = stringf("\\needle%05d_%s_%dx", needleCounter++, design->twines.unescaped_str(haystack_map.at(result.graphId)->name), result.totalMatchesAfterLimits);
|
||||
map->add(newMod);
|
||||
|
||||
for (auto wire : wires) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue