aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorJannis Harder <me@jix.one>2022-11-28 19:05:12 +0100
committerJannis Harder <me@jix.one>2022-12-02 14:36:19 +0100
commit7036a312bf1fba8ea88c0b1227bf0f84362e5f9a (patch)
tree74673a005e8056688914ab020255efbde9f6fd66 /passes
parented02d52f30d3c2b3d6a4ba0e8234cc07c78889dc (diff)
downloadyosys-7036a312bf1fba8ea88c0b1227bf0f84362e5f9a.tar.gz
yosys-7036a312bf1fba8ea88c0b1227bf0f84362e5f9a.tar.bz2
yosys-7036a312bf1fba8ea88c0b1227bf0f84362e5f9a.zip
stat: Fix JSON output for empty designs
Diffstat (limited to 'passes')
-rw-r--r--passes/cmds/stat.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/passes/cmds/stat.cc b/passes/cmds/stat.cc
index a998ab8e7..10e98952e 100644
--- a/passes/cmds/stat.cc
+++ b/passes/cmds/stat.cc
@@ -452,7 +452,7 @@ struct StatPass : public Pass {
if (json_mode) {
log("\n");
- log(" },\n");
+ log(top_mod == nullptr ? " }\n" : " },\n");
}
if (top_mod != nullptr)
@@ -466,7 +466,7 @@ struct StatPass : public Pass {
statdata_t data = hierarchy_worker(mod_stat, top_mod->name, 0, /*quiet=*/json_mode);
- if (json_mode)
+ if (json_mode)
data.log_data_json("design", true);
else if (GetSize(mod_stat) > 1) {
log("\n");