aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2022-05-02 11:18:30 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2022-05-02 11:18:30 +0200
commit3730db4b986fd69941a16520cfd54179a3424d0e (patch)
tree4c2c0d1b82bc2146639752231b273bb856479525 /passes
parentc785cb7fe35da70fe833441c70d0186ed3a892fe (diff)
downloadyosys-3730db4b986fd69941a16520cfd54179a3424d0e.tar.gz
yosys-3730db4b986fd69941a16520cfd54179a3424d0e.tar.bz2
yosys-3730db4b986fd69941a16520cfd54179a3424d0e.zip
AIM file could have gaps in or between inputs and inits
Diffstat (limited to 'passes')
-rw-r--r--passes/sat/sim.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc
index 5f795e94c..7b52b85cd 100644
--- a/passes/sat/sim.cc
+++ b/passes/sat/sim.cc
@@ -1798,6 +1798,7 @@ struct AIWWriter : public OutputWriter
std::ifstream mf(worker->map_filename);
std::string type, symbol;
int variable, index;
+ int max_input = 0;
if (mf.fail())
log_cmd_error("Not able to read AIGER witness map file.\n");
while (mf >> type >> variable >> index >> symbol) {
@@ -1815,8 +1816,10 @@ struct AIWWriter : public OutputWriter
if (worker->clockn.count(escaped_s)) {
clocks[variable] = false;
}
+ max_input = max(max_input,variable);
} else if (type == "init") {
aiw_inits[variable] = SigBit(w,index-w->start_offset);
+ max_input = max(max_input,variable);
} else if (type == "latch") {
aiw_latches[variable] = {SigBit(w,index-w->start_offset), false};
} else if (type == "invlatch") {
@@ -1863,7 +1866,7 @@ struct AIWWriter : public OutputWriter
}
if (skip)
continue;
- for (int i = 0;; i++)
+ for (int i = 0; i <= max_input; i++)
{
if (aiw_inputs.count(i)) {
SigBit bit = aiw_inputs.at(i);
@@ -1883,9 +1886,9 @@ struct AIWWriter : public OutputWriter
aiwfile << '0';
continue;
}
- aiwfile << '\n';
- break;
+ aiwfile << '0';
}
+ aiwfile << '\n';
}
}