diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-12-24 16:26:18 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-12-24 16:26:18 +0100 |
commit | b6a7e21d2ee773b2eedf55ded913b034e916fa27 (patch) | |
tree | d7e94b7d952dc6603c7d6246ea61e818781391dc | |
parent | e548483c9105a0fef0a4b5c64640611b304ecb05 (diff) | |
download | yosys-b6a7e21d2ee773b2eedf55ded913b034e916fa27.tar.gz yosys-b6a7e21d2ee773b2eedf55ded913b034e916fa27.tar.bz2 yosys-b6a7e21d2ee773b2eedf55ded913b034e916fa27.zip |
Fixed off-by-one bug in "hierarchy -check" for positional module args
-rw-r--r-- | passes/hierarchy/hierarchy.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/passes/hierarchy/hierarchy.cc b/passes/hierarchy/hierarchy.cc index 028a0f0c2..e95947a92 100644 --- a/passes/hierarchy/hierarchy.cc +++ b/passes/hierarchy/hierarchy.cc @@ -206,9 +206,9 @@ bool expand_module(RTLIL::Design *design, RTLIL::Module *module, bool flag_check for (auto &conn : cell->connections()) if (conn.first[0] == '$' && '0' <= conn.first[1] && conn.first[1] <= '9') { int id = atoi(conn.first.c_str()+1); - if (id < 0 || id >= GetSize(mod->ports)) + if (id <= 0 || id > GetSize(mod->ports)) log_error("Module `%s' referenced in module `%s' in cell `%s' has only %d ports, requested port %d.\n", - log_id(cell->type), log_id(module), log_id(cell), GetSize(mod->ports), id + 1); + log_id(cell->type), log_id(module), log_id(cell), GetSize(mod->ports), id); } else if (mod->wire(conn.first) == nullptr || mod->wire(conn.first)->port_id == 0) log_error("Module `%s' referenced in module `%s' in cell `%s' does not have a port named '%s'.\n", log_id(cell->type), log_id(module), log_id(cell), log_id(conn.first)); |