DFF input can be constant
This commit is contained in:
parent
a2e5ded5a6
commit
1adda174de
@ -128,7 +128,6 @@ void updateSR_INV(Context *ctx, CellInfo *cell, IdString port, IdString param)
|
|||||||
|
|
||||||
void updateMUX_INV(Context *ctx, CellInfo *cell, IdString port, IdString param, int bit)
|
void updateMUX_INV(Context *ctx, CellInfo *cell, IdString port, IdString param, int bit)
|
||||||
{
|
{
|
||||||
if (cell->params.count(param) == 0) return;
|
|
||||||
unsigned init_val = int_or_default(cell->params, param);
|
unsigned init_val = int_or_default(cell->params, param);
|
||||||
WireId pin_wire = ctx->getBelPinWire(cell->bel, port);
|
WireId pin_wire = ctx->getBelPinWire(cell->bel, port);
|
||||||
for (PipId pip : ctx->getPipsUphill(pin_wire)) {
|
for (PipId pip : ctx->getPipsUphill(pin_wire)) {
|
||||||
|
@ -358,12 +358,21 @@ void GateMatePacker::pack_cpe()
|
|||||||
CellInfo &ci = *cell.second;
|
CellInfo &ci = *cell.second;
|
||||||
if (!ci.type.in(id_CC_DFF))
|
if (!ci.type.in(id_CC_DFF))
|
||||||
continue;
|
continue;
|
||||||
ci.renamePort(id_D, id_IN1);
|
|
||||||
ci.renamePort(id_Q, id_OUT2);
|
ci.renamePort(id_Q, id_OUT2);
|
||||||
ci.params[id_O2] = Property(0b00, 2);
|
ci.params[id_O2] = Property(0b00, 2);
|
||||||
ci.params[id_2D_IN] = Property(1, 1);
|
ci.params[id_2D_IN] = Property(1, 1);
|
||||||
ci.params[id_INIT_L00] = Property(0b1010, 4);
|
NetInfo *d_net = ci.getPort(id_D);
|
||||||
|
if (d_net->name == ctx->id("$PACKER_GND")) {
|
||||||
|
ci.params[id_INIT_L00] = Property(0b0000, 4);
|
||||||
|
ci.disconnectPort(id_D);
|
||||||
|
} else if (d_net->name == ctx->id("$PACKER_VCC")) {
|
||||||
|
ci.params[id_INIT_L00] = Property(0b1111, 4);
|
||||||
|
ci.disconnectPort(id_D);
|
||||||
|
} else {
|
||||||
|
ci.params[id_INIT_L00] = Property(0b1010, 4);
|
||||||
|
}
|
||||||
ci.params[id_INIT_L10] = Property(0b1010, 4);
|
ci.params[id_INIT_L10] = Property(0b1010, 4);
|
||||||
|
ci.renamePort(id_D, id_IN1);
|
||||||
|
|
||||||
NetInfo *en_net = ci.getPort(id_EN);
|
NetInfo *en_net = ci.getPort(id_EN);
|
||||||
bool invert = int_or_default(ci.params, id_EN_INV, 0) == 1;
|
bool invert = int_or_default(ci.params, id_EN_INV, 0) == 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user