From 132c5b5019fa485d7e99311bb27cfdb47fc05226 Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 9 Jul 2018 17:00:54 +0200 Subject: Make logic cell positioning a constant Signed-off-by: David Shah --- ice40/arch.cc | 8 ++++---- ice40/gfx.cc | 4 ++-- ice40/gfx.h | 6 ++++++ 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'ice40') diff --git a/ice40/arch.cc b/ice40/arch.cc index a50310cf..2eb7d1c3 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -426,10 +426,10 @@ std::vector Arch::getBelGraphics(BelId bel) const if (bel_type == TYPE_ICESTORM_LC) { GraphicElement el; el.type = GraphicElement::G_BOX; - el.x1 = chip_info->bel_data[bel.index].x + 0.82; - el.x2 = chip_info->bel_data[bel.index].x + 0.92; - el.y1 = chip_info->bel_data[bel.index].y + 0.45 + (chip_info->bel_data[bel.index].z) * (0.5 / 8); - el.y2 = chip_info->bel_data[bel.index].y + 0.5 + (chip_info->bel_data[bel.index].z) * (0.5 / 8); + el.x1 = chip_info->bel_data[bel.index].x + logic_cell_x1; + el.x2 = chip_info->bel_data[bel.index].x + logic_cell_x2; + el.y1 = chip_info->bel_data[bel.index].y + logic_cell_y1 + (chip_info->bel_data[bel.index].z) * logic_cell_pitch; + el.y2 = chip_info->bel_data[bel.index].y + logic_cell_y2 + (chip_info->bel_data[bel.index].z) * logic_cell_pitch; el.z = 0; ret.push_back(el); diff --git a/ice40/gfx.cc b/ice40/gfx.cc index f29b38dc..d59c00aa 100644 --- a/ice40/gfx.cc +++ b/ice40/gfx.cc @@ -262,8 +262,8 @@ void gfxTileWire(std::vector &g, int x, int y, GfxTileWireId id) GraphicElement el; el.type = GraphicElement::G_LINE; el.x1 = x + lc_lut_swbox_x2; - el.x2 = x + 0.82; - el.y1 = y + 0.4675 + (0.005 * input) + z * (0.5 / 8); + el.x2 = x + logic_cell_x1; + el.y1 = y + 0.4675 + (0.005 * input) + z * logic_cell_pitch; el.y2 = el.y1; g.push_back(el); } diff --git a/ice40/gfx.h b/ice40/gfx.h index 15bb7300..784ba23f 100644 --- a/ice40/gfx.h +++ b/ice40/gfx.h @@ -59,6 +59,12 @@ const float span4v_swbox_x2 = 0.375; const float span4v_swbox_y1 = 0.300; const float span4v_swbox_y2 = 0.400; +const float logic_cell_x1 = 0.82; +const float logic_cell_x2 = 0.92; +const float logic_cell_y1 = 0.45; +const float logic_cell_y2 = 0.50; +const float logic_cell_pitch = 0.0625; + enum GfxTileWireId { TILE_WIRE_GLB2LOCAL_0, TILE_WIRE_GLB2LOCAL_1, -- cgit v1.2.3