From a436035424368b3d424822c7b72f99044c93dafd Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 12 Jul 2018 17:22:29 +0200 Subject: Add Groups API Signed-off-by: Clifford Wolf --- ecp5/arch.cc | 2 ++ ecp5/arch.h | 11 +++++++++++ ecp5/archdefs.h | 19 +++++++++++++++++++ 3 files changed, 32 insertions(+) (limited to 'ecp5') diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 7383e0e7..286151d8 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -317,6 +317,8 @@ DecalXY Arch::getWireDecal(WireId wire) const { return {}; } DecalXY Arch::getPipDecal(PipId pip) const { return {}; }; +DecalXY Arch::getGroupDecal(PipId pip) const { return {}; }; + // ----------------------------------------------------------------------- bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const { return true; } diff --git a/ecp5/arch.h b/ecp5/arch.h index 5f01c8c8..bbc7c561 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -711,6 +711,16 @@ struct Arch : BaseCtx // ------------------------------------------------- + GroupId getGroupByName(IdString name) const { return GroupId(); } + IdString getGroupName(GroupId group) const { return IdString(); } + std::vector getGroups() const { return std::vector(); } + std::vector getGroupBels(GroupId group) const { return std::vector(); } + std::vector getGroupWires(GroupId group) const { return std::vector(); } + std::vector getGroupPips(GroupId group) const { return std::vector(); } + std::vector getGroupGroups(GroupId group) const { return std::vector(); } + + // ------------------------------------------------- + void estimatePosition(BelId bel, int &x, int &y, bool &gb) const; delay_t estimateDelay(WireId src, WireId dst) const; delay_t getDelayEpsilon() const { return 20; } @@ -731,6 +741,7 @@ struct Arch : BaseCtx DecalXY getBelDecal(BelId bel) const; DecalXY getWireDecal(WireId wire) const; DecalXY getPipDecal(PipId pip) const; + DecalXY getGroupDecal(GroupId group) const; // ------------------------------------------------- diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index 79b20619..797db5f7 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -105,11 +105,22 @@ struct PipId bool operator!=(const PipId &other) const { return index != other.index || location != other.location; } }; +struct GroupId +{ + int32_t index = -1; + + bool operator==(const GroupId &other) const { return index == other.index; } + bool operator!=(const GroupId &other) const { return index != other.index; } +}; + struct DecalId { char type = 0; // Bel/Wire/Pip/Frame (b/w/p/f) Location location; uint32_t z = 0; + + bool operator==(const DecalId &other) const { return type == other.type && location == other.location && z == other.z; } + bool operator!=(const DecalId &other) const { return type != other.type || location != other.location || z != other.z; } }; NEXTPNR_NAMESPACE_END @@ -155,6 +166,14 @@ template <> struct hash } }; +template <> struct hash +{ + std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept + { + return std::hash()(group.index); + } +}; + template <> struct hash { std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept -- cgit v1.2.3