aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-12-27 14:49:09 -0800
committerEddie Hung <eddie@fpgeh.com>2019-12-27 14:49:09 -0800
commit5017be6445fdf3729eb8781e1692be1099039a90 (patch)
tree5112fc69a8298de3bf2fb809d54e0d459f9c40ac
parent4eaa45091cebb57db32fa30c37e80e113ae10451 (diff)
downloadyosys-5017be6445fdf3729eb8781e1692be1099039a90.tar.gz
yosys-5017be6445fdf3729eb8781e1692be1099039a90.tar.bz2
yosys-5017be6445fdf3729eb8781e1692be1099039a90.zip
Cope with abc9_arrival as string
-rw-r--r--backends/aiger/xaiger.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/backends/aiger/xaiger.cc b/backends/aiger/xaiger.cc
index 5729f045a..96263f576 100644
--- a/backends/aiger/xaiger.cc
+++ b/backends/aiger/xaiger.cc
@@ -199,6 +199,7 @@ struct XAigerWriter
dict<SigBit, pool<IdString>> bit_drivers, bit_users;
TopoSort<IdString, RTLIL::sort_by_id_str> toposort;
bool abc9_box_seen = false;
+ std::vector<int> arrivals;
for (auto cell : module->selected_cells()) {
if (cell->type == "$_NOT_")
@@ -284,16 +285,20 @@ struct XAigerWriter
}
}
if (is_output) {
- int arrival = 0;
+ arrivals.clear();
if (port_wire) {
auto it = port_wire->attributes.find("\\abc9_arrival");
if (it != port_wire->attributes.end()) {
- if (it->second.flags != 0)
- log_error("Attribute 'abc9_arrival' on port '%s' of module '%s' is not an integer.\n", log_id(port_wire), log_id(cell->type));
- arrival = it->second.as_int();
+ if (it->second.flags == 0)
+ arrivals.push_back(it->second.as_int());
+ else
+ for (const auto &tok : split_tokens(it->second.decode_string()))
+ arrivals.push_back(atoi(tok.c_str()));
}
}
+ log_assert(GetSize(arrivals) <= 1 || GetSize(arrivals) == GetSize(c.second));
+ auto it = arrivals.begin();
for (auto b : c.second) {
Wire *w = b.wire;
if (!w) continue;
@@ -303,8 +308,12 @@ struct XAigerWriter
alias_map[O] = b;
undriven_bits.erase(O);
- if (arrival)
- arrival_times[b] = arrival;
+ if (!arrivals.empty()) {
+ if (arrivals.size() == 1)
+ arrival_times[b] = *it;
+ else
+ arrival_times[b] = *it++;
+ }
}
}
}