Skip to content

Commit

Permalink
Merge pull request #3992 from YosysHQ/empty-case-fix
Browse files Browse the repository at this point in the history
write_verilog: avoid emitting empty cases.
  • Loading branch information
Ravenslofty authored Oct 8, 2023
2 parents a1923a5 + c36cf9c commit a79b15e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backends/verilog/verilog_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit a79b15e

Please sign in to comment.