generic: Don't assume unused LUT inputs are zero
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
89e15d488a
commit
f57c2bcebb
@ -158,7 +158,8 @@ static void pack_constants(Context *ctx)
|
|||||||
gnd_cell->ports.at(ctx->id("F")).net = gnd_net.get();
|
gnd_cell->ports.at(ctx->id("F")).net = gnd_net.get();
|
||||||
|
|
||||||
std::unique_ptr<CellInfo> vcc_cell = create_generic_cell(ctx, ctx->id("GENERIC_SLICE"), "$PACKER_VCC");
|
std::unique_ptr<CellInfo> vcc_cell = create_generic_cell(ctx, ctx->id("GENERIC_SLICE"), "$PACKER_VCC");
|
||||||
vcc_cell->params[ctx->id("INIT")] = 1;
|
// Fill with 1s
|
||||||
|
vcc_cell->params[ctx->id("INIT")] = Property(Property::S1).extract(0, (1 << ctx->args.K), Property::S1);
|
||||||
std::unique_ptr<NetInfo> vcc_net = std::unique_ptr<NetInfo>(new NetInfo);
|
std::unique_ptr<NetInfo> vcc_net = std::unique_ptr<NetInfo>(new NetInfo);
|
||||||
vcc_net->name = ctx->id("$PACKER_VCC_NET");
|
vcc_net->name = ctx->id("$PACKER_VCC_NET");
|
||||||
vcc_net->driver.cell = vcc_cell.get();
|
vcc_net->driver.cell = vcc_cell.get();
|
||||||
|
@ -4,7 +4,9 @@ module \$lut (A, Y);
|
|||||||
input [WIDTH-1:0] A;
|
input [WIDTH-1:0] A;
|
||||||
output Y;
|
output Y;
|
||||||
|
|
||||||
LUT #(.K(`LUT_K), .INIT(LUT)) _TECHMAP_REPLACE_ (.I(A), .Q(Y));
|
localparam rep = 1<<(`LUT_K-WIDTH);
|
||||||
|
|
||||||
|
LUT #(.K(`LUT_K), .INIT({rep{LUT}})) _TECHMAP_REPLACE_ (.I(A), .Q(Y));
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
module \$_DFF_P_ (input D, C, output Q); DFF _TECHMAP_REPLACE_ (.D(D), .Q(Q), .CLK(C)); endmodule
|
module \$_DFF_P_ (input D, C, output Q); DFF _TECHMAP_REPLACE_ (.D(D), .Q(Q), .CLK(C)); endmodule
|
||||||
|
Loading…
Reference in New Issue
Block a user