diff options
Diffstat (limited to 'generic/archdefs.h')
-rw-r--r-- | generic/archdefs.h | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/generic/archdefs.h b/generic/archdefs.h index c46fba93..4e91ffd3 100644 --- a/generic/archdefs.h +++ b/generic/archdefs.h @@ -20,6 +20,7 @@ #ifndef GENERIC_ARCHDEFS_H #define GENERIC_ARCHDEFS_H +#include "base_clusterinfo.h" #include "hashlib.h" #include "idstringlist.h" @@ -27,9 +28,42 @@ NEXTPNR_NAMESPACE_BEGIN typedef float delay_t; -typedef IdStringList BelId; -typedef IdStringList WireId; -typedef IdStringList PipId; +struct BelId +{ + BelId() : index(-1){}; + explicit BelId(int32_t index) : index(index){}; + int32_t index = -1; + + bool operator==(const BelId &other) const { return index == other.index; } + bool operator!=(const BelId &other) const { return index != other.index; } + bool operator<(const BelId &other) const { return index < other.index; } + unsigned int hash() const { return index; } +}; + +struct WireId +{ + WireId() : index(-1){}; + explicit WireId(int32_t index) : index(index){}; + int32_t index = -1; + + bool operator==(const WireId &other) const { return index == other.index; } + bool operator!=(const WireId &other) const { return index != other.index; } + bool operator<(const WireId &other) const { return index < other.index; } + unsigned int hash() const { return index; } +}; + +struct PipId +{ + PipId() : index(-1){}; + explicit PipId(int32_t index) : index(index){}; + int32_t index = -1; + + bool operator==(const PipId &other) const { return index == other.index; } + bool operator!=(const PipId &other) const { return index != other.index; } + bool operator<(const PipId &other) const { return index < other.index; } + unsigned int hash() const { return index; } +}; + typedef IdStringList GroupId; typedef IdStringList DecalId; typedef IdString BelBucketId; @@ -41,7 +75,7 @@ struct ArchNetInfo struct NetInfo; -struct ArchCellInfo +struct ArchCellInfo : BaseClusterInfo { // Custom grouping set via "PACK_GROUP" attribute. All cells with the same group // value may share a tile (-1 = don't care, default if not set) @@ -50,6 +84,8 @@ struct ArchCellInfo bool is_slice; // Only packing rule for slice type primitives is a single clock per tile const NetInfo *slice_clk; + // A flat index for cells; so viaduct uarches can have their own fast flat arrays of per-cell validity-related data + int flat_index; // Cell to bel pin mapping dict<IdString, std::vector<IdString>> bel_pins; }; |