aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/arch.cc
diff options
context:
space:
mode:
authorAlessandro Comodi <acomodi@antmicro.com>2021-05-12 18:25:47 +0200
committerAlessandro Comodi <acomodi@antmicro.com>2021-05-13 11:00:42 +0200
commit8c468acff8900f40e909882cfbf9381a59199b79 (patch)
treebd1b8dba70b86034fae4adb61f1cb2d10140fb49 /fpga_interchange/arch.cc
parentfd93697a2d4eca02fc5091a15a497f7a761f251a (diff)
downloadnextpnr-8c468acff8900f40e909882cfbf9381a59199b79.tar.gz
nextpnr-8c468acff8900f40e909882cfbf9381a59199b79.tar.bz2
nextpnr-8c468acff8900f40e909882cfbf9381a59199b79.zip
interchange: site router: add valid pips list to check during routing
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
Diffstat (limited to 'fpga_interchange/arch.cc')
-rw-r--r--fpga_interchange/arch.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/fpga_interchange/arch.cc b/fpga_interchange/arch.cc
index ad4d90e8..a05878f6 100644
--- a/fpga_interchange/arch.cc
+++ b/fpga_interchange/arch.cc
@@ -1776,15 +1776,15 @@ bool Arch::checkPipAvailForNet(PipId pip, NetInfo *net) const
}
}
+ auto tile_status_iter = tileStatus.find(pip.tile);
+
if (pip_data.pseudo_cell_wires.size() > 0) {
// FIXME: This pseudo pip check is incomplete, because constraint
// failures will not be detected. However the current FPGA
// interchange schema does not provide a cell type to place.
- auto iter = tileStatus.find(pip.tile);
- if (iter != tileStatus.end()) {
- if (!iter->second.pseudo_pip_model.checkPipAvail(getCtx(), pip)) {
- return false;
- }
+ if (tile_status_iter != tileStatus.end() &&
+ !tile_status_iter->second.pseudo_pip_model.checkPipAvail(getCtx(), pip)) {
+ return false;
}
}
@@ -1797,12 +1797,16 @@ bool Arch::checkPipAvailForNet(PipId pip, NetInfo *net) const
bool valid_pip = false;
if (pip.tile == net->driver.cell->bel.tile) {
- const BelInfoPOD &bel_data = tile_type.bel_data[net->driver.cell->bel.index];
- if (bel_data.site == pip_data.site) {
- // Only allow site pips or output site ports.
- if (dst_wire_data.site == -1) {
- // Allow output site port from this site.
- NPNR_ASSERT(src_wire_data.site == pip_data.site);
+ if (tile_status_iter == tileStatus.end()) {
+ // there is no tile status and nothing blocks the validity of this PIP
+ valid_pip = true;
+ } else {
+ const BelInfoPOD &bel_data = tile_type.bel_data[net->driver.cell->bel.index];
+ const SiteRouter &site_router = get_site_status(tile_status_iter->second, bel_data);
+
+ const auto& pips = site_router.valid_pips;
+ auto result = std::find(pips.begin(), pips.end(), pip);
+ if (result != pips.end()) {
valid_pip = true;
}
}