diff options
author | David Shah <davey1576@gmail.com> | 2018-09-24 15:14:28 +0100 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-09-24 15:14:28 +0100 |
commit | d5d9fb27a66604c89b7a2746e7ca9749b62aec91 (patch) | |
tree | 9d0a406da4bcd0c0dd351eaa0f510fa861fef39b /ice40/arch_place.cc | |
parent | 9834b68041f8bc015d0195303b81636047d86b1c (diff) | |
download | nextpnr-d5d9fb27a66604c89b7a2746e7ca9749b62aec91.tar.gz nextpnr-d5d9fb27a66604c89b7a2746e7ca9749b62aec91.tar.bz2 nextpnr-d5d9fb27a66604c89b7a2746e7ca9749b62aec91.zip |
ice40: Validity check for LVDS IO
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/arch_place.cc')
-rw-r--r-- | ice40/arch_place.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index a050e39f..b436f7d7 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -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) != ""; } else if (cell->type == id_SB_GB) { NPNR_ASSERT(cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net != nullptr); |