mirror of https://github.com/YosysHQ/yosys.git
Add verilog backend option for simple_lhs
This commit is contained in:
parent
addc493e8d
commit
7b093dca10
|
@ -35,7 +35,7 @@
|
||||||
USING_YOSYS_NAMESPACE
|
USING_YOSYS_NAMESPACE
|
||||||
PRIVATE_NAMESPACE_BEGIN
|
PRIVATE_NAMESPACE_BEGIN
|
||||||
|
|
||||||
bool verbose, norename, noattr, attr2comment, noexpr, nodec, nohex, nostr, extmem, defparam, decimal, siminit, systemverilog;
|
bool verbose, norename, noattr, attr2comment, noexpr, nodec, nohex, nostr, extmem, defparam, decimal, siminit, systemverilog, simple_lhs;
|
||||||
int auto_name_counter, auto_name_offset, auto_name_digits, extmem_counter;
|
int auto_name_counter, auto_name_offset, auto_name_digits, extmem_counter;
|
||||||
std::map<RTLIL::IdString, int> auto_name_map;
|
std::map<RTLIL::IdString, int> auto_name_map;
|
||||||
std::set<RTLIL::IdString> reg_wires;
|
std::set<RTLIL::IdString> reg_wires;
|
||||||
|
@ -1546,14 +1546,22 @@ void dump_cell(std::ostream &f, std::string indent, RTLIL::Cell *cell)
|
||||||
|
|
||||||
void dump_conn(std::ostream &f, std::string indent, const RTLIL::SigSpec &left, const RTLIL::SigSpec &right)
|
void dump_conn(std::ostream &f, std::string indent, const RTLIL::SigSpec &left, const RTLIL::SigSpec &right)
|
||||||
{
|
{
|
||||||
int offset = 0;
|
if (simple_lhs) {
|
||||||
for (auto &chunk : left.chunks()) {
|
int offset = 0;
|
||||||
|
for (auto &chunk : left.chunks()) {
|
||||||
|
f << stringf("%s" "assign ", indent.c_str());
|
||||||
|
dump_sigspec(f, chunk);
|
||||||
|
f << stringf(" = ");
|
||||||
|
dump_sigspec(f, right.extract(offset, GetSize(chunk)));
|
||||||
|
f << stringf(";\n");
|
||||||
|
offset += GetSize(chunk);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
f << stringf("%s" "assign ", indent.c_str());
|
f << stringf("%s" "assign ", indent.c_str());
|
||||||
dump_sigspec(f, chunk);
|
dump_sigspec(f, left);
|
||||||
f << stringf(" = ");
|
f << stringf(" = ");
|
||||||
dump_sigspec(f, right.extract(offset, GetSize(chunk)));
|
dump_sigspec(f, right);
|
||||||
f << stringf(";\n");
|
f << stringf(";\n");
|
||||||
offset += GetSize(chunk);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1865,6 +1873,9 @@ struct VerilogBackend : public Backend {
|
||||||
log(" deactivates this feature and instead will write string constants\n");
|
log(" deactivates this feature and instead will write string constants\n");
|
||||||
log(" as binary numbers.\n");
|
log(" as binary numbers.\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
|
log(" -simple-lhs\n");
|
||||||
|
log(" Connection assignments with simple left hand side without concatenations.\n");
|
||||||
|
log("\n");
|
||||||
log(" -extmem\n");
|
log(" -extmem\n");
|
||||||
log(" instead of initializing memories using assignments to individual\n");
|
log(" instead of initializing memories using assignments to individual\n");
|
||||||
log(" elements, use the '$readmemh' function to read initialization data\n");
|
log(" elements, use the '$readmemh' function to read initialization data\n");
|
||||||
|
@ -1912,6 +1923,7 @@ struct VerilogBackend : public Backend {
|
||||||
defparam = false;
|
defparam = false;
|
||||||
decimal = false;
|
decimal = false;
|
||||||
siminit = false;
|
siminit = false;
|
||||||
|
simple_lhs = false;
|
||||||
auto_prefix = "";
|
auto_prefix = "";
|
||||||
|
|
||||||
bool blackboxes = false;
|
bool blackboxes = false;
|
||||||
|
@ -1984,6 +1996,10 @@ struct VerilogBackend : public Backend {
|
||||||
selected = true;
|
selected = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (arg == "-simple-lhs") {
|
||||||
|
simple_lhs = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (arg == "-v") {
|
if (arg == "-v") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue