aboutsummaryrefslogtreecommitdiffstats
path: root/backends/json
diff options
context:
space:
mode:
authorR. Ou <rqou@robertou.com>2020-02-09 01:01:18 -0800
committerR. Ou <rqou@robertou.com>2020-02-09 01:01:18 -0800
commit20ce4118da1a0b14e8307aa0a605101252028757 (patch)
tree945ef9261ce3e7f206dba535011bc122a180ffd6 /backends/json
parent2e8d6ec0b06b4e51e222c15c8049130bc264ae57 (diff)
downloadyosys-20ce4118da1a0b14e8307aa0a605101252028757.tar.gz
yosys-20ce4118da1a0b14e8307aa0a605101252028757.tar.bz2
yosys-20ce4118da1a0b14e8307aa0a605101252028757.zip
json: Change compat mode to directly emit ints <= 32 bits
This increases compatibility with certain older parsers in some cases that worked before commit 15fae357 but do not work with the current compat-int mode
Diffstat (limited to 'backends/json')
-rw-r--r--backends/json/json.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/json/json.cc b/backends/json/json.cc
index 5c67cb857..6c924ff99 100644
--- a/backends/json/json.cc
+++ b/backends/json/json.cc
@@ -104,7 +104,7 @@ struct JsonWriter
if (state < 2)
str += " ";
f << get_string(str);
- } else if (compat_int_mode && GetSize(value) == 32 && value.is_fully_def()) {
+ } else if (compat_int_mode && GetSize(value) <= 32 && value.is_fully_def()) {
if ((value.flags & RTLIL::ConstFlags::CONST_FLAG_SIGNED) != 0)
f << stringf("%d", value.as_int());
else
@@ -296,7 +296,7 @@ struct JsonBackend : public Backend {
log(" include AIG models for the different gate types\n");
log("\n");
log(" -compat-int\n");
- log(" emit 32-bit fully-defined parameter values directly\n");
+ log(" emit 32-bit or smaller fully-defined parameter values directly\n");
log(" as JSON numbers (for compatibility with old parsers)\n");
log("\n");
log("\n");
@@ -540,7 +540,7 @@ struct JsonPass : public Pass {
log(" also include AIG models for the different gate types\n");
log("\n");
log(" -compat-int\n");
- log(" emit 32-bit fully-defined parameter values directly\n");
+ log(" emit 32-bit or smaller fully-defined parameter values directly\n");
log(" as JSON numbers (for compatibility with old parsers)\n");
log("\n");
log("See 'help write_json' for a description of the JSON format used.\n");