From 9218d2e56b5d06a57f80e7270b1538d134f8a6fa Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 30 Sep 2018 17:42:47 +0100 Subject: ecp5: Relative placement and bitstream gen for carries Signed-off-by: David Shah --- ecp5/pack.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'ecp5/pack.cc') diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 7a7e0dda..2f84cd02 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -532,6 +532,21 @@ class Ecp5Packer cell_count++; } } + + // Relative chain placement + for (auto &chain : all_chains) { + chain.cells.at(0)->constr_abs_z = true; + chain.cells.at(0)->constr_z = 0; + for (int i = 1; i < int(chain.cells.size()); i++) { + chain.cells.at(i)->constr_x = (i / 4); + chain.cells.at(i)->constr_y = 0; + chain.cells.at(i)->constr_z = i % 4; + chain.cells.at(i)->constr_abs_z = true; + chain.cells.at(i)->constr_parent = chain.cells.at(0); + chain.cells.at(0)->constr_children.push_back(chain.cells.at(i)); + } + } + flush_cells(); } @@ -650,6 +665,10 @@ class Ecp5Packer } else if (is_ff(ctx, uc) && user.port == ctx->id("CE")) { uc->params[ctx->id("CEMUX")] = constval ? "1" : "0"; uc->ports[user.port].net = nullptr; + } else if (is_carry(ctx, uc) && constval && + (user.port == id_A0 || user.port == id_A1 || user.port == id_B0 || user.port == id_B1 || + user.port == id_C0 || user.port == id_C1 || user.port == id_D0 || user.port == id_D1)) { + uc->ports[user.port].net = nullptr; } else if (is_ff(ctx, uc) && user.port == ctx->id("LSR") && ((!constval && str_or_default(uc->params, ctx->id("LSRMUX"), "LSR") == "LSR") || (constval && str_or_default(uc->params, ctx->id("LSRMUX"), "LSR") == "INV"))) { @@ -724,6 +743,7 @@ class Ecp5Packer { pack_io(); pack_constants(); + pack_carries(); find_lutff_pairs(); pack_lut5s(); pair_luts(); -- cgit v1.2.3