diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-08-14 23:31:25 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-08-14 23:31:25 +0200 |
commit | 1dd156f5167d9949eccb7abcbc65d9bc74f49ee8 (patch) | |
tree | 7c76235f9909d8569b0dbc75defcceb4174d166c /backends | |
parent | 2353d28ff2dc734d216f5e55f6a982cd3fe90a70 (diff) | |
download | yosys-1dd156f5167d9949eccb7abcbc65d9bc74f49ee8.tar.gz yosys-1dd156f5167d9949eccb7abcbc65d9bc74f49ee8.tar.bz2 yosys-1dd156f5167d9949eccb7abcbc65d9bc74f49ee8.zip |
Fix use of signed integers in JSON back-end
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'backends')
-rw-r--r-- | backends/json/json.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/backends/json/json.cc b/backends/json/json.cc index d3b7077a2..1a3ca64a3 100644 --- a/backends/json/json.cc +++ b/backends/json/json.cc @@ -93,8 +93,10 @@ struct JsonWriter f << get_string(param.second.decode_string()); else if (GetSize(param.second.bits) > 32) f << get_string(param.second.as_string()); - else + else if ((param.second.flags & RTLIL::ConstFlags::CONST_FLAG_SIGNED) != 0) f << stringf("%d", param.second.as_int()); + else + f << stringf("%u", param.second.as_int()); first = false; } } |