streamline constant_net detection
This commit is contained in:
parent
d2bf44ba45
commit
9e8f8b7b45
@ -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;
|
||||
|
@ -132,10 +132,12 @@ static void pack_nonlut_ffs(Context *ctx)
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user