aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-10-08 18:00:13 +0100
committerGitHub <noreply@github.com>2021-10-08 18:00:13 +0100
commit520aec3ef459c478decf6954385b25c0260614de (patch)
tree4c023d2cdf24301cf4e633eed04ece87e1490fdd
parentb749ef5f563fa9d099b158c2e493e8734558a327 (diff)
parent4c8a8003d33afce9093fe24b49cd0434a8bef0c1 (diff)
downloadnextpnr-520aec3ef459c478decf6954385b25c0260614de.tar.gz
nextpnr-520aec3ef459c478decf6954385b25c0260614de.tar.bz2
nextpnr-520aec3ef459c478decf6954385b25c0260614de.zip
Merge pull request #841 from Ravenslofty/lofty/mistral-cleanup
mistral: clean up bel init slightly
-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));