From bc1450a5cdc55abbc20775c9372131f97f66afd7 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 22 Jun 2019 09:30:35 +0200 Subject: [PATCH] Reversed logic --- json/jsonparse.cc | 4 ++-- 1 file 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::vectordata_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("]"));