aboutsummaryrefslogtreecommitdiffstats
path: root/json
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-05-31 11:50:49 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2019-05-31 11:50:49 +0200
commit1657479c8153199cbe008aad552ce07b8170293a (patch)
treefb19cb382f83e273ec91e26b5cd0ed4ed3e22708 /json
parent545068dec4a0433d17741b508965a391029e3283 (diff)
downloadnextpnr-1657479c8153199cbe008aad552ce07b8170293a.tar.gz
nextpnr-1657479c8153199cbe008aad552ce07b8170293a.tar.bz2
nextpnr-1657479c8153199cbe008aad552ce07b8170293a.zip
Solve some of connection issues
Diffstat (limited to 'json')
-rw-r--r--json/jsonwrite.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/json/jsonwrite.cc b/json/jsonwrite.cc
index b35a61cf..f41fbebc 100644
--- a/json/jsonwrite.cc
+++ b/json/jsonwrite.cc
@@ -92,12 +92,10 @@ void write_module(std::ostream &f, Context *ctx)
bool first2 = true;
for (auto &conn : c->ports) {
auto &p = conn.second;
- if (p.net) {
- std::string direction = (p.type == PORT_IN) ? "input" : (p.type == PORT_OUT) ? "output" : "inout";
- f << stringf("%s\n", first2 ? "" : ",");
- f << stringf(" %s: \"%s\"", get_name(conn.first, ctx).c_str(), direction.c_str());
- first2 = false;
- }
+ std::string direction = (p.type == PORT_IN) ? "input" : (p.type == PORT_OUT) ? "output" : "inout";
+ f << stringf("%s\n", first2 ? "" : ",");
+ f << stringf(" %s: \"%s\"", get_name(conn.first, ctx).c_str(), direction.c_str());
+ first2 = false;
}
f << stringf("\n },\n");
f << stringf(" \"connections\": {");
@@ -105,11 +103,13 @@ void write_module(std::ostream &f, Context *ctx)
for (auto &conn : c->ports) {
auto &p = conn.second;
- if (p.net) {
- f << stringf("%s\n", first2 ? "" : ",");
- f << stringf(" %s: %d", get_name(conn.first,ctx).c_str(), fn(p.net->name));
- first2 = false;
- }
+ f << stringf("%s\n", first2 ? "" : ",");
+ if (p.net)
+ f << stringf(" %s: [ %d ]", get_name(conn.first,ctx).c_str(), fn(p.net->name));
+ else
+ f << stringf(" %s: [ ]", get_name(conn.first,ctx).c_str());
+
+ first2 = false;
}
f << stringf("\n }\n");