3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-09 12:50:33 +00:00

look at all those chickens

This commit is contained in:
Emil J. Tywoniak 2024-06-13 14:27:11 +02:00
parent 8bdcc6987b
commit 61cf4b6fb6
15 changed files with 48 additions and 42 deletions

View file

@ -106,7 +106,8 @@ static bool match_attr_val(const RTLIL::Const &value, const std::string &pattern
log_abort();
}
static bool match_attr(const dict<RTLIL::IdString, RTLIL::Const> &attributes, const std::string &name_pat, const std::string &value_pat, char match_op)
template <typename SmellsLikeDict>
static bool match_attr(const SmellsLikeDict &attributes, const std::string &name_pat, const std::string &value_pat, char match_op)
{
if (name_pat.find('*') != std::string::npos || name_pat.find('?') != std::string::npos || name_pat.find('[') != std::string::npos) {
for (auto &it : attributes) {
@ -124,7 +125,8 @@ static bool match_attr(const dict<RTLIL::IdString, RTLIL::Const> &attributes, co
return false;
}
static bool match_attr(const dict<RTLIL::IdString, RTLIL::Const> &attributes, const std::string &match_expr)
template <typename SmellsLikeDict>
static bool match_attr(const SmellsLikeDict &attributes, const std::string &match_expr)
{
size_t pos = match_expr.find_first_of("<!=>");