diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/route.cc | 10 | ||||
-rw-r--r-- | common/route.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/common/route.cc b/common/route.cc index 657075ce..39e420d3 100644 --- a/common/route.cc +++ b/common/route.cc @@ -161,6 +161,7 @@ struct Router std::unordered_map<WireId, delay_t> src_wires; src_wires[src_wire] = 0; route(src_wires, dst_wire); + routedOkay = visited.count(dst_wire); } Router(Context *ctx, IdString net_name, bool ripup = false, @@ -526,4 +527,13 @@ bool route_design(Context *ctx) return true; } +bool get_actual_route_delay(Context *ctx, WireId src_wire, WireId dst_wire, + delay_t &delay) +{ + Router router(ctx, src_wire, dst_wire); + if (router.routedOkay) + delay = router.visited.at(dst_wire).delay; + return router.routedOkay; +} + NEXTPNR_NAMESPACE_END diff --git a/common/route.h b/common/route.h index 33927f26..af0de42e 100644 --- a/common/route.h +++ b/common/route.h @@ -25,6 +25,8 @@ 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); NEXTPNR_NAMESPACE_END |