3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 18:05:24 +00:00

Merge pull request #3992 from YosysHQ/empty-case-fix

write_verilog: avoid emitting empty cases.
This commit is contained in:
Lofty 2023-10-08 08:05:10 +01:00 committed by GitHub
commit a79b15e947
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());
}