3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-22 01:11:28 +00:00

Remove .c_str() from parameters to btorf() and infof()

This commit is contained in:
Robert O'Callahan 2025-09-12 05:53:59 +00:00
parent 6f0c8f56a3
commit ff5177ce8e

View file

@ -318,12 +318,12 @@ struct BtorWorker
btorf("%d slt %d %d %d\n", nid_b_ltz, sid_bit, nid_b, nid_zero); btorf("%d slt %d %d %d\n", nid_b_ltz, sid_bit, nid_b, nid_zero);
nid = next_nid++; nid = next_nid++;
btorf("%d ite %d %d %d %d%s\n", nid, sid, nid_b_ltz, nid_l, nid_r, getinfo(cell).c_str()); btorf("%d ite %d %d %d %d%s\n", nid, sid, nid_b_ltz, nid_l, nid_r, getinfo(cell));
} }
else else
{ {
nid = next_nid++; nid = next_nid++;
btorf("%d %s %d %d %d%s\n", nid, btor_op.c_str(), sid, nid_a, nid_b, getinfo(cell).c_str()); btorf("%d %s %d %d %d%s\n", nid, btor_op, sid, nid_a, nid_b, getinfo(cell));
} }
SigSpec sig = sigmap(cell->getPort(ID::Y)); SigSpec sig = sigmap(cell->getPort(ID::Y));
@ -364,7 +364,7 @@ struct BtorWorker
int sid = get_bv_sid(width); int sid = get_bv_sid(width);
int nid = next_nid++; int nid = next_nid++;
btorf("%d %c%s %d %d %d%s\n", nid, a_signed || b_signed ? 's' : 'u', btor_op.c_str(), sid, nid_a, nid_b, getinfo(cell).c_str()); btorf("%d %c%s %d %d %d%s\n", nid, a_signed || b_signed ? 's' : 'u', btor_op, sid, nid_a, nid_b, getinfo(cell));
SigSpec sig = sigmap(cell->getPort(ID::Y)); SigSpec sig = sigmap(cell->getPort(ID::Y));
@ -390,12 +390,12 @@ struct BtorWorker
if (cell->type == ID($_ANDNOT_)) { if (cell->type == ID($_ANDNOT_)) {
btorf("%d not %d %d\n", nid1, sid, nid_b); btorf("%d not %d %d\n", nid1, sid, nid_b);
btorf("%d and %d %d %d%s\n", nid2, sid, nid_a, nid1, getinfo(cell).c_str()); btorf("%d and %d %d %d%s\n", nid2, sid, nid_a, nid1, getinfo(cell));
} }
if (cell->type == ID($_ORNOT_)) { if (cell->type == ID($_ORNOT_)) {
btorf("%d not %d %d\n", nid1, sid, nid_b); btorf("%d not %d %d\n", nid1, sid, nid_b);
btorf("%d or %d %d %d%s\n", nid2, sid, nid_a, nid1, getinfo(cell).c_str()); btorf("%d or %d %d %d%s\n", nid2, sid, nid_a, nid1, getinfo(cell));
} }
SigSpec sig = sigmap(cell->getPort(ID::Y)); SigSpec sig = sigmap(cell->getPort(ID::Y));
@ -417,13 +417,13 @@ struct BtorWorker
if (cell->type == ID($_OAI3_)) { if (cell->type == ID($_OAI3_)) {
btorf("%d or %d %d %d\n", nid1, sid, nid_a, nid_b); btorf("%d or %d %d %d\n", nid1, sid, nid_a, nid_b);
btorf("%d and %d %d %d\n", nid2, sid, nid1, nid_c); btorf("%d and %d %d %d\n", nid2, sid, nid1, nid_c);
btorf("%d not %d %d%s\n", nid3, sid, nid2, getinfo(cell).c_str()); btorf("%d not %d %d%s\n", nid3, sid, nid2, getinfo(cell));
} }
if (cell->type == ID($_AOI3_)) { if (cell->type == ID($_AOI3_)) {
btorf("%d and %d %d %d\n", nid1, sid, nid_a, nid_b); btorf("%d and %d %d %d\n", nid1, sid, nid_a, nid_b);
btorf("%d or %d %d %d\n", nid2, sid, nid1, nid_c); btorf("%d or %d %d %d\n", nid2, sid, nid1, nid_c);
btorf("%d not %d %d%s\n", nid3, sid, nid2, getinfo(cell).c_str()); btorf("%d not %d %d%s\n", nid3, sid, nid2, getinfo(cell));
} }
SigSpec sig = sigmap(cell->getPort(ID::Y)); SigSpec sig = sigmap(cell->getPort(ID::Y));
@ -448,14 +448,14 @@ struct BtorWorker
btorf("%d or %d %d %d\n", nid1, sid, nid_a, nid_b); btorf("%d or %d %d %d\n", nid1, sid, nid_a, nid_b);
btorf("%d or %d %d %d\n", nid2, sid, nid_c, nid_d); btorf("%d or %d %d %d\n", nid2, sid, nid_c, nid_d);
btorf("%d and %d %d %d\n", nid3, sid, nid1, nid2); btorf("%d and %d %d %d\n", nid3, sid, nid1, nid2);
btorf("%d not %d %d%s\n", nid4, sid, nid3, getinfo(cell).c_str()); btorf("%d not %d %d%s\n", nid4, sid, nid3, getinfo(cell));
} }
if (cell->type == ID($_AOI4_)) { if (cell->type == ID($_AOI4_)) {
btorf("%d and %d %d %d\n", nid1, sid, nid_a, nid_b); btorf("%d and %d %d %d\n", nid1, sid, nid_a, nid_b);
btorf("%d and %d %d %d\n", nid2, sid, nid_c, nid_d); btorf("%d and %d %d %d\n", nid2, sid, nid_c, nid_d);
btorf("%d or %d %d %d\n", nid3, sid, nid1, nid2); btorf("%d or %d %d %d\n", nid3, sid, nid1, nid2);
btorf("%d not %d %d%s\n", nid4, sid, nid3, getinfo(cell).c_str()); btorf("%d not %d %d%s\n", nid4, sid, nid3, getinfo(cell));
} }
SigSpec sig = sigmap(cell->getPort(ID::Y)); SigSpec sig = sigmap(cell->getPort(ID::Y));
@ -487,9 +487,9 @@ struct BtorWorker
int nid = next_nid++; int nid = next_nid++;
if (cell->type.in(ID($lt), ID($le), ID($ge), ID($gt))) { if (cell->type.in(ID($lt), ID($le), ID($ge), ID($gt))) {
btorf("%d %c%s %d %d %d%s\n", nid, a_signed || b_signed ? 's' : 'u', btor_op.c_str(), sid, nid_a, nid_b, getinfo(cell).c_str()); btorf("%d %c%s %d %d %d%s\n", nid, a_signed || b_signed ? 's' : 'u', btor_op, sid, nid_a, nid_b, getinfo(cell));
} else { } else {
btorf("%d %s %d %d %d%s\n", nid, btor_op.c_str(), sid, nid_a, nid_b, getinfo(cell).c_str()); btorf("%d %s %d %d %d%s\n", nid, btor_op, sid, nid_a, nid_b, getinfo(cell));
} }
SigSpec sig = sigmap(cell->getPort(ID::Y)); SigSpec sig = sigmap(cell->getPort(ID::Y));
@ -524,7 +524,7 @@ struct BtorWorker
log_assert(!btor_op.empty()); log_assert(!btor_op.empty());
int sid = get_bv_sid(width); int sid = get_bv_sid(width);
nid = next_nid++; nid = next_nid++;
btorf("%d %s %d %d%s\n", nid, btor_op.c_str(), sid, nid_a, getinfo(cell).c_str()); btorf("%d %s %d %d%s\n", nid, btor_op, sid, nid_a, getinfo(cell));
} }
if (GetSize(sig) < width) { if (GetSize(sig) < width) {
@ -564,9 +564,9 @@ struct BtorWorker
int nid = next_nid++; int nid = next_nid++;
if (btor_op != "not") if (btor_op != "not")
btorf("%d %s %d %d %d%s\n", nid, btor_op.c_str(), sid, nid_a, nid_b, getinfo(cell).c_str()); btorf("%d %s %d %d %d%s\n", nid, btor_op, sid, nid_a, nid_b, getinfo(cell));
else else
btorf("%d %s %d %d%s\n", nid, btor_op.c_str(), sid, nid_a, getinfo(cell).c_str()); btorf("%d %s %d %d%s\n", nid, btor_op, sid, nid_a, getinfo(cell));
SigSpec sig = sigmap(cell->getPort(ID::Y)); SigSpec sig = sigmap(cell->getPort(ID::Y));
@ -597,11 +597,11 @@ struct BtorWorker
if (cell->type == ID($reduce_xnor)) { if (cell->type == ID($reduce_xnor)) {
int nid2 = next_nid++; int nid2 = next_nid++;
btorf("%d %s %d %d%s\n", nid, btor_op.c_str(), sid, nid_a, getinfo(cell).c_str()); btorf("%d %s %d %d%s\n", nid, btor_op, sid, nid_a, getinfo(cell));
btorf("%d not %d %d\n", nid2, sid, nid); btorf("%d not %d %d\n", nid2, sid, nid);
nid = nid2; nid = nid2;
} else { } else {
btorf("%d %s %d %d%s\n", nid, btor_op.c_str(), sid, nid_a, getinfo(cell).c_str()); btorf("%d %s %d %d%s\n", nid, btor_op, sid, nid_a, getinfo(cell));
} }
SigSpec sig = sigmap(cell->getPort(ID::Y)); SigSpec sig = sigmap(cell->getPort(ID::Y));
@ -636,9 +636,9 @@ struct BtorWorker
int tmp = nid; int tmp = nid;
nid = next_nid++; nid = next_nid++;
btorf("%d ite %d %d %d %d\n", tmp, sid, nid_s, nid_b, nid_a); btorf("%d ite %d %d %d %d\n", tmp, sid, nid_s, nid_b, nid_a);
btorf("%d not %d %d%s\n", nid, sid, tmp, getinfo(cell).c_str()); btorf("%d not %d %d%s\n", nid, sid, tmp, getinfo(cell));
} else { } else {
btorf("%d ite %d %d %d %d%s\n", nid, sid, nid_s, nid_b, nid_a, getinfo(cell).c_str()); btorf("%d ite %d %d %d %d%s\n", nid, sid, nid_s, nid_b, nid_a, getinfo(cell));
} }
add_nid_sig(nid, sig_y); add_nid_sig(nid, sig_y);
@ -661,7 +661,7 @@ struct BtorWorker
int nid_s = get_sig_nid(sig_s.extract(i)); int nid_s = get_sig_nid(sig_s.extract(i));
int nid2 = next_nid++; int nid2 = next_nid++;
if (i == GetSize(sig_s)-1) if (i == GetSize(sig_s)-1)
btorf("%d ite %d %d %d %d%s\n", nid2, sid, nid_s, nid_b, nid, getinfo(cell).c_str()); btorf("%d ite %d %d %d %d%s\n", nid2, sid, nid_s, nid_b, nid, getinfo(cell));
else else
btorf("%d ite %d %d %d %d\n", nid2, sid, nid_s, nid_b, nid); btorf("%d ite %d %d %d %d\n", nid2, sid, nid_s, nid_b, nid);
nid = nid2; nid = nid2;
@ -749,7 +749,7 @@ struct BtorWorker
int sid = get_bv_sid(GetSize(sig_y)); int sid = get_bv_sid(GetSize(sig_y));
int nid = next_nid++; int nid = next_nid++;
btorf("%d state %d%s\n", nid, sid, getinfo(cell).c_str()); btorf("%d state %d%s\n", nid, sid, getinfo(cell));
ywmap_state(sig_y); ywmap_state(sig_y);
@ -772,7 +772,7 @@ struct BtorWorker
int one_nid = get_sig_nid(State::S1); int one_nid = get_sig_nid(State::S1);
int zero_nid = get_sig_nid(State::S0); int zero_nid = get_sig_nid(State::S0);
initstate_nid = next_nid++; initstate_nid = next_nid++;
btorf("%d state %d%s\n", initstate_nid, sid, getinfo(cell).c_str()); btorf("%d state %d%s\n", initstate_nid, sid, getinfo(cell));
btorf("%d init %d %d %d\n", next_nid++, sid, initstate_nid, one_nid); btorf("%d init %d %d %d\n", next_nid++, sid, initstate_nid, one_nid);
btorf("%d next %d %d %d\n", next_nid++, sid, initstate_nid, zero_nid); btorf("%d next %d %d %d\n", next_nid++, sid, initstate_nid, zero_nid);
@ -1047,7 +1047,7 @@ struct BtorWorker
if (consts.count(c) == 0) { if (consts.count(c) == 0) {
int sid = get_bv_sid(GetSize(c)); int sid = get_bv_sid(GetSize(c));
int nid = next_nid++; int nid = next_nid++;
btorf("%d const %d %s\n", nid, sid, c.as_string().c_str()); btorf("%d const %d %s\n", nid, sid, c.as_string());
consts[c] = nid; consts[c] = nid;
nid_width[nid] = GetSize(c); nid_width[nid] = GetSize(c);
} }
@ -1211,7 +1211,7 @@ struct BtorWorker
int sid = get_bv_sid(GetSize(sig)); int sid = get_bv_sid(GetSize(sig));
int nid = next_nid++; int nid = next_nid++;
btorf("%d input %d%s\n", nid, sid, getinfo(wire).c_str()); btorf("%d input %d%s\n", nid, sid, getinfo(wire));
ywmap_input(wire); ywmap_input(wire);
add_nid_sig(nid, sig); add_nid_sig(nid, sig);
@ -1256,7 +1256,7 @@ struct BtorWorker
btorf_push(stringf("output %s", log_id(wire))); btorf_push(stringf("output %s", log_id(wire)));
int nid = get_sig_nid(wire); int nid = get_sig_nid(wire);
btorf("%d output %d%s\n", next_nid++, nid, getinfo(wire).c_str()); btorf("%d output %d%s\n", next_nid++, nid, getinfo(wire));
btorf_pop(stringf("output %s", log_id(wire))); btorf_pop(stringf("output %s", log_id(wire)));
} }
@ -1298,10 +1298,10 @@ struct BtorWorker
bad_properties.push_back(nid_en_and_not_a); bad_properties.push_back(nid_en_and_not_a);
} else { } else {
if (cover_mode) { if (cover_mode) {
infof("bad %d%s\n", nid_en_and_not_a, getinfo(cell, true).c_str()); infof("bad %d%s\n", nid_en_and_not_a, getinfo(cell, true));
} else { } else {
int nid = next_nid++; int nid = next_nid++;
btorf("%d bad %d%s\n", nid, nid_en_and_not_a, getinfo(cell, true).c_str()); btorf("%d bad %d%s\n", nid, nid_en_and_not_a, getinfo(cell, true));
} }
} }
@ -1323,7 +1323,7 @@ struct BtorWorker
bad_properties.push_back(nid_en_and_a); bad_properties.push_back(nid_en_and_a);
} else { } else {
int nid = next_nid++; int nid = next_nid++;
btorf("%d bad %d%s\n", nid, nid_en_and_a, getinfo(cell, true).c_str()); btorf("%d bad %d%s\n", nid, nid_en_and_a, getinfo(cell, true));
} }
btorf_pop(log_id(cell)); btorf_pop(log_id(cell));
@ -1344,7 +1344,7 @@ struct BtorWorker
continue; continue;
int this_nid = next_nid++; int this_nid = next_nid++;
btorf("%d uext %d %d %d%s\n", this_nid, sid, nid, 0, getinfo(wire).c_str()); btorf("%d uext %d %d %d%s\n", this_nid, sid, nid, 0, getinfo(wire));
if (info_clocks.count(nid)) if (info_clocks.count(nid))
info_clocks[this_nid] |= info_clocks[nid]; info_clocks[this_nid] |= info_clocks[nid];
@ -1367,7 +1367,7 @@ struct BtorWorker
SigSpec sig = sigmap(cell->getPort(ID::D)); SigSpec sig = sigmap(cell->getPort(ID::D));
int nid_q = get_sig_nid(sig); int nid_q = get_sig_nid(sig);
int sid = get_bv_sid(GetSize(sig)); int sid = get_bv_sid(GetSize(sig));
btorf("%d next %d %d %d%s\n", next_nid++, sid, nid, nid_q, getinfo(cell).c_str()); btorf("%d next %d %d %d%s\n", next_nid++, sid, nid, nid_q, getinfo(cell));
btorf_pop(stringf("next %s", log_id(cell))); btorf_pop(stringf("next %s", log_id(cell)));
} }
@ -1426,7 +1426,7 @@ struct BtorWorker
} }
int nid2 = next_nid++; int nid2 = next_nid++;
btorf("%d next %d %d %d%s\n", nid2, sid, nid, nid_head, (mem->cell ? getinfo(mem->cell) : getinfo(mem->mem)).c_str()); btorf("%d next %d %d %d%s\n", nid2, sid, nid, nid_head, (mem->cell ? getinfo(mem->cell) : getinfo(mem->mem)));
btorf_pop(stringf("next %s", log_id(mem->memid))); btorf_pop(stringf("next %s", log_id(mem->memid)));
} }