diff options
author | David Shah <davey1576@gmail.com> | 2018-08-18 18:14:18 +0100 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-08-18 18:14:18 +0100 |
commit | b8206d71ca281f00b1c681d3f7bb532eb01e030c (patch) | |
tree | 20554e7420076e901df77eb8dd9bccacd6dd5c99 /ecp5/pack.cc | |
parent | 5fe29922fd15af87cd260a561e88ac2e5b27203d (diff) | |
download | nextpnr-b8206d71ca281f00b1c681d3f7bb532eb01e030c.tar.gz nextpnr-b8206d71ca281f00b1c681d3f7bb532eb01e030c.tar.bz2 nextpnr-b8206d71ca281f00b1c681d3f7bb532eb01e030c.zip |
ecp5: Speedup placement using ArchCellInfo
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5/pack.cc')
-rw-r--r-- | ecp5/pack.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 786f543e..a2077204 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -536,10 +536,34 @@ bool Arch::pack() log_break(); Ecp5Packer(ctx).pack(); log_info("Checksum: 0x%08x\n", ctx->checksum()); + assignArchInfo(); return true; } catch (log_execution_error_exception) { + assignArchInfo(); return false; } } +void Arch::assignArchInfo() +{ + for (auto cell : sorted(cells)) { + CellInfo *ci = cell.second; + if (ci->type == id_TRELLIS_SLICE) { + if (ci->ports.count(id_CLK) && ci->ports[id_CLK].net != nullptr) + ci->sliceInfo.clk_sig = ci->ports[id_CLK].net->name; + else + ci->sliceInfo.clk_sig = IdString(); + + if (ci->ports.count(id_LSR) && ci->ports[id_LSR].net != nullptr) + ci->sliceInfo.lsr_sig = ci->ports[id_LSR].net->name; + else + ci->sliceInfo.lsr_sig = IdString(); + + ci->sliceInfo.clkmux = id(str_or_default(ci->params, id_CLKMUX, "CLK")); + ci->sliceInfo.lsrmux = id(str_or_default(ci->params, id_LSRMUX, "LSR")); + ci->sliceInfo.srmode = id(str_or_default(ci->params, id_SRMODE, "LSR_OVER_CE")); + } + } +} + NEXTPNR_NAMESPACE_END |