diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-09-25 18:21:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-25 18:21:56 +0200 |
commit | 07cf349ee46a8c8a3163d2f8a146beab02e6b487 (patch) | |
tree | a43f9f922d2af2ecb5ab59c1981acf5b2ab47405 /ice40/arch_place.cc | |
parent | 1eb7411fb0b814c524b83dc3c16715a814db8f5d (diff) | |
parent | dea87e46c4f316a950425504cadda56aaeeab280 (diff) | |
download | nextpnr-07cf349ee46a8c8a3163d2f8a146beab02e6b487.tar.gz nextpnr-07cf349ee46a8c8a3163d2f8a146beab02e6b487.tar.bz2 nextpnr-07cf349ee46a8c8a3163d2f8a146beab02e6b487.zip |
Merge pull request #79 from YosysHQ/ice40lvds
ice40: Adding LVDS input support
Diffstat (limited to 'ice40/arch_place.cc')
-rw-r--r-- | ice40/arch_place.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index c69fd34f..b436f7d7 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -34,7 +34,7 @@ bool Arch::logicCellsCompatible(const CellInfo** it, const size_t size) const int locals_count = 0; for (auto cell : boost::make_iterator_range(it, it+size)) { - NPNR_ASSERT(cell->belType == id_ICESTORM_LC); + NPNR_ASSERT(cell->type == id_ICESTORM_LC); if (cell->lcInfo.dffEnable) { if (!dffs_exist) { dffs_exist = true; @@ -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); |