aboutsummaryrefslogtreecommitdiffstats
path: root/passes/sat
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2022-01-28 12:50:41 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2022-01-28 12:50:41 +0100
commit4f75a2ca1b4a71ad335124b45d36eed9c8d619c8 (patch)
treeee936a635f796bd9da346bd3a71e9c30635bf0d9 /passes/sat
parent7101df62f8e0eca91b5bec7f2e2e72fbb3f33193 (diff)
downloadyosys-4f75a2ca1b4a71ad335124b45d36eed9c8d619c8.tar.gz
yosys-4f75a2ca1b4a71ad335124b45d36eed9c8d619c8.tar.bz2
yosys-4f75a2ca1b4a71ad335124b45d36eed9c8d619c8.zip
Do actual compare
Diffstat (limited to 'passes/sat')
-rw-r--r--passes/sat/sim.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc
index d6f5f3a81..e9e114047 100644
--- a/passes/sat/sim.cc
+++ b/passes/sat/sim.cc
@@ -966,21 +966,32 @@ struct SimWorker : SimShared
log_warning("Stop time is after simulation file end time\n");
}
}
- fst->reconstruct(fst_clock);
- auto edges = fst->edges(fst_clock.back(), true, true);
+ auto edges = fst->getAllEdges(fst_clock, startCount, stopCount);
fst->reconstructAllAtTimes(edges);
-/* for(auto &time : edges) {
+ for(auto &time : edges) {
for(auto &item : inputs) {
std::string v = fst->valueAt(item.second, time);
top->set_state(item.first, Const::from_string(v));
}
update();
+ bool status = true;
for(auto &item : outputs) {
Const fst_val = Const::from_string(fst->valueAt(item.second, time));
Const sim_val = top->get_state(item.first);
- log("%s %s\n", log_signal(fst_val), log_signal(sim_val));
+ if (sim_mode == SimulationMode::gate && !fst_val.is_fully_def()) { // FST data contains X
+ // TODO: check bit by bit
+ } else if (sim_mode == SimulationMode::gold && !sim_val.is_fully_def()) { // sim data contains X
+ // TODO: check bit by bit
+ } else {
+ if (fst_val!=sim_val) {
+ status = false;
+ log("signal: %s fst: %s sim: %s\n", log_id(item.first), log_signal(fst_val), log_signal(sim_val));
+ }
+ }
}
- }*/
+ if (!status)
+ log_error("Signal difference at %zu\n", time);
+ }
}
};