From: R. Ou Date: Sun, 9 Feb 2020 09:01:18 +0000 (-0800) Subject: json: Change compat mode to directly emit ints <= 32 bits X-Git-Tag: working-ls180~800^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=20ce4118da1a0b14e8307aa0a605101252028757;p=yosys.git 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 --- 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");