aboutsummaryrefslogtreecommitdiffstats
path: root/passes/sat/sat_solve.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-06-08 14:11:50 +0200
committerClifford Wolf <clifford@clifford.at>2013-06-08 14:11:50 +0200
commit1434312fdd1290ac21eb57c79c1999e775cdba54 (patch)
tree983363203e4430851b2f01b5e715f8e6b30b394b /passes/sat/sat_solve.cc
parent99957a825f077248560b8232465b61d1c2416cfc (diff)
downloadyosys-1434312fdd1290ac21eb57c79c1999e775cdba54.tar.gz
yosys-1434312fdd1290ac21eb57c79c1999e775cdba54.tar.bz2
yosys-1434312fdd1290ac21eb57c79c1999e775cdba54.zip
Various improvements in sat_solve pass and SAT generator
Diffstat (limited to 'passes/sat/sat_solve.cc')
-rw-r--r--passes/sat/sat_solve.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/passes/sat/sat_solve.cc b/passes/sat/sat_solve.cc
index a7605b443..b71d0507a 100644
--- a/passes/sat/sat_solve.cc
+++ b/passes/sat/sat_solve.cc
@@ -211,14 +211,16 @@ struct SatSolvePass : public Pass {
int import_cell_counter = 0;
for (auto &c : module->cells)
if (design->selected(module, c.second) && ct.cell_known(c.second->type)) {
- for (auto &p : c.second->connections)
- if (ct.cell_output(c.second->type, p.first))
- show_drivers.insert(sigmap(p.second), c.second);
- else
- show_driven[c.second].append(sigmap(p.second));
// log("Import cell: %s\n", RTLIL::id2cstr(c.first));
- satgen.importCell(c.second);
- import_cell_counter++;
+ if (satgen.importCell(c.second)) {
+ for (auto &p : c.second->connections)
+ if (ct.cell_output(c.second->type, p.first))
+ show_drivers.insert(sigmap(p.second), c.second);
+ else
+ show_driven[c.second].append(sigmap(p.second));
+ import_cell_counter++;
+ } else
+ log("Warning: failed to import cell %s (type %s) to SAT database.\n", RTLIL::id2cstr(c.first), RTLIL::id2cstr(c.second->type));
}
log("Imported %d cells to SAT database.\n", import_cell_counter);