aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorD. Shah <dave@ds0.me>2021-02-02 14:48:29 +0000
committerD. Shah <dave@ds0.me>2021-02-02 17:00:56 +0000
commit7cff69f9453e0c95f8eb9a12b004afa20b69501e (patch)
tree7218256dfc0884e27e11ad4a1877021305891237 /common/nextpnr.h
parent2a9584ea31973d415f7fdf58fc06482af57d3a0d (diff)
downloadnextpnr-7cff69f9453e0c95f8eb9a12b004afa20b69501e.tar.gz
nextpnr-7cff69f9453e0c95f8eb9a12b004afa20b69501e.tar.bz2
nextpnr-7cff69f9453e0c95f8eb9a12b004afa20b69501e.zip
generic: Use IdStringList for all arch object names
Signed-off-by: D. Shah <dave@ds0.me>
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