aboutsummaryrefslogtreecommitdiffstats
path: root/json
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-06-04 20:08:43 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2019-06-04 20:08:43 +0200
commit3ae50f85b15437b92b0ab3e6e9c243ea0556fdfc (patch)
tree03cc06e34a9fd3b193d6757c33703db253818a9b /json
parentd5f804832f1accf318e8f62a9989149f5bc0b34a (diff)
downloadnextpnr-3ae50f85b15437b92b0ab3e6e9c243ea0556fdfc.tar.gz
nextpnr-3ae50f85b15437b92b0ab3e6e9c243ea0556fdfc.tar.bz2
nextpnr-3ae50f85b15437b92b0ab3e6e9c243ea0556fdfc.zip
Use index as unique identifier for nets
Diffstat (limited to 'json')
-rw-r--r--json/jsonwrite.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/json/jsonwrite.cc b/json/jsonwrite.cc
index eb1ed3a4..2aaba756 100644
--- a/json/jsonwrite.cc
+++ b/json/jsonwrite.cc
@@ -142,8 +142,6 @@ void write_module(std::ostream &f, Context *ctx)
// TODO: Top level ports
f << stringf("\n },\n");
- auto fn = ctx->nets.hash_function();
-
f << stringf(" \"cells\": {");
bool first = true;
for (auto &pair : ctx->cells) {
@@ -175,7 +173,7 @@ void write_module(std::ostream &f, Context *ctx)
auto &p = conn.second;
f << stringf("%s\n", first2 ? "" : ",");
if (p.net)
- f << stringf(" %s: [ %d ]", get_name(conn.first,ctx).c_str(), fn(p.net->name));
+ f << stringf(" %s: [ %d ]", get_name(conn.first,ctx).c_str(), p.net->name.index);
else
f << stringf(" %s: [ ]", get_name(conn.first,ctx).c_str());
@@ -196,7 +194,7 @@ void write_module(std::ostream &f, Context *ctx)
f << stringf("%s\n", first ? "" : ",");
f << stringf(" %s: {\n", get_name(w->name, ctx).c_str());
f << stringf(" \"hide_name\": %s,\n", w->name.c_str(ctx)[0] == '$' ? "1" : "0");
- f << stringf(" \"bits\": [ %d ] ,\n", fn(pair.first));
+ f << stringf(" \"bits\": [ %d ] ,\n", pair.first.index);
f << stringf(" \"attributes\": {");
bool first2 = write_parameters(f, ctx, w->attrs);
write_routing(f, ctx, w.get(), first2);