aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/arch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r--ice40/arch.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index fbe882fc..b0839fa5 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -26,10 +26,10 @@
#include "log.h"
#include "nextpnr.h"
#include "placer1.h"
+#include "placer_heap.h"
#include "router1.h"
#include "timing_opt.h"
#include "util.h"
-
NEXTPNR_NAMESPACE_BEGIN
// -----------------------------------------------------------------------
@@ -671,8 +671,18 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay
bool Arch::place()
{
- if (!placer1(getCtx(), Placer1Cfg(getCtx())))
- return false;
+ std::string placer = str_or_default(settings, id("placer"), defaultPlacer);
+ if (placer == "heap") {
+ PlacerHeapCfg cfg(getCtx());
+ cfg.ioBufTypes.insert(id_SB_IO);
+ if (!placer_heap(getCtx(), cfg))
+ return false;
+ } else if (placer == "sa") {
+ if (!placer1(getCtx(), Placer1Cfg(getCtx())))
+ return false;
+ } else {
+ log_error("iCE40 architecture does not support placer '%s'\n", placer.c_str());
+ }
if (bool_or_default(settings, id("opt_timing"), false)) {
TimingOptCfg tocfg(getCtx());
tocfg.cellTypes.insert(id_ICESTORM_LC);
@@ -1198,4 +1208,12 @@ void Arch::assignCellInfo(CellInfo *cell)
}
}
+const std::string Arch::defaultPlacer = "sa";
+
+const std::vector<std::string> Arch::availablePlacers = {"sa",
+#ifdef WITH_HEAP
+ "heap"
+#endif
+};
+
NEXTPNR_NAMESPACE_END