3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-12-18 02:08:33 +00:00

Merge pull request #5525 from YosysHQ/emil/fix-xaiger2-empty-cell-input

aiger2: fix empty cell input
This commit is contained in:
Emil J 2025-12-04 16:47:53 +01:00 committed by GitHub
commit 46fbed6e6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 97 additions and 5 deletions

View file

@ -24,6 +24,7 @@
#include "kernel/register.h"
#include "kernel/celltypes.h"
#include "kernel/rtlil.h"
USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN
@ -845,11 +846,14 @@ struct XAigerAnalysis : Index<XAigerAnalysis, int, 0, 0> {
return false;
int max = 1;
for (auto wire : mod->wires())
if (wire->port_input && !wire->port_output)
for (int i = 0; i < wire->width; i++) {
int ilevel = visit(cursor, driver->getPort(wire->name)[i]);
max = std::max(max, ilevel + 1);
for (auto wire : mod->wires()) {
if (wire->port_input && !wire->port_output) {
SigSpec port = driver->getPort(wire->name);
for (int i = 0; i < std::min(wire->width, port.size()); i++) {
int ilevel = visit(cursor, port[i]);
max = std::max(max, ilevel + 1);
}
}
}
lits[idx] = max;