mirror of
https://github.com/YosysHQ/yosys.git
synced 2026-08-22 14:17:27 +02:00
write_verilog: avoid emitting empty cases.
The Verilog grammar does not allow an empty case. Most synthesis tools are quite permissive about this, but Quartus is not. This causes problems for amaranth with Quartus (see amaranth-lang/amaranth#931).
This commit is contained in:
@@ -2008,6 +2008,11 @@ void dump_proc_switch(std::ostream &f, std::string indent, RTLIL::SwitchRule *sw
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user