aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-15 02:40:46 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-15 02:40:46 +0200
commitca8711644975c128d45fd8e9434439c1266c00ac (patch)
treed142e82fe2dbdebf77635a05862b383c81167e3b /kernel
parent8ff71b5ae506306d7981eb118874cd4f407b2bf8 (diff)
downloadyosys-ca8711644975c128d45fd8e9434439c1266c00ac.tar.gz
yosys-ca8711644975c128d45fd8e9434439c1266c00ac.tar.bz2
yosys-ca8711644975c128d45fd8e9434439c1266c00ac.zip
More idstring sort_by_* helpers and fixed tpl ordering in techmap
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 3a0f0ff8c..2c4b26f53 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -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);