mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-04-30 13:41:26 +00:00
Add ctx->route() API
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
@@ -260,6 +260,10 @@ struct BaseCtx
|
||||
delete idstring_idx_to_str;
|
||||
}
|
||||
|
||||
Context *getCtx() { return reinterpret_cast<Context*>(this); }
|
||||
|
||||
const Context *getCtx() const { return reinterpret_cast<const Context*>(this); }
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
bool allUiReload = false;
|
||||
@@ -366,6 +370,11 @@ struct Context : Arch
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
// provided by router1.cc
|
||||
bool getActualRouteDelay(WireId src_wire, WireId dst_wire, delay_t &delay);
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
uint64_t rngstate = 0x3141592653589793;
|
||||
|
||||
uint64_t rng64()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <queue>
|
||||
|
||||
#include "log.h"
|
||||
#include "route.h"
|
||||
#include "router1.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -402,7 +402,7 @@ struct Router
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
bool route_design(Context *ctx)
|
||||
bool router1(Context *ctx)
|
||||
{
|
||||
try {
|
||||
int totalVisitCnt = 0, totalRevisitCnt = 0, totalOvertimeRevisitCnt = 0;
|
||||
@@ -643,10 +643,10 @@ bool route_design(Context *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
bool get_actual_route_delay(Context *ctx, WireId src_wire, WireId dst_wire, delay_t &delay)
|
||||
bool Context::getActualRouteDelay(WireId src_wire, WireId dst_wire, delay_t &delay)
|
||||
{
|
||||
RipupScoreboard scores;
|
||||
Router router(ctx, scores, src_wire, dst_wire);
|
||||
Router router(this, scores, src_wire, dst_wire);
|
||||
if (router.routedOkay)
|
||||
delay = router.visited.at(dst_wire).delay;
|
||||
return router.routedOkay;
|
||||
@@ -17,16 +17,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ROUTE_H
|
||||
#define ROUTE_H
|
||||
#ifndef ROUTER1_H
|
||||
#define ROUTER1_H
|
||||
|
||||
#include "nextpnr.h"
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
extern bool route_design(Context *ctx);
|
||||
extern bool get_actual_route_delay(Context *ctx, WireId src_wire, WireId dst_wire, delay_t &delay);
|
||||
extern bool router1(Context *ctx);
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif // ROUTE_H
|
||||
#endif // ROUTER1_H
|
||||
Reference in New Issue
Block a user