From 926c186ec78efb086364a05ba7e83e68fa116301 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Sat, 21 Jul 2018 13:05:09 -0700 Subject: Add Arch::getBudgetOverride() to eliminate hack for COUT --- ice40/arch.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ice40/arch.cc') diff --git a/ice40/arch.cc b/ice40/arch.cc index e9a7d2b6..fa0fd153 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -488,6 +488,12 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return xscale * abs(xd) + yscale * abs(yd) + offset; } +delay_t Arch::getBudgetOverride(const PortRef& pr, delay_t v) const +{ + if (pr.port == id("COUT")) return 0; + return v; +} + // ----------------------------------------------------------------------- bool Arch::place() { return placer1(getCtx()); } -- cgit v1.2.3 From e2f8deec41a0ca00ba2752322c46fabbb282d0dc Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 25 Jul 2018 18:22:23 -0700 Subject: clangformat --- ice40/arch.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ice40/arch.cc') diff --git a/ice40/arch.cc b/ice40/arch.cc index daf0c78b..2892ad8c 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -495,9 +495,10 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return xscale * abs(xd) + yscale * abs(yd) + offset; } -delay_t Arch::getBudgetOverride(const PortRef& pr, delay_t v) const +delay_t Arch::getBudgetOverride(const PortRef &pr, delay_t v) const { - if (pr.port == id("COUT")) return 0; + if (pr.port == id("COUT")) + return 0; return v; } -- cgit v1.2.3 From 749dae4ae5b2b719237af5db28e98ff671bae265 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 25 Jul 2018 23:02:31 -0700 Subject: Remove Arch::getBudgetOverride() --- ice40/arch.cc | 7 ------- 1 file changed, 7 deletions(-) (limited to 'ice40/arch.cc') diff --git a/ice40/arch.cc b/ice40/arch.cc index 2892ad8c..dedc59bc 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -495,13 +495,6 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return xscale * abs(xd) + yscale * abs(yd) + offset; } -delay_t Arch::getBudgetOverride(const PortRef &pr, delay_t v) const -{ - if (pr.port == id("COUT")) - return 0; - return v; -} - // ----------------------------------------------------------------------- bool Arch::place() { return placer1(getCtx()); } -- cgit v1.2.3 From 97e546041e109fdade1099b056c7166578314846 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 26 Jul 2018 21:37:19 -0700 Subject: Revert "Remove Arch::getBudgetOverride()" This reverts commit 749dae4ae5b2b719237af5db28e98ff671bae265. --- ice40/arch.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ice40/arch.cc') diff --git a/ice40/arch.cc b/ice40/arch.cc index 3803f842..fec35a0f 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -587,6 +587,13 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return xscale * abs(xd) + yscale * abs(yd) + offset; } +delay_t Arch::getBudgetOverride(const PortRef &pr, delay_t v) const +{ + if (pr.port == id("COUT")) + return 0; + return v; +} + // ----------------------------------------------------------------------- bool Arch::place() { return placer1(getCtx()); } -- cgit v1.2.3 From cd561b4316edeed72d468a28197c4b05c2cde85f Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 26 Jul 2018 22:30:15 -0700 Subject: getBudgetOverride() now handles COUT crossing tiles --- ice40/arch.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'ice40/arch.cc') diff --git a/ice40/arch.cc b/ice40/arch.cc index fec35a0f..4e9baf7e 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -587,11 +587,18 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return xscale * abs(xd) + yscale * abs(yd) + offset; } -delay_t Arch::getBudgetOverride(const PortRef &pr, delay_t v) const -{ - if (pr.port == id("COUT")) - return 0; - return v; +delay_t Arch::getBudgetOverride(NetInfo *net_info, int user_idx, delay_t budget) const +{ + const auto& driver = net_info->driver; + if (driver.port == id_cout) { + const auto& sink = net_info->users[user_idx]; + auto driver_loc = getBelLocation(driver.cell->bel); + auto sink_loc = getBelLocation(sink.cell->bel); + if (driver_loc.y == sink_loc.y) + return 0; + return 250; + } + return budget; } // ----------------------------------------------------------------------- -- cgit v1.2.3 From 02b3bda7f6ecec2e6896e46b03938871c236a52d Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 27 Jul 2018 19:52:45 -0700 Subject: ice40 estimateDelay to account for out/in muxes --- ice40/arch.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ice40/arch.cc') diff --git a/ice40/arch.cc b/ice40/arch.cc index 4e9baf7e..cfafa2d8 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -584,6 +584,22 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const // offset = 500; // } + // Estimate for output mux + for (const auto& bp : getWireBelPins(src)) { + if (bp.pin == PIN_O && getBelType(bp.bel) == TYPE_ICESTORM_LC) { + offset += 330; + break; + } + } + + // Estimate for input mux + for (const auto& bp : getWireBelPins(dst)) { + if ((bp.pin == PIN_I0 || bp.pin == PIN_I1 || bp.pin == PIN_I2 || bp.pin == PIN_I3) && getBelType(bp.bel) == TYPE_ICESTORM_LC) { + offset += 260; + break; + } + } + return xscale * abs(xd) + yscale * abs(yd) + offset; } -- cgit v1.2.3 From beabb429b0be91c597cb2a9f7726a159a6f40b32 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Sat, 28 Jul 2018 14:11:43 -0700 Subject: clangformat --- ice40/arch.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ice40/arch.cc') diff --git a/ice40/arch.cc b/ice40/arch.cc index cfafa2d8..2ca8b665 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -585,7 +585,7 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const // } // Estimate for output mux - for (const auto& bp : getWireBelPins(src)) { + for (const auto &bp : getWireBelPins(src)) { if (bp.pin == PIN_O && getBelType(bp.bel) == TYPE_ICESTORM_LC) { offset += 330; break; @@ -593,8 +593,9 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const } // Estimate for input mux - for (const auto& bp : getWireBelPins(dst)) { - if ((bp.pin == PIN_I0 || bp.pin == PIN_I1 || bp.pin == PIN_I2 || bp.pin == PIN_I3) && getBelType(bp.bel) == TYPE_ICESTORM_LC) { + for (const auto &bp : getWireBelPins(dst)) { + if ((bp.pin == PIN_I0 || bp.pin == PIN_I1 || bp.pin == PIN_I2 || bp.pin == PIN_I3) && + getBelType(bp.bel) == TYPE_ICESTORM_LC) { offset += 260; break; } @@ -605,9 +606,9 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const delay_t Arch::getBudgetOverride(NetInfo *net_info, int user_idx, delay_t budget) const { - const auto& driver = net_info->driver; + const auto &driver = net_info->driver; if (driver.port == id_cout) { - const auto& sink = net_info->users[user_idx]; + const auto &sink = net_info->users[user_idx]; auto driver_loc = getBelLocation(driver.cell->bel); auto sink_loc = getBelLocation(sink.cell->bel); if (driver_loc.y == sink_loc.y) -- cgit v1.2.3