ice40: Trim DSP inputs that are constant where appropriate

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-07-19 14:32:30 +02:00
parent bff7d673ed
commit 79dc910b40
2 changed files with 10 additions and 2 deletions

View File

@ -52,7 +52,11 @@ typedef IdString PipId;
typedef IdString GroupId;
typedef IdString DecalId;
struct ArchNetInfo { };
struct ArchCellInfo { };
struct ArchNetInfo
{
};
struct ArchCellInfo
{
};
NEXTPNR_NAMESPACE_END

View File

@ -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);