diff options
Diffstat (limited to 'gowin/pack.cc')
-rw-r--r-- | gowin/pack.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gowin/pack.cc b/gowin/pack.cc index 9f0a2478..28370a75 100644 --- a/gowin/pack.cc +++ b/gowin/pack.cc @@ -611,20 +611,17 @@ static void pack_constants(Context *ctx) { log_info("Packing constants..\n"); - std::unique_ptr<CellInfo> gnd_cell = create_generic_cell(ctx, id_SLICE, "$PACKER_GND"); - gnd_cell->params[id_INIT] = Property(0, 1 << 4); + std::unique_ptr<CellInfo> gnd_cell = create_generic_cell(ctx, id_GND, "$PACKER_GND"); auto gnd_net = std::make_unique<NetInfo>(ctx->id("$PACKER_GND_NET")); gnd_net->driver.cell = gnd_cell.get(); - gnd_net->driver.port = id_F; - gnd_cell->ports.at(id_F).net = gnd_net.get(); + gnd_net->driver.port = id_G; + gnd_cell->ports.at(id_G).net = gnd_net.get(); - std::unique_ptr<CellInfo> vcc_cell = create_generic_cell(ctx, id_SLICE, "$PACKER_VCC"); - // Fill with 1s - vcc_cell->params[id_INIT] = Property(Property::S1).extract(0, (1 << 4), Property::S1); + std::unique_ptr<CellInfo> vcc_cell = create_generic_cell(ctx, id_VCC, "$PACKER_VCC"); auto vcc_net = std::make_unique<NetInfo>(ctx->id("$PACKER_VCC_NET")); vcc_net->driver.cell = vcc_cell.get(); - vcc_net->driver.port = id_F; - vcc_cell->ports.at(id_F).net = vcc_net.get(); + vcc_net->driver.port = id_V; + vcc_cell->ports.at(id_V).net = vcc_net.get(); std::vector<IdString> dead_nets; @@ -801,6 +798,13 @@ static void pack_iologic(Context *ctx) ci->attrs[id_IOBUF] = 1; } } + // if have XXX_ inputs connect them + if (ctx->ddr_has_extra_inputs) { + ci->addInput(id_XXX_VSS); + ci->connectPort(id_XXX_VSS, ctx->nets[ctx->id("$PACKER_GND_NET")].get()); + ci->addInput(id_XXX_VCC); + ci->connectPort(id_XXX_VCC, ctx->nets[ctx->id("$PACKER_VCC_NET")].get()); + } } break; default: break; |