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 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 --- ice40/arch.cc | 16 ++++++++++++++++ ice40/arch.h | 1 + 2 files changed, 17 insertions(+) (limited to 'ice40') diff --git a/ice40/arch.cc b/ice40/arch.cc index 3803f842..91c20b42 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -579,6 +579,22 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const int xd = x2 - x1, yd = y2 - y1; int xscale = 120, yscale = 120, offset = 0; + return xscale * abs(xd) + yscale * abs(yd) + offset; +} + +delay_t Arch::predictDelay(WireId src, WireId dst) const +{ + NPNR_ASSERT(src != WireId()); + int x1 = chip_info->wire_data[src.index].x; + int y1 = chip_info->wire_data[src.index].y; + + NPNR_ASSERT(dst != WireId()); + int x2 = chip_info->wire_data[dst.index].x; + int y2 = chip_info->wire_data[dst.index].y; + + int xd = x2 - x1, yd = y2 - y1; + int xscale = 120, yscale = 120, offset = 0; + // if (chip_info->wire_data[src.index].type == WIRE_TYPE_SP4_VERT) { // yd = yd < -4 ? yd + 4 : (yd < 0 ? 0 : yd); // offset = 500; diff --git a/ice40/arch.h b/ice40/arch.h index 51cbe725..1725d181 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -684,6 +684,7 @@ struct Arch : BaseCtx // ------------------------------------------------- delay_t estimateDelay(WireId src, WireId dst) const; + delay_t predictDelay(WireId src, WireId dst) const; delay_t getDelayEpsilon() const { return 20; } delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } -- 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 --- ice40/arch.cc | 41 ++++++++++++----------------------------- ice40/arch.h | 2 +- 2 files changed, 13 insertions(+), 30 deletions(-) (limited to 'ice40') diff --git a/ice40/arch.cc b/ice40/arch.cc index 4b28564a..76ce6a39 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -587,40 +587,23 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return xscale * abs(xd) + yscale * abs(yd) + offset; } -delay_t Arch::predictDelay(WireId src, WireId dst) const +delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const { - NPNR_ASSERT(src != WireId()); - int x1 = chip_info->wire_data[src.index].x; - int y1 = chip_info->wire_data[src.index].y; + const auto& driver = net_info->driver; + auto driver_loc = getBelLocation(driver.cell->bel); + auto sink_loc = getBelLocation(sink.cell->bel); - NPNR_ASSERT(dst != WireId()); - int x2 = chip_info->wire_data[dst.index].x; - int y2 = chip_info->wire_data[dst.index].y; + if (driver.port == id_cout) { + if (driver_loc.y == sink_loc.y) + return 0; + return 250; + } - int xd = x2 - x1, yd = y2 - y1; + int xd = sink_loc.x - driver_loc.x, yd = sink_loc.y - driver_loc.y; int xscale = 120, yscale = 120, offset = 0; - // if (chip_info->wire_data[src.index].type == WIRE_TYPE_SP4_VERT) { - // yd = yd < -4 ? yd + 4 : (yd < 0 ? 0 : yd); - // 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; - } - } + if (driver.port == id_o) offset += 330; + if (sink.port == id_i0 || sink.port == id_i1 || sink.port == id_i2 || sink.port == id_i3) offset += 260; return xscale * abs(xd) + yscale * abs(yd) + offset; } diff --git a/ice40/arch.h b/ice40/arch.h index c2768efe..a4d148e5 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -697,7 +697,7 @@ struct Arch : BaseCtx // ------------------------------------------------- delay_t estimateDelay(WireId src, WireId dst) const; - delay_t predictDelay(WireId src, WireId dst) const; + delay_t predictDelay(const NetInfo *net_info, const PortRef &sink) const; delay_t getDelayEpsilon() const { return 20; } delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } -- cgit v1.2.3 From a82f6f410595de26e82eaf4818e41036f0bc2f9c Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 30 Jul 2018 19:19:30 -0700 Subject: Modify predictDelay signature --- ice40/arch.cc | 21 +++++++++++++-------- ice40/arch.h | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'ice40') diff --git a/ice40/arch.cc b/ice40/arch.cc index 91c20b42..107bf56a 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -582,17 +582,19 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return xscale * abs(xd) + yscale * abs(yd) + offset; } -delay_t Arch::predictDelay(WireId src, WireId dst) const +delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const { - NPNR_ASSERT(src != WireId()); - int x1 = chip_info->wire_data[src.index].x; - int y1 = chip_info->wire_data[src.index].y; + const auto& driver = net_info->driver; + auto driver_loc = getBelLocation(driver.cell->bel); + auto sink_loc = getBelLocation(sink.cell->bel); - NPNR_ASSERT(dst != WireId()); - int x2 = chip_info->wire_data[dst.index].x; - int y2 = chip_info->wire_data[dst.index].y; + if (driver.port == id_cout) { + if (driver_loc.y == sink_loc.y) + return 0; + return 250; + } - int xd = x2 - x1, yd = y2 - y1; + int xd = sink_loc.x - driver_loc.x, yd = sink_loc.y - driver_loc.y; int xscale = 120, yscale = 120, offset = 0; // if (chip_info->wire_data[src.index].type == WIRE_TYPE_SP4_VERT) { @@ -600,6 +602,9 @@ delay_t Arch::predictDelay(WireId src, WireId dst) const // offset = 500; // } + if (driver.port == id_o) offset += 330; + if (sink.port == id_i0 || sink.port == id_i1 || sink.port == id_i2 || sink.port == id_i3) offset += 260; + return xscale * abs(xd) + yscale * abs(yd) + offset; } diff --git a/ice40/arch.h b/ice40/arch.h index 1725d181..57089ed7 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -684,7 +684,7 @@ struct Arch : BaseCtx // ------------------------------------------------- delay_t estimateDelay(WireId src, WireId dst) const; - delay_t predictDelay(WireId src, WireId dst) const; + delay_t predictDelay(const NetInfo *net_info, const PortRef &sink) const; delay_t getDelayEpsilon() const { return 20; } delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } -- cgit v1.2.3 From 07e2c9ba996d5429d7c820c4854ca8a83049d846 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 30 Jul 2018 22:20:49 -0700 Subject: assign_budget() after initial placement, not after pack --- ice40/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ice40') diff --git a/ice40/main.cc b/ice40/main.cc index 865eea9e..5c9678db 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -411,7 +411,7 @@ int main(int argc, char *argv[]) if (!ctx->pack() && !ctx->force) log_error("Packing design failed.\n"); - assign_budget(ctx.get()); + //assign_budget(ctx.get()); ctx->check(); print_utilisation(ctx.get()); if (!vm.count("pack-only")) { -- cgit v1.2.3 From 720e81586502f527cba7b9052b6bfed719c0b165 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 31 Jul 2018 19:07:39 -0700 Subject: Add --slack_redist_iter for ice40 --- ice40/main.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ice40') diff --git a/ice40/main.cc b/ice40/main.cc index 5c9678db..ab672ddc 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -105,6 +105,7 @@ int main(int argc, char *argv[]) options.add_options()("asc", po::value(), "asc bitstream file to write"); options.add_options()("read", po::value(), "asc bitstream file to read"); options.add_options()("seed", po::value(), "seed value for random number generator"); + options.add_options()("slack_redist_iter", po::value(), "number of iterations between slack redistribution"); options.add_options()("version,V", "show version"); options.add_options()("tmfuzz", "run path delay estimate fuzzer"); options.add_options()("test", "check architecture database integrity"); @@ -302,6 +303,10 @@ int main(int argc, char *argv[]) ctx->rngseed(vm["seed"].as()); } + if (vm.count("slack_redist_iter")) { + ctx->slack_redist_iter = vm["slack_redist_iter"].as(); + } + if (vm.count("svg")) { std::cout << "\n"; @@ -411,7 +416,6 @@ int main(int argc, char *argv[]) if (!ctx->pack() && !ctx->force) log_error("Packing design failed.\n"); - //assign_budget(ctx.get()); ctx->check(); print_utilisation(ctx.get()); if (!vm.count("pack-only")) { -- 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 --- ice40/arch.cc | 3 +-- ice40/arch.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'ice40') diff --git a/ice40/arch.cc b/ice40/arch.cc index bdfb13fe..18887a3c 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -642,11 +642,10 @@ delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const return xscale * abs(xd) + yscale * abs(yd) + offset; } -delay_t Arch::getBudgetOverride(NetInfo *net_info, int user_idx, delay_t budget) const +delay_t Arch::getBudgetOverride(const NetInfo *net_info, const PortRef& sink, 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) diff --git a/ice40/arch.h b/ice40/arch.h index 92698b4d..d813c038 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -702,7 +702,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(NetInfo *net_info, int user_idx, delay_t budget) const; + delay_t getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t budget) const; // ------------------------------------------------- -- 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 --- ice40/arch.cc | 26 ++++++++++++++------------ ice40/main.cc | 3 ++- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'ice40') diff --git a/ice40/arch.cc b/ice40/arch.cc index 18887a3c..5545ddf4 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -317,15 +317,15 @@ PortType Arch::getBelPinType(BelId bel, PortPin pin) const return PortType(bel_wires[i].type); } } else { - int b = 0, e = num_bel_wires-1; + int b = 0, e = num_bel_wires - 1; while (b <= e) { - int i = (b+e) / 2; + int i = (b + e) / 2; if (bel_wires[i].port == pin) return PortType(bel_wires[i].type); if (bel_wires[i].port > pin) - e = i-1; + e = i - 1; else - b = i+1; + b = i + 1; } } @@ -349,17 +349,17 @@ WireId Arch::getBelPinWire(BelId bel, PortPin pin) const } } } else { - int b = 0, e = num_bel_wires-1; + int b = 0, e = num_bel_wires - 1; while (b <= e) { - int i = (b+e) / 2; + int i = (b + e) / 2; if (bel_wires[i].port == pin) { ret.index = bel_wires[i].wire_index; break; } if (bel_wires[i].port > pin) - e = i-1; + e = i - 1; else - b = i+1; + b = i + 1; } } @@ -618,7 +618,7 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const { - const auto& driver = net_info->driver; + const auto &driver = net_info->driver; auto driver_loc = getBelLocation(driver.cell->bel); auto sink_loc = getBelLocation(sink.cell->bel); @@ -636,13 +636,15 @@ delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const // offset = 500; // } - if (driver.port == id_o) offset += 330; - if (sink.port == id_i0 || sink.port == id_i1 || sink.port == id_i2 || sink.port == id_i3) offset += 260; + if (driver.port == id_o) + offset += 330; + if (sink.port == id_i0 || sink.port == id_i1 || sink.port == id_i2 || sink.port == id_i3) + offset += 260; return xscale * abs(xd) + yscale * abs(yd) + offset; } -delay_t Arch::getBudgetOverride(const NetInfo *net_info, const PortRef& sink, delay_t budget) const +delay_t Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t budget) const { const auto &driver = net_info->driver; if (driver.port == id_cout) { diff --git a/ice40/main.cc b/ice40/main.cc index ab672ddc..2a0cded5 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -105,7 +105,8 @@ int main(int argc, char *argv[]) options.add_options()("asc", po::value(), "asc bitstream file to write"); options.add_options()("read", po::value(), "asc bitstream file to read"); options.add_options()("seed", po::value(), "seed value for random number generator"); - options.add_options()("slack_redist_iter", po::value(), "number of iterations between slack redistribution"); + options.add_options()("slack_redist_iter", po::value(), + "number of iterations between slack redistribution"); options.add_options()("version,V", "show version"); options.add_options()("tmfuzz", "run path delay estimate fuzzer"); options.add_options()("test", "check architecture database integrity"); -- cgit v1.2.3