mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Merge pull request #3992 from YosysHQ/empty-case-fix
write_verilog: avoid emitting empty cases.
This commit is contained in:
commit
a79b15e947
|
@ -2008,6 +2008,11 @@ void dump_proc_switch(std::ostream &f, std::string indent, RTLIL::SwitchRule *sw
|
||||||
dump_case_body(f, indent + " ", *it);
|
dump_case_body(f, indent + " ", *it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sw->cases.empty()) {
|
||||||
|
// Verilog does not allow empty cases.
|
||||||
|
f << stringf("%s default: ;\n", indent.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
f << stringf("%s" "endcase\n", indent.c_str());
|
f << stringf("%s" "endcase\n", indent.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue