3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 03:35:40 +00:00
This commit is contained in:
Emil J. Tywoniak 2026-06-15 11:26:09 +02:00
parent d22805bd47
commit dcc74755e7
18 changed files with 74 additions and 72 deletions

View file

@ -1988,8 +1988,8 @@ namespace {
std::string mod_name = module ? module->design->twines.str(module->meta_->name) : std::string();
std::string cell_name = cell->module->design->twines.str(cell->meta_->name);
log_error("Found error in internal cell %s%s%s (%s) at %s:%d:\n%s",
mod_name.c_str(), module ? "." : "",
cell_name.c_str(), cell->type.c_str(), __FILE__, linenr, buf.str().c_str());
mod_name, module ? "." : "",
cell_name, cell->type.str(), __FILE__, linenr, buf.str());
}
int param(IdString name)
@ -2066,7 +2066,7 @@ namespace {
cell->type.begins_with("$verific$") || cell->type.begins_with("$array:") || cell->type.begins_with("$extern:"))
return;
if (cell->type == TW($buf)) {
if (cell->type_impl == TW($buf)) {
port(TW::A, param(ID::WIDTH));
port(TW::Y, param(ID::WIDTH));
check_expected();

View file

@ -1353,19 +1353,22 @@ struct NameMasqBase {
if (s.empty()) return RTLIL::IdString{};
return RTLIL::IdString(s);
}
operator std::string() const {
return self().escaped();
}
bool isPublic() const { return twine_is_public(self().ref()); }
bool empty() const { return RTLIL::IdString(self()).empty(); }
std::string str() const { return self().escaped(); }
const char *c_str() const { return RTLIL::IdString(self()).c_str(); }
std::string unescape() const { return self().unescaped(); }
bool begins_with(const char *s) const { return RTLIL::IdString(self()).begins_with(s); }
bool ends_with(const char *s) const { return RTLIL::IdString(self()).ends_with(s); }
bool begins_with(const char *s) const { return str().starts_with(s); }
bool ends_with(const char *s) const { return str().ends_with(s); }
template <typename... Ts> bool in(Ts &&...args) const {
return RTLIL::IdString(self()).in(std::forward<Ts>(args)...);
}
std::string substr(size_t pos = 0, size_t len = std::string::npos) const {
return RTLIL::IdString(self()).substr(pos, len);
}
// TODO less IdString construction in masquerades
size_t size() const { return RTLIL::IdString(self()).size(); }
bool contains(const char *p) const { return RTLIL::IdString(self()).contains(p); }
char operator[](int n) const { return RTLIL::IdString(self()).str()[n]; }
@ -1438,19 +1441,18 @@ struct RTLIL::CellTypeMasq {
bool isPublic() const { return twine_is_public(ref()); }
bool empty() const { return ref() == Twine::Null; }
std::string str() const { return escaped(); } // TODO deprecate
const char *c_str() const { return RTLIL::IdString(*this).c_str(); }
std::string unescape() const { return unescaped(); }
bool begins_with(const char *s) const { return RTLIL::IdString(*this).begins_with(s); }
bool ends_with(const char *s) const { return RTLIL::IdString(*this).ends_with(s); }
bool begins_with(const char *s) const { return str().starts_with(s); }
bool ends_with(const char *s) const { return str().ends_with(s); }
template <typename... Ts> bool in(Ts &&...args) const {
return ref().in(std::forward<Ts>(args)...);
}
std::string substr(size_t pos = 0, size_t len = std::string::npos) const {
return RTLIL::IdString(*this).substr(pos, len);
}
size_t size() const { return RTLIL::IdString(*this).size(); }
bool contains(const char *p) const { return RTLIL::IdString(*this).contains(p); }
char operator[](int n) const { return RTLIL::IdString(*this).str()[n]; }
size_t size() const { return str().size(); }
// bool contains(const char *p) const { return str().contains(p); }
char operator[](int n) const { return str()[n]; }
bool operator==(RTLIL::IdString rhs) const { return RTLIL::IdString(*this) == rhs; }
bool operator!=(RTLIL::IdString rhs) const { return RTLIL::IdString(*this) != rhs; }
bool operator<(RTLIL::IdString rhs) const { return RTLIL::IdString(*this) < rhs; }