mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 09:05:32 +00:00
More idstring sort_by_* helpers and fixed tpl ordering in techmap
This commit is contained in:
parent
8ff71b5ae5
commit
ca87116449
4 changed files with 22 additions and 10 deletions
|
@ -255,12 +255,24 @@ namespace RTLIL
|
|||
return log_id(str);
|
||||
}
|
||||
|
||||
template <typename T> struct sort_by_name {
|
||||
template <typename T> struct sort_by_name_id {
|
||||
bool operator()(T *a, T *b) const {
|
||||
return a->name < b->name;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T> struct sort_by_name_str {
|
||||
bool operator()(T *a, T *b) const {
|
||||
return strcmp(a->name.c_str(), b->name.c_str()) < 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct sort_by_id_str {
|
||||
bool operator()(RTLIL::IdString a, RTLIL::IdString b) const {
|
||||
return strcmp(a.c_str(), b.c_str()) < 0;
|
||||
}
|
||||
};
|
||||
|
||||
// see calc.cc for the implementation of this functions
|
||||
RTLIL::Const const_not (const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
|
||||
RTLIL::Const const_and (const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue