aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-07-19 14:32:30 +0200
committerDavid Shah <davey1576@gmail.com>2018-07-19 14:32:30 +0200
commit79dc910b40b082c9d74d010557b7939fb18535fe (patch)
tree2c442484baa82bad58821887788485903a0f5e85
parentbff7d673eda60f1ff8a59fd49a9e57a9ba8fa393 (diff)
downloadnextpnr-79dc910b40b082c9d74d010557b7939fb18535fe.tar.gz
nextpnr-79dc910b40b082c9d74d010557b7939fb18535fe.tar.bz2
nextpnr-79dc910b40b082c9d74d010557b7939fb18535fe.zip
ice40: Trim DSP inputs that are constant where appropriate
Signed-off-by: David Shah <davey1576@gmail.com>
-rw-r--r--generic/archdefs.h8
-rw-r--r--ice40/pack.cc4
2 files changed, 10 insertions, 2 deletions
diff --git a/generic/archdefs.h b/generic/archdefs.h
index f5999776..06d4ec6e 100644
--- a/generic/archdefs.h
+++ b/generic/archdefs.h
@@ -52,7 +52,11 @@ typedef IdString PipId;
typedef IdString GroupId;
typedef IdString DecalId;
-struct ArchNetInfo { };
-struct ArchCellInfo { };
+struct ArchNetInfo
+{
+};
+struct ArchCellInfo
+{
+};
NEXTPNR_NAMESPACE_END
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 78df00f6..7e2e389c 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -307,6 +307,10 @@ static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constne
if ((is_lut(ctx, uc) || is_lc(ctx, uc) || is_carry(ctx, uc)) && (user.port.str(ctx).at(0) == 'I') &&
!constval) {
uc->ports[user.port].net = nullptr;
+ } else if ((is_sb_mac16(ctx, uc) || uc->type == ctx->id("ICESTORM_DSP")) &&
+ (user.port != ctx->id("CLK") &&
+ ((constval && user.port == ctx->id("CE")) || (!constval && user.port != ctx->id("CE"))))) {
+ uc->ports[user.port].net = nullptr;
} else {
uc->ports[user.port].net = constnet;
constnet->users.push_back(user);