From 7de80fbb9c0fc5bc2e9b680f409579795de6b6c7 Mon Sep 17 00:00:00 2001 From: gatecat Date: Wed, 15 Apr 2026 14:41:04 +0200 Subject: [PATCH] ecp5: Fix placement of LUT permutation switchboxes Signed-off-by: gatecat --- ecp5/gfx.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index d4aff492..7ea838e2 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -95,8 +95,8 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int // LUT permutation switchbox el.x1 = x + slice_x1 - wire_length_lut; el.x2 = x + slice_x1 - wire_length; - int start_wire = (TILE_WIRE_D7 + 24 * (lc / 2) + 4 * (lc % 2)); - el.y2 = y + slice_y2 - wire_distance * (start_wire - TILE_WIRE_FCO + 1 + (lc / 2) * 2) + 3 * slice_pitch + + int start_wire = (TILE_WIRE_D7 + 24 * ((7 - lc) / 2) + 4 * ((7 - lc) % 2)); + el.y2 = y + slice_y2 - wire_distance * (start_wire - TILE_WIRE_FCO + 1 + ((7 - lc) / 2) * 2) + 3 * slice_pitch + 0.25 * wire_distance; el.y1 = el.y2 - 3.5 * wire_distance; g.push_back(el);