mirror of https://github.com/YosysHQ/nextpnr.git
frontend: don't connect a const net to ports connected to `x`. (#1447)
prjunnamed normalizes ports that are not present in the primitive to be all-x. On iCE40, this can cause a false placement conflict between `SB_IO` cells where one's clock input is `x` and another's is some other net.
This commit is contained in:
parent
81ccada239
commit
b64bf018ea
|
|
@ -472,7 +472,10 @@ template <typename FrontendType> struct GenericFrontend
|
|||
ci->ports[port_bit_ids].type = dir;
|
||||
// Resolve connectivity
|
||||
NetInfo *net;
|
||||
if (impl.is_vector_bit_constant(bits, i)) {
|
||||
if (impl.is_vector_bit_undef(bits, i)) {
|
||||
// Don't connect it if it's an `x`
|
||||
continue;
|
||||
} else if (impl.is_vector_bit_constant(bits, i)) {
|
||||
// Create a constant driver if one is needed
|
||||
net = create_constant_net(m, inst_name.str(ctx) + "." + port_bit_name + "$const",
|
||||
impl.get_vector_bit_constval(bits, i));
|
||||
|
|
|
|||
|
|
@ -161,6 +161,12 @@ struct JsonFrontendImpl
|
|||
|
||||
int get_vector_length(BitVectorDataType &bits) const { return int(bits.size()); }
|
||||
|
||||
bool is_vector_bit_undef(BitVectorDataType &bits, int i) const
|
||||
{
|
||||
NPNR_ASSERT(i < int(bits.size()));
|
||||
return bits[i] == "x";
|
||||
}
|
||||
|
||||
bool is_vector_bit_constant(BitVectorDataType &bits, int i) const
|
||||
{
|
||||
NPNR_ASSERT(i < int(bits.size()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue