aboutsummaryrefslogtreecommitdiffstats
path: root/backends/aiger/xaiger.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-09-03 10:49:21 -0700
committerEddie Hung <eddie@fpgeh.com>2019-09-03 10:49:21 -0700
commitd6a84a78a7ca70e567bc1b0665751daf0e44f4ae (patch)
tree131ecdaa9713cdcf31f5e5fe11aa86e877ac5103 /backends/aiger/xaiger.cc
parent67587bad7fb1adf14ca9598bb1a01d0ffda6a018 (diff)
parent58af64b63a3a253ab08b1410422677deac5c6618 (diff)
downloadyosys-d6a84a78a7ca70e567bc1b0665751daf0e44f4ae.tar.gz
yosys-d6a84a78a7ca70e567bc1b0665751daf0e44f4ae.tar.bz2
yosys-d6a84a78a7ca70e567bc1b0665751daf0e44f4ae.zip
Merge remote-tracking branch 'origin/master' into eddie/deferred_top
Diffstat (limited to 'backends/aiger/xaiger.cc')
-rw-r--r--backends/aiger/xaiger.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/backends/aiger/xaiger.cc b/backends/aiger/xaiger.cc
index 77d0e94c2..e1b84236d 100644
--- a/backends/aiger/xaiger.cc
+++ b/backends/aiger/xaiger.cc
@@ -261,11 +261,12 @@ struct XAigerWriter
}
}
else {
- bool cell_known = cell->known();
+ bool cell_known = inst_module || cell->known();
for (const auto &c : cell->connections()) {
if (c.second.is_fully_const()) continue;
- auto is_input = !cell_known || cell->input(c.first);
- auto is_output = !cell_known || cell->output(c.first);
+ auto port_wire = inst_module ? inst_module->wire(c.first) : nullptr;
+ auto is_input = (port_wire && port_wire->port_input) || !cell_known || cell->input(c.first);
+ auto is_output = (port_wire && port_wire->port_output) || !cell_known || cell->output(c.first);
if (!is_input && !is_output)
log_error("Connection '%s' on cell '%s' (type '%s') not recognised!\n", log_id(c.first), log_id(cell), log_id(cell->type));