diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2019-06-22 09:30:35 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2019-06-22 09:30:35 +0200 |
commit | bc1450a5cdc55abbc20775c9372131f97f66afd7 (patch) | |
tree | 208e0f6f77525fa9631ec26788c4ef4e97be3564 | |
parent | 5cb9735735ae3a3e93a08951d59578f6104da9a9 (diff) | |
download | nextpnr-bc1450a5cdc55abbc20775c9372131f97f66afd7.tar.gz nextpnr-bc1450a5cdc55abbc20775c9372131f97f66afd7.tar.bz2 nextpnr-bc1450a5cdc55abbc20775c9372131f97f66afd7.zip |
Reversed logic
-rw-r--r-- | json/jsonparse.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/json/jsonparse.cc b/json/jsonparse.cc index 6b6c6317..1a98f53f 100644 --- a/json/jsonparse.cc +++ b/json/jsonparse.cc @@ -407,7 +407,7 @@ void json_import_ports(Context *ctx, const string &modname, const std::vector<Id // // Pick a name for this port int ndx = index + start_offset; - if (!upto) + if (upto) ndx = start_offset + wire_group_node->data_array.size() - index - 1; if (is_bus) this_port.name = ctx->id(port_info.name.str(ctx) + "[" + std::to_string(ndx) + "]"); @@ -768,7 +768,7 @@ void json_import(Context *ctx, string modname, JsonNode *node) if (netid >= int(netlabels.size())) netlabels.resize(netid + 1); int ndx = i + start_offset; - if (!upto) + if (upto) ndx = start_offset + num_bits - i - 1; std::string name = basename + (num_bits == 1 ? "" : std::string("[") + std::to_string(ndx) + std::string("]")); |