From efb58711b0dfcdb8080f63bd64d3f9d9fafd2637 Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 31 Mar 2022 11:17:57 +0100 Subject: ecp5: Split the SLICE bel into separate LUT/FF/RAMW bels --- ecp5/gfx.cc | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'ecp5/gfx.cc') diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 8b5015f8..fe206de0 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -23,11 +23,13 @@ NEXTPNR_NAMESPACE_BEGIN const float slice_x1 = 0.92; +const float slice_x2_comb = 0.927; +const float slice_x1_ff = 0.933; const float slice_x2 = 0.94; const float slice_x2_wide = 0.97; const float slice_y1 = 0.71; -const float slice_y2 = 0.745 + 0.0068; -const float slice_pitch = 0.0374 + 0.0068; +const float slice_y2 = 0.7275 + 0.0068 / 2; +const float slice_pitch = (0.0374 + 0.0068) / 2; const float io_cell_v_x1 = 0.76; const float io_cell_v_x2 = 0.95; @@ -54,11 +56,25 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = style; - if (bel_type == id_TRELLIS_SLICE) { + if (bel_type == id_TRELLIS_COMB) { el.x1 = x + slice_x1; + el.x2 = x + slice_x2_comb; + el.y1 = y + slice_y1 + (z >> Arch::lc_idx_shift) * slice_pitch; + el.y2 = y + slice_y2 + (z >> Arch::lc_idx_shift) * slice_pitch; + g.push_back(el); + + el.style = GraphicElement::STYLE_FRAME; + el.x1 = x + slice_x2_comb + 15 * wire_distance; + el.x2 = el.x1 + wire_distance; + el.y1 = y + slice_y2 - wire_distance * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 5 + (3 - z) * 26) + + 3 * slice_pitch - 0.0007f; + el.y2 = el.y1 + wire_distance * 5; + g.push_back(el); + } else if (bel_type == id_TRELLIS_FF) { + el.x1 = x + slice_x1_ff; el.x2 = x + slice_x2; - el.y1 = y + slice_y1 + (z)*slice_pitch; - el.y2 = y + slice_y2 + (z)*slice_pitch; + el.y1 = y + slice_y1 + (z >> Arch::lc_idx_shift) * slice_pitch; + el.y2 = y + slice_y2 + (z >> Arch::lc_idx_shift) * slice_pitch; g.push_back(el); el.style = GraphicElement::STYLE_FRAME; -- cgit v1.2.3