diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-10-03 17:31:21 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-10-03 17:31:21 +0200 |
commit | 65f91e51205fdd436c569c4795517160960ac700 (patch) | |
tree | 866f50f10a644202612aecce5ca07e48dec35102 | |
parent | 4718e65763854d9870bf9b88a7c1b1e78e10f05f (diff) | |
download | yosys-65f91e51205fdd436c569c4795517160960ac700.tar.gz yosys-65f91e51205fdd436c569c4795517160960ac700.tar.bz2 yosys-65f91e51205fdd436c569c4795517160960ac700.zip |
Rename "write_verilog -nobasenradix" to "write_verilog -decimal"
-rw-r--r-- | backends/verilog/verilog_backend.cc | 29 | ||||
-rwxr-xr-x | techlibs/intel/synth_intel.cc | 5 |
2 files changed, 14 insertions, 20 deletions
diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc index 48e06dc7c..fb0add847 100644 --- a/backends/verilog/verilog_backend.cc +++ b/backends/verilog/verilog_backend.cc @@ -33,7 +33,7 @@ USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN -bool verbose, norename, noattr, attr2comment, noexpr, nodec, nohex, nostr, defparam, nobasenradix; +bool verbose, norename, noattr, attr2comment, noexpr, nodec, nohex, nostr, defparam, decimal; int auto_name_counter, auto_name_offset, auto_name_digits; std::map<RTLIL::IdString, int> auto_name_map; std::set<RTLIL::IdString> reg_wires, reg_ct; @@ -172,14 +172,12 @@ void dump_const(std::ostream &f, const RTLIL::Const &data, int width = -1, int o if (data.bits[i] == RTLIL::S1) val |= 1 << (i - offset); } - if (set_signed && val < 0) + if (decimal) + f << stringf("%d", val); + else if (set_signed && val < 0) f << stringf("-32'sd%u", -val); - else { - if(nobasenradix) - f << stringf("%u", val); // There's no signed parameter on megawizard IP - else - f << stringf("32'%sd%u", set_signed ? "s" : "", val); - } + else + f << stringf("32'%sd%u", set_signed ? "s" : "", val); } else { dump_hex: if (nohex) @@ -1462,6 +1460,9 @@ struct VerilogBackend : public Backend { log(" not bit pattern. This option decativates this feature and instead\n"); log(" will write out all constants in binary.\n"); log("\n"); + log(" -decimal\n"); + log(" dump 32-bit constants in decimal and without size and radix\n"); + log("\n"); log(" -nohex\n"); log(" constant values that are compatible with hex output are usually\n"); log(" dumped as hex values. This option decativates this feature and\n"); @@ -1489,10 +1490,6 @@ struct VerilogBackend : public Backend { log(" -v\n"); log(" verbose output (print new names of all renamed wires and cells)\n"); log("\n"); - log(" -nobasenradix\n"); - log(" dump defparam constants without size and radix for align with legacy\n"); - log(" MegaWizard primitive template implementation.\n"); - log("\n"); log("Note that RTLIL processes can't always be mapped directly to Verilog\n"); log("always blocks. This frontend should only be used to export an RTLIL\n"); log("netlist, i.e. after the \"proc\" pass has been used to convert all\n"); @@ -1513,7 +1510,7 @@ struct VerilogBackend : public Backend { nohex = false; nostr = false; defparam = false; - nobasenradix= false; + decimal = false; auto_prefix = ""; bool blackboxes = false; @@ -1584,9 +1581,9 @@ struct VerilogBackend : public Backend { defparam = true; continue; } - if (arg == "-nobasenradix") { - nobasenradix = true; - continue; + if (arg == "-decimal") { + decimal = true; + continue; } if (arg == "-blackboxes") { blackboxes = true; diff --git a/techlibs/intel/synth_intel.cc b/techlibs/intel/synth_intel.cc index 4c4c13016..5f8b9c92a 100755 --- a/techlibs/intel/synth_intel.cc +++ b/techlibs/intel/synth_intel.cc @@ -63,9 +63,6 @@ struct SynthIntelPass : public ScriptPass { log(" -retime\n"); log(" run 'abc' with -dff option\n"); log("\n"); - log(" -nobasenradix\n"); - log(" dump the VQM netlist in clearbox format for certain defparam primitives\n"); - log("\n"); log("The following commands are executed by this synthesis command:\n"); help_script(); log("\n"); @@ -232,7 +229,7 @@ struct SynthIntelPass : public ScriptPass { if (check_label("vqm")) { if (!vout_file.empty() || help_mode) - run(stringf("write_verilog -attr2comment -defparam -nohex -nobasenradix -renameprefix syn_ %s", + run(stringf("write_verilog -attr2comment -defparam -nohex -decimal -renameprefix syn_ %s", help_mode ? "<file-name>" : vout_file.c_str())); } } |