From 4359197dfe49f981966222679d8270b0d4dc311d Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 24 Jul 2018 11:21:10 +0200 Subject: [PATCH] ice40: Trim BRAM constant inputs, reduces routing congestion around BRAM Signed-off-by: David Shah --- ice40/pack.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ice40/pack.cc b/ice40/pack.cc index 7e2e389c..164fa756 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -311,6 +311,9 @@ static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constne (user.port != ctx->id("CLK") && ((constval && user.port == ctx->id("CE")) || (!constval && user.port != ctx->id("CE"))))) { uc->ports[user.port].net = nullptr; + } else if (is_ram(ctx, uc) && !constval && user.port != ctx->id("RCLK") && user.port != ctx->id("RCLKN") && user.port != ctx->id("WCLK") && user.port != ctx->id("WCLKN") + && user.port != ctx->id("RCLKE") && user.port != ctx->id("WCLKE")) { + uc->ports[user.port].net = nullptr; } else { uc->ports[user.port].net = constnet; constnet->users.push_back(user);