aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-13 17:07:42 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-16 14:44:10 +0200
commit6b74d326d42063dc1b68f8276c5892bf90099b26 (patch)
tree6d68eda0eef1fb836c883bebde5620d84a0278ca /ice40
parent355d33632cdbc1808e2d33ef89ed92052f9bb2ea (diff)
downloadnextpnr-6b74d326d42063dc1b68f8276c5892bf90099b26.tar.gz
nextpnr-6b74d326d42063dc1b68f8276c5892bf90099b26.tar.bz2
nextpnr-6b74d326d42063dc1b68f8276c5892bf90099b26.zip
experiment: Simple heuristic-based placer
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch_place.cc10
-rw-r--r--ice40/cells.cc2
-rw-r--r--ice40/cells.h2
-rw-r--r--ice40/main.cc2
4 files changed, 10 insertions, 6 deletions
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<const CellInfo *> &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);
}
}