From 0daffec2a0efdbea36201eeb5666d208a10d0226 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 30 Jul 2018 15:35:40 +0200 Subject: Add predictDelay Arch API Signed-off-by: Clifford Wolf --- common/nextpnr.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common/nextpnr.cc') diff --git a/common/nextpnr.cc b/common/nextpnr.cc index cf1b5982..5b0a45ed 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -93,7 +93,9 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const WireId src_wire = getNetinfoSourceWire(net_info); if (src_wire == WireId()) return 0; - WireId cursor = getNetinfoSinkWire(net_info, user_idx); + + WireId dst_wire = getNetinfoSinkWire(net_info, user_idx); + WireId cursor = dst_wire; delay_t delay = 0; while (cursor != WireId() && cursor != src_wire) { @@ -107,11 +109,9 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const } if (cursor == src_wire) - delay += getWireDelay(src_wire).maxDelay(); - else - delay += estimateDelay(src_wire, cursor); + return delay + getWireDelay(src_wire).maxDelay(); - return delay; + return predictDelay(src_wire, dst_wire); } static uint32_t xorshift32(uint32_t x) -- cgit v1.2.3 From a099aca3c203eeea6b6cd093f31089c2a0933927 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 30 Jul 2018 19:19:30 -0700 Subject: Modify predictDelay signature --- common/nextpnr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/nextpnr.cc') diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 5b0a45ed..4a97bd93 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -111,7 +111,7 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const if (cursor == src_wire) return delay + getWireDelay(src_wire).maxDelay(); - return predictDelay(src_wire, dst_wire); + return predictDelay(net_info, net_info->users[user_idx]); } static uint32_t xorshift32(uint32_t x) -- cgit v1.2.3 From f646ec790a79f29d6964f3b7e30088f044b4a4e9 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 31 Jul 2018 19:31:54 -0700 Subject: Modify the getNetinfo*() functions and getBudgetOverride() to not use user_idx and to take a PortRef& instead --- common/nextpnr.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'common/nextpnr.cc') diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 4a97bd93..4e15a594 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -51,7 +51,7 @@ void IdString::initialize_add(const BaseCtx *ctx, const char *s, int idx) ctx->idstring_idx_to_str->push_back(&insert_rc.first->first); } -WireId Context::getNetinfoSourceWire(NetInfo *net_info) const +WireId Context::getNetinfoSourceWire(const NetInfo *net_info) const { if (net_info->driver.cell == nullptr) return WireId(); @@ -70,9 +70,8 @@ WireId Context::getNetinfoSourceWire(NetInfo *net_info) const return getBelPinWire(src_bel, portPinFromId(driver_port)); } -WireId Context::getNetinfoSinkWire(NetInfo *net_info, int user_idx) const +WireId Context::getNetinfoSinkWire(const NetInfo *net_info, const PortRef& user_info) const { - auto &user_info = net_info->users[user_idx]; auto dst_bel = user_info.cell->bel; if (dst_bel == BelId()) @@ -88,13 +87,13 @@ WireId Context::getNetinfoSinkWire(NetInfo *net_info, int user_idx) const return getBelPinWire(dst_bel, portPinFromId(user_port)); } -delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const +delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef& user_info) const { WireId src_wire = getNetinfoSourceWire(net_info); if (src_wire == WireId()) return 0; - WireId dst_wire = getNetinfoSinkWire(net_info, user_idx); + WireId dst_wire = getNetinfoSinkWire(net_info, user_info); WireId cursor = dst_wire; delay_t delay = 0; @@ -111,7 +110,7 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const if (cursor == src_wire) return delay + getWireDelay(src_wire).maxDelay(); - return predictDelay(net_info, net_info->users[user_idx]); + return predictDelay(net_info, user_info); } static uint32_t xorshift32(uint32_t x) -- cgit v1.2.3 From 92ec2cd13825ef996ebf0d88246d975a19352800 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 31 Jul 2018 20:57:36 -0700 Subject: clangformat for stuff I've touched --- common/nextpnr.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/nextpnr.cc') diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 4e15a594..dbea26d8 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -70,7 +70,7 @@ WireId Context::getNetinfoSourceWire(const NetInfo *net_info) const return getBelPinWire(src_bel, portPinFromId(driver_port)); } -WireId Context::getNetinfoSinkWire(const NetInfo *net_info, const PortRef& user_info) const +WireId Context::getNetinfoSinkWire(const NetInfo *net_info, const PortRef &user_info) const { auto dst_bel = user_info.cell->bel; @@ -87,7 +87,7 @@ WireId Context::getNetinfoSinkWire(const NetInfo *net_info, const PortRef& user_ return getBelPinWire(dst_bel, portPinFromId(user_port)); } -delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef& user_info) const +delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef &user_info) const { WireId src_wire = getNetinfoSourceWire(net_info); if (src_wire == WireId()) -- cgit v1.2.3