aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-07-11 18:15:08 +0200
committerClifford Wolf <clifford@clifford.at>2018-07-11 18:15:08 +0200
commit7daa8524c8ab8c9ff5400d5074b80573b0d39a14 (patch)
tree372ed9db3069f40e733a503472659155ea62f4dc
parent7df67c91b38433e8a1002f8e9f53926aafaa4d1b (diff)
downloadnextpnr-7daa8524c8ab8c9ff5400d5074b80573b0d39a14.tar.gz
nextpnr-7daa8524c8ab8c9ff5400d5074b80573b0d39a14.tar.bz2
nextpnr-7daa8524c8ab8c9ff5400d5074b80573b0d39a14.zip
Add ctx->place() API
Signed-off-by: Clifford Wolf <clifford@clifford.at>
-rw-r--r--common/placer1.cc (renamed from common/place_sa.cc)4
-rw-r--r--common/placer1.h (renamed from common/place_sa.h)2
-rw-r--r--ecp5/arch.cc6
-rw-r--r--ecp5/arch.h1
-rw-r--r--ecp5/main.cc3
-rw-r--r--generic/arch.cc6
-rw-r--r--generic/arch.h1
-rw-r--r--gui/ice40/mainwindow.cc1
-rw-r--r--gui/ice40/worker.cc3
-rw-r--r--ice40/arch.cc6
-rw-r--r--ice40/arch.h1
-rw-r--r--ice40/main.cc3
12 files changed, 27 insertions, 10 deletions
diff --git a/common/place_sa.cc b/common/placer1.cc
index ab161c57..53295a91 100644
--- a/common/place_sa.cc
+++ b/common/placer1.cc
@@ -21,7 +21,7 @@
*
*/
-#include "place_sa.h"
+#include "placer1.h"
#include <algorithm>
#include <cmath>
#include <iostream>
@@ -429,7 +429,7 @@ class SAPlacer
const float post_legalise_dia_scale = 2;
};
-bool place_design_sa(Context *ctx)
+bool placer1(Context *ctx)
{
try {
SAPlacer placer(ctx);
diff --git a/common/place_sa.h b/common/placer1.h
index 1fd8c712..477fae56 100644
--- a/common/place_sa.h
+++ b/common/placer1.h
@@ -23,7 +23,7 @@
NEXTPNR_NAMESPACE_BEGIN
-extern bool place_design_sa(Context *ctx);
+extern bool placer1(Context *ctx);
NEXTPNR_NAMESPACE_END
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index 74548391..7383e0e7 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -23,6 +23,7 @@
#include <cstring>
#include "log.h"
#include "nextpnr.h"
+#include "placer1.h"
#include "router1.h"
#include "util.h"
@@ -289,6 +290,11 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
// -----------------------------------------------------------------------
+bool Arch::place()
+{
+ return placer1(getCtx());
+}
+
bool Arch::route()
{
return router1(getCtx());
diff --git a/ecp5/arch.h b/ecp5/arch.h
index c9c5a6a1..5f01c8c8 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -720,6 +720,7 @@ struct Arch : BaseCtx
// -------------------------------------------------
+ bool place();
bool route();
// -------------------------------------------------
diff --git a/ecp5/main.cc b/ecp5/main.cc
index a6128d0f..45774431 100644
--- a/ecp5/main.cc
+++ b/ecp5/main.cc
@@ -44,7 +44,6 @@
#include "design_utils.h"
#include "jsonparse.h"
#include "pack.h"
-#include "place_sa.h"
#include "timing.h"
USING_NEXTPNR_NAMESPACE
@@ -146,7 +145,7 @@ int main(int argc, char *argv[])
if (vm.count("no-tmdriv"))
ctx.timing_driven = false;
- if (!place_design_sa(&ctx) && !ctx.force)
+ if (!ctx.place() && !ctx.force)
log_error("Placing design failed.\n");
ctx.check();
if (!ctx.route() && !ctx.force)
diff --git a/generic/arch.cc b/generic/arch.cc
index b82d8ce6..2282b2b8 100644
--- a/generic/arch.cc
+++ b/generic/arch.cc
@@ -19,6 +19,7 @@
#include <math.h>
#include "nextpnr.h"
+#include "placer1.h"
#include "router1.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -316,6 +317,11 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
// ---------------------------------------------------------------
+bool Arch::place()
+{
+ return placer1(getCtx());
+}
+
bool Arch::route()
{
return router1(getCtx());
diff --git a/generic/arch.h b/generic/arch.h
index 60ac9435..85f469f9 100644
--- a/generic/arch.h
+++ b/generic/arch.h
@@ -158,6 +158,7 @@ struct Arch : BaseCtx
float getDelayNS(delay_t v) const { return v; }
uint32_t getDelayChecksum(delay_t v) const { return 0; }
+ bool place();
bool route();
const std::vector<GraphicElement> &getDecalGraphics(DecalId decal) const;
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc
index ea7e0667..6f0a9b97 100644
--- a/gui/ice40/mainwindow.cc
+++ b/gui/ice40/mainwindow.cc
@@ -29,7 +29,6 @@
#include "log.h"
#include "pack.h"
#include "pcf.h"
-#include "place_sa.h"
static void initMainResource() { Q_INIT_RESOURCE(nextpnr); }
diff --git a/gui/ice40/worker.cc b/gui/ice40/worker.cc
index fc21ed34..16f5fb89 100644
--- a/gui/ice40/worker.cc
+++ b/gui/ice40/worker.cc
@@ -25,7 +25,6 @@
#include "log.h"
#include "pack.h"
#include "pcf.h"
-#include "place_sa.h"
#include "timing.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -123,7 +122,7 @@ void Worker::place(bool timing_driven)
Q_EMIT taskStarted();
try {
ctx->timing_driven = timing_driven;
- Q_EMIT place_finished(place_design_sa(ctx));
+ Q_EMIT place_finished(ctx->place());
} catch (WorkerInterruptionRequested) {
Q_EMIT taskCanceled();
}
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 0bb27d38..1e6b4569 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -21,6 +21,7 @@
#include <cmath>
#include "log.h"
#include "nextpnr.h"
+#include "placer1.h"
#include "router1.h"
#include "util.h"
#include "gfx.h"
@@ -401,6 +402,11 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
// -----------------------------------------------------------------------
+bool Arch::place()
+{
+ return placer1(getCtx());
+}
+
bool Arch::route()
{
return router1(getCtx());
diff --git a/ice40/arch.h b/ice40/arch.h
index 02c37fae..659139a6 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -643,6 +643,7 @@ struct Arch : BaseCtx
// -------------------------------------------------
+ bool place();
bool route();
// -------------------------------------------------
diff --git a/ice40/main.cc b/ice40/main.cc
index f586a079..2427ea6c 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -42,7 +42,6 @@
#include "pack.h"
#include "pcf.h"
#include "place_legaliser.h"
-#include "place_sa.h"
#include "timing.h"
#include "version.h"
@@ -372,7 +371,7 @@ int main(int argc, char *argv[])
if (vm.count("no-tmdriv"))
ctx.timing_driven = false;
if (!vm.count("pack-only")) {
- if (!place_design_sa(&ctx) && !ctx.force)
+ if (!ctx.place() && !ctx.force)
log_error("Placing design failed.\n");
ctx.check();
if (!ctx.route() && !ctx.force)