Add ctx->place() API
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
7df67c91b3
commit
7daa8524c8
@ -21,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "place_sa.h"
|
#include "placer1.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -429,7 +429,7 @@ class SAPlacer
|
|||||||
const float post_legalise_dia_scale = 2;
|
const float post_legalise_dia_scale = 2;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool place_design_sa(Context *ctx)
|
bool placer1(Context *ctx)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
SAPlacer placer(ctx);
|
SAPlacer placer(ctx);
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
extern bool place_design_sa(Context *ctx);
|
extern bool placer1(Context *ctx);
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
|
@ -23,6 +23,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "nextpnr.h"
|
#include "nextpnr.h"
|
||||||
|
#include "placer1.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
#include "util.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()
|
bool Arch::route()
|
||||||
{
|
{
|
||||||
return router1(getCtx());
|
return router1(getCtx());
|
||||||
|
@ -720,6 +720,7 @@ struct Arch : BaseCtx
|
|||||||
|
|
||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
|
|
||||||
|
bool place();
|
||||||
bool route();
|
bool route();
|
||||||
|
|
||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
#include "design_utils.h"
|
#include "design_utils.h"
|
||||||
#include "jsonparse.h"
|
#include "jsonparse.h"
|
||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
#include "place_sa.h"
|
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
|
|
||||||
USING_NEXTPNR_NAMESPACE
|
USING_NEXTPNR_NAMESPACE
|
||||||
@ -146,7 +145,7 @@ int main(int argc, char *argv[])
|
|||||||
if (vm.count("no-tmdriv"))
|
if (vm.count("no-tmdriv"))
|
||||||
ctx.timing_driven = false;
|
ctx.timing_driven = false;
|
||||||
|
|
||||||
if (!place_design_sa(&ctx) && !ctx.force)
|
if (!ctx.place() && !ctx.force)
|
||||||
log_error("Placing design failed.\n");
|
log_error("Placing design failed.\n");
|
||||||
ctx.check();
|
ctx.check();
|
||||||
if (!ctx.route() && !ctx.force)
|
if (!ctx.route() && !ctx.force)
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "nextpnr.h"
|
#include "nextpnr.h"
|
||||||
|
#include "placer1.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
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()
|
bool Arch::route()
|
||||||
{
|
{
|
||||||
return router1(getCtx());
|
return router1(getCtx());
|
||||||
|
@ -158,6 +158,7 @@ struct Arch : BaseCtx
|
|||||||
float getDelayNS(delay_t v) const { return v; }
|
float getDelayNS(delay_t v) const { return v; }
|
||||||
uint32_t getDelayChecksum(delay_t v) const { return 0; }
|
uint32_t getDelayChecksum(delay_t v) const { return 0; }
|
||||||
|
|
||||||
|
bool place();
|
||||||
bool route();
|
bool route();
|
||||||
|
|
||||||
const std::vector<GraphicElement> &getDecalGraphics(DecalId decal) const;
|
const std::vector<GraphicElement> &getDecalGraphics(DecalId decal) const;
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
#include "pcf.h"
|
#include "pcf.h"
|
||||||
#include "place_sa.h"
|
|
||||||
|
|
||||||
static void initMainResource() { Q_INIT_RESOURCE(nextpnr); }
|
static void initMainResource() { Q_INIT_RESOURCE(nextpnr); }
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
#include "pcf.h"
|
#include "pcf.h"
|
||||||
#include "place_sa.h"
|
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
@ -123,7 +122,7 @@ void Worker::place(bool timing_driven)
|
|||||||
Q_EMIT taskStarted();
|
Q_EMIT taskStarted();
|
||||||
try {
|
try {
|
||||||
ctx->timing_driven = timing_driven;
|
ctx->timing_driven = timing_driven;
|
||||||
Q_EMIT place_finished(place_design_sa(ctx));
|
Q_EMIT place_finished(ctx->place());
|
||||||
} catch (WorkerInterruptionRequested) {
|
} catch (WorkerInterruptionRequested) {
|
||||||
Q_EMIT taskCanceled();
|
Q_EMIT taskCanceled();
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "nextpnr.h"
|
#include "nextpnr.h"
|
||||||
|
#include "placer1.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "gfx.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()
|
bool Arch::route()
|
||||||
{
|
{
|
||||||
return router1(getCtx());
|
return router1(getCtx());
|
||||||
|
@ -643,6 +643,7 @@ struct Arch : BaseCtx
|
|||||||
|
|
||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
|
|
||||||
|
bool place();
|
||||||
bool route();
|
bool route();
|
||||||
|
|
||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
#include "pcf.h"
|
#include "pcf.h"
|
||||||
#include "place_legaliser.h"
|
#include "place_legaliser.h"
|
||||||
#include "place_sa.h"
|
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
@ -372,7 +371,7 @@ int main(int argc, char *argv[])
|
|||||||
if (vm.count("no-tmdriv"))
|
if (vm.count("no-tmdriv"))
|
||||||
ctx.timing_driven = false;
|
ctx.timing_driven = false;
|
||||||
if (!vm.count("pack-only")) {
|
if (!vm.count("pack-only")) {
|
||||||
if (!place_design_sa(&ctx) && !ctx.force)
|
if (!ctx.place() && !ctx.force)
|
||||||
log_error("Placing design failed.\n");
|
log_error("Placing design failed.\n");
|
||||||
ctx.check();
|
ctx.check();
|
||||||
if (!ctx.route() && !ctx.force)
|
if (!ctx.route() && !ctx.force)
|
||||||
|
Loading…
Reference in New Issue
Block a user