summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-08-09 12:42:32 +0200
committerClifford Wolf <clifford@clifford.at>2013-08-09 12:42:32 +0200
commit05483619f0b776eda2f96ca7a9bfb8cdc3732a0e (patch)
treedf893fc9929cc54f684f9975834220743199d93e /kernel
parentd97782b848bf5da4529e5b732b1ad06177539a93 (diff)
Some fixes to improve determinism
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.h6
-rw-r--r--kernel/sigtools.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index f5e8ae47..4a4e8235 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -129,6 +129,12 @@ namespace RTLIL
#define NEW_ID \
RTLIL::new_id(__FILE__, __LINE__, __FUNCTION__)
+ template <typename T> struct sort_by_name {
+ bool operator()(T *a, T *b) const {
+ return a->name < b->name;
+ }
+ };
+
// 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);
diff --git a/kernel/sigtools.h b/kernel/sigtools.h
index 7f7f95ab..ae6a00f8 100644
--- a/kernel/sigtools.h
+++ b/kernel/sigtools.h
@@ -165,11 +165,11 @@ struct SigPool
}
};
-template <typename T>
+template <typename T, class Compare = std::less<T>>
struct SigSet
{
typedef std::pair<RTLIL::Wire*,int> bitDef_t;
- std::map<bitDef_t, std::set<T>> bits;
+ std::map<bitDef_t, std::set<T, Compare>> bits;
void clear()
{