Skip to content

Commit

Permalink
write_verilog: emit $check cell names as labels
Browse files Browse the repository at this point in the history
  • Loading branch information
rroohhh committed Jan 30, 2025
1 parent 954250d commit 9ad7bc2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions backends/verilog/verilog_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1044,16 +1044,21 @@ void dump_cell_expr_print(std::ostream &f, std::string indent, const RTLIL::Cell
void dump_cell_expr_check(std::ostream &f, std::string indent, const RTLIL::Cell *cell)
{
std::string flavor = cell->getParam(ID(FLAVOR)).decode_string();
std::string indent_name = indent;
if (cell->name.isPublic()) {
indent_name += stringf("%s: ", id(cell->name).c_str());
}

if (flavor == "assert")
f << stringf("%s" "assert (", indent.c_str());
f << stringf("%s" "assert (", indent_name.c_str());
else if (flavor == "assume")
f << stringf("%s" "assume (", indent.c_str());
f << stringf("%s" "assume (", indent_name.c_str());
else if (flavor == "live")
f << stringf("%s" "assert (eventually ", indent.c_str());
f << stringf("%s" "assert (eventually ", indent_name.c_str());
else if (flavor == "fair")
f << stringf("%s" "assume (eventually ", indent.c_str());
f << stringf("%s" "assume (eventually ", indent_name.c_str());
else if (flavor == "cover")
f << stringf("%s" "cover (", indent.c_str());
f << stringf("%s" "cover (", indent_name.c_str());
dump_sigspec(f, cell->getPort(ID::A));
f << stringf(");\n");
}
Expand Down

0 comments on commit 9ad7bc2

Please sign in to comment.