aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index d4db9e9e..78bbf66e 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -243,6 +243,21 @@ struct IdStringList
const IdString &operator[](size_t idx) const { return ids[idx]; }
bool operator==(const IdStringList &other) const { return ids == other.ids; }
bool operator!=(const IdStringList &other) const { return ids != other.ids; }
+ bool operator<(const IdStringList &other) const
+ {
+ if (size() > other.size())
+ return false;
+ if (size() < other.size())
+ return true;
+ for (size_t i = 0; i < size(); i++) {
+ IdString a = ids[i], b = other[i];
+ if (a.index < b.index)
+ return true;
+ if (a.index > b.index)
+ return false;
+ }
+ return false;
+ }
};
NEXTPNR_NAMESPACE_END