From 6b74d326d42063dc1b68f8276c5892bf90099b26 Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 13 Jun 2018 17:07:42 +0200 Subject: experiment: Simple heuristic-based placer Signed-off-by: David Shah --- ice40/arch_place.cc | 10 +++++++--- ice40/cells.cc | 2 +- ice40/cells.h | 2 +- ice40/main.cc | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) (limited to 'ice40') diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index c02add1c..e4a6c5d7 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -18,6 +18,7 @@ */ #include "arch_place.h" +#include "cells.h" NEXTPNR_NAMESPACE_BEGIN @@ -45,9 +46,12 @@ static bool logicCellsCompatible(const std::vector &cells) clk = get_net_or_nullptr(cell, "CLK"); sr = get_net_or_nullptr(cell, "SR"); - locals.insert(cen); - locals.insert(clk); - locals.insert(sr); + if (!is_global_net(cen)) + locals.insert(cen); + if (!is_global_net(clk)) + locals.insert(clk); + if (!is_global_net(sr)) + locals.insert(sr); if (std::stoi(cell->params.at("NEG_CLK"))) { dffs_neg = true; diff --git a/ice40/cells.cc b/ice40/cells.cc index b7a02790..61b24ce3 100644 --- a/ice40/cells.cc +++ b/ice40/cells.cc @@ -190,7 +190,7 @@ void nxio_to_sb(CellInfo *nxio, CellInfo *sbio) } } -bool is_global_net(NetInfo *net) +bool is_global_net(const NetInfo *net) { return bool(net_driven_by(net, is_gbuf, "GLOBAL_BUFFER_OUTPUT")); } diff --git a/ice40/cells.h b/ice40/cells.h index e5b4fa9c..a2fa4c16 100644 --- a/ice40/cells.h +++ b/ice40/cells.h @@ -75,7 +75,7 @@ void dff_to_lc(CellInfo *dff, CellInfo *lc, bool pass_thru_lut = false); void nxio_to_sb(CellInfo *nxio, CellInfo *sbio); // Return true if a net is a global net -bool is_global_net(NetInfo *net); +bool is_global_net(const NetInfo *net); NEXTPNR_NAMESPACE_END diff --git a/ice40/main.cc b/ice40/main.cc index d4177fb1..304fec6e 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -222,7 +222,7 @@ int main(int argc, char *argv[]) pack_design(&design); if (!vm.count("pack-only")) { - place_design(&design); + place_design_heuristic(&design); route_design(&design, verbose); } } -- cgit v1.2.3