From 27a9850921c73f7d6605fd70b868ee8f1769fd13 Mon Sep 17 00:00:00 2001 From: David Shah Date: Thu, 28 Jun 2018 15:48:57 +0200 Subject: Debugging carry legalisation Signed-off-by: David Shah --- ice40/place_legaliser.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ice40/place_legaliser.cc b/ice40/place_legaliser.cc index aeef47a1..1292d094 100644 --- a/ice40/place_legaliser.cc +++ b/ice40/place_legaliser.cc @@ -128,15 +128,20 @@ class PlacementLegaliser bool legalise_carries() { std::vector carry_chains = find_chains( - ctx, is_lc, + ctx, [](const Context *ctx, const CellInfo *cell) { + return is_lc(ctx, cell); + }, + [](const Context *ctx, const + + CellInfo *cell) { CellInfo *carry_prev = net_driven_by(ctx, cell->ports.at(ctx->id("CIN")).net, is_lc, ctx->id("COUT")); if (carry_prev != nullptr) return carry_prev; - CellInfo *i3_prev = net_driven_by(ctx, cell->ports.at(ctx->id("I3")).net, is_lc, ctx->id("COUT")); + /*CellInfo *i3_prev = net_driven_by(ctx, cell->ports.at(ctx->id("I3")).net, is_lc, ctx->id("COUT")); if (i3_prev != nullptr) - return i3_prev; + return i3_prev;*/ return (CellInfo *)nullptr; }, [](const Context *ctx, const CellInfo *cell) { @@ -144,10 +149,10 @@ class PlacementLegaliser net_only_drives(ctx, cell->ports.at(ctx->id("COUT")).net, is_lc, ctx->id("CIN"), false); if (carry_next != nullptr) return carry_next; - CellInfo *i3_next = + /*CellInfo *i3_next = net_only_drives(ctx, cell->ports.at(ctx->id("COUT")).net, is_lc, ctx->id("I3"), false); if (i3_next != nullptr) - return i3_next; + return i3_next;*/ return (CellInfo *)nullptr; }); bool success = true; -- cgit v1.2.3