aboutsummaryrefslogtreecommitdiffstats
path: root/mistral/arch.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-05-09 13:16:22 +0100
committergatecat <gatecat@ds0.me>2021-05-15 14:54:33 +0100
commit5d191f8297e338e5ac678bdbdfcb176a2a7a8cc3 (patch)
tree3159919cb5f1699e25772e4fe1eabae6f0aa4803 /mistral/arch.cc
parent96f16c8635b37aa58f275e63df5172902bedf8f5 (diff)
downloadnextpnr-5d191f8297e338e5ac678bdbdfcb176a2a7a8cc3.tar.gz
nextpnr-5d191f8297e338e5ac678bdbdfcb176a2a7a8cc3.tar.bz2
nextpnr-5d191f8297e338e5ac678bdbdfcb176a2a7a8cc3.zip
mistral: Add IO packing
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'mistral/arch.cc')
-rw-r--r--mistral/arch.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/mistral/arch.cc b/mistral/arch.cc
index aa149a3c..592eddff 100644
--- a/mistral/arch.cc
+++ b/mistral/arch.cc
@@ -73,9 +73,6 @@ Arch::Arch(ArchArgs args)
case CycloneV::block_type_t::LAB:
create_lab(x, y);
break;
- case CycloneV::block_type_t::GPIO:
- create_gpio(x, y);
- break;
default:
continue;
}
@@ -83,6 +80,10 @@ Arch::Arch(ArchArgs args)
}
}
+ for (auto gpio_pos : cyclonev->gpio_get_pos()) {
+ create_gpio(CycloneV::pos2x(gpio_pos), CycloneV::pos2y(gpio_pos));
+ }
+
// This import takes about 5s, perhaps long term we can speed it up, e.g. defer to Mistral more...
log_info("Initialising routing graph...\n");
int pip_count = 0;
@@ -251,6 +252,17 @@ BelBucketId Arch::getBelBucketForCellType(IdString cell_type) const
return cell_type;
}
+BelId Arch::bel_by_block_idx(int x, int y, IdString type, int block_index) const
+{
+ auto &bels = bels_by_tile.at(pos2idx(x, y));
+ for (size_t i = 0; i < bels.size(); i++) {
+ auto &bel_data = bels.at(i);
+ if (bel_data.type == type && bel_data.block_index == block_index)
+ return BelId(CycloneV::xy2pos(x, y), i);
+ }
+ return BelId();
+}
+
BelId Arch::add_bel(int x, int y, IdString name, IdString type)
{
auto &bels = bels_by_tile.at(pos2idx(x, y));