mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-29 20:59:03 +00:00
Remove .c_str() from stringf parameters
This commit is contained in:
parent
c41ba912d8
commit
c7df6954b9
90 changed files with 773 additions and 773 deletions
|
@ -591,7 +591,7 @@ static void run_eval_test(RTLIL::Design *design, bool verbose, bool nosat, std::
|
|||
|
||||
if (vlog_file.is_open())
|
||||
{
|
||||
vlog_file << stringf("\nmodule %s;\n", uut_name.c_str());
|
||||
vlog_file << stringf("\nmodule %s;\n", uut_name);
|
||||
|
||||
for (auto port : gold_mod->ports) {
|
||||
RTLIL::Wire *wire = gold_mod->wire(port);
|
||||
|
@ -601,13 +601,13 @@ static void run_eval_test(RTLIL::Design *design, bool verbose, bool nosat, std::
|
|||
vlog_file << stringf(" wire [%d:0] %s_expr, %s_noexpr;\n", GetSize(wire)-1, log_id(wire), log_id(wire));
|
||||
}
|
||||
|
||||
vlog_file << stringf(" %s_expr uut_expr(", uut_name.c_str());
|
||||
vlog_file << stringf(" %s_expr uut_expr(", uut_name);
|
||||
for (int i = 0; i < GetSize(gold_mod->ports); i++)
|
||||
vlog_file << stringf("%s.%s(%s%s)", i ? ", " : "", log_id(gold_mod->ports[i]), log_id(gold_mod->ports[i]),
|
||||
gold_mod->wire(gold_mod->ports[i])->port_input ? "" : "_expr");
|
||||
vlog_file << stringf(");\n");
|
||||
|
||||
vlog_file << stringf(" %s_expr uut_noexpr(", uut_name.c_str());
|
||||
vlog_file << stringf(" %s_expr uut_noexpr(", uut_name);
|
||||
for (int i = 0; i < GetSize(gold_mod->ports); i++)
|
||||
vlog_file << stringf("%s.%s(%s%s)", i ? ", " : "", log_id(gold_mod->ports[i]), log_id(gold_mod->ports[i]),
|
||||
gold_mod->wire(gold_mod->ports[i])->port_input ? "" : "_noexpr");
|
||||
|
@ -615,7 +615,7 @@ static void run_eval_test(RTLIL::Design *design, bool verbose, bool nosat, std::
|
|||
|
||||
vlog_file << stringf(" task run;\n");
|
||||
vlog_file << stringf(" begin\n");
|
||||
vlog_file << stringf(" $display(\"%s\");\n", uut_name.c_str());
|
||||
vlog_file << stringf(" $display(\"%s\");\n", uut_name);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 64; i++)
|
||||
|
@ -662,7 +662,7 @@ static void run_eval_test(RTLIL::Design *design, bool verbose, bool nosat, std::
|
|||
gate_ce.set(gate_wire, in_value);
|
||||
|
||||
if (vlog_file.is_open() && GetSize(in_value) > 0) {
|
||||
vlog_file << stringf(" %s = 'b%s;\n", log_id(gold_wire), in_value.as_string().c_str());
|
||||
vlog_file << stringf(" %s = 'b%s;\n", log_id(gold_wire), in_value.as_string());
|
||||
if (!vlog_pattern_info.empty())
|
||||
vlog_pattern_info += " ";
|
||||
vlog_pattern_info += stringf("%s=%s", log_id(gold_wire), log_signal(in_value));
|
||||
|
@ -716,8 +716,8 @@ static void run_eval_test(RTLIL::Design *design, bool verbose, bool nosat, std::
|
|||
if (vlog_file.is_open()) {
|
||||
vlog_file << stringf(" $display(\"[%s] %s expected: %%b, expr: %%b, noexpr: %%b\", %d'b%s, %s_expr, %s_noexpr);\n",
|
||||
vlog_pattern_info.c_str(), log_id(gold_wire), GetSize(gold_outval), gold_outval.as_string().c_str(), log_id(gold_wire), log_id(gold_wire));
|
||||
vlog_file << stringf(" if (%s_expr !== %d'b%s) begin $display(\"ERROR\"); $finish; end\n", log_id(gold_wire), GetSize(gold_outval), gold_outval.as_string().c_str());
|
||||
vlog_file << stringf(" if (%s_noexpr !== %d'b%s) begin $display(\"ERROR\"); $finish; end\n", log_id(gold_wire), GetSize(gold_outval), gold_outval.as_string().c_str());
|
||||
vlog_file << stringf(" if (%s_expr !== %d'b%s) begin $display(\"ERROR\"); $finish; end\n", log_id(gold_wire), GetSize(gold_outval), gold_outval.as_string());
|
||||
vlog_file << stringf(" if (%s_noexpr !== %d'b%s) begin $display(\"ERROR\"); $finish; end\n", log_id(gold_wire), GetSize(gold_outval), gold_outval.as_string());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1142,12 +1142,12 @@ struct TestCellPass : public Pass {
|
|||
else
|
||||
uut = create_gold_module(design, cell_type, cell_types.at(cell_type), constmode, muxdiv);
|
||||
if (!write_prefix.empty()) {
|
||||
Pass::call(design, stringf("write_rtlil %s_%s_%05d.il", write_prefix.c_str(), cell_type.c_str()+1, i));
|
||||
Pass::call(design, stringf("write_rtlil %s_%s_%05d.il", write_prefix, cell_type.c_str()+1, i));
|
||||
} else if (edges) {
|
||||
Pass::call(design, "dump gold");
|
||||
run_edges_test(design, verbose);
|
||||
} else {
|
||||
Pass::call(design, stringf("copy gold gate; cd gate; %s; cd ..", techmap_cmd.c_str()));
|
||||
Pass::call(design, stringf("copy gold gate; cd gate; %s; cd ..", techmap_cmd));
|
||||
if (!noopt)
|
||||
Pass::call(design, "opt -fast gate");
|
||||
if (!nosat)
|
||||
|
@ -1157,11 +1157,11 @@ struct TestCellPass : public Pass {
|
|||
Pass::call(design, "dump gold");
|
||||
if (!nosat)
|
||||
Pass::call(design, "sat -verify -enable_undef -prove trigger 0 -show-inputs -show-outputs miter");
|
||||
std::string uut_name = stringf("uut_%s_%d", cell_type.substr(1).c_str(), i);
|
||||
std::string uut_name = stringf("uut_%s_%d", cell_type.substr(1), i);
|
||||
if (vlog_file.is_open()) {
|
||||
Pass::call(design, stringf("copy gold %s_expr; select %s_expr", uut_name.c_str(), uut_name.c_str()));
|
||||
Pass::call(design, stringf("copy gold %s_expr; select %s_expr", uut_name, uut_name));
|
||||
Backend::backend_call(design, &vlog_file, "<test_cell -vlog>", "verilog -selected");
|
||||
Pass::call(design, stringf("copy gold %s_noexpr; select %s_noexpr", uut_name.c_str(), uut_name.c_str()));
|
||||
Pass::call(design, stringf("copy gold %s_noexpr; select %s_noexpr", uut_name, uut_name));
|
||||
Backend::backend_call(design, &vlog_file, "<test_cell -vlog>", "verilog -selected -noexpr");
|
||||
uut_names.push_back(uut_name);
|
||||
}
|
||||
|
@ -1208,7 +1208,7 @@ struct TestCellPass : public Pass {
|
|||
if (vlog_file.is_open()) {
|
||||
vlog_file << "\nmodule testbench;\n";
|
||||
for (auto &uut : uut_names)
|
||||
vlog_file << stringf(" %s %s ();\n", uut.c_str(), uut.c_str());
|
||||
vlog_file << stringf(" %s %s ();\n", uut, uut);
|
||||
vlog_file << " initial begin\n";
|
||||
for (auto &uut : uut_names)
|
||||
vlog_file << " " << uut << ".run;\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue