Fix json formatting
authorMiodrag Milanovic <mmicko@gmail.com>
Fri, 21 Jun 2019 18:01:40 +0000 (20:01 +0200)
committerMiodrag Milanovic <mmicko@gmail.com>
Fri, 21 Jun 2019 18:01:40 +0000 (20:01 +0200)
backends/json/json.cc

index eb59e5eba3a919e0bc0fa1a542ccc9d2ca8e3899..dda4dfeddafc5bbb087b41eda58a543f3f53edd1 100644 (file)
@@ -126,11 +126,11 @@ struct JsonWriter
                        f << stringf("%s\n", first ? "" : ",");
                        f << stringf("        %s: {\n", get_name(n).c_str());
                        f << stringf("          \"direction\": \"%s\",\n", w->port_input ? w->port_output ? "inout" : "input" : "output");
-                       f << stringf("          \"bits\": %s\n", get_bits(w).c_str());
                        if (w->start_offset)
                                f << stringf("          \"offset\": %d,\n", w->start_offset);
                        if (w->upto)
                                f << stringf("          \"upto\": 1,\n");
+                       f << stringf("          \"bits\": %s\n", get_bits(w).c_str());
                        f << stringf("        }");
                        first = false;
                }