From 6f12f2b7e8c58a0b14c6f1f3df2112b8860a6e4f Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 26 Jun 2018 15:06:59 +0200 Subject: Working on debugging the carry legaliser Signed-off-by: David Shah --- common/util.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common') diff --git a/common/util.h b/common/util.h index c888c8b8..a9ad2172 100644 --- a/common/util.h +++ b/common/util.h @@ -21,6 +21,7 @@ #define UTIL_H #include +#include #include #include "nextpnr.h" @@ -65,6 +66,15 @@ template std::map sorted(const std::unordered_m return retVal; }; +// Wrap an unordered_set, and allow it to be iterated over sorted by key +template std::set sorted(const std::unordered_set &orig) +{ + std::set retVal; + for (auto &item : orig) + retVal.insert(item); + return retVal; +}; + NEXTPNR_NAMESPACE_END #endif -- cgit v1.2.3