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 ++++++ ice40/arch.h | 1 + 2 files changed, 7 insertions(+) (limited to 'ice40') 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()); } diff --git a/ice40/arch.h b/ice40/arch.h index 21169298..1349365c 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -701,6 +701,7 @@ struct Arch : BaseCtx delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } uint32_t getDelayChecksum(delay_t v) const { return v; } + delay_t getBudgetOverride(const PortRef& pr, delay_t v) const; // ------------------------------------------------- -- cgit v1.2.3 From c71212d0e148b0b2ee136a951f5d707cc8822bda Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 24 Jul 2018 23:19:24 -0700 Subject: If --freq not set, attempt to find max by adjusting budget so min path slack == 0 --- ice40/main.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ice40') diff --git a/ice40/main.cc b/ice40/main.cc index 4de05d00..a893921b 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -365,8 +365,13 @@ int main(int argc, char *argv[]) } } - if (vm.count("freq")) + if (vm.count("freq")) { ctx->target_freq = vm["freq"].as() * 1e6; + ctx->user_freq = true; + } + else { + log_warning("Target frequency not specified. Will optimise for max frequency.\n"); + } ctx->timing_driven = true; if (vm.count("no-tmdriv")) -- 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 +++-- ice40/arch.h | 2 +- ice40/main.cc | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'ice40') 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; } diff --git a/ice40/arch.h b/ice40/arch.h index a9392f6d..eee99ffe 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -684,7 +684,7 @@ struct Arch : BaseCtx delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } uint32_t getDelayChecksum(delay_t v) const { return v; } - delay_t getBudgetOverride(const PortRef& pr, delay_t v) const; + delay_t getBudgetOverride(const PortRef &pr, delay_t v) const; // ------------------------------------------------- diff --git a/ice40/main.cc b/ice40/main.cc index 5b658288..2560387b 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -366,8 +366,7 @@ int main(int argc, char *argv[]) if (vm.count("freq")) { ctx->target_freq = vm["freq"].as() * 1e6; ctx->user_freq = true; - } - else { + } else { log_warning("Target frequency not specified. Will optimise for max frequency.\n"); } -- 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 ------- ice40/arch.h | 1 - 2 files changed, 8 deletions(-) (limited to 'ice40') 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()); } diff --git a/ice40/arch.h b/ice40/arch.h index eee99ffe..123b408c 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -684,7 +684,6 @@ struct Arch : BaseCtx delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } uint32_t getDelayChecksum(delay_t v) const { return v; } - delay_t getBudgetOverride(const PortRef &pr, delay_t v) const; // ------------------------------------------------- -- 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 +++++++ ice40/arch.h | 1 + 2 files changed, 8 insertions(+) (limited to 'ice40') 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()); } diff --git a/ice40/arch.h b/ice40/arch.h index 51cbe725..048a9053 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -688,6 +688,7 @@ struct Arch : BaseCtx delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } uint32_t getDelayChecksum(delay_t v) const { return v; } + delay_t getBudgetOverride(const PortRef &pr, delay_t v) const; // ------------------------------------------------- -- 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 ++++++++++++----- ice40/arch.h | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'ice40') 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; } // ----------------------------------------------------------------------- diff --git a/ice40/arch.h b/ice40/arch.h index 048a9053..e2d14e3c 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -688,7 +688,7 @@ struct Arch : BaseCtx delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } uint32_t getDelayChecksum(delay_t v) const { return v; } - delay_t getBudgetOverride(const PortRef &pr, delay_t v) const; + delay_t getBudgetOverride(NetInfo *net_info, int user_idx, delay_t budget) const; // ------------------------------------------------- -- 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') 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') 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