From 7df67c91b38433e8a1002f8e9f53926aafaa4d1b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 11 Jul 2018 18:04:09 +0200 Subject: Add ctx->route() API Signed-off-by: Clifford Wolf --- ice40/arch.cc | 8 ++++++++ ice40/arch.h | 4 ++++ ice40/main.cc | 5 ++--- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'ice40') diff --git a/ice40/arch.cc b/ice40/arch.cc index a25c3d87..0bb27d38 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -21,6 +21,7 @@ #include #include "log.h" #include "nextpnr.h" +#include "router1.h" #include "util.h" #include "gfx.h" @@ -400,6 +401,13 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const // ----------------------------------------------------------------------- +bool Arch::route() +{ + return router1(getCtx()); +} + +// ----------------------------------------------------------------------- + DecalXY Arch::getFrameDecal() const { DecalXY decalxy; diff --git a/ice40/arch.h b/ice40/arch.h index 28e913e4..02c37fae 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -643,6 +643,10 @@ struct Arch : BaseCtx // ------------------------------------------------- + bool route(); + + // ------------------------------------------------- + std::vector getDecalGraphics(DecalId decal) const; DecalXY getFrameDecal() const; diff --git a/ice40/main.cc b/ice40/main.cc index ff823cbe..f586a079 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -43,7 +43,6 @@ #include "pcf.h" #include "place_legaliser.h" #include "place_sa.h" -#include "route.h" #include "timing.h" #include "version.h" @@ -339,7 +338,7 @@ int main(int argc, char *argv[]) for (int i = 0; i < int(src_wires.size()) && i < int(dst_wires.size()); i++) { delay_t actual_delay; WireId src = src_wires[i], dst = dst_wires[i]; - if (!get_actual_route_delay(&ctx, src, dst, actual_delay)) + if (!ctx.getActualRouteDelay(src, dst, actual_delay)) continue; printf("%s %s %.3f %.3f %d %d %d %d %d %d\n", ctx.getWireName(src).c_str(&ctx), ctx.getWireName(dst).c_str(&ctx), ctx.getDelayNS(actual_delay), @@ -376,7 +375,7 @@ int main(int argc, char *argv[]) if (!place_design_sa(&ctx) && !ctx.force) log_error("Placing design failed.\n"); ctx.check(); - if (!route_design(&ctx) && !ctx.force) + if (!ctx.route() && !ctx.force) log_error("Routing design failed.\n"); } } -- cgit v1.2.3