diff options
author | David Shah <davey1576@gmail.com> | 2018-07-18 12:12:05 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-07-18 12:12:05 +0200 |
commit | c75a924c3f9dba4fd7d5c4e9674b29f7869a4e52 (patch) | |
tree | 526dc36005efb9bc1ec8b03b58f5b82aa3470f8b /ice40/pack.cc | |
parent | 74cbaa5b83518d1743ae0a8fd335e7be1afb4f54 (diff) | |
download | nextpnr-c75a924c3f9dba4fd7d5c4e9674b29f7869a4e52.tar.gz nextpnr-c75a924c3f9dba4fd7d5c4e9674b29f7869a4e52.tar.bz2 nextpnr-c75a924c3f9dba4fd7d5c4e9674b29f7869a4e52.zip |
ice40: Assign ArchArgs after packing
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/pack.cc')
-rw-r--r-- | ice40/pack.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc index 76a52be0..e656e596 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -575,6 +575,36 @@ static void pack_special(Context *ctx) } } +// Assign arch arg info +static void assign_archargs(Context *ctx) +{ + for (auto &net : ctx->nets) { + NetInfo *ni = net.second.get(); + if (ctx->isGlobalNet(ni)) + ni->is_global = true; + } + for (auto &cell : ctx->cells) { + CellInfo *ci = cell.second.get(); + ci->belType = ctx->belTypeFromId(ci->type); + if (is_lc(ctx, ci)) { + ci->lcInfo.dffEnable = bool_or_default(ci->params, ctx->id("DFF_ENABLE")); + ci->lcInfo.negClk = bool_or_default(ci->params, ctx->id("NEG_CLK")); + ci->lcInfo.clk = get_net_or_empty(ci, ctx->id("CLK")); + ci->lcInfo.cen = get_net_or_empty(ci, ctx->id("CEN")); + ci->lcInfo.sr = get_net_or_empty(ci, ctx->id("SR")); + ci->lcInfo.inputCount = 0; + if (get_net_or_empty(ci, ctx->id("I0"))) + ci->lcInfo.inputCount++; + if (get_net_or_empty(ci, ctx->id("I1"))) + ci->lcInfo.inputCount++; + if (get_net_or_empty(ci, ctx->id("I2"))) + ci->lcInfo.inputCount++; + if (get_net_or_empty(ci, ctx->id("I3"))) + ci->lcInfo.inputCount++; + } + } +} + // Main pack function bool Arch::pack() { @@ -589,6 +619,7 @@ bool Arch::pack() pack_carries(ctx); pack_ram(ctx); pack_special(ctx); + assign_archargs(ctx); log_info("Checksum: 0x%08x\n", ctx->checksum()); return true; } catch (log_execution_error_exception) { |