From ecc19c2c083f7e3ed7da95557731ded803d2cb1d Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 2 Jun 2021 10:01:36 +0100 Subject: Using hashlib in arches Signed-off-by: gatecat --- mistral/arch.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'mistral/arch.h') 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 pins; + dict pins; // Info for different kinds of bels union { @@ -153,7 +153,7 @@ struct UpDownhillPipRange UpDownhillPipIterator b, e; UpDownhillPipRange(const std::vector &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::const_iterator; +using WireMapIterator = dict::const_iterator; struct AllPipIterator { WireMapIterator base, end; @@ -196,8 +196,7 @@ struct AllPipRange { AllPipIterator b, e; - AllPipRange(const std::unordered_map &wires) - : b(wires.cbegin(), wires.cend(), -1), e(wires.cend(), wires.cend(), 0) + AllPipRange(const dict &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 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 struct key_range xformed_iterator end() const { return xformed_iterator(e); } }; -using AllWireRange = key_range>; +using AllWireRange = key_range>; struct ArchRanges : BaseArchRanges { @@ -489,7 +488,7 @@ struct Arch : BaseArch static const std::string defaultRouter; static const std::vector availableRouters; - std::unordered_map wires; + dict wires; // List of LABs std::vector labs; @@ -499,13 +498,13 @@ struct Arch : BaseArch // Conversion between numbers and rnode types and IdString, for fast wire name implementation std::vector int2id; - std::unordered_map id2int; + dict id2int; std::vector rn_t2id; - std::unordered_map id2rn_t; + dict id2rn_t; // This structure is only used for nextpnr-created wires - std::unordered_map npnr_wirebyname; + dict npnr_wirebyname; std::vector> bels_by_tile; std::vector all_bels; @@ -525,18 +524,18 @@ struct Arch : BaseArch // ------------------------------------------------- void assign_default_pinmap(CellInfo *cell); - static const std::unordered_map comb_pinmap; + static const dict comb_pinmap; // ------------------------------------------------- - typedef std::unordered_map CellPinsData; // pins.cc - static const std::unordered_map cell_pins_db; // pins.cc + typedef dict CellPinsData; // pins.cc + static const dict 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> io_attr; + dict> io_attr; void read_qsf(std::istream &in); // qsf.cc // ------------------------------------------------- -- cgit v1.2.3