// promote public wires
                for (auto wire : module->wires())
-                       if (wire->name[0] == '\\')
+                       if (wire->name.isPublic())
                                sigmap.add(wire);
 
                // promote input wires
 
 
                // promote public wires
                for (auto wire : module->wires())
-                       if (wire->name[0] == '\\')
+                       if (wire->name.isPublic())
                                sigmap.add(wire);
 
                // promote input wires
 
                                }
                                *f << stringf("\n            (property %s (string \"%d'h%s\"))", EDIF_DEF(name), GetSize(val.bits), hex_string.c_str());
                        }
-               };              
+               };
                for (auto module : sorted_modules)
                {
                        if (module->get_blackbox_attribute())
                                        }
 
                                        {
-                                               int c1 = w1->name[0] == '\\';
-                                               int c2 = w2->name[0] == '\\';
+                                               int c1 = w1->name.isPublic();
+                                               int c2 = w2->name.isPublic();
 
                                                if (c1 > c2) goto promote;
                                                if (c1 < c2) goto nopromote;
                                                *f << stringf("            (portRef %c (instanceRef GND))\n", gndvccy ? 'Y' : 'G');
                                        if (sig == RTLIL::State::S1)
                                                *f << stringf("            (portRef %c (instanceRef VCC))\n", gndvccy ? 'Y' : 'P');
-                               }                               
+                               }
                                *f << stringf("            )");
                                if (attr_properties && sig.wire != NULL)
                                        for (auto &p : sig.wire->attributes)
 
                        for (auto bit : SigSpec(wire))
                                if (reg_bits.count(bit))
                                        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);
                                std::vector<std::string> comments;
                                if (wire->port_input)
                                        comments.push_back(stringf("; yosys-smt2-output %s %d\n", get_id(wire), wire->width));
                                if (is_register)
                                        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));
                                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),
 
                                dict<RTLIL::Cell *, IdString> new_cell_names;
 
                                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;
 
                                for (auto cell : module->selected_cells())
-                                       if (cell->name[0] == '\\')
+                                       if (cell->name.isPublic())
                                                new_cell_names[cell] = NEW_ID;
 
                                for (auto &it : new_wire_names)
 
                        const char *shape = "diamond";
                        if (wire->port_input || wire->port_output)
                                shape = "octagon";
-                       if (wire->name[0] == '\\') {
+                       if (wire->name.isPublic()) {
                                fprintf(f, "n%d [ shape=%s, label=\"%s\", %s, fontcolor=\"black\" ];\n",
                                                id2num(wire->name), shape, findLabel(wire->name.str()),
                                                nextColor(RTLIL::SigSpec(wire), "color=\"black\"").c_str());
 
                std::vector<Wire*> mod_wires = module->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))
                                        continue;
                                RTLIL::SigSpec sig = sigmap(wire);
 
 
                for (auto wire : mod->selected_wires())
                {
-                       if (wire->name[0] == '\\') {
+                       if (wire->name.isPublic()) {
                                num_pub_wires++;
                                num_pub_wire_bits += wire->width;
                        }
 
                Module *gate_clone = gate_mod->clone();
 
                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);
                        gold_clone->rename(it, it->name.str() + "_gold");
                }
 
                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);
                        gold_clone->rename(it, it->name.str() + "_gold");
                }
 
                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);
                        gate_clone->rename(it, it->name.str() + "_gate");
                }
 
                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);
                        gate_clone->rename(it, it->name.str() + "_gate");
                }
 
        {
                if (sig.is_wire()) {
                        Wire *wire = sig.as_wire();
-                       if (wire->name[0] == '\\') {
+                       if (wire->name.isPublic()) {
                                if (!wire->port_output) {
                                        log("  Module output: %s (%s)\n", log_signal(wire), log_id(cellname));
                                        wire->port_output = true;
        {
                if (sig.is_wire()) {
                        Wire *wire = sig.as_wire();
-                       if (wire->name[0] == '\\') {
+                       if (wire->name.isPublic()) {
                                if (!wire->port_output) {
                                        log("  Module input: %s\n", log_signal(wire));
                                        wire->port_input = true;
 
        if ((w1->port_input && w1->port_output) != (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))
                        return regs.check(s2);
                if (direct_wires.count(w1) != direct_wires.count(w2))
                return w2->port_output;
 
        if (w1->name[0] != w2->name[0])
-               return w2->name[0] == '\\';
+               return w2->name.isPublic();
 
        int attrs1 = count_nontrivial_wire_attrs(w1);
        int attrs2 = count_nontrivial_wire_attrs(w2);
 
                dict<SigBit, int> bit_user_cnt;
 
                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);
                }
 
                                }
 
                                if (!bit.wire->name[0] != !sigbit.wire->name[0]) {
-                                       if (bit.wire->name[0] == '\\')
+                                       if (bit.wire->name.isPublic())
                                                sigmap.add(bit);
                                        continue;
                                }
                                                entry.src.insert(s);
 
                                        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))
                                                        entry.src.insert(s);
                                                entry.wire = bit.wire->name;
 
 
                if (show_public) {
                        for (auto wire : module->wires())
-                               if (wire->name[0] == '\\')
+                               if (wire->name.isPublic())
                                        shows.push_back(wire->name.str());
                }