diff options
author | David Shah <davey1576@gmail.com> | 2018-08-05 14:31:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-05 14:31:43 +0200 |
commit | ba97c233fb6e4502f3465a602f997cc2382f0e06 (patch) | |
tree | 3a62397aebff56e2031f3d5c6c930ead2699d641 /ice40/gfx.cc | |
parent | 8a9b3626d32e8845dc51044e0f281c0ccdb7e53a (diff) | |
parent | 287fe7e89451b952d15c7839aff9cb3db12bf807 (diff) | |
download | nextpnr-ba97c233fb6e4502f3465a602f997cc2382f0e06.tar.gz nextpnr-ba97c233fb6e4502f3465a602f997cc2382f0e06.tar.bz2 nextpnr-ba97c233fb6e4502f3465a602f997cc2382f0e06.zip |
Merge pull request #36 from YosysHQ/lutperm
Add LUT input permutations, improvements in ice40 timing model, improvements in router
Diffstat (limited to 'ice40/gfx.cc')
-rw-r--r-- | ice40/gfx.cc | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/ice40/gfx.cc b/ice40/gfx.cc index d5c6e77f..1ab2fb3c 100644 --- a/ice40/gfx.cc +++ b/ice40/gfx.cc @@ -391,6 +391,17 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId id, int z = idx / 4; int input = idx % 4; el.x1 = x + local_swbox_x2; + el.x2 = x + lut_swbox_x1; + el.y1 = y + (logic_cell_y1 + logic_cell_y2) / 2 - 0.0075 + (0.005 * input) + z * logic_cell_pitch; + el.y2 = el.y1; + g.push_back(el); + } + + if (id >= TILE_WIRE_LUTFF_0_IN_0_LUT && id <= TILE_WIRE_LUTFF_7_IN_3_LUT) { + int idx = id - TILE_WIRE_LUTFF_0_IN_0_LUT; + int z = idx / 4; + int input = idx % 4; + el.x1 = x + lut_swbox_x2; el.x2 = x + logic_cell_x1; el.y1 = y + (logic_cell_y1 + logic_cell_y2) / 2 - 0.0075 + (0.005 * input) + z * logic_cell_pitch; el.y2 = el.y1; @@ -706,10 +717,10 @@ void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId src, return; } - if (TILE_WIRE_LUTFF_0_IN_0 <= src && src <= TILE_WIRE_LUTFF_7_IN_3 && TILE_WIRE_LUTFF_0_OUT <= dst && + if (TILE_WIRE_LUTFF_0_IN_0_LUT <= src && src <= TILE_WIRE_LUTFF_7_IN_3_LUT && TILE_WIRE_LUTFF_0_OUT <= dst && dst <= TILE_WIRE_LUTFF_7_OUT) { - int lut_idx = (src - TILE_WIRE_LUTFF_0_IN_0) / 4; - int in_idx = (src - TILE_WIRE_LUTFF_0_IN_0) % 4; + int lut_idx = (src - TILE_WIRE_LUTFF_0_IN_0_LUT) / 4; + int in_idx = (src - TILE_WIRE_LUTFF_0_IN_0_LUT) % 4; GraphicElement el; el.type = GraphicElement::TYPE_ARROW; @@ -722,6 +733,23 @@ void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, GfxTileWireId src, return; } + if (TILE_WIRE_LUTFF_0_IN_0 <= src && src <= TILE_WIRE_LUTFF_7_IN_3 && TILE_WIRE_LUTFF_0_IN_0_LUT <= dst && + dst <= TILE_WIRE_LUTFF_7_IN_3_LUT) { + int lut_idx = (src - TILE_WIRE_LUTFF_0_IN_0) / 4; + int in_idx = (src - TILE_WIRE_LUTFF_0_IN_0) % 4; + int out_idx = (dst - TILE_WIRE_LUTFF_0_IN_0_LUT) % 4; + + GraphicElement el; + el.type = GraphicElement::TYPE_ARROW; + el.style = style; + el.x1 = x + lut_swbox_x1; + el.x2 = x + lut_swbox_x2; + el.y1 = y + (logic_cell_y1 + logic_cell_y2) / 2 - 0.0075 + (0.005 * in_idx) + lut_idx * logic_cell_pitch; + el.y2 = y + (logic_cell_y1 + logic_cell_y2) / 2 - 0.0075 + (0.005 * out_idx) + lut_idx * logic_cell_pitch; + g.push_back(el); + return; + } + if (src == TILE_WIRE_CARRY_IN && dst == TILE_WIRE_CARRY_IN_MUX) { GraphicElement el; el.type = GraphicElement::TYPE_ARROW; |