aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.cc
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 /ice40/arch.cc
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 'ice40/arch.cc')
-rw-r--r--ice40/arch.cc64
1 files changed, 58 insertions, 6 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 1e6b4569..26c3b003 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -369,6 +369,52 @@ std::string Arch::getBelPackagePin(BelId bel) const
}
return "";
}
+
+// -----------------------------------------------------------------------
+
+GroupId Arch::getGroupByName(IdString name) const
+{
+ for (auto g : getGroups())
+ if (getGroupName(g) == name)
+ return g;
+ return GroupId();
+}
+
+IdString Arch::getGroupName(GroupId group) const
+{
+ return IdString();
+}
+
+std::vector<GroupId> Arch::getGroups() const
+{
+ std::vector<GroupId> ret;
+ return ret;
+}
+
+std::vector<BelId> Arch::getGroupBels(GroupId group) const
+{
+ std::vector<BelId> ret;
+ return ret;
+}
+
+std::vector<WireId> Arch::getGroupWires(GroupId group) const
+{
+ std::vector<WireId> ret;
+ return ret;
+}
+
+std::vector<PipId> Arch::getGroupPips(GroupId group) const
+{
+ std::vector<PipId> ret;
+ return ret;
+}
+
+std::vector<GroupId> Arch::getGroupGroups(GroupId group) const
+{
+ std::vector<GroupId> ret;
+ return ret;
+}
+
// -----------------------------------------------------------------------
void Arch::estimatePosition(BelId bel, int &x, int &y, bool &gb) const
@@ -417,15 +463,15 @@ bool Arch::route()
DecalXY Arch::getFrameDecal() const
{
DecalXY decalxy;
- decalxy.decal.type = 'f';
+ decalxy.decal.type = DecalId::TYPE_FRAME;
return decalxy;
}
DecalXY Arch::getBelDecal(BelId bel) const
{
DecalXY decalxy;
- decalxy.decal.type = 'b';
- decalxy.decal.z = bel.index;
+ decalxy.decal.type = DecalId::TYPE_BEL;
+ decalxy.decal.index = bel.index;
return decalxy;
}
@@ -441,11 +487,17 @@ DecalXY Arch::getPipDecal(PipId pip) const
return decalxy;
};
+DecalXY Arch::getGroupDecal(GroupId group) const
+{
+ DecalXY decalxy;
+ return decalxy;
+};
+
std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
{
std::vector<GraphicElement> ret;
- if (decal.type == 'f')
+ if (decal.type == DecalId::TYPE_FRAME)
{
for (int x = 0; x <= chip_info->width; x++)
for (int y = 0; y <= chip_info->height; y++) {
@@ -458,10 +510,10 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
}
}
- if (decal.type == 'b')
+ if (decal.type == DecalId::TYPE_BEL)
{
BelId bel;
- bel.index = decal.z;
+ bel.index = decal.index;
auto bel_type = getBelType(bel);