diff options
author | Aman Goel <amangoel@umich.edu> | 2018-08-18 08:18:40 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-18 08:18:40 +0530 |
commit | 61f002c908830d59e883d25668b731e7d12470d0 (patch) | |
tree | 25174f7321f60e14ca6c144544f29971c40abe9b /backends/json/json.cc | |
parent | 5dcb899e76a82c8aa84552a59f4a9f64394e7785 (diff) | |
parent | e343f3e6d475984c21611474bffe7dcd8f599497 (diff) | |
download | yosys-61f002c908830d59e883d25668b731e7d12470d0.tar.gz yosys-61f002c908830d59e883d25668b731e7d12470d0.tar.bz2 yosys-61f002c908830d59e883d25668b731e7d12470d0.zip |
Merge pull request #3 from YosysHQ/master
Updates from official repo
Diffstat (limited to 'backends/json/json.cc')
-rw-r--r-- | backends/json/json.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/backends/json/json.cc b/backends/json/json.cc index d3b7077a2..f5c687981 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; } } @@ -250,7 +252,7 @@ struct JsonWriter struct JsonBackend : public Backend { JsonBackend() : Backend("json", "write design to a JSON file") { } - virtual void help() + void help() YS_OVERRIDE { // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| log("\n"); @@ -458,7 +460,7 @@ struct JsonBackend : public Backend { log("format. A program processing this format must ignore all unknown fields.\n"); log("\n"); } - virtual void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) + void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE { bool aig_mode = false; @@ -482,7 +484,7 @@ struct JsonBackend : public Backend { struct JsonPass : public Pass { JsonPass() : Pass("json", "write design in JSON format") { } - virtual void help() + void help() YS_OVERRIDE { // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---| log("\n"); @@ -499,7 +501,7 @@ struct JsonPass : public Pass { log("See 'help write_json' for a description of the JSON format used.\n"); log("\n"); } - virtual void execute(std::vector<std::string> args, RTLIL::Design *design) + void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE { std::string filename; bool aig_mode = false; |