diff options
Diffstat (limited to 'ice40/archdefs.h')
-rw-r--r-- | ice40/archdefs.h | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/ice40/archdefs.h b/ice40/archdefs.h index 7125ba16..360617fd 100644 --- a/ice40/archdefs.h +++ b/ice40/archdefs.h @@ -48,34 +48,17 @@ struct DelayInfo // ----------------------------------------------------------------------- -enum BelType : int32_t +enum ConstIds { - TYPE_NONE, - TYPE_ICESTORM_LC, - TYPE_ICESTORM_RAM, - TYPE_SB_IO, - TYPE_SB_GB, - TYPE_ICESTORM_PLL, - TYPE_SB_WARMBOOT, - TYPE_ICESTORM_DSP, - TYPE_ICESTORM_HFOSC, - TYPE_ICESTORM_LFOSC, - TYPE_SB_I2C, - TYPE_SB_SPI, - TYPE_IO_I3C, - TYPE_SB_LEDDA_IP, - TYPE_SB_RGBA_DRV, - TYPE_ICESTORM_SPRAM, + ID_NONE +#define X(t) , ID_##t +#include "constids.inc" +#undef X }; -enum PortPin : int32_t -{ - PIN_NONE, -#define X(t) PIN_##t, -#include "portpins.inc" +#define X(t) static constexpr auto id_##t = IdString(ID_##t); +#include "constids.inc" #undef X - PIN_MAXIDX -}; struct BelId { @@ -151,7 +134,7 @@ struct NetInfo; struct ArchCellInfo { - BelType belType = TYPE_NONE; + IdString belType; union { struct @@ -186,14 +169,6 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId> std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PipId &pip) const noexcept { return hash<int>()(pip.index); } }; -template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelType> : hash<int> -{ -}; - -template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PortPin> : hash<int> -{ -}; - template <> struct hash<NEXTPNR_NAMESPACE_PREFIX GroupId> { std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept |