aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch_place.h
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-19 14:44:49 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-19 14:44:49 +0200
commit90086698679d8a3c5f9e58d619bc18a284ab17e1 (patch)
treef2b88758860ff46a3d0502780c623cc645b5ec9c /ice40/arch_place.h
parent786bd6b25a2d7db691e70fd2bc9a60c796e0df35 (diff)
downloadnextpnr-90086698679d8a3c5f9e58d619bc18a284ab17e1.tar.gz
nextpnr-90086698679d8a3c5f9e58d619bc18a284ab17e1.tar.bz2
nextpnr-90086698679d8a3c5f9e58d619bc18a284ab17e1.zip
Major performance improvement to placement validity check
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/arch_place.h')
-rw-r--r--ice40/arch_place.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/ice40/arch_place.h b/ice40/arch_place.h
index 3d05ed7a..d276b9c4 100644
--- a/ice40/arch_place.h
+++ b/ice40/arch_place.h
@@ -26,13 +26,27 @@
NEXTPNR_NAMESPACE_BEGIN
-// Whether or not a given cell can be placed at a given Bel
-// This is not intended for Bel type checks, but finer-grained constraints
-// such as conflicting set/reset signals, etc
-bool isValidBelForCell(Context *ctx, CellInfo *cell, BelId bel);
+class PlaceValidityChecker
+{
+ public:
+ PlaceValidityChecker(Context *ctx);
+ // Whether or not a given cell can be placed at a given Bel
+ // This is not intended for Bel type checks, but finer-grained constraints
+ // such as conflicting set/reset signals, etc
+ bool isValidBelForCell(CellInfo *cell, BelId bel);
-// Return true whether all Bels at a given location are valid
-bool isBelLocationValid(Context *ctx, BelId bel);
+ // Return true whether all Bels at a given location are valid
+ bool isBelLocationValid(BelId bel);
+
+ private:
+ bool logicCellsCompatible(const Context *ctx,
+ const std::vector<const CellInfo *> &cells);
+ IdString id_icestorm_lc, id_sb_io, id_sb_gb;
+ IdString id_cen, id_clk, id_sr;
+ IdString id_i0, id_i1, id_i2, id_i3;
+ IdString id_dff_en, id_neg_clk;
+ Context *ctx;
+};
NEXTPNR_NAMESPACE_END