From ca8711644975c128d45fd8e9434439c1266c00ac Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 15 Aug 2014 02:40:46 +0200 Subject: More idstring sort_by_* helpers and fixed tpl ordering in techmap --- kernel/rtlil.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'kernel') 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 struct sort_by_name { + template struct sort_by_name_id { bool operator()(T *a, T *b) const { return a->name < b->name; } }; + template 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); -- cgit v1.2.3