mirror of https://github.com/YosysHQ/yosys.git
use the new isPublic() in a few places
This commit is contained in:
parent
4af04be0b7
commit
3238190797
|
@ -111,7 +111,7 @@ struct AigerWriter
|
||||||
|
|
||||||
// promote public wires
|
// promote public wires
|
||||||
for (auto wire : module->wires())
|
for (auto wire : module->wires())
|
||||||
if (wire->name[0] == '\\')
|
if (wire->name.isPublic())
|
||||||
sigmap.add(wire);
|
sigmap.add(wire);
|
||||||
|
|
||||||
// promote input wires
|
// promote input wires
|
||||||
|
|
|
@ -146,7 +146,7 @@ struct XAigerWriter
|
||||||
|
|
||||||
// promote public wires
|
// promote public wires
|
||||||
for (auto wire : module->wires())
|
for (auto wire : module->wires())
|
||||||
if (wire->name[0] == '\\')
|
if (wire->name.isPublic())
|
||||||
sigmap.add(wire);
|
sigmap.add(wire);
|
||||||
|
|
||||||
// promote input wires
|
// promote input wires
|
||||||
|
|
|
@ -330,7 +330,7 @@ struct EdifBackend : public Backend {
|
||||||
}
|
}
|
||||||
*f << stringf("\n (property %s (string \"%d'h%s\"))", EDIF_DEF(name), GetSize(val.bits), hex_string.c_str());
|
*f << stringf("\n (property %s (string \"%d'h%s\"))", EDIF_DEF(name), GetSize(val.bits), hex_string.c_str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
for (auto module : sorted_modules)
|
for (auto module : sorted_modules)
|
||||||
{
|
{
|
||||||
if (module->get_blackbox_attribute())
|
if (module->get_blackbox_attribute())
|
||||||
|
@ -373,8 +373,8 @@ struct EdifBackend : public Backend {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
int c1 = w1->name[0] == '\\';
|
int c1 = w1->name.isPublic();
|
||||||
int c2 = w2->name[0] == '\\';
|
int c2 = w2->name.isPublic();
|
||||||
|
|
||||||
if (c1 > c2) goto promote;
|
if (c1 > c2) goto promote;
|
||||||
if (c1 < c2) goto nopromote;
|
if (c1 < c2) goto nopromote;
|
||||||
|
@ -524,7 +524,7 @@ struct EdifBackend : public Backend {
|
||||||
*f << stringf(" (portRef %c (instanceRef GND))\n", gndvccy ? 'Y' : 'G');
|
*f << stringf(" (portRef %c (instanceRef GND))\n", gndvccy ? 'Y' : 'G');
|
||||||
if (sig == RTLIL::State::S1)
|
if (sig == RTLIL::State::S1)
|
||||||
*f << stringf(" (portRef %c (instanceRef VCC))\n", gndvccy ? 'Y' : 'P');
|
*f << stringf(" (portRef %c (instanceRef VCC))\n", gndvccy ? 'Y' : 'P');
|
||||||
}
|
}
|
||||||
*f << stringf(" )");
|
*f << stringf(" )");
|
||||||
if (attr_properties && sig.wire != NULL)
|
if (attr_properties && sig.wire != NULL)
|
||||||
for (auto &p : sig.wire->attributes)
|
for (auto &p : sig.wire->attributes)
|
||||||
|
|
|
@ -822,7 +822,7 @@ struct Smt2Worker
|
||||||
for (auto bit : SigSpec(wire))
|
for (auto bit : SigSpec(wire))
|
||||||
if (reg_bits.count(bit))
|
if (reg_bits.count(bit))
|
||||||
is_register = true;
|
is_register = true;
|
||||||
if (wire->port_id || is_register || wire->get_bool_attribute(ID::keep) || (wiresmode && wire->name[0] == '\\')) {
|
if (wire->port_id || is_register || wire->get_bool_attribute(ID::keep) || (wiresmode && wire->name.isPublic())) {
|
||||||
RTLIL::SigSpec sig = sigmap(wire);
|
RTLIL::SigSpec sig = sigmap(wire);
|
||||||
std::vector<std::string> comments;
|
std::vector<std::string> comments;
|
||||||
if (wire->port_input)
|
if (wire->port_input)
|
||||||
|
@ -831,7 +831,7 @@ struct Smt2Worker
|
||||||
comments.push_back(stringf("; yosys-smt2-output %s %d\n", get_id(wire), wire->width));
|
comments.push_back(stringf("; yosys-smt2-output %s %d\n", get_id(wire), wire->width));
|
||||||
if (is_register)
|
if (is_register)
|
||||||
comments.push_back(stringf("; yosys-smt2-register %s %d\n", get_id(wire), wire->width));
|
comments.push_back(stringf("; yosys-smt2-register %s %d\n", get_id(wire), wire->width));
|
||||||
if (wire->get_bool_attribute(ID::keep) || (wiresmode && wire->name[0] == '\\'))
|
if (wire->get_bool_attribute(ID::keep) || (wiresmode && wire->name.isPublic()))
|
||||||
comments.push_back(stringf("; yosys-smt2-wire %s %d\n", get_id(wire), wire->width));
|
comments.push_back(stringf("; yosys-smt2-wire %s %d\n", get_id(wire), wire->width));
|
||||||
if (GetSize(wire) == 1 && (clock_posedge.count(sig) || clock_negedge.count(sig)))
|
if (GetSize(wire) == 1 && (clock_posedge.count(sig) || clock_negedge.count(sig)))
|
||||||
comments.push_back(stringf("; yosys-smt2-clock %s%s%s\n", get_id(wire),
|
comments.push_back(stringf("; yosys-smt2-clock %s%s%s\n", get_id(wire),
|
||||||
|
|
|
@ -290,11 +290,11 @@ struct RenamePass : public Pass {
|
||||||
dict<RTLIL::Cell *, IdString> new_cell_names;
|
dict<RTLIL::Cell *, IdString> new_cell_names;
|
||||||
|
|
||||||
for (auto wire : module->selected_wires())
|
for (auto wire : module->selected_wires())
|
||||||
if (wire->name[0] == '\\' && wire->port_id == 0)
|
if (wire->name.isPublic() && wire->port_id == 0)
|
||||||
new_wire_names[wire] = NEW_ID;
|
new_wire_names[wire] = NEW_ID;
|
||||||
|
|
||||||
for (auto cell : module->selected_cells())
|
for (auto cell : module->selected_cells())
|
||||||
if (cell->name[0] == '\\')
|
if (cell->name.isPublic())
|
||||||
new_cell_names[cell] = NEW_ID;
|
new_cell_names[cell] = NEW_ID;
|
||||||
|
|
||||||
for (auto &it : new_wire_names)
|
for (auto &it : new_wire_names)
|
||||||
|
|
|
@ -368,7 +368,7 @@ struct ShowWorker
|
||||||
const char *shape = "diamond";
|
const char *shape = "diamond";
|
||||||
if (wire->port_input || wire->port_output)
|
if (wire->port_input || wire->port_output)
|
||||||
shape = "octagon";
|
shape = "octagon";
|
||||||
if (wire->name[0] == '\\') {
|
if (wire->name.isPublic()) {
|
||||||
fprintf(f, "n%d [ shape=%s, label=\"%s\", %s, fontcolor=\"black\" ];\n",
|
fprintf(f, "n%d [ shape=%s, label=\"%s\", %s, fontcolor=\"black\" ];\n",
|
||||||
id2num(wire->name), shape, findLabel(wire->name.str()),
|
id2num(wire->name), shape, findLabel(wire->name.str()),
|
||||||
nextColor(RTLIL::SigSpec(wire), "color=\"black\"").c_str());
|
nextColor(RTLIL::SigSpec(wire), "color=\"black\"").c_str());
|
||||||
|
|
|
@ -211,7 +211,7 @@ struct SpliceWorker
|
||||||
std::vector<Wire*> mod_wires = module->wires();
|
std::vector<Wire*> mod_wires = module->wires();
|
||||||
|
|
||||||
for (auto wire : mod_wires)
|
for (auto wire : mod_wires)
|
||||||
if ((!no_outputs && wire->port_output) || (do_wires && wire->name[0] == '\\')) {
|
if ((!no_outputs && wire->port_output) || (do_wires && wire->name.isPublic())) {
|
||||||
if (!design->selected(module, wire))
|
if (!design->selected(module, wire))
|
||||||
continue;
|
continue;
|
||||||
RTLIL::SigSpec sig = sigmap(wire);
|
RTLIL::SigSpec sig = sigmap(wire);
|
||||||
|
|
|
@ -81,7 +81,7 @@ struct statdata_t
|
||||||
|
|
||||||
for (auto wire : mod->selected_wires())
|
for (auto wire : mod->selected_wires())
|
||||||
{
|
{
|
||||||
if (wire->name[0] == '\\') {
|
if (wire->name.isPublic()) {
|
||||||
num_pub_wires++;
|
num_pub_wires++;
|
||||||
num_pub_wire_bits += wire->width;
|
num_pub_wire_bits += wire->width;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,25 +114,25 @@ struct EquivMakeWorker
|
||||||
Module *gate_clone = gate_mod->clone();
|
Module *gate_clone = gate_mod->clone();
|
||||||
|
|
||||||
for (auto it : gold_clone->wires().to_vector()) {
|
for (auto it : gold_clone->wires().to_vector()) {
|
||||||
if ((it->name[0] == '\\' || inames) && blacklist_names.count(it->name) == 0)
|
if ((it->name.isPublic() || inames) && blacklist_names.count(it->name) == 0)
|
||||||
wire_names.insert(it->name);
|
wire_names.insert(it->name);
|
||||||
gold_clone->rename(it, it->name.str() + "_gold");
|
gold_clone->rename(it, it->name.str() + "_gold");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto it : gold_clone->cells().to_vector()) {
|
for (auto it : gold_clone->cells().to_vector()) {
|
||||||
if ((it->name[0] == '\\' || inames) && blacklist_names.count(it->name) == 0)
|
if ((it->name.isPublic() || inames) && blacklist_names.count(it->name) == 0)
|
||||||
cell_names.insert(it->name);
|
cell_names.insert(it->name);
|
||||||
gold_clone->rename(it, it->name.str() + "_gold");
|
gold_clone->rename(it, it->name.str() + "_gold");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto it : gate_clone->wires().to_vector()) {
|
for (auto it : gate_clone->wires().to_vector()) {
|
||||||
if ((it->name[0] == '\\' || inames) && blacklist_names.count(it->name) == 0)
|
if ((it->name.isPublic() || inames) && blacklist_names.count(it->name) == 0)
|
||||||
wire_names.insert(it->name);
|
wire_names.insert(it->name);
|
||||||
gate_clone->rename(it, it->name.str() + "_gate");
|
gate_clone->rename(it, it->name.str() + "_gate");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto it : gate_clone->cells().to_vector()) {
|
for (auto it : gate_clone->cells().to_vector()) {
|
||||||
if ((it->name[0] == '\\' || inames) && blacklist_names.count(it->name) == 0)
|
if ((it->name.isPublic() || inames) && blacklist_names.count(it->name) == 0)
|
||||||
cell_names.insert(it->name);
|
cell_names.insert(it->name);
|
||||||
gate_clone->rename(it, it->name.str() + "_gate");
|
gate_clone->rename(it, it->name.str() + "_gate");
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ struct EquivPurgeWorker
|
||||||
{
|
{
|
||||||
if (sig.is_wire()) {
|
if (sig.is_wire()) {
|
||||||
Wire *wire = sig.as_wire();
|
Wire *wire = sig.as_wire();
|
||||||
if (wire->name[0] == '\\') {
|
if (wire->name.isPublic()) {
|
||||||
if (!wire->port_output) {
|
if (!wire->port_output) {
|
||||||
log(" Module output: %s (%s)\n", log_signal(wire), log_id(cellname));
|
log(" Module output: %s (%s)\n", log_signal(wire), log_id(cellname));
|
||||||
wire->port_output = true;
|
wire->port_output = true;
|
||||||
|
@ -62,7 +62,7 @@ struct EquivPurgeWorker
|
||||||
{
|
{
|
||||||
if (sig.is_wire()) {
|
if (sig.is_wire()) {
|
||||||
Wire *wire = sig.as_wire();
|
Wire *wire = sig.as_wire();
|
||||||
if (wire->name[0] == '\\') {
|
if (wire->name.isPublic()) {
|
||||||
if (!wire->port_output) {
|
if (!wire->port_output) {
|
||||||
log(" Module input: %s\n", log_signal(wire));
|
log(" Module input: %s\n", log_signal(wire));
|
||||||
wire->port_input = true;
|
wire->port_input = true;
|
||||||
|
|
|
@ -207,7 +207,7 @@ bool compare_signals(RTLIL::SigBit &s1, RTLIL::SigBit &s2, SigPool ®s, SigPoo
|
||||||
if ((w1->port_input && w1->port_output) != (w2->port_input && w2->port_output))
|
if ((w1->port_input && w1->port_output) != (w2->port_input && w2->port_output))
|
||||||
return !(w2->port_input && w2->port_output);
|
return !(w2->port_input && w2->port_output);
|
||||||
|
|
||||||
if (w1->name[0] == '\\' && w2->name[0] == '\\') {
|
if (w1->name.isPublic() && w2->name.isPublic()) {
|
||||||
if (regs.check(s1) != regs.check(s2))
|
if (regs.check(s1) != regs.check(s2))
|
||||||
return regs.check(s2);
|
return regs.check(s2);
|
||||||
if (direct_wires.count(w1) != direct_wires.count(w2))
|
if (direct_wires.count(w1) != direct_wires.count(w2))
|
||||||
|
@ -220,7 +220,7 @@ bool compare_signals(RTLIL::SigBit &s1, RTLIL::SigBit &s2, SigPool ®s, SigPoo
|
||||||
return w2->port_output;
|
return w2->port_output;
|
||||||
|
|
||||||
if (w1->name[0] != w2->name[0])
|
if (w1->name[0] != w2->name[0])
|
||||||
return w2->name[0] == '\\';
|
return w2->name.isPublic();
|
||||||
|
|
||||||
int attrs1 = count_nontrivial_wire_attrs(w1);
|
int attrs1 = count_nontrivial_wire_attrs(w1);
|
||||||
int attrs2 = count_nontrivial_wire_attrs(w2);
|
int attrs2 = count_nontrivial_wire_attrs(w2);
|
||||||
|
|
|
@ -439,7 +439,7 @@ void mutate_list(Design *design, const mutate_opts_t &opts, const string &filena
|
||||||
dict<SigBit, int> bit_user_cnt;
|
dict<SigBit, int> bit_user_cnt;
|
||||||
|
|
||||||
for (auto wire : module->wires()) {
|
for (auto wire : module->wires()) {
|
||||||
if (wire->name[0] == '\\' && wire->attributes.count(ID::src))
|
if (wire->name.isPublic() && wire->attributes.count(ID::src))
|
||||||
sigmap.add(wire);
|
sigmap.add(wire);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,7 +468,7 @@ void mutate_list(Design *design, const mutate_opts_t &opts, const string &filena
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bit.wire->name[0] != !sigbit.wire->name[0]) {
|
if (!bit.wire->name[0] != !sigbit.wire->name[0]) {
|
||||||
if (bit.wire->name[0] == '\\')
|
if (bit.wire->name.isPublic())
|
||||||
sigmap.add(bit);
|
sigmap.add(bit);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -493,7 +493,7 @@ void mutate_list(Design *design, const mutate_opts_t &opts, const string &filena
|
||||||
entry.src.insert(s);
|
entry.src.insert(s);
|
||||||
|
|
||||||
SigBit bit = sigmap(conn.second[i]);
|
SigBit bit = sigmap(conn.second[i]);
|
||||||
if (bit.wire && bit.wire->name[0] == '\\' && (cell->output(conn.first) || bit_user_cnt[bit] == 1)) {
|
if (bit.wire && bit.wire->name.isPublic() && (cell->output(conn.first) || bit_user_cnt[bit] == 1)) {
|
||||||
for (auto &s : bit.wire->get_strpool_attribute(ID::src))
|
for (auto &s : bit.wire->get_strpool_attribute(ID::src))
|
||||||
entry.src.insert(s);
|
entry.src.insert(s);
|
||||||
entry.wire = bit.wire->name;
|
entry.wire = bit.wire->name;
|
||||||
|
|
|
@ -1365,7 +1365,7 @@ struct SatPass : public Pass {
|
||||||
|
|
||||||
if (show_public) {
|
if (show_public) {
|
||||||
for (auto wire : module->wires())
|
for (auto wire : module->wires())
|
||||||
if (wire->name[0] == '\\')
|
if (wire->name.isPublic())
|
||||||
shows.push_back(wire->name.str());
|
shows.push_back(wire->name.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue