ice40: Add helper to know which global network is driven by a SB_GB Bel
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
822b525035
commit
a79f0db749
@ -884,6 +884,13 @@ struct Arch : BaseCtx
|
|||||||
}
|
}
|
||||||
NPNR_ASSERT_FALSE("Expected PLL pin to share an output with an SB_IO D_IN_{0,1}");
|
NPNR_ASSERT_FALSE("Expected PLL pin to share an output with an SB_IO D_IN_{0,1}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getDrivenGlobalNetwork(BelId bel) const
|
||||||
|
{
|
||||||
|
NPNR_ASSERT(getBelType(bel) == id_SB_GB);
|
||||||
|
IdString glb_net = getWireName(getBelPinWire(bel, id_GLOBAL_BUFFER_OUTPUT));
|
||||||
|
return std::stoi(std::string("") + glb_net.str(this).back());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ice40DelayFuzzerMain(Context *ctx);
|
void ice40DelayFuzzerMain(Context *ctx);
|
||||||
|
@ -165,8 +165,7 @@ bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const
|
|||||||
return true;
|
return true;
|
||||||
NPNR_ASSERT(cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net != nullptr);
|
NPNR_ASSERT(cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net != nullptr);
|
||||||
const NetInfo *net = cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net;
|
const NetInfo *net = cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net;
|
||||||
IdString glb_net = getWireName(getBelPinWire(bel, id_GLOBAL_BUFFER_OUTPUT));
|
int glb_id = getDrivenGlobalNetwork(bel);
|
||||||
int glb_id = std::stoi(std::string("") + glb_net.str(this).back());
|
|
||||||
if (net->is_reset && net->is_enable)
|
if (net->is_reset && net->is_enable)
|
||||||
return false;
|
return false;
|
||||||
else if (net->is_reset)
|
else if (net->is_reset)
|
||||||
|
Loading…
Reference in New Issue
Block a user