ice40: Validity check for LVDS IO
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
9834b68041
commit
d5d9fb27a6
@ -975,6 +975,8 @@ void Arch::assignCellInfo(CellInfo *cell)
|
|||||||
cell->lcInfo.inputCount++;
|
cell->lcInfo.inputCount++;
|
||||||
if (get_net_or_empty(cell, id_I3))
|
if (get_net_or_empty(cell, id_I3))
|
||||||
cell->lcInfo.inputCount++;
|
cell->lcInfo.inputCount++;
|
||||||
|
} else if (cell->type == id_SB_IO) {
|
||||||
|
cell->ioInfo.lvds = str_or_default(cell->params, id_IO_STANDARD, "SB_LVCMOS") == "SB_LVDS_INPUT";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +139,27 @@ bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loc ioLoc = getBelLocation(bel);
|
||||||
|
Loc compLoc = ioLoc;
|
||||||
|
compLoc.z = 1 - compLoc.z;
|
||||||
|
|
||||||
|
// Check LVDS pairing
|
||||||
|
if (cell->ioInfo.lvds) {
|
||||||
|
// Check correct z and complement location is free
|
||||||
|
if (ioLoc.z != 0)
|
||||||
|
return false;
|
||||||
|
BelId compBel = getBelByLocation(compLoc);
|
||||||
|
CellInfo *compCell = getBoundBelCell(compBel);
|
||||||
|
if (compCell)
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
// Check LVDS IO is not placed at complement location
|
||||||
|
BelId compBel = getBelByLocation(compLoc);
|
||||||
|
CellInfo *compCell = getBoundBelCell(compBel);
|
||||||
|
if (compCell && compCell->ioInfo.lvds)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return getBelPackagePin(bel) != "";
|
return getBelPackagePin(bel) != "";
|
||||||
} else if (cell->type == id_SB_GB) {
|
} else if (cell->type == id_SB_GB) {
|
||||||
NPNR_ASSERT(cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net != nullptr);
|
NPNR_ASSERT(cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net != nullptr);
|
||||||
|
@ -144,6 +144,11 @@ struct ArchCellInfo
|
|||||||
int inputCount;
|
int inputCount;
|
||||||
const NetInfo *clk, *cen, *sr;
|
const NetInfo *clk, *cen, *sr;
|
||||||
} lcInfo;
|
} lcInfo;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
bool lvds;
|
||||||
|
// TODO: clk packing checks...
|
||||||
|
} ioInfo;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -435,3 +435,4 @@ X(ICESTORM_SPRAM)
|
|||||||
X(DFF_ENABLE)
|
X(DFF_ENABLE)
|
||||||
X(CARRY_ENABLE)
|
X(CARRY_ENABLE)
|
||||||
X(NEG_CLK)
|
X(NEG_CLK)
|
||||||
|
X(IO_STANDARD)
|
Loading…
Reference in New Issue
Block a user