diff options
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/arch.cc | 284 | ||||
-rw-r--r-- | ecp5/constids.inc | 2 | ||||
-rw-r--r-- | ecp5/gfx.h | 356 | ||||
-rwxr-xr-x | ecp5/trellis_import.py | 12 |
4 files changed, 254 insertions, 400 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 34ee0dbb..84cfcde7 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -599,6 +599,29 @@ bool Arch::route() // ----------------------------------------------------------------------- +const float switchbox_x1 = 0.51; +const float switchbox_x2 = 0.90; +const float switchbox_y1 = 0.51; +const float switchbox_y2 = 0.90; + +const float slice_x1 = 0.92; +const float slice_x2 = 0.94; +const float slice_y1 = 0.71; +const float slice_y2 = 0.745 + 0.0068; +const float slice_pitch = 0.0374 +0.0068; + +const float io_cell_v_x1 = 0.76; +const float io_cell_v_x2 = 0.95; +const float io_cell_v_y1 = 0.05; +const float io_cell_v_y2 = 0.15; +const float io_cell_v_pitch = 0.125; + +const float io_cell_h_x1 = 0.05; +const float io_cell_h_x2 = 0.14; +const float io_cell_h_y1 = 0.05; +const float io_cell_h_y2 = 0.24; +const float io_cell_h_pitch = 0.125; + std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const { std::vector<GraphicElement> ret; @@ -618,6 +641,15 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const el.y1 = y + switchbox_y1; el.y2 = y + switchbox_y2; ret.push_back(el); + + for(int i=0;i<4;i++) + { + el.x1 = x + slice_x2 + 0.0255f; + el.x2 = el.x1 + 0.0017f; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 5 + i*26) + 3*slice_pitch - 0.0007f; + el.y2 = el.y1 + 0.0017f * 5; + ret.push_back(el); + } } } if (decal.type == DecalId::TYPE_WIRE) { @@ -633,71 +665,54 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - if (tilewire >= TILE_WIRE_D7_SLICE && tilewire <=TILE_WIRE_CLK0_SLICE) + if (tilewire >= TILE_WIRE_FCO_SLICE && tilewire <=TILE_WIRE_FCI_SLICE) { + int gap = (tilewire - TILE_WIRE_FCO_SLICE) / 24; + int item = (tilewire - TILE_WIRE_FCO_SLICE) % 24; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_D7_SLICE + 1) + 3*slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_D7_SLICE + 1) + 3*slice_pitch; - ret.push_back(el); - } - if (tilewire >= TILE_WIRE_DUMMY_100 && tilewire <=TILE_WIRE_F5A_SLICE) - { - el.x1 = x + slice_x2; - el.x2 = x + slice_x2 + 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_DUMMY_100 + 1) + 3*slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_DUMMY_100 + 1) + 3*slice_pitch; - ret.push_back(el); - } - if (tilewire >= TILE_WIRE_FCID_SLICE && tilewire <=TILE_WIRE_FCI_SLICE) - { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x1 + 0.005f; - el.x2 = x + slice_x1 + 0.005f; - if (tilewire==TILE_WIRE_FCI_SLICE) - el.y1 = y + slice_y1 - 0.0007f + (3-(tilewire - TILE_WIRE_FCID_SLICE))*slice_pitch; - else - el.y1 = y + slice_y1 - 0.00125f + (3-(tilewire - TILE_WIRE_FCID_SLICE))*slice_pitch; - el.y2 = y + slice_y1 + (3-(tilewire - TILE_WIRE_FCID_SLICE))*slice_pitch; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_FCO_SLICE + 1 + gap*2) + 3*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_FCO_SLICE + 1 + gap*2) + 3*slice_pitch; ret.push_back(el); - if (tilewire==TILE_WIRE_FCI_SLICE) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1 + 0.005f; - el.y2 = el.y1; + // FX to F connection - top + if (item == (TILE_WIRE_FXD_SLICE-TILE_WIRE_FCO_SLICE)) + { + el.x2 = el.x1; + el.y2 = el.y1 - 0.0017f; + ret.push_back(el); + } + // F5 to F connection - bottom + if (item == (TILE_WIRE_F5D_SLICE-TILE_WIRE_FCO_SLICE)) + { + el.x2 = el.x1; + el.y2 = el.y1 + 0.0017f; + ret.push_back(el); + } + // connection between slices + if (item == (TILE_WIRE_FCID_SLICE-TILE_WIRE_FCO_SLICE) && tilewire!=TILE_WIRE_FCI_SLICE) + { + el.x2 = el.x1; + el.y2 = el.y1 - 0.0017f * 3; ret.push_back(el); } } - if (tilewire >= TILE_WIRE_FCO_SLICE && tilewire <=TILE_WIRE_FCOA_SLICE) + if (tilewire >= TILE_WIRE_DUMMY_D2 && tilewire <=TILE_WIRE_WAD0A_SLICE) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x1 + 0.005f; - el.x2 = x + slice_x1 + 0.005f; - if (tilewire==TILE_WIRE_FCO_SLICE) - el.y1 = y + slice_y2 + 0.0017f + (3-(tilewire - TILE_WIRE_FCO_SLICE))*slice_pitch; - else - el.y1 = y + slice_y2 + 0.00125f + (3-(tilewire - TILE_WIRE_FCO_SLICE))*slice_pitch; - el.y2 = y + slice_y2 + (3-(tilewire - TILE_WIRE_FCO_SLICE))*slice_pitch; + int gap = (tilewire - TILE_WIRE_DUMMY_D2) / 12; + el.x1 = x + slice_x2 + 0.005f; + el.x2 = x + slice_x2; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_DUMMY_D2 + 1 + gap*14) + 3*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_DUMMY_D2 + 1 + gap*14) + 3*slice_pitch; ret.push_back(el); - if (tilewire==TILE_WIRE_FCO_SLICE) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1 + 0.005f; - el.y2 = el.y1; - ret.push_back(el); - } } } if (wire_type == id_WIRE_TYPE_V01) { if (tilewire >= TILE_WIRE_V01N0001 && tilewire <=TILE_WIRE_V01S0100) - //if (tilewire >= TILE_WIRE_V01N0000 && tilewire <=TILE_WIRE_V01S0101) // not existing in trellis { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x1 + 0.0017f*4 + 0.0017f * (tilewire - TILE_WIRE_V01N0001); + el.x1 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (tilewire - TILE_WIRE_V01N0001); el.x2 = el.x1; el.y1 = y + switchbox_y1; el.y2 = y + switchbox_y2 - 1; @@ -705,47 +720,24 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const } } if (wire_type == id_WIRE_TYPE_H01) { - if (tilewire >= TILE_WIRE_H01E0001 && tilewire <=TILE_WIRE_H01W0100) - //if (tilewire >= TILE_WIRE_H01E0000 && tilewire <=TILE_WIRE_H01W0101) // not existing in trellis + if (tilewire >= TILE_WIRE_H01E0001 && tilewire <=TILE_WIRE_HL7W0001) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; el.x1 = x + switchbox_x1; el.x2 = x + switchbox_x2 - 1; - el.y1 = y + switchbox_y1 + 0.0017f*12 - 0.0017f * (tilewire - TILE_WIRE_H01E0001); + el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (tilewire - TILE_WIRE_H01E0001); el.y2 = el.y1; ret.push_back(el); } } - if (wire_type == id_WIRE_TYPE_HFI) { - // only TILE_WIRE_HFIE0000 - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x1; - el.x2 = x + switchbox_x2 - 1; - el.y1 = y + switchbox_y1 + 0.0017f*1; - el.y2 = el.y1; - ret.push_back(el); - } - if (wire_type == id_WIRE_TYPE_HL7) { - // only TILE_WIRE_HL7W0001 - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x2 - 1; - el.x2 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f*20; - el.y2 = el.y1; - ret.push_back(el); - } if (wire_type == id_WIRE_TYPE_V00) { int group = (tilewire - TILE_WIRE_V00T0000) / 2; GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x2 - 0.0017f*(20 - ((tilewire - TILE_WIRE_V00T0000) % 2)); + el.x1 = x + switchbox_x2 - 0.0017f*(8 - ((tilewire - TILE_WIRE_V00T0000) % 2)*4); el.x2 = el.x1; if (group) { el.y1 = y + switchbox_y1; @@ -761,7 +753,7 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.y1 = y + switchbox_y1 + 0.0017f*(4 - ((tilewire - TILE_WIRE_H00L0000) % 2)); + el.y1 = y + switchbox_y1 + 0.0017f*(8 - ((tilewire - TILE_WIRE_H00L0000) % 2)*4); el.y2 = el.y1; if (group) { @@ -779,8 +771,8 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x2 - 0.0017f*19; - el.x2 = x + switchbox_x2 - 0.0017f*20; + el.x1 = x + switchbox_x2 - 0.0017f*4; + el.x2 = x + switchbox_x2 - 0.0017f*8; if (tilewire == TILE_WIRE_NBOUNCE) { el.y1 = y + switchbox_y2 + 0.0017f*4; el.y2 = el.y1; @@ -795,8 +787,8 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.y1 = y + switchbox_y1 + 0.0017f*3; - el.y2 = y + switchbox_y1 + 0.0017f*4; + el.y1 = y + switchbox_y1 + 0.0017f*4; + el.y2 = y + switchbox_y1 + 0.0017f*8; if (tilewire == TILE_WIRE_WBOUNCE) { el.x1 = x + switchbox_x1 - 0.0017f*4; el.x2 = el.x1; @@ -806,114 +798,66 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const } ret.push_back(el); } - if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) + if (tilewire >= TILE_WIRE_CLK0 && tilewire <=TILE_WIRE_LSR1) { - GraphicElement el; + GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; el.x1 = x + switchbox_x2; - el.x2 = x + slice_x1 - 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_LSR1 - 5) + 3*slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_LSR1 - 5) + 3*slice_pitch; + el.x2 = x + slice_x2 + 0.0255f + (8 - (tilewire - TILE_WIRE_CLK0)) * 0.0017f; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CLK0 - 5) + 3*slice_pitch; + el.y2 = el.y1; ret.push_back(el); - } - if (tilewire >= TILE_WIRE_LSR1 && tilewire <=TILE_WIRE_CLK0) - { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x2; - el.x2 = x + switchbox_x2 + 0.0017f * (6-(tilewire-TILE_WIRE_LSR1)); - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_LSR1 - 5) + 3*slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_LSR1 - 5) + 3*slice_pitch; + el.x1 = el.x2; + el.y2 = y + slice_y2 - 0.0017f * (3 + (tilewire - TILE_WIRE_CLK0)); ret.push_back(el); - - if (tilewire == TILE_WIRE_LSR1 || tilewire==TILE_WIRE_LSR0) { - el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 - 5 + 1) + 3*slice_pitch; - ret.push_back(el); - if (tilewire == TILE_WIRE_LSR1) { - for (int i=0;i<2;i++){ - el.x2 = x + slice_x1 - 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 - 5 - 2) + (3+i)*slice_pitch; - el.y2 = el.y1; - ret.push_back(el); - } - } - } else { - el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 -5 + 2) + 3*slice_pitch; + for (int i=0;i<4;i++) + { + el.x1 = x + slice_x2 + 0.0255f + 0.0017f; + el.x2 = x + slice_x2 + 0.0255f + (8 - (tilewire - TILE_WIRE_CLK0)) * 0.0017f; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 1 + tilewire - TILE_WIRE_CLK0)+ i*slice_pitch; + el.y2 = el.y1; ret.push_back(el); - if (tilewire == TILE_WIRE_CLK1) { - for (int i=0;i<2;i++){ - el.x2 = x + slice_x1 - 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 - 5 - 1) + (3+i)*slice_pitch; - el.y2 = el.y1; - ret.push_back(el); - } + } + if (tilewire==TILE_WIRE_CLK1 || tilewire==TILE_WIRE_LSR1) { + for (int i=0;i<2;i++) + { + el.x1 = x + slice_x2 + 0.0051f; + el.x2 = x + slice_x2 + 0.0255f + (8 - (tilewire - TILE_WIRE_CLK0)) * 0.0017f; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 - 1 + (tilewire - TILE_WIRE_CLK0)/2)+ i*slice_pitch; + el.y2 = el.y1; + ret.push_back(el); } - } - } - if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <=TILE_WIRE_MUXCLK0) - { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x2 + 0.0017f * 3; - el.x2 = x + slice_x1 - 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 - 5 + 2) + (3 + 3 - (tilewire - TILE_WIRE_MUXCLK3))*slice_pitch; - el.y2 = el.y1; - ret.push_back(el); - } - if (tilewire >= TILE_WIRE_MUXLSR3 && tilewire <=TILE_WIRE_MUXLSR0) + } + + if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) { - GraphicElement el; + int gap = (tilewire - TILE_WIRE_FCO) / 24; + GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x2 + 0.0017f * 5; + el.x1 = x + switchbox_x2; el.x2 = x + slice_x1 - 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 - 5 + 1) + (3 + 3 - (tilewire - TILE_WIRE_MUXLSR3))*slice_pitch; - el.y2 = el.y1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_FCO + 1 + gap*2) + 3*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_FCO + 1 + gap*2) + 3*slice_pitch; ret.push_back(el); - } - + } - if (tilewire >= TILE_WIRE_F7 && tilewire <=TILE_WIRE_F0) + if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <=TILE_WIRE_MUXLSR0) { - int group = (tilewire - TILE_WIRE_F7) / 4; - int part = (tilewire - TILE_WIRE_F7) % 4; - float offset = 0; - if (part == 0) offset = -0.0017f/2; - if (part == 3) offset = +0.0017f/2; + int gap = (tilewire - TILE_WIRE_MUXCLK3) / 2; + int part = (tilewire - TILE_WIRE_MUXCLK3) % 2; GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x2 + 0.005f; - el.x2 = x + slice_x2 + 0.005f + (0.0017f * (7 *(4-group)-part)); - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_F7_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + (3 - group )*slice_pitch - offset; + el.x1 = x + slice_x2 + 0.0051f; + el.x2 = x + slice_x2 + 0.0255f; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + gap*26) + 3*slice_pitch; el.y2 = el.y1; ret.push_back(el); + } - if (part == 0 || part == 3) { - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el2.x1 = x + slice_x2 + 0.005f; - el2.x2 = el2.x1; - el2.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_F7_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + (3 - group )*slice_pitch; - el2.y2 = el2.y1 + 0.0017f * (part==3 ? -1 : 1); - ret.push_back(el2); - } - - el.x1 = el.x2; - el.y2 = el.y1 - (0.0017f * (30 *(3-group) + (3-part)*2 + 10)) + offset; - ret.push_back(el); - - el.x1 = x + switchbox_x2; - el.y1 = el.y2; - ret.push_back(el); - } if (tilewire >= TILE_WIRE_WD3 && tilewire <=TILE_WIRE_WD0) { GraphicElement el; @@ -923,12 +867,12 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; el.x1 = x + slice_x2 + 0.005f; el.x2 = x + slice_x2 + 0.005f + 0.0017f *(4 - part); - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WDO3C_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 3*slice_pitch; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WDO3C_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + 14) + 3*slice_pitch; el.y2 = el.y1; ret.push_back(el); el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WD1B_SLICE - TILE_WIRE_DUMMY_100 + 1 + (part & 1)) + (3-group)*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WD1B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + (part & 1) + 14*2) + (3-group)*slice_pitch; ret.push_back(el); el.x1 = x + slice_x2 + 0.005f; @@ -943,12 +887,12 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; el.x1 = x + slice_x2 + 0.005f; el.x2 = x + slice_x2 + 0.005f + 0.0017f *(8 - part); - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WADO3C_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 3*slice_pitch; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WADO3C_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part+ 14) + 3*slice_pitch; el.y2 = el.y1; ret.push_back(el); el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 2*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part+ 14*2) + 2*slice_pitch; ret.push_back(el); el.x1 = x + slice_x2 + 0.005f; @@ -958,7 +902,7 @@ std::vector<GraphicElement> Arch::getDecalGraphics(DecalId decal) const // middle line el.x1 = x + slice_x2 + 0.005f; el.x2 = x + slice_x2 + 0.005f + 0.0017f *(8 - part); - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 3*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part+ 14*2) + 3*slice_pitch; el.y1 = el.y2; ret.push_back(el); } diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 62d14bf6..63ca4b26 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1305,5 +1305,3 @@ X(WIRE_TYPE_V00) X(WIRE_TYPE_V01) X(WIRE_TYPE_V02) X(WIRE_TYPE_V06) -X(WIRE_TYPE_HFI) -X(WIRE_TYPE_HL7) @@ -24,33 +24,11 @@ NEXTPNR_NAMESPACE_BEGIN -const float switchbox_x1 = 0.51; -const float switchbox_x2 = 0.90; -const float switchbox_y1 = 0.51; -const float switchbox_y2 = 0.90; - -const float slice_x1 = 0.92; -const float slice_x2 = 0.94; -const float slice_y1 = 0.71; -const float slice_y2 = 0.745; -const float slice_pitch = 0.0374; - -const float io_cell_v_x1 = 0.76; -const float io_cell_v_x2 = 0.95; -const float io_cell_v_y1 = 0.05; -const float io_cell_v_y2 = 0.15; -const float io_cell_v_pitch = 0.125; - -const float io_cell_h_x1 = 0.05; -const float io_cell_h_x2 = 0.14; -const float io_cell_h_y1 = 0.05; -const float io_cell_h_y2 = 0.24; -const float io_cell_h_pitch = 0.125; - enum GfxTileWireId { TILE_WIRE_NONE, - + + TILE_WIRE_FCO_SLICE, TILE_WIRE_D7_SLICE, TILE_WIRE_C7_SLICE, TILE_WIRE_B7_SLICE, @@ -65,16 +43,18 @@ enum GfxTileWireId TILE_WIRE_M6_SLICE, TILE_WIRE_FXBD_SLICE, TILE_WIRE_FXAD_SLICE, - TILE_WIRE_DUMMY_001, - TILE_WIRE_DUMMY_002, + TILE_WIRE_DUMMY_D1, + TILE_WIRE_FXD_SLICE, + TILE_WIRE_F7_SLICE, + TILE_WIRE_Q7_SLICE, + TILE_WIRE_Q6_SLICE, + TILE_WIRE_F6_SLICE, + TILE_WIRE_F5D_SLICE, TILE_WIRE_CE3_SLICE, - TILE_WIRE_LSR3_SLICE, - TILE_WIRE_CLK3_SLICE, - - TILE_WIRE_DUMMY_003, - TILE_WIRE_DUMMY_004, - TILE_WIRE_DUMMY_005, + TILE_WIRE_FCID_SLICE, + + TILE_WIRE_FCOC_SLICE, TILE_WIRE_D5_SLICE, TILE_WIRE_C5_SLICE, TILE_WIRE_B5_SLICE, @@ -89,16 +69,17 @@ enum GfxTileWireId TILE_WIRE_M4_SLICE, TILE_WIRE_FXBC_SLICE, TILE_WIRE_FXAC_SLICE, - TILE_WIRE_DUMMY_006, - TILE_WIRE_DUMMY_007, + TILE_WIRE_DUMMY_C1, + TILE_WIRE_FXC_SLICE, + TILE_WIRE_F5_SLICE, + TILE_WIRE_Q5_SLICE, + TILE_WIRE_Q4_SLICE, + TILE_WIRE_F4_SLICE, + TILE_WIRE_F5C_SLICE, TILE_WIRE_CE2_SLICE, - TILE_WIRE_LSR2_SLICE, - TILE_WIRE_CLK2_SLICE, - - TILE_WIRE_DUMMY_008, - TILE_WIRE_DUMMY_009, - TILE_WIRE_DUMMY_010, + TILE_WIRE_FCIC_SLICE, + TILE_WIRE_FCOB_SLICE, TILE_WIRE_D3_SLICE, TILE_WIRE_C3_SLICE, TILE_WIRE_B3_SLICE, @@ -113,16 +94,17 @@ enum GfxTileWireId TILE_WIRE_M2_SLICE, TILE_WIRE_FXBB_SLICE, TILE_WIRE_FXAB_SLICE, - TILE_WIRE_WRE1_SLICE, - TILE_WIRE_WCK1_SLICE, + TILE_WIRE_DUMMY_B1, + TILE_WIRE_FXB_SLICE, + TILE_WIRE_F3_SLICE, + TILE_WIRE_Q3_SLICE, + TILE_WIRE_Q2_SLICE, + TILE_WIRE_F2_SLICE, + TILE_WIRE_F5B_SLICE, TILE_WIRE_CE1_SLICE, - TILE_WIRE_LSR1_SLICE, - TILE_WIRE_CLK1_SLICE, - - TILE_WIRE_DUMMY_011, - TILE_WIRE_DUMMY_012, - TILE_WIRE_DUMMY_013, - + TILE_WIRE_FCIB_SLICE, + + TILE_WIRE_FCOA_SLICE, TILE_WIRE_D1_SLICE, TILE_WIRE_C1_SLICE, TILE_WIRE_B1_SLICE, @@ -137,121 +119,23 @@ enum GfxTileWireId TILE_WIRE_M0_SLICE, TILE_WIRE_FXBA_SLICE, TILE_WIRE_FXAA_SLICE, - TILE_WIRE_WRE0_SLICE, - TILE_WIRE_WCK0_SLICE, - TILE_WIRE_CE0_SLICE, - TILE_WIRE_LSR0_SLICE, - TILE_WIRE_CLK0_SLICE, - - TILE_WIRE_FCO_SLICE, - TILE_WIRE_FCOC_SLICE, - TILE_WIRE_FCOB_SLICE, - TILE_WIRE_FCOA_SLICE, - - TILE_WIRE_FCID_SLICE, - TILE_WIRE_FCIC_SLICE, - TILE_WIRE_FCIB_SLICE, - TILE_WIRE_FCI_SLICE, - - TILE_WIRE_DUMMY_100, - TILE_WIRE_DUMMY_101, - TILE_WIRE_DUMMY_102, - TILE_WIRE_DUMMY_103, - TILE_WIRE_DUMMY_104, - TILE_WIRE_DUMMY_105, - TILE_WIRE_DUMMY_106, - TILE_WIRE_DUMMY_107, - TILE_WIRE_DUMMY_108, - TILE_WIRE_DUMMY_109, - TILE_WIRE_DUMMY_110, - TILE_WIRE_DUMMY_111, - TILE_WIRE_DUMMY_112, - TILE_WIRE_FXD_SLICE, - TILE_WIRE_F7_SLICE, - TILE_WIRE_Q7_SLICE, - TILE_WIRE_Q6_SLICE, - TILE_WIRE_F6_SLICE, - TILE_WIRE_F5D_SLICE, - - TILE_WIRE_DUMMY_113, - TILE_WIRE_DUMMY_114, - TILE_WIRE_DUMMY_115, - - TILE_WIRE_WDO3C_SLICE, - TILE_WIRE_WDO2C_SLICE, - TILE_WIRE_WDO1C_SLICE, - TILE_WIRE_WDO0C_SLICE, - TILE_WIRE_DUMMY_200, - TILE_WIRE_WADO3C_SLICE, - TILE_WIRE_WADO2C_SLICE, - TILE_WIRE_WADO1C_SLICE, - TILE_WIRE_WADO0C_SLICE, - TILE_WIRE_DUMMY_201, - TILE_WIRE_DUMMY_202, - TILE_WIRE_DUMMY_203, - TILE_WIRE_DUMMY_204, - TILE_WIRE_FXC_SLICE, - TILE_WIRE_F5_SLICE, - TILE_WIRE_Q5_SLICE, - TILE_WIRE_Q4_SLICE, - TILE_WIRE_F4_SLICE, - TILE_WIRE_F5C_SLICE, - - TILE_WIRE_DUMMY_213, - TILE_WIRE_DUMMY_214, - TILE_WIRE_DUMMY_215, - - TILE_WIRE_DUMMY_300, - TILE_WIRE_DUMMY_301, - TILE_WIRE_WD1B_SLICE, - TILE_WIRE_WD0B_SLICE, - TILE_WIRE_DUMMY_302, - TILE_WIRE_WAD3B_SLICE, - TILE_WIRE_WAD2B_SLICE, - TILE_WIRE_WAD1B_SLICE, - TILE_WIRE_WAD0B_SLICE, - TILE_WIRE_DUMMY_303, - TILE_WIRE_DUMMY_304, - TILE_WIRE_DUMMY_305, - TILE_WIRE_DUMMY_306, - TILE_WIRE_FXB_SLICE, - TILE_WIRE_F3_SLICE, - TILE_WIRE_Q3_SLICE, - TILE_WIRE_Q2_SLICE, - TILE_WIRE_F2_SLICE, - TILE_WIRE_F5B_SLICE, - - TILE_WIRE_DUMMY_313, - TILE_WIRE_DUMMY_314, - TILE_WIRE_DUMMY_315, - - TILE_WIRE_DUMMY_400, - TILE_WIRE_DUMMY_401, - TILE_WIRE_WD1A_SLICE, - TILE_WIRE_WD0A_SLICE, - TILE_WIRE_DUMMY_402, - TILE_WIRE_WAD3A_SLICE, - TILE_WIRE_WAD2A_SLICE, - TILE_WIRE_WAD1A_SLICE, - TILE_WIRE_WAD0A_SLICE, - TILE_WIRE_DUMMY_403, - TILE_WIRE_DUMMY_404, - TILE_WIRE_DUMMY_405, - TILE_WIRE_DUMMY_406, + TILE_WIRE_DUMMY_A1, TILE_WIRE_FXA_SLICE, TILE_WIRE_F1_SLICE, TILE_WIRE_Q1_SLICE, TILE_WIRE_Q0_SLICE, TILE_WIRE_F0_SLICE, TILE_WIRE_F5A_SLICE, + TILE_WIRE_CE0_SLICE, + TILE_WIRE_FCI_SLICE, - TILE_WIRE_LSR1, - TILE_WIRE_LSR0, - TILE_WIRE_CLK1, TILE_WIRE_CLK0, + TILE_WIRE_CLK1, + TILE_WIRE_LSR0, + TILE_WIRE_LSR1, + TILE_WIRE_FCO, - TILE_WIRE_DUMMY_500, TILE_WIRE_D7, TILE_WIRE_C7, TILE_WIRE_B7, @@ -266,16 +150,17 @@ enum GfxTileWireId TILE_WIRE_M6, TILE_WIRE_FXBD, TILE_WIRE_FXAD, - TILE_WIRE_DUMMY_501, - TILE_WIRE_DUMMY_502, + TILE_WIRE_DUMMY_SWB1, + TILE_WIRE_DUMMY_SWB2, + TILE_WIRE_F7, + TILE_WIRE_Q7, + TILE_WIRE_Q6, + TILE_WIRE_F6, + TILE_WIRE_DUMMY_SWB3, TILE_WIRE_CE3, - TILE_WIRE_DUMMY_503, - TILE_WIRE_DUMMY_504, - - TILE_WIRE_DUMMY_505, - TILE_WIRE_DUMMY_506, - TILE_WIRE_DUMMY_507, + TILE_WIRE_DUMMY_SWB4, + TILE_WIRE_DUMMY_SWB5, TILE_WIRE_D5, TILE_WIRE_C5, TILE_WIRE_B5, @@ -290,16 +175,18 @@ enum GfxTileWireId TILE_WIRE_M4, TILE_WIRE_FXBC, TILE_WIRE_FXAC, - TILE_WIRE_DUMMY_508, - TILE_WIRE_DUMMY_509, + TILE_WIRE_DUMMY_SWB6, + TILE_WIRE_DUMMY_SWB7, + TILE_WIRE_F5, + TILE_WIRE_Q5, + TILE_WIRE_Q4, + TILE_WIRE_F4, + TILE_WIRE_DUMMY_SWB8, TILE_WIRE_CE2, - TILE_WIRE_DUMMY_510, - TILE_WIRE_DUMMY_511, + TILE_WIRE_DUMMY_SWB9, - TILE_WIRE_DUMMY_512, - TILE_WIRE_DUMMY_513, - TILE_WIRE_DUMMY_514, + TILE_WIRE_DUMMY_SWB10, TILE_WIRE_D3, TILE_WIRE_C3, TILE_WIRE_B3, @@ -314,16 +201,18 @@ enum GfxTileWireId TILE_WIRE_M2, TILE_WIRE_FXBB, TILE_WIRE_FXAB, - TILE_WIRE_DUMMY_515, - TILE_WIRE_DUMMY_516, + TILE_WIRE_DUMMY_SWB11, + TILE_WIRE_DUMMY_SWB12, + TILE_WIRE_F3, + TILE_WIRE_Q3, + TILE_WIRE_Q2, + TILE_WIRE_F2, + TILE_WIRE_DUMMY_SWB13, TILE_WIRE_CE1, - TILE_WIRE_DUMMY_517, - TILE_WIRE_DUMMY_518, - - TILE_WIRE_DUMMY_519, - TILE_WIRE_DUMMY_520, - TILE_WIRE_DUMMY_521, + TILE_WIRE_DUMMY_SWB14, + + TILE_WIRE_DUMMY_SWB15, TILE_WIRE_D1, TILE_WIRE_C1, TILE_WIRE_B1, @@ -338,46 +227,25 @@ enum GfxTileWireId TILE_WIRE_M0, TILE_WIRE_FXBA, TILE_WIRE_FXAA, - TILE_WIRE_DUMMY_522, - TILE_WIRE_DUMMY_523, + TILE_WIRE_DUMMY_SWB16, + TILE_WIRE_DUMMY_SWB17, + TILE_WIRE_F1, + TILE_WIRE_Q1, + TILE_WIRE_Q0, + TILE_WIRE_F0, + TILE_WIRE_DUMMY_SWB18, TILE_WIRE_CE0, - TILE_WIRE_DUMMY_524, - TILE_WIRE_DUMMY_525, - - TILE_WIRE_DUMMY_526, TILE_WIRE_FCI, - - TILE_WIRE_MUXLSR3, - TILE_WIRE_MUXLSR2, - TILE_WIRE_MUXLSR1, - TILE_WIRE_MUXLSR0, + TILE_WIRE_MUXCLK3, + TILE_WIRE_MUXLSR3, TILE_WIRE_MUXCLK2, + TILE_WIRE_MUXLSR2, TILE_WIRE_MUXCLK1, + TILE_WIRE_MUXLSR1, TILE_WIRE_MUXCLK0, - - - TILE_WIRE_F7, - TILE_WIRE_Q7, - TILE_WIRE_Q6, - TILE_WIRE_F6, - - TILE_WIRE_F5, - TILE_WIRE_Q5, - TILE_WIRE_Q4, - TILE_WIRE_F4, - - TILE_WIRE_F3, - TILE_WIRE_Q3, - TILE_WIRE_Q2, - TILE_WIRE_F2, - - TILE_WIRE_F1, - TILE_WIRE_Q1, - TILE_WIRE_Q0, - TILE_WIRE_F0, - + TILE_WIRE_MUXLSR0, TILE_WIRE_WD3, TILE_WIRE_WD2, @@ -388,12 +256,62 @@ enum GfxTileWireId TILE_WIRE_WAD2, TILE_WIRE_WAD1, TILE_WIRE_WAD0, + + TILE_WIRE_DUMMY_D2, + TILE_WIRE_DUMMY_D3, + TILE_WIRE_CLK3_SLICE, + TILE_WIRE_LSR3_SLICE, + TILE_WIRE_DUMMY_D4, + TILE_WIRE_DUMMY_D5, + TILE_WIRE_DUMMY_D6, + TILE_WIRE_DUMMY_D7, + TILE_WIRE_DUMMY_D8, + TILE_WIRE_DUMMY_D9, + TILE_WIRE_DUMMY_D10, + TILE_WIRE_DUMMY_D11, + + + TILE_WIRE_DUMMY_C2, + TILE_WIRE_DUMMY_C3, + TILE_WIRE_CLK2_SLICE, + TILE_WIRE_LSR2_SLICE, + TILE_WIRE_WDO3C_SLICE, + TILE_WIRE_WDO2C_SLICE, + TILE_WIRE_WDO1C_SLICE, + TILE_WIRE_WDO0C_SLICE, + TILE_WIRE_WADO3C_SLICE, + TILE_WIRE_WADO2C_SLICE, + TILE_WIRE_WADO1C_SLICE, + TILE_WIRE_WADO0C_SLICE, - TILE_WIRE_V01N0000, - TILE_WIRE_V01N0100, - TILE_WIRE_V01S0001, - TILE_WIRE_V01S0101, + TILE_WIRE_WCK1_SLICE, + TILE_WIRE_WRE1_SLICE, + TILE_WIRE_CLK1_SLICE, + TILE_WIRE_LSR1_SLICE, + TILE_WIRE_DUMMY_B2, + TILE_WIRE_DUMMY_B3, + TILE_WIRE_WD1B_SLICE, + TILE_WIRE_WD0B_SLICE, + TILE_WIRE_WAD3B_SLICE, + TILE_WIRE_WAD2B_SLICE, + TILE_WIRE_WAD1B_SLICE, + TILE_WIRE_WAD0B_SLICE, + + + TILE_WIRE_WCK0_SLICE, + TILE_WIRE_WRE0_SLICE, + TILE_WIRE_CLK0_SLICE, + TILE_WIRE_LSR0_SLICE, + TILE_WIRE_DUMMY_A2, + TILE_WIRE_DUMMY_A3, + TILE_WIRE_WD1A_SLICE, + TILE_WIRE_WD0A_SLICE, + TILE_WIRE_WAD3A_SLICE, + TILE_WIRE_WAD2A_SLICE, + TILE_WIRE_WAD1A_SLICE, + TILE_WIRE_WAD0A_SLICE, + TILE_WIRE_V01N0001, TILE_WIRE_V01N0101, @@ -404,11 +322,8 @@ enum GfxTileWireId TILE_WIRE_H01E0101, TILE_WIRE_H01W0000, TILE_WIRE_H01W0100, - - TILE_WIRE_H01E0000, - TILE_WIRE_H01E0100, - TILE_WIRE_H01W0001, - TILE_WIRE_H01W0101, + TILE_WIRE_HFIE0000, + TILE_WIRE_HL7W0001, TILE_WIRE_V00T0000, TILE_WIRE_V00T0100, @@ -427,9 +342,6 @@ enum GfxTileWireId TILE_WIRE_WBOUNCE, TILE_WIRE_EBOUNCE, - TILE_WIRE_HFIE0000, - TILE_WIRE_HL7W0001 - }; NEXTPNR_NAMESPACE_END diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index ebdc45f7..821a8a10 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -56,6 +56,12 @@ def wire_type(name): if name[0].startswith("H01"): return "WIRE_TYPE_H01" + if name[0].startswith("HFI"): + return "WIRE_TYPE_H01" + + if name[0].startswith("HL7"): + return "WIRE_TYPE_H01" + if name[0].startswith("H02"): return "WIRE_TYPE_H02" @@ -74,12 +80,6 @@ def wire_type(name): if name[0].startswith("V06"): return "WIRE_TYPE_V06" - if name[0].startswith("HFI"): - return "WIRE_TYPE_HFI" - - if name[0].startswith("HL7"): - return "WIRE_TYPE_HL7" - return "WIRE_TYPE_NONE" def is_global(loc): |