diff options
author | gatecat <gatecat@ds0.me> | 2021-06-03 09:04:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-03 09:04:34 +0100 |
commit | a3d8b4f9d198226ec0903e34a8d290b376b45c0b (patch) | |
tree | ada2c6a5d48e766fa523e633aaa28179baea3273 /mistral/arch.h | |
parent | 589ca8ded5da2012e4388a3ec4c8fae74dff75e4 (diff) | |
parent | dcbb322447a7fb59cabe197ec1dd2307acfa3681 (diff) | |
download | nextpnr-a3d8b4f9d198226ec0903e34a8d290b376b45c0b.tar.gz nextpnr-a3d8b4f9d198226ec0903e34a8d290b376b45c0b.tar.bz2 nextpnr-a3d8b4f9d198226ec0903e34a8d290b376b45c0b.zip |
Merge pull request #718 from YosysHQ/gatecat/hashlib
Moving from unordered_{map, set} to hashlib
Diffstat (limited to 'mistral/arch.h')
-rw-r--r-- | mistral/arch.h | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/mistral/arch.h b/mistral/arch.h index ee2c84a3..1a42530a 100644 --- a/mistral/arch.h +++ b/mistral/arch.h @@ -85,7 +85,7 @@ struct BelInfo // For cases where we need to determine an original block index, due to multiple bels at the same tile this // might not be the same as the nextpnr z-coordinate int block_index; - std::unordered_map<IdString, PinInfo> pins; + dict<IdString, PinInfo> pins; // Info for different kinds of bels union { @@ -153,7 +153,7 @@ struct UpDownhillPipRange UpDownhillPipIterator b, e; UpDownhillPipRange(const std::vector<WireId> &v, WireId other_wire, bool is_uphill) - : b(v.cbegin(), other_wire, is_uphill), e(v.cend(), other_wire, is_uphill){}; + : b(v.begin(), other_wire, is_uphill), e(v.end(), other_wire, is_uphill){}; UpDownhillPipIterator begin() const { return b; } UpDownhillPipIterator end() const { return e; } @@ -161,7 +161,7 @@ struct UpDownhillPipRange // This iterates over the list of wires, and for each wire yields its uphill pips, as an efficient way of going over // all the pips in the device -using WireMapIterator = std::unordered_map<WireId, WireInfo>::const_iterator; +using WireMapIterator = dict<WireId, WireInfo>::const_iterator; struct AllPipIterator { WireMapIterator base, end; @@ -196,8 +196,7 @@ struct AllPipRange { AllPipIterator b, e; - AllPipRange(const std::unordered_map<WireId, WireInfo> &wires) - : b(wires.cbegin(), wires.cend(), -1), e(wires.cend(), wires.cend(), 0) + AllPipRange(const dict<WireId, WireInfo> &wires) : b(wires.begin(), wires.end(), -1), e(wires.end(), wires.end(), 0) { // Starting the begin iterator at index -1 and incrementing it ensures we skip over the first wire if it has no // uphill pips @@ -211,7 +210,7 @@ struct AllPipRange // This transforms a map to a range of keys, used as the wire iterator template <typename T> struct key_range { - key_range(const T &t) : b(t.cbegin()), e(t.cend()){}; + key_range(const T &t) : b(t.begin()), e(t.end()){}; typename T::const_iterator b, e; struct xformed_iterator : public T::const_iterator @@ -224,7 +223,7 @@ template <typename T> struct key_range xformed_iterator end() const { return xformed_iterator(e); } }; -using AllWireRange = key_range<std::unordered_map<WireId, WireInfo>>; +using AllWireRange = key_range<dict<WireId, WireInfo>>; struct ArchRanges : BaseArchRanges { @@ -489,7 +488,7 @@ struct Arch : BaseArch<ArchRanges> static const std::string defaultRouter; static const std::vector<std::string> availableRouters; - std::unordered_map<WireId, WireInfo> wires; + dict<WireId, WireInfo> wires; // List of LABs std::vector<LABInfo> labs; @@ -499,13 +498,13 @@ struct Arch : BaseArch<ArchRanges> // Conversion between numbers and rnode types and IdString, for fast wire name implementation std::vector<IdString> int2id; - std::unordered_map<IdString, int> id2int; + dict<IdString, int> id2int; std::vector<IdString> rn_t2id; - std::unordered_map<IdString, CycloneV::rnode_type_t> id2rn_t; + dict<IdString, CycloneV::rnode_type_t> id2rn_t; // This structure is only used for nextpnr-created wires - std::unordered_map<IdStringList, WireId> npnr_wirebyname; + dict<IdStringList, WireId> npnr_wirebyname; std::vector<std::vector<BelInfo>> bels_by_tile; std::vector<BelId> all_bels; @@ -525,18 +524,18 @@ struct Arch : BaseArch<ArchRanges> // ------------------------------------------------- void assign_default_pinmap(CellInfo *cell); - static const std::unordered_map<IdString, IdString> comb_pinmap; + static const dict<IdString, IdString> comb_pinmap; // ------------------------------------------------- - typedef std::unordered_map<IdString, CellPinStyle> CellPinsData; // pins.cc - static const std::unordered_map<IdString, CellPinsData> cell_pins_db; // pins.cc + typedef dict<IdString, CellPinStyle> CellPinsData; // pins.cc + static const dict<IdString, CellPinsData> cell_pins_db; // pins.cc CellPinStyle get_cell_pin_style(const CellInfo *cell, IdString port) const; // pins.cc // ------------------------------------------------- // List of IO constraints, used by QSF parser - std::unordered_map<IdString, std::unordered_map<IdString, Property>> io_attr; + dict<IdString, dict<IdString, Property>> io_attr; void read_qsf(std::istream &in); // qsf.cc // ------------------------------------------------- |