From 30fd86ce69fa65e89dec119e23b5bccb54de70a3 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 16 Feb 2022 13:53:47 +0000 Subject: refactor: New NetInfo and CellInfo constructors --- generic/pack.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'generic/pack.cc') diff --git a/generic/pack.cc b/generic/pack.cc index 291a528d..8bdbbed0 100644 --- a/generic/pack.cc +++ b/generic/pack.cc @@ -140,8 +140,7 @@ static void pack_constants(Context *ctx) std::unique_ptr gnd_cell = create_generic_cell(ctx, ctx->id("GENERIC_SLICE"), "$PACKER_GND"); gnd_cell->params[ctx->id("INIT")] = Property(0, 1 << ctx->args.K); - std::unique_ptr gnd_net = std::unique_ptr(new NetInfo); - gnd_net->name = ctx->id("$PACKER_GND_NET"); + std::unique_ptr gnd_net = std::make_unique(ctx->id("$PACKER_GND_NET")); gnd_net->driver.cell = gnd_cell.get(); gnd_net->driver.port = ctx->id("F"); gnd_cell->ports.at(ctx->id("F")).net = gnd_net.get(); @@ -149,8 +148,7 @@ static void pack_constants(Context *ctx) std::unique_ptr vcc_cell = create_generic_cell(ctx, ctx->id("GENERIC_SLICE"), "$PACKER_VCC"); // Fill with 1s vcc_cell->params[ctx->id("INIT")] = Property(Property::S1).extract(0, (1 << ctx->args.K), Property::S1); - std::unique_ptr vcc_net = std::unique_ptr(new NetInfo); - vcc_net->name = ctx->id("$PACKER_VCC_NET"); + std::unique_ptr vcc_net = std::make_unique(ctx->id("$PACKER_VCC_NET")); vcc_net->driver.cell = vcc_cell.get(); vcc_net->driver.port = ctx->id("F"); vcc_cell->ports.at(ctx->id("F")).net = vcc_net.get(); -- cgit v1.2.3