aboutsummaryrefslogtreecommitdiffstats
path: root/mistral
diff options
context:
space:
mode:
authorLofty <dan.ravensloft@gmail.com>2021-10-08 15:21:21 +0100
committerLofty <dan.ravensloft@gmail.com>2021-10-08 15:21:21 +0100
commit4c8a8003d33afce9093fe24b49cd0434a8bef0c1 (patch)
tree4c023d2cdf24301cf4e633eed04ece87e1490fdd /mistral
parentb749ef5f563fa9d099b158c2e493e8734558a327 (diff)
downloadnextpnr-4c8a8003d33afce9093fe24b49cd0434a8bef0c1.tar.gz
nextpnr-4c8a8003d33afce9093fe24b49cd0434a8bef0c1.tar.bz2
nextpnr-4c8a8003d33afce9093fe24b49cd0434a8bef0c1.zip
mistral: clean up bel init slightly
Diffstat (limited to 'mistral')
-rw-r--r--mistral/arch.cc24
1 files changed, 6 insertions, 18 deletions
diff --git a/mistral/arch.cc b/mistral/arch.cc
index a6146fcb..52ba14fb 100644
--- a/mistral/arch.cc
+++ b/mistral/arch.cc
@@ -64,24 +64,12 @@ Arch::Arch(ArchArgs args)
log_info("Initialising bels...\n");
bels_by_tile.resize(cyclonev->get_tile_sx() * cyclonev->get_tile_sy());
- for (int x = 0; x < cyclonev->get_tile_sx(); x++) {
- for (int y = 0; y < cyclonev->get_tile_sy(); y++) {
- CycloneV::pos_t pos = cyclonev->xy2pos(x, y);
-
- for (CycloneV::block_type_t bel : cyclonev->pos_get_bels(pos)) {
- switch (bel) {
- case CycloneV::block_type_t::LAB:
- create_lab(x, y, /*is_mlab=*/false);
- break;
- case CycloneV::block_type_t::MLAB:
- create_lab(x, y, /*is_mlab=*/true);
- break;
- default:
- continue;
- }
- }
- }
- }
+
+ for (auto lab_pos : cyclonev->lab_get_pos())
+ create_lab(CycloneV::pos2x(lab_pos), CycloneV::pos2y(lab_pos), /*is_mlab=*/false);
+
+ for (auto mlab_pos : cyclonev->mlab_get_pos())
+ create_lab(CycloneV::pos2x(mlab_pos), CycloneV::pos2y(mlab_pos), /*is_mlab=*/true);
for (auto gpio_pos : cyclonev->gpio_get_pos())
create_gpio(CycloneV::pos2x(gpio_pos), CycloneV::pos2y(gpio_pos));