From 0d6be6f4749174f4a6938a675456cb663edc47cb Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 6 May 2021 12:30:58 +0100 Subject: Add stub cluster API impl for remaining arches Signed-off-by: gatecat --- common/base_clusterinfo.h | 2 ++ fpga_interchange/arch.h | 13 +++++++++++++ fpga_interchange/archdefs.h | 2 ++ generic/arch.h | 11 +++++++++++ generic/archdefs.h | 1 + gowin/archdefs.h | 3 ++- machxo2/archdefs.h | 4 +++- 7 files changed, 34 insertions(+), 2 deletions(-) diff --git a/common/base_clusterinfo.h b/common/base_clusterinfo.h index 32e6f87e..65e8e6d4 100644 --- a/common/base_clusterinfo.h +++ b/common/base_clusterinfo.h @@ -23,6 +23,8 @@ #include "idstring.h" #include "nextpnr_namespaces.h" +#include + NEXTPNR_NAMESPACE_BEGIN struct CellInfo; diff --git a/fpga_interchange/arch.h b/fpga_interchange/arch.h index da620699..c7d2544f 100644 --- a/fpga_interchange/arch.h +++ b/fpga_interchange/arch.h @@ -835,6 +835,19 @@ struct Arch : ArchAPI return get_site_status(tile_status, bel_data).checkSiteRouting(getCtx(), tile_status); } + // ------------------------------------------------- + + // TODO + CellInfo *getClusterRootCell(ClusterId cluster) const override { NPNR_ASSERT_FALSE("unimplemented"); } + ArcBounds getClusterBounds(ClusterId cluster) const override { NPNR_ASSERT_FALSE("unimplemented"); } + Loc getClusterOffset(const CellInfo *cell) const override { NPNR_ASSERT_FALSE("unimplemented"); } + bool isClusterStrict(const CellInfo *cell) const override { NPNR_ASSERT_FALSE("unimplemented"); } + bool getClusterPlacement(ClusterId cluster, BelId root_bel, + std::vector> &placement) const override + { + NPNR_ASSERT_FALSE("unimplemented"); + } + IdString get_bel_tiletype(BelId bel) const { return IdString(loc_info(chip_info, bel).name); } std::unordered_map sink_locs, source_locs; diff --git a/fpga_interchange/archdefs.h b/fpga_interchange/archdefs.h index 23bff4f3..c145b893 100644 --- a/fpga_interchange/archdefs.h +++ b/fpga_interchange/archdefs.h @@ -98,6 +98,8 @@ struct BelBucketId bool operator<(const BelBucketId &other) const { return name < other.name; } }; +typedef IdString ClusterId; + struct SiteExpansionLoop; struct ArchNetInfo diff --git a/generic/arch.h b/generic/arch.h index 92260ce0..50d2731c 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -362,6 +362,17 @@ struct Arch : ArchAPI bool isValidBelForCellType(IdString cell_type, BelId bel) const override { return cell_type == getBelType(bel); } bool isBelLocationValid(BelId bel) const override; + // TODO + CellInfo *getClusterRootCell(ClusterId cluster) const override { NPNR_ASSERT_FALSE("unimplemented"); } + ArcBounds getClusterBounds(ClusterId cluster) const override { NPNR_ASSERT_FALSE("unimplemented"); } + Loc getClusterOffset(const CellInfo *cell) const override { NPNR_ASSERT_FALSE("unimplemented"); } + bool isClusterStrict(const CellInfo *cell) const override { NPNR_ASSERT_FALSE("unimplemented"); } + bool getClusterPlacement(ClusterId cluster, BelId root_bel, + std::vector> &placement) const override + { + NPNR_ASSERT_FALSE("unimplemented"); + } + static const std::string defaultPlacer; static const std::vector availablePlacers; static const std::string defaultRouter; diff --git a/generic/archdefs.h b/generic/archdefs.h index bdd97dde..0489ab04 100644 --- a/generic/archdefs.h +++ b/generic/archdefs.h @@ -34,6 +34,7 @@ typedef IdStringList PipId; typedef IdStringList GroupId; typedef IdStringList DecalId; typedef IdString BelBucketId; +typedef IdString ClusterId; struct ArchNetInfo { diff --git a/gowin/archdefs.h b/gowin/archdefs.h index a6b16e5b..fd7e0b0b 100644 --- a/gowin/archdefs.h +++ b/gowin/archdefs.h @@ -21,6 +21,7 @@ #ifndef GOWIN_ARCHDEFS_H #define GOWIN_ARCHDEFS_H +#include "base_clusterinfo.h" #include "idstring.h" #include "nextpnr_namespaces.h" @@ -56,7 +57,7 @@ struct ArchNetInfo struct NetInfo; -struct ArchCellInfo +struct ArchCellInfo : BaseClusterInfo { // Is the flip-flop of this slice used bool ff_used; diff --git a/machxo2/archdefs.h b/machxo2/archdefs.h index 11791d3c..2d50dddb 100644 --- a/machxo2/archdefs.h +++ b/machxo2/archdefs.h @@ -21,6 +21,7 @@ #ifndef MACHXO2_ARCHDEFS_H #define MACHXO2_ARCHDEFS_H +#include "base_clusterinfo.h" #include "idstring.h" #include "nextpnr_namespaces.h" @@ -104,6 +105,7 @@ struct PipId typedef IdString GroupId; typedef IdString DecalId; typedef IdString BelBucketId; +typedef IdString ClusterId; struct ArchNetInfo { @@ -111,7 +113,7 @@ struct ArchNetInfo struct NetInfo; -struct ArchCellInfo +struct ArchCellInfo : BaseClusterInfo { }; -- cgit v1.2.3