aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-07-12 17:22:29 +0200
committerClifford Wolf <clifford@clifford.at>2018-07-12 17:22:29 +0200
commita436035424368b3d424822c7b72f99044c93dafd (patch)
tree9bbf888bc6db482b42677656f4ee3fd4357355e8 /ecp5
parent1245eb6343f272b6aeb096b0d41407c5ea6bc5cd (diff)
downloadnextpnr-a436035424368b3d424822c7b72f99044c93dafd.tar.gz
nextpnr-a436035424368b3d424822c7b72f99044c93dafd.tar.bz2
nextpnr-a436035424368b3d424822c7b72f99044c93dafd.zip
Add Groups API
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ecp5')
-rw-r--r--ecp5/arch.cc2
-rw-r--r--ecp5/arch.h11
-rw-r--r--ecp5/archdefs.h19
3 files changed, 32 insertions, 0 deletions
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<GroupId> getGroups() const { return std::vector<GroupId>(); }
+ std::vector<BelId> getGroupBels(GroupId group) const { return std::vector<BelId>(); }
+ std::vector<WireId> getGroupWires(GroupId group) const { return std::vector<WireId>(); }
+ std::vector<PipId> getGroupPips(GroupId group) const { return std::vector<PipId>(); }
+ std::vector<GroupId> getGroupGroups(GroupId group) const { return std::vector<GroupId>(); }
+
+ // -------------------------------------------------
+
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<NEXTPNR_NAMESPACE_PREFIX PipId>
}
};
+template <> struct hash<NEXTPNR_NAMESPACE_PREFIX GroupId>
+{
+ std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept
+ {
+ return std::hash<int>()(group.index);
+ }
+};
+
template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId>
{
std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept