diff options
author | gatecat <gatecat@ds0.me> | 2021-05-01 14:55:33 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-05-15 14:54:33 +0100 |
commit | 5d1b8bf74469d0d5c5cc15e8c8e042da55da5357 (patch) | |
tree | 425eddfd77e269c54235edfd4f945e4e16933bad /common/idstringlist.cc | |
parent | af0bffbae905d92942492e0fdf42a4b02686b224 (diff) | |
download | nextpnr-5d1b8bf74469d0d5c5cc15e8c8e042da55da5357.tar.gz nextpnr-5d1b8bf74469d0d5c5cc15e8c8e042da55da5357.tar.bz2 nextpnr-5d1b8bf74469d0d5c5cc15e8c8e042da55da5357.zip |
cyclonev: Add names and archcheck fixes
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/idstringlist.cc')
-rw-r--r-- | common/idstringlist.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common/idstringlist.cc b/common/idstringlist.cc index 9900f92a..6f6f8cd0 100644 --- a/common/idstringlist.cc +++ b/common/idstringlist.cc @@ -58,4 +58,23 @@ std::string IdStringList::str(const Context *ctx) const return s; } +IdStringList IdStringList::concat(IdStringList a, IdStringList b) +{ + IdStringList result(a.size() + b.size()); + for (size_t i = 0; i < a.size(); i++) + result.ids[i] = a[i]; + for (size_t i = 0; i < b.size(); i++) + result.ids[a.size() + i] = b[i]; + return result; +} + +IdStringList IdStringList::slice(size_t s, size_t e) const +{ + NPNR_ASSERT(e >= s); + IdStringList result(e - s); + for (size_t i = 0; i < result.size(); i++) + result.ids[i] = ids[s + i]; + return result; +} + NEXTPNR_NAMESPACE_END |