aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/place_legaliser.cc
diff options
context:
space:
mode:
authorEddie Hung <e.hung@imperial.ac.uk>2018-07-24 21:21:11 -0700
committerEddie Hung <e.hung@imperial.ac.uk>2018-07-24 21:21:11 -0700
commit879f0d7c574147cabd82a4db013622c65674e528 (patch)
tree03bce28389b9ed71e2e5f3776ada74055b7de242 /ice40/place_legaliser.cc
parent32c7247785f48b2307e559a0af50d9387bda8b49 (diff)
downloadnextpnr-879f0d7c574147cabd82a4db013622c65674e528.tar.gz
nextpnr-879f0d7c574147cabd82a4db013622c65674e528.tar.bz2
nextpnr-879f0d7c574147cabd82a4db013622c65674e528.zip
Reduce id() lookups for commonly used update_budget()
Diffstat (limited to 'ice40/place_legaliser.cc')
-rw-r--r--ice40/place_legaliser.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/ice40/place_legaliser.cc b/ice40/place_legaliser.cc
index ebc2b865..9fde179d 100644
--- a/ice40/place_legaliser.cc
+++ b/ice40/place_legaliser.cc
@@ -90,21 +90,20 @@ static int get_cell_evilness(const Context *ctx, const CellInfo *cell)
// This returns how "evil" a logic cell is, and thus how likely it is to be ripped up
// during logic tile legalisation
int score = 0;
- if (get_net_or_empty(cell, ctx->id("I0")))
+ if (get_net_or_empty(cell, ctx->id_i0))
++score;
- if (get_net_or_empty(cell, ctx->id("I1")))
+ if (get_net_or_empty(cell, ctx->id_i1))
++score;
- if (get_net_or_empty(cell, ctx->id("I2")))
+ if (get_net_or_empty(cell, ctx->id_i2))
++score;
- if (get_net_or_empty(cell, ctx->id("I3")))
+ if (get_net_or_empty(cell, ctx->id_i3))
++score;
- if (bool_or_default(cell->params, ctx->id("DFF_ENABLE"))) {
- const NetInfo *cen = get_net_or_empty(cell, ctx->id("CEN")), *sr = get_net_or_empty(cell, ctx->id("SR"));
- if (cen)
+ if (cell->lcInfo.dffEnable) {
+ if (cell->lcInfo.cen)
score += 10;
- if (sr)
+ if (cell->lcInfo.sr)
score += 10;
- if (bool_or_default(cell->params, ctx->id("NEG_CLK")))
+ if (cell->lcInfo.negClk)
score += 5;
}
return score;