From c5562429760b444133fcb2391236275b0c353670 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 21 Jul 2018 13:38:44 +0200 Subject: Add getWireDelay API Signed-off-by: Clifford Wolf --- common/router1.cc | 6 ++++-- ecp5/arch.h | 6 ++++++ generic/arch.h | 1 + ice40/arch.h | 6 ++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/common/router1.cc b/common/router1.cc index 94c7070e..de5caa5a 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -148,6 +148,8 @@ struct Router bool foundRipupNet = false; thisVisitCnt++; + next_delay += ctx->getWireDelay(next_wire).avgDelay(); + if (!ctx->checkWireAvail(next_wire)) { if (!ripup) continue; @@ -226,7 +228,7 @@ struct Router : ctx(ctx), scores(scores), ripup(ripup), ripup_penalty(ripup_penalty) { std::unordered_map src_wires; - src_wires[src_wire] = 0; + src_wires[src_wire] = ctx->getWireDelay(src_wire).avgDelay(); route(src_wires, dst_wire); routedOkay = visited.count(dst_wire); @@ -284,7 +286,7 @@ struct Router log(" Source wire: %s\n", ctx->getWireName(src_wire).c_str(ctx)); std::unordered_map src_wires; - src_wires[src_wire] = 0; + src_wires[src_wire] = ctx->getWireDelay(src_wire).avgDelay(); ripup_net(ctx, net_name); ctx->bindWire(src_wire, net_name, STRENGTH_WEAK); diff --git a/ecp5/arch.h b/ecp5/arch.h index 944aedea..bf36ef2f 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -578,6 +578,12 @@ struct Arch : BaseCtx return wire_to_net.at(wire); } + DelayInfo getWireDelay(WireId wire) const + { + DelayInfo delay; + return delay; + } + WireRange getWires() const { WireRange range; diff --git a/generic/arch.h b/generic/arch.h index ea4bb565..e1516569 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -157,6 +157,7 @@ struct Arch : BaseCtx bool checkWireAvail(WireId wire) const; IdString getBoundWireNet(WireId wire) const; IdString getConflictingWireNet(WireId wire) const; + DelayInfo getWireDelay(WireId wire) const { return DelayInfo(); } const std::vector &getWires() const; PipId getPipByName(IdString name) const; diff --git a/ice40/arch.h b/ice40/arch.h index beba2ccf..21169298 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -548,6 +548,12 @@ struct Arch : BaseCtx return wire_to_net[wire.index]; } + DelayInfo getWireDelay(WireId wire) const + { + DelayInfo delay; + return delay; + } + WireRange getWires() const { WireRange range; -- cgit v1.2.3