From 9e8f8b7b45b4060531190259b2cfaae4d18819f1 Mon Sep 17 00:00:00 2001 From: rowanG077 Date: Mon, 6 Feb 2023 17:04:30 +0100 Subject: streamline constant_net detection --- ecp5/pack.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ecp5/pack.cc') diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 7033319f..a6f31656 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -38,10 +38,12 @@ static bool is_nextpnr_iob(Context *ctx, CellInfo *cell) static bool net_is_constant(const Context *ctx, NetInfo *net, bool &value) { + auto gnd = ctx->id("$PACKER_GND_NET"); + auto vcc = ctx->id("$PACKER_VCC_NET"); if (net == nullptr) return false; - if (net->name == ctx->id("$PACKER_GND_NET") || net->name == ctx->id("$PACKER_VCC_NET")) { - value = (net->name == ctx->id("$PACKER_VCC_NET")); + if (net->name.in(gnd, vcc)) { + value = (net->name == vcc); return true; } else { return false; -- cgit v1.2.3