From bfbb6dbf6955f0fd5e68928f27d1a2edd17b5646 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 6 Oct 2019 11:26:56 +0200 Subject: Draw swbox, smaller slices, proper io --- ecp5/arch.cc | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++----- ecp5/arch.h | 14 +++---- ecp5/archdefs.h | 21 +++++++--- ecp5/gfx.h | 27 ++++++++++--- 4 files changed, 157 insertions(+), 28 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 8ce0653c..9344ff5e 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -603,32 +603,60 @@ std::vector Arch::getDecalGraphics(DecalId decal) const { std::vector ret; + if (decal.type == DecalId::TYPE_GROUP) { + int type = decal.z; + int x = decal.location.x; + int y = chip_info->height - 1 - decal.location.y; + + if (type == GroupId::TYPE_SWITCHBOX) { + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = GraphicElement::STYLE_FRAME; + + el.x1 = x + switchbox_x1; + el.x2 = x + switchbox_x2; + el.y1 = y + switchbox_y1; + el.y2 = y + switchbox_y2; + ret.push_back(el); + } + } + if (decal.type == DecalId::TYPE_BEL) { BelId bel; bel.index = decal.z; bel.location = decal.location; - int z = locInfo(bel)->bel_data[bel.index].z; auto bel_type = getBelType(bel); + int x = decal.location.x; + int y = chip_info->height - 1 - decal.location.y; + int z = locInfo(bel)->bel_data[bel.index].z; if (bel_type == id_TRELLIS_SLICE) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = bel.location.x + logic_cell_x1; - el.x2 = bel.location.x + logic_cell_x2; - el.y1 = bel.location.y + logic_cell_y1 + (z)*logic_cell_pitch; - el.y2 = bel.location.y + logic_cell_y2 + (z)*logic_cell_pitch; + el.x1 = x + slice_x1; + el.x2 = x + slice_x2; + el.y1 = y + slice_y1 + (z)*slice_pitch; + el.y2 = y + slice_y2 + (z)*slice_pitch; ret.push_back(el); } if (bel_type == id_TRELLIS_IO) { + bool top_bottom = (y==0 || y==(chip_info->height-1)); GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = bel.location.x + logic_cell_x1; - el.x2 = bel.location.x + logic_cell_x2; - el.y1 = bel.location.y + logic_cell_y1 + (2 * z) * logic_cell_pitch; - el.y2 = bel.location.y + logic_cell_y2 + (2 * z + 0.5f) * logic_cell_pitch; + if (top_bottom) { + el.x1 = x + io_cell_h_x1 + (2 * (z+1)) * io_cell_h_pitch; + el.x2 = x + io_cell_h_x2 + (2 * (z+1) + 0.5f) * io_cell_h_pitch; + el.y1 = y + io_cell_h_y1; + el.y2 = y + io_cell_h_y2; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = x + io_cell_v_x2; + el.y1 = y + io_cell_v_y1 + (2 * z) * io_cell_v_pitch; + el.y2 = y + io_cell_v_y2 + (2 * z + 0.5f) * io_cell_v_pitch; + } ret.push_back(el); } } @@ -650,7 +678,15 @@ DecalXY Arch::getWireDecal(WireId wire) const { return {}; } DecalXY Arch::getPipDecal(PipId pip) const { return {}; }; -DecalXY Arch::getGroupDecal(GroupId pip) const { return {}; }; +DecalXY Arch::getGroupDecal(GroupId group) const +{ + DecalXY decalxy; + decalxy.decal.type = DecalId::TYPE_GROUP; + decalxy.decal.location = group.location; + decalxy.decal.z = group.type; + decalxy.decal.active = true; + return decalxy; +} // ----------------------------------------------------------------------- @@ -1068,4 +1104,71 @@ const std::vector Arch::availablePlacers = {"sa", #endif }; +// ----------------------------------------------------------------------- + +GroupId Arch::getGroupByName(IdString name) const +{ + for (auto g : getGroups()) + if (getGroupName(g) == name) + return g; + return GroupId(); +} + +IdString Arch::getGroupName(GroupId group) const +{ + std::string suffix; + + switch (group.type) { + case GroupId::TYPE_SWITCHBOX: + suffix = "switchbox"; + break; + default: + return IdString(); + } + + return id("X" + std::to_string(group.location.x) + "/Y" + std::to_string(group.location.y) + "/" + suffix); +} + +std::vector Arch::getGroups() const +{ + std::vector ret; + + for (int y = 1; y < chip_info->height-1; y++) { + for (int x = 1; x < chip_info->width-1; x++) { + GroupId group; + group.type = GroupId::TYPE_SWITCHBOX; + group.location.x = x; + group.location. y = y; + ret.push_back(group); + } + } + return ret; +} + +std::vector Arch::getGroupBels(GroupId group) const +{ + std::vector ret; + return ret; +} + +std::vector Arch::getGroupWires(GroupId group) const +{ + std::vector ret; + return ret; +} + +std::vector Arch::getGroupPips(GroupId group) const +{ + std::vector ret; + return ret; +} + +std::vector Arch::getGroupGroups(GroupId group) const +{ + std::vector ret; + return ret; +} + +// ----------------------------------------------------------------------- + NEXTPNR_NAMESPACE_END diff --git a/ecp5/arch.h b/ecp5/arch.h index a479abb6..94bd5f3a 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -930,13 +930,13 @@ struct Arch : BaseCtx // ------------------------------------------------- - GroupId getGroupByName(IdString name) const { return GroupId(); } - IdString getGroupName(GroupId group) const { return IdString(); } - std::vector getGroups() const { return std::vector(); } - std::vector getGroupBels(GroupId group) const { return std::vector(); } - std::vector getGroupWires(GroupId group) const { return std::vector(); } - std::vector getGroupPips(GroupId group) const { return std::vector(); } - std::vector getGroupGroups(GroupId group) const { return std::vector(); } + GroupId getGroupByName(IdString name) const; + IdString getGroupName(GroupId group) const; + std::vector getGroups() const; + std::vector getGroupBels(GroupId group) const; + std::vector getGroupWires(GroupId group) const; + std::vector getGroupPips(GroupId group) const; + std::vector getGroupGroups(GroupId group) const; // ------------------------------------------------- diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index da12eeaa..67c016cc 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -122,10 +122,15 @@ struct PipId struct GroupId { - int32_t index = -1; + enum : int8_t + { + TYPE_NONE, + TYPE_SWITCHBOX + } type = TYPE_NONE; + Location location; - bool operator==(const GroupId &other) const { return index == other.index; } - bool operator!=(const GroupId &other) const { return index != other.index; } + bool operator==(const GroupId &other) const { return (type == other.type) && (location == other.location); } + bool operator!=(const GroupId &other) const { return (type != other.type) || (location != other.location); } }; struct DecalId @@ -133,8 +138,11 @@ struct DecalId enum { TYPE_NONE, - TYPE_BEL - } type; + TYPE_BEL, + TYPE_WIRE, + TYPE_PIP, + TYPE_GROUP + } type = TYPE_NONE; Location location; uint32_t z = 0; bool active = false; @@ -216,7 +224,8 @@ template <> struct hash { std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept { - return std::hash()(group.index); + std::size_t seed = std::hash()(group.location); + return seed; } }; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 0290d2f6..ec867547 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -24,11 +24,28 @@ NEXTPNR_NAMESPACE_BEGIN -const float logic_cell_x1 = 0.76; -const float logic_cell_x2 = 0.95; -const float logic_cell_y1 = 0.05; -const float logic_cell_y2 = 0.15; -const float logic_cell_pitch = 0.125; +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.04; + +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; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From eafc0e4e9e94edfb0626dc3817fa5d119e2a01f7 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 6 Oct 2019 16:24:43 +0200 Subject: Added type to wire --- ecp5/arch.h | 9 +++++++- ecp5/constids.inc | 19 ++++++++++++++++ ecp5/trellis_import.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) diff --git a/ecp5/arch.h b/ecp5/arch.h index 94bd5f3a..f6ba1a7b 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -84,6 +84,7 @@ NPNR_PACKED_STRUCT(struct PipLocatorPOD { NPNR_PACKED_STRUCT(struct WireInfoPOD { RelPtr name; + int32_t type; int32_t num_uphill, num_downhill; RelPtr pips_uphill, pips_downhill; @@ -639,7 +640,13 @@ struct Arch : BaseCtx return id(name.str()); } - IdString getWireType(WireId wire) const { return IdString(); } + IdString getWireType(WireId wire) const + { + NPNR_ASSERT(wire != WireId()); + IdString id; + id.index = locInfo(wire)->wire_data[wire.index].type; + return id; + } std::vector> getWireAttrs(WireId) const { diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 5e8fc7da..f7d722c1 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1294,3 +1294,22 @@ X(P) X(ECLKBRIDGECS) X(SEL) X(ECSOUT) + +X(WIRE_TYPE_NONE) +X(WIRE_TYPE_SLICE) +X(WIRE_TYPE_H00R) +X(WIRE_TYPE_H00L) +X(WIRE_TYPE_H01E) +X(WIRE_TYPE_H01W) +X(WIRE_TYPE_H02E) +X(WIRE_TYPE_H02W) +X(WIRE_TYPE_H06E) +X(WIRE_TYPE_H06W) +X(WIRE_TYPE_V00T) +X(WIRE_TYPE_V00B) +X(WIRE_TYPE_V01N) +X(WIRE_TYPE_V01S) +X(WIRE_TYPE_V02N) +X(WIRE_TYPE_V02S) +X(WIRE_TYPE_V06N) +X(WIRE_TYPE_V06S) diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index 610bd331..188c6909 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -16,6 +16,65 @@ parser.add_argument("device", type=str, help="target device") parser.add_argument("-p", "--constids", type=str, help="path to constids.inc") args = parser.parse_args() +def wire_type(name): + longname = name + name = name.split('/') + + if name[0].startswith("X") and name[1].startswith("Y"): + name = name[2:] + + if name[0].endswith("_SLICE"): + return "WIRE_TYPE_SLICE" + + if name[0].startswith("H00R"): + return "WIRE_TYPE_H00R" + + if name[0].startswith("H00L"): + return "WIRE_TYPE_H00L" + + if name[0].startswith("H01E"): + return "WIRE_TYPE_H01E" + + if name[0].startswith("H01W"): + return "WIRE_TYPE_H01W" + + if name[0].startswith("H02E"): + return "WIRE_TYPE_H02E" + + if name[0].startswith("H02W"): + return "WIRE_TYPE_H02W" + + if name[0].startswith("H06E"): + return "WIRE_TYPE_H06E" + + if name[0].startswith("H06W"): + return "WIRE_TYPE_H06W" + + if name[0].startswith("V00T"): + return "WIRE_TYPE_V00T" + + if name[0].startswith("V00B"): + return "WIRE_TYPE_V00B" + + if name[0].startswith("V01N"): + return "WIRE_TYPE_V01N" + + if name[0].startswith("V01S"): + return "WIRE_TYPE_V01S" + + if name[0].startswith("V02N"): + return "WIRE_TYPE_V02N" + + if name[0].startswith("V02S"): + return "WIRE_TYPE_V02S" + + if name[0].startswith("V06N"): + return "WIRE_TYPE_V06N" + + if name[0].startswith("V06S"): + return "WIRE_TYPE_V06S" + + return "WIRE_TYPE_NONE" def is_global(loc): return loc.x == -2 and loc.y == -2 @@ -298,6 +357,7 @@ def write_database(dev_name, chip, ddrg, endianness): for wire_idx in range(len(loctype.wires)): wire = loctype.wires[wire_idx] bba.s(ddrg.to_str(wire.name), "name") + bba.u32(constids[wire_type(ddrg.to_str(wire.name))], "type") bba.u32(len(wire.arcsUphill), "num_uphill") bba.u32(len(wire.arcsDownhill), "num_downhill") bba.r("loc%d_wire%d_uppips" % (idx, wire_idx) if len(wire.arcsUphill) > 0 else None, "pips_uphill") -- cgit v1.2.3 From f7a6d4dc06c333ebb8165daa1e2b4d23c188285d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 6 Oct 2019 17:59:44 +0200 Subject: Start adding visible wires --- ecp5/arch.cc | 39 ++++++++++++++++++++++++++++++++++++++- ecp5/arch.h | 7 ++----- ecp5/family.cmake | 10 ++++++---- ecp5/gfx.h | 25 +++++++++++++++++++++++++ ecp5/trellis_import.py | 28 ++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 10 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 9344ff5e..709f1c3f 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -620,7 +620,26 @@ std::vector Arch::getDecalGraphics(DecalId decal) const ret.push_back(el); } } + if (decal.type == DecalId::TYPE_WIRE) { + WireId wire; + wire.index = decal.z; + wire.location = decal.location; + auto wire_type = getWireType(wire); + int x = decal.location.x; + int y = chip_info->height - 1 - decal.location.y; + GfxTileWireId tilewire = GfxTileWireId(locInfo(wire)->wire_data[wire.index].tile_wire); + if (wire_type == id_WIRE_TYPE_SLICE && tilewire != GfxTileWireId::TILE_WIRE_NONE) { + 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; + el.y1 = y + slice_y2 - 0.0017f * tilewire; + el.y2 = y + slice_y2 - 0.0017f * tilewire; + ret.push_back(el); + } + } if (decal.type == DecalId::TYPE_BEL) { BelId bel; bel.index = decal.z; @@ -674,7 +693,15 @@ DecalXY Arch::getBelDecal(BelId bel) const return decalxy; } -DecalXY Arch::getWireDecal(WireId wire) const { return {}; } +DecalXY Arch::getWireDecal(WireId wire) const +{ + DecalXY decalxy; + decalxy.decal.type = DecalId::TYPE_WIRE; + decalxy.decal.location = wire.location; + decalxy.decal.z = wire.index; + decalxy.decal.active = false; + return decalxy; +} DecalXY Arch::getPipDecal(PipId pip) const { return {}; }; @@ -1171,4 +1198,14 @@ std::vector Arch::getGroupGroups(GroupId group) const // ----------------------------------------------------------------------- + +std::vector> Arch::getWireAttrs(WireId wire) const +{ + std::vector> ret; + auto &wi = locInfo(wire)->wire_data[wire.index]; + + ret.push_back(std::make_pair(id("TILE_WIRE_ID"), stringf("%d", wi.tile_wire))); + + return ret; +} NEXTPNR_NAMESPACE_END diff --git a/ecp5/arch.h b/ecp5/arch.h index f6ba1a7b..815dae0c 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -85,6 +85,7 @@ NPNR_PACKED_STRUCT(struct PipLocatorPOD { NPNR_PACKED_STRUCT(struct WireInfoPOD { RelPtr name; int32_t type; + int32_t tile_wire; int32_t num_uphill, num_downhill; RelPtr pips_uphill, pips_downhill; @@ -648,11 +649,7 @@ struct Arch : BaseCtx return id; } - std::vector> getWireAttrs(WireId) const - { - std::vector> ret; - return ret; - } + std::vector> getWireAttrs(WireId) const; uint32_t getWireChecksum(WireId wire) const { return wire.index; } diff --git a/ecp5/family.cmake b/ecp5/family.cmake index 5512e7dd..b0b520d7 100644 --- a/ecp5/family.cmake +++ b/ecp5/family.cmake @@ -41,14 +41,15 @@ if (NOT EXTERNAL_CHIPDB) set(DEV_CC_DB ${CMAKE_CURRENT_BINARY_DIR}/ecp5/chipdbs/chipdb-${dev}.bin) set(DEV_CC_BBA_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.bba) set(DEV_CONSTIDS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/constids.inc) + set(DEV_GFXH ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/gfx.h) if (PREGENERATED_BBA_PATH) add_custom_command(OUTPUT ${DEV_CC_DB} COMMAND bbasm ${BBASM_ENDIAN_FLAG} ${PREGENERATED_BBA_PATH}/chipdb-${dev}.bba ${DEV_CC_DB} ) else() add_custom_command(OUTPUT ${DEV_CC_BBA_DB} - COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB} - DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB} + COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} -g ${DEV_GFXH} ${dev} > ${DEV_CC_BBA_DB} + DEPENDS ${DEV_CONSTIDS_INC} ${DEV_GFXH} ${DB_PY} ${PREV_DEV_CC_BBA_DB} ) add_custom_command(OUTPUT ${DEV_CC_DB} COMMAND bbasm ${BBASM_ENDIAN_FLAG} ${DEV_CC_BBA_DB} ${DEV_CC_DB} @@ -71,6 +72,7 @@ if (NOT EXTERNAL_CHIPDB) set(DEV_CC_DB ${CMAKE_CURRENT_BINARY_DIR}/ecp5/chipdbs/chipdb-${dev}.cc) set(DEV_CC_BBA_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.bba) set(DEV_CONSTIDS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/constids.inc) + set(DEV_GFXH ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/gfx.h) if (PREGENERATED_BBA_PATH) add_custom_command(OUTPUT ${DEV_CC_DB} COMMAND bbasm --c ${BBASM_ENDIAN_FLAG} ${PREGENERATED_BBA_PATH}/chipdb-${dev}.bba ${DEV_CC_DB}.new @@ -78,9 +80,9 @@ if (NOT EXTERNAL_CHIPDB) ) else() add_custom_command(OUTPUT ${DEV_CC_BBA_DB} - COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}.new + COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} -g ${DEV_GFXH} ${dev} > ${DEV_CC_BBA_DB}.new COMMAND mv ${DEV_CC_BBA_DB}.new ${DEV_CC_BBA_DB} - DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB} + DEPENDS ${DEV_CONSTIDS_INC} ${DEV_GFXH} ${DB_PY} ${PREV_DEV_CC_BBA_DB} ) add_custom_command(OUTPUT ${DEV_CC_DB} COMMAND bbasm --c ${BBASM_ENDIAN_FLAG} ${DEV_CC_BBA_DB} ${DEV_CC_DB}.new diff --git a/ecp5/gfx.h b/ecp5/gfx.h index ec867547..c8d77766 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -47,6 +47,31 @@ 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_D1_SLICE, + TILE_WIRE_C1_SLICE, + TILE_WIRE_B1_SLICE, + TILE_WIRE_A1_SLICE, + TILE_WIRE_D0_SLICE, + TILE_WIRE_C0_SLICE, + TILE_WIRE_B0_SLICE, + TILE_WIRE_A0_SLICE, + TILE_WIRE_DI1_SLICE, + TILE_WIRE_DI0_SLICE, + TILE_WIRE_M1_SLICE, + 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 +}; + NEXTPNR_NAMESPACE_END #endif diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index 188c6909..2ff0d0e7 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -10,12 +10,36 @@ from os import path location_types = dict() type_at_location = dict() tiletype_names = dict() +gfx_wire_ids = dict() +gfx_wire_names = list() parser = argparse.ArgumentParser(description="import ECP5 routing and bels from Project Trellis") parser.add_argument("device", type=str, help="target device") parser.add_argument("-p", "--constids", type=str, help="path to constids.inc") +parser.add_argument("-g", "--gfxh", type=str, help="path to gfx.h") args = parser.parse_args() +with open(args.gfxh) as f: + state = 0 + for line in f: + if state == 0 and line.startswith("enum GfxTileWireId"): + state = 1 + elif state == 1 and line.startswith("};"): + state = 0 + elif state == 1 and (line.startswith("{") or line.strip() == ""): + pass + elif state == 1: + idx = len(gfx_wire_ids) + name = line.strip().rstrip(",") + gfx_wire_ids[name] = idx + gfx_wire_names.append(name) + +def gfx_wire_alias(old, new): + assert old in gfx_wire_ids + assert new not in gfx_wire_ids + gfx_wire_ids[new] = gfx_wire_ids[old] + + def wire_type(name): longname = name name = name.split('/') @@ -358,6 +382,10 @@ def write_database(dev_name, chip, ddrg, endianness): wire = loctype.wires[wire_idx] bba.s(ddrg.to_str(wire.name), "name") bba.u32(constids[wire_type(ddrg.to_str(wire.name))], "type") + if ("TILE_WIRE_" + ddrg.to_str(wire.name)) in gfx_wire_ids: + bba.u32(gfx_wire_ids["TILE_WIRE_" + ddrg.to_str(wire.name)], "tile_wire") + else: + bba.u32(0, "tile_wire") bba.u32(len(wire.arcsUphill), "num_uphill") bba.u32(len(wire.arcsDownhill), "num_downhill") bba.r("loc%d_wire%d_uppips" % (idx, wire_idx) if len(wire.arcsUphill) > 0 else None, "pips_uphill") -- cgit v1.2.3 From d1dc2c3a5f4fc1d737eeac7d0fb9c87bf89c392b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 6 Oct 2019 18:09:23 +0200 Subject: Add more zoom --- gui/fpgaviewwidget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index 3c0cfbbd..6236daca 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -126,7 +126,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions void clickedPip(PipId pip, bool add); private: - const float zoomNear_ = 0.1f; // do not zoom closer than this + const float zoomNear_ = 0.05f; // do not zoom closer than this float zoomFar_ = 10.0f; // do not zoom further than this const float zoomLvl1_ = 1.0f; const float zoomLvl2_ = 5.0f; -- cgit v1.2.3 From 1ae64d7bf53cb988003fa9b3eff1f36c30d4d50d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 11 Oct 2019 08:15:02 +0200 Subject: Display rest of slice input wires --- ecp5/arch.cc | 10 ++++++++-- ecp5/gfx.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 709f1c3f..74ed57bc 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -633,10 +633,16 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + int offset = 0; + int wire_offset = 0; + if (tilewire >= TILE_WIRE_D7_SLICE && tilewire <=TILE_WIRE_CLK3_SLICE) { offset = 3; wire_offset = tilewire - TILE_WIRE_D7_SLICE + 1; } + if (tilewire >= TILE_WIRE_D5_SLICE && tilewire <=TILE_WIRE_CLK2_SLICE) { offset = 2; wire_offset = tilewire - TILE_WIRE_D5_SLICE + 1; } + if (tilewire >= TILE_WIRE_D3_SLICE && tilewire <=TILE_WIRE_CLK1_SLICE) { offset = 1; wire_offset = tilewire - TILE_WIRE_D3_SLICE + 1; } + if (tilewire >= TILE_WIRE_D1_SLICE && tilewire <=TILE_WIRE_CLK0_SLICE) { offset = 0; wire_offset = tilewire - TILE_WIRE_D1_SLICE + 1; } el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * tilewire; - el.y2 = y + slice_y2 - 0.0017f * tilewire; + el.y1 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; ret.push_back(el); } } diff --git a/ecp5/gfx.h b/ecp5/gfx.h index c8d77766..00d131e8 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -50,7 +50,67 @@ const float io_cell_h_pitch = 0.125; enum GfxTileWireId { TILE_WIRE_NONE, - + + TILE_WIRE_D7_SLICE, + TILE_WIRE_C7_SLICE, + TILE_WIRE_B7_SLICE, + TILE_WIRE_A7_SLICE, + TILE_WIRE_D6_SLICE, + TILE_WIRE_C6_SLICE, + TILE_WIRE_B6_SLICE, + TILE_WIRE_A6_SLICE, + TILE_WIRE_DI7_SLICE, + TILE_WIRE_DI6_SLICE, + TILE_WIRE_M7_SLICE, + TILE_WIRE_M6_SLICE, + TILE_WIRE_FXBD_SLICE, + TILE_WIRE_FXAD_SLICE, + TILE_WIRE_WRE3_SLICE_DUMMY, + TILE_WIRE_WCK3_SLICE_DUMMY, + TILE_WIRE_CE3_SLICE, + TILE_WIRE_LSR3_SLICE, + TILE_WIRE_CLK3_SLICE, + + TILE_WIRE_D5_SLICE, + TILE_WIRE_C5_SLICE, + TILE_WIRE_B5_SLICE, + TILE_WIRE_A5_SLICE, + TILE_WIRE_D4_SLICE, + TILE_WIRE_C4_SLICE, + TILE_WIRE_B4_SLICE, + TILE_WIRE_A4_SLICE, + TILE_WIRE_DI5_SLICE, + TILE_WIRE_DI4_SLICE, + TILE_WIRE_M5_SLICE, + TILE_WIRE_M4_SLICE, + TILE_WIRE_FXBC_SLICE, + TILE_WIRE_FXAC_SLICE, + TILE_WIRE_WRE2_SLICE_DUMMY, + TILE_WIRE_WCK2_SLICE_DUMMY, + TILE_WIRE_CE2_SLICE, + TILE_WIRE_LSR2_SLICE, + TILE_WIRE_CLK2_SLICE, + + TILE_WIRE_D3_SLICE, + TILE_WIRE_C3_SLICE, + TILE_WIRE_B3_SLICE, + TILE_WIRE_A3_SLICE, + TILE_WIRE_D2_SLICE, + TILE_WIRE_C2_SLICE, + TILE_WIRE_B2_SLICE, + TILE_WIRE_A2_SLICE, + TILE_WIRE_DI3_SLICE, + TILE_WIRE_DI2_SLICE, + TILE_WIRE_M3_SLICE, + TILE_WIRE_M2_SLICE, + TILE_WIRE_FXBB_SLICE, + TILE_WIRE_FXAB_SLICE, + TILE_WIRE_WRE1_SLICE, + TILE_WIRE_WCK1_SLICE, + TILE_WIRE_CE1_SLICE, + TILE_WIRE_LSR1_SLICE, + TILE_WIRE_CLK1_SLICE, + TILE_WIRE_D1_SLICE, TILE_WIRE_C1_SLICE, TILE_WIRE_B1_SLICE, -- cgit v1.2.3 From 49b12a828ad647552fa440c42a8000d84ec9d85a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 11 Oct 2019 15:31:07 +0200 Subject: Add other side of slice wires --- ecp5/arch.cc | 33 ++++++++++++++------ ecp5/gfx.h | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 118 insertions(+), 14 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 74ed57bc..bc533f24 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -635,15 +635,30 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; int offset = 0; int wire_offset = 0; - if (tilewire >= TILE_WIRE_D7_SLICE && tilewire <=TILE_WIRE_CLK3_SLICE) { offset = 3; wire_offset = tilewire - TILE_WIRE_D7_SLICE + 1; } - if (tilewire >= TILE_WIRE_D5_SLICE && tilewire <=TILE_WIRE_CLK2_SLICE) { offset = 2; wire_offset = tilewire - TILE_WIRE_D5_SLICE + 1; } - if (tilewire >= TILE_WIRE_D3_SLICE && tilewire <=TILE_WIRE_CLK1_SLICE) { offset = 1; wire_offset = tilewire - TILE_WIRE_D3_SLICE + 1; } - if (tilewire >= TILE_WIRE_D1_SLICE && tilewire <=TILE_WIRE_CLK0_SLICE) { offset = 0; wire_offset = tilewire - TILE_WIRE_D1_SLICE + 1; } - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; - ret.push_back(el); + if (tilewire >= TILE_WIRE_D7_SLICE && tilewire <=TILE_WIRE_CLK0_SLICE) + { + if (tilewire >= TILE_WIRE_D7_SLICE && tilewire <=TILE_WIRE_CLK3_SLICE) { offset = 3; wire_offset = tilewire - TILE_WIRE_D7_SLICE + 1; } + if (tilewire >= TILE_WIRE_D5_SLICE && tilewire <=TILE_WIRE_CLK2_SLICE) { offset = 2; wire_offset = tilewire - TILE_WIRE_D5_SLICE + 1; } + if (tilewire >= TILE_WIRE_D3_SLICE && tilewire <=TILE_WIRE_CLK1_SLICE) { offset = 1; wire_offset = tilewire - TILE_WIRE_D3_SLICE + 1; } + if (tilewire >= TILE_WIRE_D1_SLICE && tilewire <=TILE_WIRE_CLK0_SLICE) { offset = 0; wire_offset = tilewire - TILE_WIRE_D1_SLICE + 1; } + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; + ret.push_back(el); + } + if (tilewire >= TILE_WIRE_DUMMY_100 && tilewire <=TILE_WIRE_F5A_SLICE) + { + if (tilewire >= TILE_WIRE_DUMMY_100 && tilewire <=TILE_WIRE_F5D_SLICE) { offset = 3; wire_offset = tilewire - TILE_WIRE_DUMMY_100 + 1; } + if (tilewire >= TILE_WIRE_WDO3C_SLICE && tilewire <=TILE_WIRE_F5C_SLICE) { offset = 2; wire_offset = tilewire - TILE_WIRE_WDO3C_SLICE + 1; } + if (tilewire >= TILE_WIRE_DUMMY_300 && tilewire <=TILE_WIRE_F5B_SLICE) { offset = 1; wire_offset = tilewire - TILE_WIRE_DUMMY_300 + 1; } + if (tilewire >= TILE_WIRE_DUMMY_400 && tilewire <=TILE_WIRE_F5A_SLICE) { offset = 0; wire_offset = tilewire - TILE_WIRE_DUMMY_400 + 1; } + el.x1 = x + slice_x2; + el.x2 = x + slice_x2 + 0.005f; + el.y1 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; + ret.push_back(el); + } } } if (decal.type == DecalId::TYPE_BEL) { diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 00d131e8..aa1c9185 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -65,8 +65,8 @@ enum GfxTileWireId TILE_WIRE_M6_SLICE, TILE_WIRE_FXBD_SLICE, TILE_WIRE_FXAD_SLICE, - TILE_WIRE_WRE3_SLICE_DUMMY, - TILE_WIRE_WCK3_SLICE_DUMMY, + TILE_WIRE_DUMMY_1, + TILE_WIRE_DUMMY_2, TILE_WIRE_CE3_SLICE, TILE_WIRE_LSR3_SLICE, TILE_WIRE_CLK3_SLICE, @@ -85,8 +85,8 @@ enum GfxTileWireId TILE_WIRE_M4_SLICE, TILE_WIRE_FXBC_SLICE, TILE_WIRE_FXAC_SLICE, - TILE_WIRE_WRE2_SLICE_DUMMY, - TILE_WIRE_WCK2_SLICE_DUMMY, + TILE_WIRE_DUMMY_3, + TILE_WIRE_DUMMY_4, TILE_WIRE_CE2_SLICE, TILE_WIRE_LSR2_SLICE, TILE_WIRE_CLK2_SLICE, @@ -129,7 +129,96 @@ enum GfxTileWireId TILE_WIRE_WCK0_SLICE, TILE_WIRE_CE0_SLICE, TILE_WIRE_LSR0_SLICE, - TILE_WIRE_CLK0_SLICE + TILE_WIRE_CLK0_SLICE, + + TILE_WIRE_FCO_SLICE, + TILE_WIRE_FCID_SLICE, + TILE_WIRE_FCOC_SLICE, + TILE_WIRE_FCIC_SLICE, + TILE_WIRE_FCOB_SLICE, + TILE_WIRE_FCIB_SLICE, + TILE_WIRE_FCOA_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_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_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_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_FXA_SLICE, + TILE_WIRE_F1_SLICE, + TILE_WIRE_Q1_SLICE, + TILE_WIRE_Q0_SLICE, + TILE_WIRE_F0_SLICE, + TILE_WIRE_F5A_SLICE }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 3e117ce7925165e1f4ae61011b5444dfc3a78627 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 11 Oct 2019 16:26:08 +0200 Subject: Optimize --- ecp5/arch.cc | 16 +++-------- ecp5/gfx.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 87 insertions(+), 18 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index bc533f24..818085ad 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -637,26 +637,18 @@ std::vector Arch::getDecalGraphics(DecalId decal) const int wire_offset = 0; if (tilewire >= TILE_WIRE_D7_SLICE && tilewire <=TILE_WIRE_CLK0_SLICE) { - if (tilewire >= TILE_WIRE_D7_SLICE && tilewire <=TILE_WIRE_CLK3_SLICE) { offset = 3; wire_offset = tilewire - TILE_WIRE_D7_SLICE + 1; } - if (tilewire >= TILE_WIRE_D5_SLICE && tilewire <=TILE_WIRE_CLK2_SLICE) { offset = 2; wire_offset = tilewire - TILE_WIRE_D5_SLICE + 1; } - if (tilewire >= TILE_WIRE_D3_SLICE && tilewire <=TILE_WIRE_CLK1_SLICE) { offset = 1; wire_offset = tilewire - TILE_WIRE_D3_SLICE + 1; } - if (tilewire >= TILE_WIRE_D1_SLICE && tilewire <=TILE_WIRE_CLK0_SLICE) { offset = 0; wire_offset = tilewire - TILE_WIRE_D1_SLICE + 1; } el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; + 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) { - if (tilewire >= TILE_WIRE_DUMMY_100 && tilewire <=TILE_WIRE_F5D_SLICE) { offset = 3; wire_offset = tilewire - TILE_WIRE_DUMMY_100 + 1; } - if (tilewire >= TILE_WIRE_WDO3C_SLICE && tilewire <=TILE_WIRE_F5C_SLICE) { offset = 2; wire_offset = tilewire - TILE_WIRE_WDO3C_SLICE + 1; } - if (tilewire >= TILE_WIRE_DUMMY_300 && tilewire <=TILE_WIRE_F5B_SLICE) { offset = 1; wire_offset = tilewire - TILE_WIRE_DUMMY_300 + 1; } - if (tilewire >= TILE_WIRE_DUMMY_400 && tilewire <=TILE_WIRE_F5A_SLICE) { offset = 0; wire_offset = tilewire - TILE_WIRE_DUMMY_400 + 1; } el.x1 = x + slice_x2; el.x2 = x + slice_x2 + 0.005f; - el.y1 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * wire_offset + offset*slice_pitch; + 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); } } diff --git a/ecp5/gfx.h b/ecp5/gfx.h index aa1c9185..aa8cc398 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -33,7 +33,7 @@ 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.04; +const float slice_pitch = 0.0374; const float io_cell_v_x1 = 0.76; const float io_cell_v_x2 = 0.95; @@ -65,11 +65,15 @@ enum GfxTileWireId TILE_WIRE_M6_SLICE, TILE_WIRE_FXBD_SLICE, TILE_WIRE_FXAD_SLICE, - TILE_WIRE_DUMMY_1, - TILE_WIRE_DUMMY_2, + TILE_WIRE_DUMMY_001, + TILE_WIRE_DUMMY_002, 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_D5_SLICE, TILE_WIRE_C5_SLICE, @@ -85,12 +89,16 @@ enum GfxTileWireId TILE_WIRE_M4_SLICE, TILE_WIRE_FXBC_SLICE, TILE_WIRE_FXAC_SLICE, - TILE_WIRE_DUMMY_3, - TILE_WIRE_DUMMY_4, + TILE_WIRE_DUMMY_006, + TILE_WIRE_DUMMY_007, 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_D3_SLICE, TILE_WIRE_C3_SLICE, TILE_WIRE_B3_SLICE, @@ -111,6 +119,10 @@ enum GfxTileWireId TILE_WIRE_LSR1_SLICE, TILE_WIRE_CLK1_SLICE, + TILE_WIRE_DUMMY_011, + TILE_WIRE_DUMMY_012, + TILE_WIRE_DUMMY_013, + TILE_WIRE_D1_SLICE, TILE_WIRE_C1_SLICE, TILE_WIRE_B1_SLICE, @@ -159,6 +171,10 @@ enum GfxTileWireId 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, @@ -180,6 +196,10 @@ enum GfxTileWireId 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, @@ -200,6 +220,10 @@ enum GfxTileWireId 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, @@ -218,7 +242,60 @@ enum GfxTileWireId TILE_WIRE_Q1_SLICE, TILE_WIRE_Q0_SLICE, TILE_WIRE_F0_SLICE, - TILE_WIRE_F5A_SLICE + TILE_WIRE_F5A_SLICE, + + + TILE_WIRE_LSR1, + TILE_WIRE_LSR0, + TILE_WIRE_CLK1, + TILE_WIRE_CLK0, + TILE_WIRE_DUMMY_500, + TILE_WIRE_FCO, + TILE_WIRE_D7, + TILE_WIRE_C7, + TILE_WIRE_B7, + TILE_WIRE_A7, + TILE_WIRE_D6, + TILE_WIRE_C6, + TILE_WIRE_B6, + TILE_WIRE_A6, + TILE_WIRE_DI7, + TILE_WIRE_DI6, + TILE_WIRE_M7, + TILE_WIRE_M6, + TILE_WIRE_FXBD, + TILE_WIRE_FXAD, + TILE_WIRE_DUMMY_501, + TILE_WIRE_DUMMY_502, + 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_D5, + TILE_WIRE_C5, + TILE_WIRE_B5, + TILE_WIRE_A5, + TILE_WIRE_D4, + TILE_WIRE_C4, + TILE_WIRE_B4, + TILE_WIRE_A4, + TILE_WIRE_DI5, + TILE_WIRE_DI4, + TILE_WIRE_M5, + TILE_WIRE_M4, + TILE_WIRE_FXBC, + TILE_WIRE_FXAC, + TILE_WIRE_DUMMY_508, + TILE_WIRE_DUMMY_509, + TILE_WIRE_CE2, + TILE_WIRE_DUMMY_510, + TILE_WIRE_DUMMY_511, + + }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 0b4ced96ecfd9ba216bccca5b073d23ed104a89f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 11 Oct 2019 17:52:57 +0200 Subject: draw rest of slice wires and more from switchbox --- ecp5/arch.cc | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- ecp5/gfx.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 106 insertions(+), 7 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 818085ad..3c56e057 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -633,8 +633,6 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - int offset = 0; - int wire_offset = 0; if (tilewire >= TILE_WIRE_D7_SLICE && tilewire <=TILE_WIRE_CLK0_SLICE) { el.x1 = x + slice_x1 - 0.005f; @@ -651,7 +649,58 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_DUMMY_100 + 1) + 3*slice_pitch; ret.push_back(el); } - } + } + if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) + { + 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; + ret.push_back(el); + } + if (tilewire >= TILE_WIRE_FCO_SLICE && tilewire <=TILE_WIRE_FCOA_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; + 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 (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; + 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; + ret.push_back(el); + } + } } if (decal.type == DecalId::TYPE_BEL) { BelId bel; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index aa8cc398..a5c62508 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -144,12 +144,13 @@ enum GfxTileWireId TILE_WIRE_CLK0_SLICE, TILE_WIRE_FCO_SLICE, - TILE_WIRE_FCID_SLICE, TILE_WIRE_FCOC_SLICE, - TILE_WIRE_FCIC_SLICE, TILE_WIRE_FCOB_SLICE, - TILE_WIRE_FCIB_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, @@ -249,8 +250,8 @@ enum GfxTileWireId TILE_WIRE_LSR0, TILE_WIRE_CLK1, TILE_WIRE_CLK0, - TILE_WIRE_DUMMY_500, TILE_WIRE_FCO, + TILE_WIRE_DUMMY_500, TILE_WIRE_D7, TILE_WIRE_C7, TILE_WIRE_B7, @@ -295,7 +296,56 @@ enum GfxTileWireId TILE_WIRE_DUMMY_510, TILE_WIRE_DUMMY_511, + TILE_WIRE_DUMMY_512, + TILE_WIRE_DUMMY_513, + TILE_WIRE_DUMMY_514, + + TILE_WIRE_D3, + TILE_WIRE_C3, + TILE_WIRE_B3, + TILE_WIRE_A3, + TILE_WIRE_D2, + TILE_WIRE_C2, + TILE_WIRE_B2, + TILE_WIRE_A2, + TILE_WIRE_DI3, + TILE_WIRE_DI2, + TILE_WIRE_M3, + TILE_WIRE_M2, + TILE_WIRE_FXBB, + TILE_WIRE_FXAB, + TILE_WIRE_DUMMY_515, + TILE_WIRE_DUMMY_516, + 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_D1, + TILE_WIRE_C1, + TILE_WIRE_B1, + TILE_WIRE_A1, + TILE_WIRE_D0, + TILE_WIRE_C0, + TILE_WIRE_B0, + TILE_WIRE_A0, + TILE_WIRE_DI1, + TILE_WIRE_DI0, + TILE_WIRE_M1, + TILE_WIRE_M0, + TILE_WIRE_FXBA, + TILE_WIRE_FXAA, + TILE_WIRE_DUMMY_522, + TILE_WIRE_DUMMY_523, + TILE_WIRE_CE0, + TILE_WIRE_DUMMY_524, + TILE_WIRE_DUMMY_525, + TILE_WIRE_DUMMY_526, + TILE_WIRE_FCI, }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 3da7af9f026004dba6b08ffee1b09bec1506b6ee Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 09:27:55 +0200 Subject: clk and lsr muxes --- ecp5/arch.cc | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- ecp5/gfx.h | 31 ++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 3c56e057..947d0f93 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -701,7 +701,68 @@ std::vector Arch::getDecalGraphics(DecalId decal) const 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; + 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; + 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_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 + tilewire - TILE_WIRE_MUXCLK3)*slice_pitch; + el.y2 = el.y1; + ret.push_back(el); + } + if (tilewire >= TILE_WIRE_MUXLSR3 && tilewire <=TILE_WIRE_MUXLSR0) + { + 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.x2 = x + slice_x1 - 0.005f; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 - 5 + 1) + (3 + tilewire - TILE_WIRE_MUXLSR3)*slice_pitch; + el.y2 = el.y1; + ret.push_back(el); + } + } if (decal.type == DecalId::TYPE_BEL) { BelId bel; bel.index = decal.z; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index a5c62508..84891e1d 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -346,6 +346,37 @@ enum GfxTileWireId TILE_WIRE_DUMMY_526, TILE_WIRE_FCI, + + TILE_WIRE_MUXLSR3, + TILE_WIRE_MUXLSR2, + TILE_WIRE_MUXLSR1, + TILE_WIRE_MUXLSR0, + + TILE_WIRE_MUXCLK3, + TILE_WIRE_MUXCLK2, + TILE_WIRE_MUXCLK1, + 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, }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From a11cc8791b0cc21d6b5c95596644f34e05c7d139 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 10:35:52 +0200 Subject: set wire active flag --- ecp5/arch.cc | 2 +- ecp5/arch.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 947d0f93..81a9725c 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -822,7 +822,7 @@ DecalXY Arch::getWireDecal(WireId wire) const decalxy.decal.type = DecalId::TYPE_WIRE; decalxy.decal.location = wire.location; decalxy.decal.z = wire.index; - decalxy.decal.active = false; + decalxy.decal.active = getBoundWireNet(wire) != nullptr; return decalxy; } diff --git a/ecp5/arch.h b/ecp5/arch.h index 815dae0c..a0254965 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -660,6 +660,7 @@ struct Arch : BaseCtx wire_to_net[wire] = net; net->wires[wire].pip = PipId(); net->wires[wire].strength = strength; + refreshUiWire(wire); } void unbindWire(WireId wire) @@ -679,6 +680,7 @@ struct Arch : BaseCtx net_wires.erase(it); wire_to_net[wire] = nullptr; + refreshUiWire(wire); } bool checkWireAvail(WireId wire) const -- cgit v1.2.3 From 07a8022a1f6b4b24d5e227007d8147e2b3bb592f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 10:47:37 +0200 Subject: fix mux display --- ecp5/arch.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 81a9725c..31e3e1fa 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -747,7 +747,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const 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 + tilewire - TILE_WIRE_MUXCLK3)*slice_pitch; + 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); } @@ -758,7 +758,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; el.x1 = x + switchbox_x2 + 0.0017f * 5; el.x2 = x + slice_x1 - 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 - 5 + 1) + (3 + tilewire - TILE_WIRE_MUXLSR3)*slice_pitch; + 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; ret.push_back(el); } -- cgit v1.2.3 From a59faa8df0b615f8d09e703c93743a26e3c35823 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 12:06:17 +0200 Subject: Add output wires --- ecp5/arch.cc | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 31e3e1fa..ec9004c7 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -762,6 +762,41 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y2 = el.y1; ret.push_back(el); } + + + if (tilewire >= TILE_WIRE_F7 && tilewire <=TILE_WIRE_F0) + { + int group = (tilewire - TILE_WIRE_F7) / 4; + int part = (tilewire - TILE_WIRE_F7) % 4; + 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; + 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 = el.x1; + el2.x2 = el.x1; + el2.y1 = el.y1; + el2.y2 = el.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)); + ret.push_back(el); + + el.x1 = x + switchbox_x2; + el.y1 = el.y2; + ret.push_back(el); + + } } if (decal.type == DecalId::TYPE_BEL) { BelId bel; -- cgit v1.2.3 From 4b79050ef4924045e8a7bc3356378340c0c773af Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 12:19:44 +0200 Subject: Fix look of some wires --- ecp5/arch.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index ec9004c7..fec1084f 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -768,12 +768,15 @@ std::vector Arch::getDecalGraphics(DecalId decal) const { 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; 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; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_F7_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + (3 - group )*slice_pitch - offset; el.y2 = el.y1; ret.push_back(el); @@ -781,15 +784,15 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GraphicElement el2; el2.type = GraphicElement::TYPE_LINE; el2.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el2.x1 = el.x1; - el2.x2 = el.x1; - el2.y1 = el.y1; - el2.y2 = el.y1 + 0.0017f * (part==3 ? -1 : 1); + 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)); + el.y2 = el.y1 - (0.0017f * (30 *(3-group) + (3-part)*2 + 10)) + offset; ret.push_back(el); el.x1 = x + switchbox_x2; -- cgit v1.2.3 From 74da9cc4241197b43d424ef039ed030fc602dc05 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 13:47:01 +0200 Subject: wd wires --- ecp5/arch.cc | 22 +++++++++++++++++++++- ecp5/gfx.h | 11 +++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index fec1084f..ac4326f2 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -798,8 +798,28 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.x1 = x + switchbox_x2; el.y1 = el.y2; ret.push_back(el); - } + if (tilewire >= TILE_WIRE_WD3 && tilewire <=TILE_WIRE_WD0) + { + GraphicElement el; + int part = (tilewire - TILE_WIRE_WD3) % 4; + int group = (tilewire - TILE_WIRE_WD3) / 2; + 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 *(4 - part); + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WDO3C_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 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; + ret.push_back(el); + + el.x1 = x + slice_x2 + 0.005f; + el.y1 = el.y2; + ret.push_back(el); + } } if (decal.type == DecalId::TYPE_BEL) { BelId bel; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 84891e1d..7cbb6eab 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -377,6 +377,17 @@ enum GfxTileWireId TILE_WIRE_Q1, TILE_WIRE_Q0, TILE_WIRE_F0, + + + TILE_WIRE_WD3, + TILE_WIRE_WD2, + TILE_WIRE_WD1, + TILE_WIRE_WD0, + + TILE_WIRE_WAD3, + TILE_WIRE_WAD2, + TILE_WIRE_WAD1, + TILE_WIRE_WAD0 }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 966d0dec193150fe4fab6cc64a70c4d860885bf6 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 13:56:13 +0200 Subject: finixed slice wires --- ecp5/arch.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index ac4326f2..3afaffa8 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -820,6 +820,33 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = el.y2; ret.push_back(el); } + if (tilewire >= TILE_WIRE_WAD3 && tilewire <=TILE_WIRE_WAD0) + { + GraphicElement el; + int part = (tilewire - TILE_WIRE_WAD3) % 4; + 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 *(8 - part); + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WADO3C_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 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; + ret.push_back(el); + + el.x1 = x + slice_x2 + 0.005f; + el.y1 = el.y2; + ret.push_back(el); + + // 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.y1 = el.y2; + ret.push_back(el); + } } if (decal.type == DecalId::TYPE_BEL) { BelId bel; -- cgit v1.2.3 From 28d0313cccacff0aaa775a5b2b50edd3a852bae8 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 15:26:24 +0200 Subject: Less types needed --- ecp5/constids.inc | 24 ++++++++-------------- ecp5/trellis_import.py | 56 +++++++++++++++----------------------------------- 2 files changed, 24 insertions(+), 56 deletions(-) diff --git a/ecp5/constids.inc b/ecp5/constids.inc index f7d722c1..63ca4b26 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1297,19 +1297,11 @@ X(ECSOUT) X(WIRE_TYPE_NONE) X(WIRE_TYPE_SLICE) -X(WIRE_TYPE_H00R) -X(WIRE_TYPE_H00L) -X(WIRE_TYPE_H01E) -X(WIRE_TYPE_H01W) -X(WIRE_TYPE_H02E) -X(WIRE_TYPE_H02W) -X(WIRE_TYPE_H06E) -X(WIRE_TYPE_H06W) -X(WIRE_TYPE_V00T) -X(WIRE_TYPE_V00B) -X(WIRE_TYPE_V01N) -X(WIRE_TYPE_V01S) -X(WIRE_TYPE_V02N) -X(WIRE_TYPE_V02S) -X(WIRE_TYPE_V06N) -X(WIRE_TYPE_V06S) +X(WIRE_TYPE_H00) +X(WIRE_TYPE_H01) +X(WIRE_TYPE_H02) +X(WIRE_TYPE_H06) +X(WIRE_TYPE_V00) +X(WIRE_TYPE_V01) +X(WIRE_TYPE_V02) +X(WIRE_TYPE_V06) diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index 2ff0d0e7..e12f8bb7 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -50,53 +50,29 @@ def wire_type(name): if name[0].endswith("_SLICE"): return "WIRE_TYPE_SLICE" - if name[0].startswith("H00R"): - return "WIRE_TYPE_H00R" + if name[0].startswith("H00"): + return "WIRE_TYPE_H00" - if name[0].startswith("H00L"): - return "WIRE_TYPE_H00L" + if name[0].startswith("H01"): + return "WIRE_TYPE_H01" - if name[0].startswith("H01E"): - return "WIRE_TYPE_H01E" + if name[0].startswith("H02"): + return "WIRE_TYPE_H02" - if name[0].startswith("H01W"): - return "WIRE_TYPE_H01W" + if name[0].startswith("H06"): + return "WIRE_TYPE_H06" - if name[0].startswith("H02E"): - return "WIRE_TYPE_H02E" + if name[0].startswith("V00"): + return "WIRE_TYPE_V00" - if name[0].startswith("H02W"): - return "WIRE_TYPE_H02W" + if name[0].startswith("V01"): + return "WIRE_TYPE_V01" - if name[0].startswith("H06E"): - return "WIRE_TYPE_H06E" + if name[0].startswith("V02"): + return "WIRE_TYPE_V02" - if name[0].startswith("H06W"): - return "WIRE_TYPE_H06W" - - if name[0].startswith("V00T"): - return "WIRE_TYPE_V00T" - - if name[0].startswith("V00B"): - return "WIRE_TYPE_V00B" - - if name[0].startswith("V01N"): - return "WIRE_TYPE_V01N" - - if name[0].startswith("V01S"): - return "WIRE_TYPE_V01S" - - if name[0].startswith("V02N"): - return "WIRE_TYPE_V02N" - - if name[0].startswith("V02S"): - return "WIRE_TYPE_V02S" - - if name[0].startswith("V06N"): - return "WIRE_TYPE_V06N" - - if name[0].startswith("V06S"): - return "WIRE_TYPE_V06S" + if name[0].startswith("V06"): + return "WIRE_TYPE_V06" return "WIRE_TYPE_NONE" -- cgit v1.2.3 From 4cbdc388b860ca5f5af5e99c2bc7b21ff6b461bd Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 17:53:46 +0200 Subject: Add more types of wires --- ecp5/arch.cc | 367 +++++++++++++++++++++++++++++++---------------------------- ecp5/gfx.h | 31 ++++- 2 files changed, 221 insertions(+), 177 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 3afaffa8..80dc8817 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -649,204 +649,219 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_DUMMY_100 + 1) + 3*slice_pitch; ret.push_back(el); } - } - if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) - { - 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; - ret.push_back(el); - } - if (tilewire >= TILE_WIRE_FCO_SLICE && tilewire <=TILE_WIRE_FCOA_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; - ret.push_back(el); - if (tilewire==TILE_WIRE_FCO_SLICE) { - el.x1 = x + slice_x1 - 0.005f; + 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; - el.y2 = el.y1; + 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; 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; + 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; - ret.push_back(el); - if (tilewire==TILE_WIRE_FCI_SLICE) { - el.x1 = x + slice_x1 - 0.005f; + 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.005f + 0.0017f * (tilewire - TILE_WIRE_V01N0001); + el.x2 = el.x1; + el.y1 = y + switchbox_y1; + el.y2 = y + switchbox_y2 - 1; + ret.push_back(el); + } + } + if (wire_type == id_WIRE_TYPE_NONE) { + if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) + { + 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; + ret.push_back(el); + } + if (tilewire >= TILE_WIRE_FCO_SLICE && tilewire <=TILE_WIRE_FCOA_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; - el.y2 = el.y1; + 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; 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 (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; - 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; + 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; 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); + + 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; - 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); + } else { + el.x1 = el.x2; + el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_CE0 - TILE_WIRE_LSR1 -5 + 2) + 3*slice_pitch; + 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_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_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) - { - 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.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; - ret.push_back(el); - } + if (tilewire >= TILE_WIRE_MUXLSR3 && tilewire <=TILE_WIRE_MUXLSR0) + { + 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.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; + ret.push_back(el); + } - if (tilewire >= TILE_WIRE_F7 && tilewire <=TILE_WIRE_F0) - { - 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; - 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.y2 = el.y1; - ret.push_back(el); + if (tilewire >= TILE_WIRE_F7 && tilewire <=TILE_WIRE_F0) + { + 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; + 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.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); - } + 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 = 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; - int part = (tilewire - TILE_WIRE_WD3) % 4; - int group = (tilewire - TILE_WIRE_WD3) / 2; - 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 *(4 - part); - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WDO3C_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 3*slice_pitch; - el.y2 = el.y1; - 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; + int part = (tilewire - TILE_WIRE_WD3) % 4; + int group = (tilewire - TILE_WIRE_WD3) / 2; + 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 *(4 - part); + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WDO3C_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 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; - 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; + ret.push_back(el); - el.x1 = x + slice_x2 + 0.005f; - el.y1 = el.y2; - ret.push_back(el); - } - if (tilewire >= TILE_WIRE_WAD3 && tilewire <=TILE_WIRE_WAD0) - { - GraphicElement el; - int part = (tilewire - TILE_WIRE_WAD3) % 4; - 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 *(8 - part); - el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WADO3C_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 3*slice_pitch; - el.y2 = el.y1; - ret.push_back(el); + el.x1 = x + slice_x2 + 0.005f; + el.y1 = el.y2; + ret.push_back(el); + } + if (tilewire >= TILE_WIRE_WAD3 && tilewire <=TILE_WIRE_WAD0) + { + GraphicElement el; + int part = (tilewire - TILE_WIRE_WAD3) % 4; + 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 *(8 - part); + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_WADO3C_SLICE - TILE_WIRE_DUMMY_100 + 1 + part) + 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; - 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; + ret.push_back(el); - el.x1 = x + slice_x2 + 0.005f; - el.y1 = el.y2; - ret.push_back(el); + el.x1 = x + slice_x2 + 0.005f; + el.y1 = el.y2; + ret.push_back(el); - // 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.y1 = el.y2; - ret.push_back(el); - } + // 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.y1 = el.y2; + ret.push_back(el); + } + } } if (decal.type == DecalId::TYPE_BEL) { BelId bel; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 7cbb6eab..f030d9c8 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -387,7 +387,36 @@ enum GfxTileWireId TILE_WIRE_WAD3, TILE_WIRE_WAD2, TILE_WIRE_WAD1, - TILE_WIRE_WAD0 + TILE_WIRE_WAD0, + + + TILE_WIRE_V01N0000, + TILE_WIRE_V01N0100, + TILE_WIRE_V01S0001, + TILE_WIRE_V01S0101, + + TILE_WIRE_V01N0001, + TILE_WIRE_V01N0101, + TILE_WIRE_V01S0000, + TILE_WIRE_V01S0100, + + TILE_WIRE_V00T0000, + TILE_WIRE_V00T0100, + + TILE_WIRE_V00B0000, + TILE_WIRE_V00B0100, + + TILE_WIRE_H00L0000, + TILE_WIRE_H00L0100, + + TILE_WIRE_H00R0000, + TILE_WIRE_H00R0100, + + TILE_WIRE_NBOUNCE, + TILE_WIRE_SBOUNCE, + TILE_WIRE_WBOUNCE, + TILE_WIRE_EBOUNCE + }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 8c79044d43417790a2a8844ea09cfc038e6b239c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 19:07:54 +0200 Subject: more wires between switchboxes --- ecp5/arch.cc | 38 +++++++++++++++++++++++++++++++++++++- ecp5/constids.inc | 2 ++ ecp5/gfx.h | 15 ++++++++++++++- ecp5/trellis_import.py | 6 ++++++ 4 files changed, 59 insertions(+), 2 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 80dc8817..ce27e077 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -677,13 +677,49 @@ std::vector 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_x1 + 0.005f + 0.0017f * (tilewire - TILE_WIRE_V01N0001); + el.x1 = x + switchbox_x1 + 0.0017f*4 + 0.0017f * (tilewire - TILE_WIRE_V01N0001); el.x2 = el.x1; el.y1 = y + switchbox_y1; el.y2 = y + switchbox_y2 - 1; ret.push_back(el); } } + 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 + { + 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.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_NONE) { if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) { diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 63ca4b26..62d14bf6 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1305,3 +1305,5 @@ X(WIRE_TYPE_V00) X(WIRE_TYPE_V01) X(WIRE_TYPE_V02) X(WIRE_TYPE_V06) +X(WIRE_TYPE_HFI) +X(WIRE_TYPE_HL7) diff --git a/ecp5/gfx.h b/ecp5/gfx.h index f030d9c8..40d5c0fb 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -400,6 +400,16 @@ enum GfxTileWireId TILE_WIRE_V01S0000, TILE_WIRE_V01S0100, + TILE_WIRE_H01E0001, + TILE_WIRE_H01E0101, + TILE_WIRE_H01W0000, + TILE_WIRE_H01W0100, + + TILE_WIRE_H01E0000, + TILE_WIRE_H01E0100, + TILE_WIRE_H01W0001, + TILE_WIRE_H01W0101, + TILE_WIRE_V00T0000, TILE_WIRE_V00T0100, @@ -415,7 +425,10 @@ enum GfxTileWireId TILE_WIRE_NBOUNCE, TILE_WIRE_SBOUNCE, TILE_WIRE_WBOUNCE, - TILE_WIRE_EBOUNCE + TILE_WIRE_EBOUNCE, + + TILE_WIRE_HFIE0000, + TILE_WIRE_HL7W0001 }; diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index e12f8bb7..ebdc45f7 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -74,6 +74,12 @@ 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): -- cgit v1.2.3 From 399a137a7767d70c3d4ff810278d7402196ac380 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 12 Oct 2019 19:44:18 +0200 Subject: bound signals --- ecp5/arch.cc | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index ce27e077..33f63097 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -720,7 +720,72 @@ std::vector Arch::getDecalGraphics(DecalId decal) const 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.x2 = el.x1; + if (group) { + el.y1 = y + switchbox_y1; + el.y2 = y + switchbox_y1 - 0.0017f*4; + } else { + el.y1 = y + switchbox_y2; + el.y2 = y + switchbox_y2 + 0.0017f*4; + } + ret.push_back(el); + } + if (wire_type == id_WIRE_TYPE_H00) { + int group = (tilewire - TILE_WIRE_H00L0000) / 2; + 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.y2 = el.y1; + + if (group) { + el.x1 = x + switchbox_x2 + 0.0017f*4; + el.x2 = x + switchbox_x2; + } else { + el.x1 = x + switchbox_x1 - 0.0017f*4; + el.x2 = x + switchbox_x1; + } + ret.push_back(el); + } if (wire_type == id_WIRE_TYPE_NONE) { + if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) + { + 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; + if (tilewire == TILE_WIRE_NBOUNCE) { + el.y1 = y + switchbox_y2 + 0.0017f*4; + el.y2 = el.y1; + } else { + el.y1 = y + switchbox_y1 - 0.0017f*4; + el.y2 = el.y1; + } + ret.push_back(el); + } + if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <=TILE_WIRE_EBOUNCE) + { + 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; + if (tilewire == TILE_WIRE_WBOUNCE) { + el.x1 = x + switchbox_x1 - 0.0017f*4; + el.x2 = el.x1; + } else { + el.x1 = x + switchbox_x2 + 0.0017f*4; + el.x2 = el.x1; + } + ret.push_back(el); + } if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) { GraphicElement el; -- cgit v1.2.3 From 3b01d2fbcefdd334028a447343c90912deea8366 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 18 Oct 2019 15:10:19 +0200 Subject: fix slice wire --- ecp5/arch.cc | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 33f63097..34ee0dbb 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -669,6 +669,26 @@ std::vector Arch::getDecalGraphics(DecalId decal) const ret.push_back(el); } } + if (tilewire >= TILE_WIRE_FCO_SLICE && tilewire <=TILE_WIRE_FCOA_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; + 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) @@ -797,26 +817,6 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_LSR1 - 5) + 3*slice_pitch; ret.push_back(el); } - if (tilewire >= TILE_WIRE_FCO_SLICE && tilewire <=TILE_WIRE_FCOA_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; - 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 (tilewire >= TILE_WIRE_LSR1 && tilewire <=TILE_WIRE_CLK0) { GraphicElement el; -- cgit v1.2.3 From e69bb4c077a7df3fd6d9ff2325f845a926760415 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 20 Oct 2019 09:34:02 +0200 Subject: Simplify layout of elements --- ecp5/arch.cc | 284 ++++++++++++++++----------------------- ecp5/constids.inc | 2 - ecp5/gfx.h | 356 +++++++++++++++++++------------------------------ 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 Arch::getDecalGraphics(DecalId decal) const { std::vector ret; @@ -618,6 +641,15 @@ std::vector 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 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 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 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 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 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 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 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 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 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) diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 40d5c0fb..1ba4fec2 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -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): -- cgit v1.2.3 From eaf760768b0515ea0b3d9b694daa6ed480d0da9e Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 20 Oct 2019 09:34:32 +0200 Subject: Remove not used line --- ecp5/arch.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 84cfcde7..d111e923 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -448,8 +448,6 @@ BelId Arch::getBelByLocation(Loc loc) const delay_t Arch::estimateDelay(WireId src, WireId dst) const { - WireId cursor = dst; - int num_uh = locInfo(dst)->wire_data[dst.index].num_uphill; if (num_uh < 6) { for (auto uh : getPipsUphill(dst)) { -- cgit v1.2.3 From e9ae0cf7ce664f03b1810dbe21fa82100c7b58c3 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 20 Oct 2019 09:38:08 +0200 Subject: muxes only together with slices --- ecp5/arch.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index d111e923..9e5c4a14 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -639,15 +639,6 @@ std::vector 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) { @@ -924,6 +915,13 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = y + slice_y1 + (z)*slice_pitch; el.y2 = y + slice_y2 + (z)*slice_pitch; ret.push_back(el); + + el.style = GraphicElement::STYLE_FRAME; + 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 + z*26) + 3*slice_pitch - 0.0007f; + el.y2 = el.y1 + 0.0017f * 5; + ret.push_back(el); } if (bel_type == id_TRELLIS_IO) { -- cgit v1.2.3 From 847910d9864bbb75b7b6930b2c51bb8f5d705d5a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 20 Oct 2019 10:03:37 +0200 Subject: type needs to be part of hash for GroupId --- ecp5/archdefs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index 67c016cc..d155d672 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -224,7 +224,9 @@ template <> struct hash { std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept { - std::size_t seed = std::hash()(group.location); + std::size_t seed = 0; + boost::hash_combine(seed, hash()(group.type)); + boost::hash_combine(seed, hash()(group.location)); return seed; } }; -- cgit v1.2.3 From 0d2ae5cc9dc3667f12e0f6d8ff3881191ee10930 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 20 Oct 2019 11:12:26 +0200 Subject: Split graphics calls for wires into gfx.cc --- ecp5/arch.cc | 271 +-------------------------------------------------------- ecp5/gfx.cc | 276 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ecp5/gfx.h | 25 ++++++ 3 files changed, 304 insertions(+), 268 deletions(-) create mode 100644 ecp5/gfx.cc diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 9e5c4a14..e6b43d0b 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -597,28 +597,6 @@ 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 Arch::getDecalGraphics(DecalId decal) const { @@ -648,254 +626,11 @@ std::vector Arch::getDecalGraphics(DecalId decal) const auto wire_type = getWireType(wire); int x = decal.location.x; int y = chip_info->height - 1 - decal.location.y; + GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; GfxTileWireId tilewire = GfxTileWireId(locInfo(wire)->wire_data[wire.index].tile_wire); - if (wire_type == id_WIRE_TYPE_SLICE && tilewire != GfxTileWireId::TILE_WIRE_NONE) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - 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_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); - // 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_DUMMY_D2 && tilewire <=TILE_WIRE_WAD0A_SLICE) - { - 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 (wire_type == id_WIRE_TYPE_V01) { - if (tilewire >= TILE_WIRE_V01N0001 && tilewire <=TILE_WIRE_V01S0100) - { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - 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; - ret.push_back(el); - } - } - if (wire_type == id_WIRE_TYPE_H01) { - 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*16 - 0.0017f * (tilewire - TILE_WIRE_H01E0001); - 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*(8 - ((tilewire - TILE_WIRE_V00T0000) % 2)*4); - el.x2 = el.x1; - if (group) { - el.y1 = y + switchbox_y1; - el.y2 = y + switchbox_y1 - 0.0017f*4; - } else { - el.y1 = y + switchbox_y2; - el.y2 = y + switchbox_y2 + 0.0017f*4; - } - ret.push_back(el); - } - if (wire_type == id_WIRE_TYPE_H00) { - int group = (tilewire - TILE_WIRE_H00L0000) / 2; - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.y1 = y + switchbox_y1 + 0.0017f*(8 - ((tilewire - TILE_WIRE_H00L0000) % 2)*4); - el.y2 = el.y1; - - if (group) { - el.x1 = x + switchbox_x2 + 0.0017f*4; - el.x2 = x + switchbox_x2; - } else { - el.x1 = x + switchbox_x1 - 0.0017f*4; - el.x2 = x + switchbox_x1; - } - ret.push_back(el); - } - if (wire_type == id_WIRE_TYPE_NONE) { - if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) - { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - 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; - } else { - el.y1 = y + switchbox_y1 - 0.0017f*4; - el.y2 = el.y1; - } - ret.push_back(el); - } - if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <=TILE_WIRE_EBOUNCE) - { - 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; - 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; - } else { - el.x1 = x + switchbox_x2 + 0.0017f*4; - el.x2 = el.x1; - } - ret.push_back(el); - } - if (tilewire >= TILE_WIRE_CLK0 && tilewire <=TILE_WIRE_LSR1) - { - 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_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); - el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (3 + (tilewire - TILE_WIRE_CLK0)); - ret.push_back(el); - 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 || 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_FCO && tilewire <=TILE_WIRE_FCI) - { - 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; - el.x2 = x + slice_x1 - 0.005f; - 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_MUXCLK3 && tilewire <=TILE_WIRE_MUXLSR0) - { - 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.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 (tilewire >= TILE_WIRE_WD3 && tilewire <=TILE_WIRE_WD0) - { - GraphicElement el; - int part = (tilewire - TILE_WIRE_WD3) % 4; - int group = (tilewire - TILE_WIRE_WD3) / 2; - 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 *(4 - part); - 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_D2 + 1 + (part & 1) + 14*2) + (3-group)*slice_pitch; - ret.push_back(el); - - el.x1 = x + slice_x2 + 0.005f; - el.y1 = el.y2; - ret.push_back(el); - } - if (tilewire >= TILE_WIRE_WAD3 && tilewire <=TILE_WIRE_WAD0) - { - GraphicElement el; - int part = (tilewire - TILE_WIRE_WAD3) % 4; - 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 *(8 - part); - 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_D2 + 1 + part+ 14*2) + 2*slice_pitch; - ret.push_back(el); - - el.x1 = x + slice_x2 + 0.005f; - el.y1 = el.y2; - ret.push_back(el); - - // 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_D2 + 1 + part+ 14*2) + 3*slice_pitch; - el.y1 = el.y2; - ret.push_back(el); - } - } + + gfxTileWire(ret, x, y, wire_type, tilewire, style); } if (decal.type == DecalId::TYPE_BEL) { BelId bel; diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc new file mode 100644 index 00000000..c749bad7 --- /dev/null +++ b/ecp5/gfx.cc @@ -0,0 +1,276 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2019 Miodrag Milanovic + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include "gfx.h" + +NEXTPNR_NAMESPACE_BEGIN + +void gfxTileWire(std::vector &g, int x, int y, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style) +{ + if (wire_type == id_WIRE_TYPE_SLICE && tilewire != GfxTileWireId::TILE_WIRE_NONE) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + 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_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; + g.push_back(el); + // 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; + g.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; + g.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; + g.push_back(el); + } + } + if (tilewire >= TILE_WIRE_DUMMY_D2 && tilewire <=TILE_WIRE_WAD0A_SLICE) + { + 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; + g.push_back(el); + } + } + if (wire_type == id_WIRE_TYPE_V01) { + if (tilewire >= TILE_WIRE_V01N0001 && tilewire <=TILE_WIRE_V01S0100) + { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + 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; + g.push_back(el); + } + } + if (wire_type == id_WIRE_TYPE_H01) { + if (tilewire >= TILE_WIRE_H01E0001 && tilewire <=TILE_WIRE_HL7W0001) + { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + switchbox_x1; + el.x2 = x + switchbox_x2 - 1; + el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (tilewire - TILE_WIRE_H01E0001); + el.y2 = el.y1; + g.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 = style; + 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; + el.y2 = y + switchbox_y1 - 0.0017f*4; + } else { + el.y1 = y + switchbox_y2; + el.y2 = y + switchbox_y2 + 0.0017f*4; + } + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_H00) { + int group = (tilewire - TILE_WIRE_H00L0000) / 2; + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.y1 = y + switchbox_y1 + 0.0017f*(8 - ((tilewire - TILE_WIRE_H00L0000) % 2)*4); + el.y2 = el.y1; + + if (group) { + el.x1 = x + switchbox_x2 + 0.0017f*4; + el.x2 = x + switchbox_x2; + } else { + el.x1 = x + switchbox_x1 - 0.0017f*4; + el.x2 = x + switchbox_x1; + } + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_NONE) { + if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) + { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + 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; + } else { + el.y1 = y + switchbox_y1 - 0.0017f*4; + el.y2 = el.y1; + } + g.push_back(el); + } + if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <=TILE_WIRE_EBOUNCE) + { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + 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; + } else { + el.x1 = x + switchbox_x2 + 0.0017f*4; + el.x2 = el.x1; + } + g.push_back(el); + } + if (tilewire >= TILE_WIRE_CLK0 && tilewire <=TILE_WIRE_LSR1) + { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + switchbox_x2; + 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; + g.push_back(el); + el.x1 = el.x2; + el.y2 = y + slice_y2 - 0.0017f * (3 + (tilewire - TILE_WIRE_CLK0)); + g.push_back(el); + 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; + g.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; + g.push_back(el); + } + } + } + + if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) + { + int gap = (tilewire - TILE_WIRE_FCO) / 24; + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + switchbox_x2; + el.x2 = x + slice_x1 - 0.005f; + 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; + g.push_back(el); + } + + if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <=TILE_WIRE_MUXLSR0) + { + int gap = (tilewire - TILE_WIRE_MUXCLK3) / 2; + int part = (tilewire - TILE_WIRE_MUXCLK3) % 2; + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + 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; + g.push_back(el); + } + + if (tilewire >= TILE_WIRE_WD3 && tilewire <=TILE_WIRE_WD0) + { + GraphicElement el; + int part = (tilewire - TILE_WIRE_WD3) % 4; + int group = (tilewire - TILE_WIRE_WD3) / 2; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + 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_D2 + 1 + part + 14) + 3*slice_pitch; + el.y2 = el.y1; + g.push_back(el); + + el.x1 = el.x2; + el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WD1B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + (part & 1) + 14*2) + (3-group)*slice_pitch; + g.push_back(el); + + el.x1 = x + slice_x2 + 0.005f; + el.y1 = el.y2; + g.push_back(el); + } + if (tilewire >= TILE_WIRE_WAD3 && tilewire <=TILE_WIRE_WAD0) + { + GraphicElement el; + int part = (tilewire - TILE_WIRE_WAD3) % 4; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + 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_D2 + 1 + part+ 14) + 3*slice_pitch; + el.y2 = el.y1; + g.push_back(el); + + el.x1 = el.x2; + el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part+ 14*2) + 2*slice_pitch; + g.push_back(el); + + el.x1 = x + slice_x2 + 0.005f; + el.y1 = el.y2; + g.push_back(el); + + // 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_D2 + 1 + part+ 14*2) + 3*slice_pitch; + el.y1 = el.y2; + g.push_back(el); + } + } + +} + +NEXTPNR_NAMESPACE_END diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 1ba4fec2..6a6d7ad2 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -24,6 +24,29 @@ 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 + 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; + enum GfxTileWireId { TILE_WIRE_NONE, @@ -344,6 +367,8 @@ enum GfxTileWireId }; +void gfxTileWire(std::vector &g, int x, int y, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); + NEXTPNR_NAMESPACE_END #endif -- cgit v1.2.3 From d1feb2aa2d9865807083888c5d24cdbbd98a942a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 23 Oct 2019 18:17:08 +0200 Subject: display horizontal wires, add some globals to list --- ecp5/constids.inc | 2 ++ ecp5/gfx.cc | 51 ++++++++++++++++++++++++++++++++++++- ecp5/gfx.h | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ ecp5/trellis_import.py | 3 +++ 4 files changed, 123 insertions(+), 1 deletion(-) diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 63ca4b26..76c9bc8c 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1305,3 +1305,5 @@ X(WIRE_TYPE_V00) X(WIRE_TYPE_V01) X(WIRE_TYPE_V02) X(WIRE_TYPE_V06) + +X(WIRE_TYPE_G_HPBX) \ No newline at end of file diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index c749bad7..950ccc3c 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -127,7 +127,56 @@ void gfxTileWire(std::vector &g, int x, int y, IdString wire_typ el.x2 = x + switchbox_x1; } g.push_back(el); - } + } + if (wire_type == id_WIRE_TYPE_H02) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x2 = el.x1; + el.y1 = y + switchbox_y1; + el.y2 = y + switchbox_y1 - 0.0017f*(20 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + g.push_back(el); + + el.x2 = (x+2) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.y1 = el.y2; + g.push_back(el); + + el.x2 = (x+1) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + g.push_back(el); + + el.x2 = (x+2) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_H06) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x2 = el.x1; + el.y1 = y + switchbox_y1; + el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + g.push_back(el); + + el.x2 = (x+6) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.y1 = el.y2; + g.push_back(el); + + el.x2 = (x+3) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + g.push_back(el); + + el.x2 = (x+6) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_NONE) { if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) { diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 6a6d7ad2..d880b06e 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -365,6 +365,74 @@ enum GfxTileWireId TILE_WIRE_WBOUNCE, TILE_WIRE_EBOUNCE, + TILE_WIRE_V02N0701, + TILE_WIRE_V02S0701, + TILE_WIRE_V02N0601, + TILE_WIRE_V02S0601, + TILE_WIRE_V02N0501, + TILE_WIRE_V02S0501, + TILE_WIRE_V02N0401, + TILE_WIRE_V02S0401, + TILE_WIRE_V02N0301, + TILE_WIRE_V02S0301, + TILE_WIRE_V02N0201, + TILE_WIRE_V02S0201, + TILE_WIRE_V02N0101, + TILE_WIRE_V02S0101, + TILE_WIRE_V02N0001, + TILE_WIRE_V02S0001, + + TILE_WIRE_V06N0303, + TILE_WIRE_V06S0303, + TILE_WIRE_V06N0203, + TILE_WIRE_V06S0203, + TILE_WIRE_V06N0103, + TILE_WIRE_V06S0103, + TILE_WIRE_V06N0003, + TILE_WIRE_V06S0003, + + TILE_WIRE_H02W0701, + TILE_WIRE_H02E0701, + TILE_WIRE_H02W0601, + TILE_WIRE_H02E0601, + TILE_WIRE_H02W0501, + TILE_WIRE_H02E0501, + TILE_WIRE_H02W0401, + TILE_WIRE_H02E0401, + TILE_WIRE_H02W0301, + TILE_WIRE_H02E0301, + TILE_WIRE_H02W0201, + TILE_WIRE_H02E0201, + TILE_WIRE_H02W0101, + TILE_WIRE_H02E0101, + TILE_WIRE_H02W0001, + TILE_WIRE_H02E0001, + + TILE_WIRE_H06W0303, + TILE_WIRE_H06E0303, + TILE_WIRE_H06W0203, + TILE_WIRE_H06E0203, + TILE_WIRE_H06W0103, + TILE_WIRE_H06E0103, + TILE_WIRE_H06W0003, + TILE_WIRE_H06E0003, + + TILE_WIRE_G_HPBX0000, + TILE_WIRE_G_HPBX0100, + TILE_WIRE_G_HPBX0200, + TILE_WIRE_G_HPBX0300, + TILE_WIRE_G_HPBX0400, + TILE_WIRE_G_HPBX0500, + TILE_WIRE_G_HPBX0600, + TILE_WIRE_G_HPBX0700, + TILE_WIRE_G_HPBX0800, + TILE_WIRE_G_HPBX0900, + TILE_WIRE_G_HPBX1000, + TILE_WIRE_G_HPBX1100, + TILE_WIRE_G_HPBX1200, + TILE_WIRE_G_HPBX1300, + TILE_WIRE_G_HPBX1400, + TILE_WIRE_G_HPBX1500, }; void gfxTileWire(std::vector &g, int x, int y, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index 821a8a10..68fbfe53 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -80,6 +80,9 @@ def wire_type(name): if name[0].startswith("V06"): return "WIRE_TYPE_V06" + if name[0].startswith("G_HPBX"): + return "WIRE_TYPE_G_HPBX" + return "WIRE_TYPE_NONE" def is_global(loc): -- cgit v1.2.3 From 49760a9ea81180024783a06ee9ac052035de98ea Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 25 Oct 2019 09:28:08 +0200 Subject: Show V02/V06/H02/H06 --- ecp5/arch.cc | 2 +- ecp5/gfx.cc | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++------ ecp5/gfx.h | 2 +- 3 files changed, 105 insertions(+), 13 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index e6b43d0b..7027fdfc 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -630,7 +630,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GfxTileWireId tilewire = GfxTileWireId(locInfo(wire)->wire_data[wire.index].tile_wire); - gfxTileWire(ret, x, y, wire_type, tilewire, style); + gfxTileWire(ret, x, y, chip_info->width, chip_info->height, wire_type, tilewire, style); } if (decal.type == DecalId::TYPE_BEL) { BelId bel; diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 950ccc3c..5828965f 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -22,7 +22,7 @@ NEXTPNR_NAMESPACE_BEGIN -void gfxTileWire(std::vector &g, int x, int y, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style) +void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style) { if (wire_type == id_WIRE_TYPE_SLICE && tilewire != GfxTileWireId::TILE_WIRE_NONE) { GraphicElement el; @@ -128,7 +128,8 @@ void gfxTileWire(std::vector &g, int x, int y, IdString wire_typ } g.push_back(el); } - if (wire_type == id_WIRE_TYPE_H02) { + + if (wire_type == id_WIRE_TYPE_H02) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; @@ -138,21 +139,67 @@ void gfxTileWire(std::vector &g, int x, int y, IdString wire_typ el.y2 = y + switchbox_y1 - 0.0017f*(20 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); g.push_back(el); - el.x2 = (x+2) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + int x1 = x + 1; + if (x1> w - 1) x1 = w - 1; + + el.x2 = x1 + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); el.y1 = el.y2; g.push_back(el); - el.x2 = (x+1) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); el.x1 = el.x2; el.y1 = y + switchbox_y1; g.push_back(el); - el.x2 = (x+2) + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + int x2 = x - 1; + if (x2<0) x2 = 0; + + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x2 = x2 + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.y2 = y + switchbox_y1 - 0.0017f*(20 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.y1 = el.y2; + g.push_back(el); + el.x1 = el.x2; el.y1 = y + switchbox_y1; g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_H06) { + } + + if (wire_type == id_WIRE_TYPE_V02) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y2 = el.y1; + el.x1 = x + switchbox_x1; + el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + g.push_back(el); + + int y1 = y + 1; + if (y1> h - 1) y1 = h - 1; + + el.y2 = y1 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.x1 = el.x2; + g.push_back(el); + + el.y1 = el.y2; + el.x1 = x + switchbox_x1; + g.push_back(el); + + int y2 = y - 1; + if (y2<0) y2 = 0; + + el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y2 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.x1 = el.x2; + g.push_back(el); + + el.y1 = el.y2; + el.x1 = x + switchbox_x1; + g.push_back(el); + } + + if (wire_type == id_WIRE_TYPE_H06) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; @@ -162,20 +209,65 @@ void gfxTileWire(std::vector &g, int x, int y, IdString wire_typ el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); g.push_back(el); - el.x2 = (x+6) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + int x1 = x + 3; + if (x1> w - 1) x1 = w - 1; + + el.x2 = x1 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); el.y1 = el.y2; g.push_back(el); - el.x2 = (x+3) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); el.x1 = el.x2; el.y1 = y + switchbox_y1; g.push_back(el); - el.x2 = (x+6) + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + int x2 = x - 3; + if (x2<0) x2 = 0; + + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.y1 = el.y2; + g.push_back(el); + el.x1 = el.x2; el.y1 = y + switchbox_y1; g.push_back(el); - } + } + + if (wire_type == id_WIRE_TYPE_V06) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y2 = el.y1; + el.x1 = x + switchbox_x1; + el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + g.push_back(el); + + int y1 = y + 3; + if (y1> h - 1) y1 = h - 1; + + el.y2 = y1 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.x1 = el.x2; + g.push_back(el); + + el.y1 = el.y2; + el.x1 = x + switchbox_x1; + g.push_back(el); + + int y2 = y - 3; + if (y2<0) y2 = 0; + + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y2 = y2 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.x1 = el.x2; + g.push_back(el); + + el.y1 = el.y2; + el.x1 = x + switchbox_x1; + g.push_back(el); + } if (wire_type == id_WIRE_TYPE_NONE) { if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) diff --git a/ecp5/gfx.h b/ecp5/gfx.h index d880b06e..e9ec6133 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -435,7 +435,7 @@ enum GfxTileWireId TILE_WIRE_G_HPBX1500, }; -void gfxTileWire(std::vector &g, int x, int y, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); +void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From f6d74cb7a91db81410d4990f94b133447081f902 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 9 Nov 2019 13:12:20 +0100 Subject: Draw some pips, fixed H6 and V6 --- ecp5/arch.cc | 23 ++++++++++++++++++++- ecp5/gfx.cc | 65 ++++++++++++++++++++++++++++++++---------------------------- ecp5/gfx.h | 1 + 3 files changed, 58 insertions(+), 31 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 7027fdfc..fd9879b9 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -632,6 +632,19 @@ std::vector Arch::getDecalGraphics(DecalId decal) const gfxTileWire(ret, x, y, chip_info->width, chip_info->height, wire_type, tilewire, style); } + if (decal.type == DecalId::TYPE_PIP) { + PipId pip; + pip.index = decal.z; + pip.location = decal.location; + WireId src_wire = getPipSrcWire(pip); + WireId dst_wire = getPipDstWire(pip); + int x = decal.location.x; + int y = chip_info->height - 1 - decal.location.y; + GfxTileWireId src_id = GfxTileWireId(locInfo(src_wire)->wire_data[src_wire.index].tile_wire); + GfxTileWireId dst_id = GfxTileWireId(locInfo(dst_wire)->wire_data[dst_wire.index].tile_wire); + GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_HIDDEN; + gfxTilePip(ret, x, y, chip_info->width, chip_info->height, src_wire, getWireType(src_wire), src_id, dst_wire, getWireType(dst_wire), dst_id, style); + } if (decal.type == DecalId::TYPE_BEL) { BelId bel; bel.index = decal.z; @@ -702,7 +715,15 @@ DecalXY Arch::getWireDecal(WireId wire) const return decalxy; } -DecalXY Arch::getPipDecal(PipId pip) const { return {}; }; +DecalXY Arch::getPipDecal(PipId pip) const +{ + DecalXY decalxy; + decalxy.decal.type = DecalId::TYPE_PIP; + decalxy.decal.location = pip.location; + decalxy.decal.z = pip.index; + decalxy.decal.active = getBoundPipNet(pip) != nullptr; + return decalxy; +}; DecalXY Arch::getGroupDecal(GroupId group) const { diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 5828965f..f13a6ab7 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -168,70 +168,50 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; + el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.y2 = el.y1; el.x1 = x + switchbox_x1; el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); g.push_back(el); - int y1 = y + 1; - if (y1> h - 1) y1 = h - 1; - - el.y2 = y1 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); - el.x1 = el.x2; - g.push_back(el); + int y2 = y - 3; + if (y2<0) y2 = 0; - el.y1 = el.y2; - el.x1 = x + switchbox_x1; + el.y1 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y2 = el.y1; g.push_back(el); - int y2 = y - 1; - if (y2<0) y2 = 0; - el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.y2 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.x1 = el.x2; g.push_back(el); - - el.y1 = el.y2; - el.x1 = x + switchbox_x1; - g.push_back(el); } if (wire_type == id_WIRE_TYPE_H06) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); el.x2 = el.x1; el.y1 = y + switchbox_y1; el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); g.push_back(el); - int x1 = x + 3; - if (x1> w - 1) x1 = w - 1; - - el.x2 = x1 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); - el.y1 = el.y2; - g.push_back(el); - - el.x1 = el.x2; - el.y1 = y + switchbox_y1; - g.push_back(el); - int x2 = x - 3; if (x2<0) x2 = 0; + el.x1 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x2 = el.x1; + g.push_back(el); + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); el.y1 = el.y2; g.push_back(el); - - el.x1 = el.x2; - el.y1 = y + switchbox_y1; - g.push_back(el); } if (wire_type == id_WIRE_TYPE_V06) { @@ -414,4 +394,29 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } +void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style) +{ + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + + if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) { + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.y1 = y + switchbox_y1; + + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.x2 = x + switchbox_x1; + g.push_back(el); + } + if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { + el.x1 = x + switchbox_x2; + el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); + + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.x2 = x + switchbox_x1; + g.push_back(el); + } + +} + NEXTPNR_NAMESPACE_END diff --git a/ecp5/gfx.h b/ecp5/gfx.h index e9ec6133..f3fa6a4c 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -436,6 +436,7 @@ enum GfxTileWireId }; void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); +void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style); NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 9a9265f4d2c5d1c4f1a5bb90aece2647990e8b56 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 10 Nov 2019 10:08:02 +0100 Subject: more pips --- ecp5/gfx.cc | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index f13a6ab7..77572437 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -409,14 +409,55 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire g.push_back(el); } if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { - el.x1 = x + switchbox_x2; - el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); + if (src_id <= TILE_WIRE_H01E0101) { + el.x1 = x + switchbox_x1; + el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); + + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + g.push_back(el); + + el.x1 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.x2 = x + switchbox_x1; + g.push_back(el); + } else { + el.x1 = x + switchbox_x2; + el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); + + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.x2 = x + switchbox_x1; + g.push_back(el); + } + } + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { + el.x1 = x + switchbox_x1; + el.y1 = y + switchbox_y1 + 0.0017f*(16 + (src_id - TILE_WIRE_V02N0701)+ 20 *(y%3)); + + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + g.push_back(el); + + el.x1 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); el.x2 = x + switchbox_x1; g.push_back(el); } + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (src_id - TILE_WIRE_H02W0701)+ 20 *(src.location.x%3)); + el.y1 = y + switchbox_y1; + + el.x2 = x + switchbox_x1; + el.y2 = y + switchbox_y1 + 0.0017f*(16 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(y%3)); + + g.push_back(el); + } + + } NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 43c7b4fa2113c2eaca0053fe9395dc4fd0635be3 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 10 Nov 2019 11:10:13 +0100 Subject: Fixed V2, some more pips --- ecp5/gfx.cc | 55 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 77572437..373112a7 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -163,31 +163,41 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y1 = y + switchbox_y1; g.push_back(el); } - + if (wire_type == id_WIRE_TYPE_V02) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - - el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.y2 = el.y1; el.x1 = x + switchbox_x1; el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); g.push_back(el); - int y2 = y - 3; - if (y2<0) y2 = 0; + int y1 = y + 1; + if (y1> h - 1) y1 = h - 1; - el.y1 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); - el.y2 = el.y1; + el.y2 = y1 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.x1 = el.x2; g.push_back(el); - el.y1 = y + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); - el.y2 = y2 + switchbox_y1 + 0.0017f*(16 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y1 = el.y2; + el.x1 = x + switchbox_x1; + g.push_back(el); + + int y2 = y - 1; + if (y2<0) y2 = 0; + + el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y2 = y2 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.x1 = el.x2; g.push_back(el); - } + + el.y1 = el.y2; + el.x1 = x + switchbox_x1; + g.push_back(el); + } if (wire_type == id_WIRE_TYPE_H06) { GraphicElement el; @@ -434,7 +444,7 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f*(16 + (src_id - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); @@ -452,10 +462,31 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el.y1 = y + switchbox_y1; el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f*(16 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3)); g.push_back(el); } + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { + + el.x1 = x + switchbox_x1; + el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); + + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 - 0.0017f*(src_id - TILE_WIRE_V02N0701); + el.y2 = el.y1; + + g.push_back(el); + + el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3)); + el.x1 = el.x2; + + g.push_back(el); + + el.y1 = el.y2; + el.x1 = x + switchbox_x1; + + g.push_back(el); + + } } -- cgit v1.2.3 From 74f2c4a73b56910b5b42013a89484e1060a1f736 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 10 Nov 2019 15:24:06 +0100 Subject: more pips, and valid mapping --- ecp5/arch.cc | 8 ++++---- ecp5/gfx.cc | 25 +++++++++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index fd9879b9..e80c9438 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -605,7 +605,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const if (decal.type == DecalId::TYPE_GROUP) { int type = decal.z; int x = decal.location.x; - int y = chip_info->height - 1 - decal.location.y; + int y = decal.location.y; if (type == GroupId::TYPE_SWITCHBOX) { GraphicElement el; @@ -625,7 +625,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const wire.location = decal.location; auto wire_type = getWireType(wire); int x = decal.location.x; - int y = chip_info->height - 1 - decal.location.y; + int y = decal.location.y; GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; GfxTileWireId tilewire = GfxTileWireId(locInfo(wire)->wire_data[wire.index].tile_wire); @@ -639,7 +639,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const WireId src_wire = getPipSrcWire(pip); WireId dst_wire = getPipDstWire(pip); int x = decal.location.x; - int y = chip_info->height - 1 - decal.location.y; + int y = decal.location.y; GfxTileWireId src_id = GfxTileWireId(locInfo(src_wire)->wire_data[src_wire.index].tile_wire); GfxTileWireId dst_id = GfxTileWireId(locInfo(dst_wire)->wire_data[dst_wire.index].tile_wire); GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_HIDDEN; @@ -651,7 +651,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const bel.location = decal.location; auto bel_type = getBelType(bel); int x = decal.location.x; - int y = chip_info->height - 1 - decal.location.y; + int y = decal.location.y; int z = locInfo(bel)->bel_data[bel.index].z; if (bel_type == id_TRELLIS_SLICE) { diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 373112a7..6b07861b 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -455,8 +455,7 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); el.x2 = x + switchbox_x1; g.push_back(el); - } - + } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { el.x1 = x + switchbox_x1 + 0.0017f*(16 + (src_id - TILE_WIRE_H02W0701)+ 20 *(src.location.x%3)); el.y1 = y + switchbox_y1; @@ -466,6 +465,15 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire g.push_back(el); } + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H02) { + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (dst_id - TILE_WIRE_H02W0701)+ 20 *(dst.location.x%3)); + el.y1 = y + switchbox_y1; + + el.x2 = x + switchbox_x1; + el.y2 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); + + g.push_back(el); + } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { el.x1 = x + switchbox_x1; @@ -485,10 +493,15 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el.x1 = x + switchbox_x1; g.push_back(el); - - } - - + } + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H02) { + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (dst_id - TILE_WIRE_H02W0701)+ 20 *(dst.location.x%3)); + el.y1 = y + switchbox_y1; + + el.x2 = x + switchbox_x1; + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (src_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + g.push_back(el); + } } NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From afea345cc74d75f9b0b1f578b301681f73e09434 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 10 Nov 2019 17:02:18 +0100 Subject: More pips added --- ecp5/gfx.cc | 241 +++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 200 insertions(+), 41 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 6b07861b..ac6ac21b 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -404,6 +404,46 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } +void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, GfxTileWireId src_id) +{ + if (src_type == id_WIRE_TYPE_H02) { + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (src_id - TILE_WIRE_H02W0701)+ 20 *(src.location.x%3)); + el.y1 = y + switchbox_y1; + } + if (src_type == id_WIRE_TYPE_H06) { + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.y1 = y + switchbox_y1; + } + if (src_type == id_WIRE_TYPE_V02) { + el.x1 = x + switchbox_x1; + el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); + } + if (src_type == id_WIRE_TYPE_V06) { + el.x1 = x + switchbox_x1; + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (src_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + } +} + +void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_type, GfxTileWireId dst_id) +{ + if (dst_type == id_WIRE_TYPE_H02) { + el.x2 = x + switchbox_x1 + 0.0017f*(16 + (dst_id - TILE_WIRE_H02W0701)+ 20 *(dst.location.x%3)); + el.y2 = y + switchbox_y1; + } + if (dst_type == id_WIRE_TYPE_H06) { + el.x2 = x + switchbox_x1 + 0.0017f*(96 + (dst_id - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.y2 = y + switchbox_y1; + } + if (dst_type == id_WIRE_TYPE_V02) { + el.x2 = x + switchbox_x1; + el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3)); + } + if (dst_type == id_WIRE_TYPE_V06) { + el.x2 = x + switchbox_x1; + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + } +} + void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style) { GraphicElement el; @@ -411,13 +451,10 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el.style = style; if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) { - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 20 *(x%3)); - el.y1 = y + switchbox_y1; - - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); - el.x2 = x + switchbox_x1; + setSource(el,x,y,src,src_type,src_id); + setDestination(el,x,y,dst,dst_type,dst_id); g.push_back(el); - } + } if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { if (src_id <= TILE_WIRE_H01E0101) { @@ -441,67 +478,189 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el.x2 = x + switchbox_x1; g.push_back(el); } - } + } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { - el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); + setSource(el,x,y,src,src_type,src_id); + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + 0.0017f*(src_id - TILE_WIRE_V02N0701); + el.y2 = el.y1; + g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_LINE; + el2.style = style; - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el.x2; + el.y1 = el2.y2; g.push_back(el); - el.x1 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); - el.x2 = x + switchbox_x1; + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); + } + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V02) { + setSource(el,x,y,src,src_type,src_id); + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + 0.0017f*(src_id - TILE_WIRE_V06N0303); + el.y2 = el.y1; + g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_LINE; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el.x2; + el.y1 = el2.y2; g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); } - if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { - el.x1 = x + switchbox_x1 + 0.0017f*(16 + (src_id - TILE_WIRE_H02W0701)+ 20 *(src.location.x%3)); - el.y1 = y + switchbox_y1; + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { + setSource(el,x,y,src,src_type,src_id); + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 - 0.0017f*(src_id - TILE_WIRE_V02N0701); + el.y2 = el.y1; + g.push_back(el); - el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3)); + GraphicElement el2; + el2.type = GraphicElement::TYPE_LINE; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el.x2; + el.y1 = el2.y2; + g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); + } + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { + setSource(el,x,y,src,src_type,src_id); + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + 0.0017f*(src_id - TILE_WIRE_V06N0303); + el.y2 = el.y1; + g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_LINE; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el.x2; + el.y1 = el2.y2; + g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); + } + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { + setSource(el,x,y,src,src_type,src_id); + setDestination(el,x,y,dst,dst_type,dst_id); g.push_back(el); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H02) { - el.x1 = x + switchbox_x1 + 0.0017f*(16 + (dst_id - TILE_WIRE_H02W0701)+ 20 *(dst.location.x%3)); - el.y1 = y + switchbox_y1; - - el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); + setSource(el,x,y,src,src_type,src_id); + setDestination(el,x,y,dst,dst_type,dst_id); g.push_back(el); } - if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { - - el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H02) { + setSource(el,x,y,src,src_type,src_id); + setDestination(el,x,y,dst,dst_type,dst_id); + g.push_back(el); + } - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 - 0.0017f*(src_id - TILE_WIRE_V02N0701); - el.y2 = el.y1; + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) { + setSource(el,x,y,src,src_type,src_id); + el.x2 = el.x1; + el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 + 0.0017f*(src_id - TILE_WIRE_H02W0701); + g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_LINE; + el2.style = style; + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el2.x2; + el.y1 = el.y2; g.push_back(el); - el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3)); - el.x1 = el.x2; + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); + } + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) { + setSource(el,x,y,src,src_type,src_id); + el.x2 = el.x1; + el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 + 0.0017f*(src_id - TILE_WIRE_H02W0701); g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_LINE; + el2.style = style; + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el2.x2; el.y1 = el.y2; - el.x1 = x + switchbox_x1; + g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); + } + + if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H06) { + setSource(el,x,y,src,src_type,src_id); + el.x2 = el.x1; + el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 - 0.0017f*(src_id - TILE_WIRE_H06W0303); + g.push_back(el); + GraphicElement el2; + el2.type = GraphicElement::TYPE_LINE; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el2.x2; + el.y1 = el.y2; + g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); + } + + if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H02) { + setSource(el,x,y,src,src_type,src_id); + el.x2 = el.x1; + el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 - 0.0017f*(src_id - TILE_WIRE_H06W0303); g.push_back(el); - } - if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H02) { - el.x1 = x + switchbox_x1 + 0.0017f*(16 + (dst_id - TILE_WIRE_H02W0701)+ 20 *(dst.location.x%3)); - el.y1 = y + switchbox_y1; - el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (src_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + GraphicElement el2; + el2.type = GraphicElement::TYPE_LINE; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el2.x2; + el.y1 = el.y2; g.push_back(el); - } + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); + } + } NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 6e349db55b5bc01e0d6719a8e24f96fc04c47b86 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 11 Nov 2019 08:58:46 +0100 Subject: proper h06 and v06 --- ecp5/gfx.cc | 73 +++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index ac6ac21b..23053b39 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -197,47 +197,55 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y1 = el.y2; el.x1 = x + switchbox_x1; g.push_back(el); - } - + } if (wire_type == id_WIRE_TYPE_H06) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); el.x2 = el.x1; el.y1 = y + switchbox_y1; - el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); g.push_back(el); - int x2 = x - 3; - if (x2<0) x2 = 0; + int x1 = x + 3; + if (x1> w - 1) x1 = w - 1; - el.x1 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); - el.x2 = el.x1; + el.x2 = x1 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + el.y1 = el.y2; g.push_back(el); - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); - el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); - el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 20 *(x%3)); - el.y1 = el.y2; + el.x1 = el.x2; + el.y1 = y + switchbox_y1; g.push_back(el); - } + int x2 = x - 3; + if (x2<0) x2 = 0; + + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + el.y1 = el.y2; + g.push_back(el); + + el.x1 = el.x2; + el.y1 = y + switchbox_y1; + g.push_back(el); + } if (wire_type == id_WIRE_TYPE_V06) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); el.y2 = el.y1; el.x1 = x + switchbox_x1; - el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); g.push_back(el); int y1 = y + 3; if (y1> h - 1) y1 = h - 1; - el.y2 = y1 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y2 = y1 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); el.x1 = el.x2; g.push_back(el); @@ -248,17 +256,16 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS int y2 = y - 3; if (y2<0) y2 = 0; - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); - el.y2 = y2 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); - el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + el.y2 = y2 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); el.x1 = el.x2; g.push_back(el); - + el.y1 = el.y2; el.x1 = x + switchbox_x1; g.push_back(el); } - if (wire_type == id_WIRE_TYPE_NONE) { if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) { @@ -411,7 +418,7 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, el.y1 = y + switchbox_y1; } if (src_type == id_WIRE_TYPE_H06) { - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 10 *(src.location.x%9)); el.y1 = y + switchbox_y1; } if (src_type == id_WIRE_TYPE_V02) { @@ -420,7 +427,7 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, } if (src_type == id_WIRE_TYPE_V06) { el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (src_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (src_id - TILE_WIRE_V06N0303)+ 10 *(src.location.y%9)); } } @@ -431,7 +438,7 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t el.y2 = y + switchbox_y1; } if (dst_type == id_WIRE_TYPE_H06) { - el.x2 = x + switchbox_x1 + 0.0017f*(96 + (dst_id - TILE_WIRE_H06W0303)+ 20 *(x%3)); + el.x2 = x + switchbox_x1 + 0.0017f*(96 + (dst_id - TILE_WIRE_H06W0303)+ 10 *(dst.location.x%9)); el.y2 = y + switchbox_y1; } if (dst_type == id_WIRE_TYPE_V02) { @@ -440,7 +447,7 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t } if (dst_type == id_WIRE_TYPE_V06) { el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); } } @@ -462,19 +469,19 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); g.push_back(el); el.x1 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); el.x2 = x + switchbox_x1; g.push_back(el); } else { el.x1 = x + switchbox_x2; el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 20 *(y%3)); + el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); el.x2 = x + switchbox_x1; g.push_back(el); } @@ -538,7 +545,7 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el2.x1 = el.x1; el2.y1 = el.y1; g.push_back(el2); - } + } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { setSource(el,x,y,src,src_type,src_id); el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + 0.0017f*(src_id - TILE_WIRE_V06N0303); @@ -570,13 +577,12 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire setDestination(el,x,y,dst,dst_type,dst_id); g.push_back(el); - } + } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H02) { setSource(el,x,y,src,src_type,src_id); setDestination(el,x,y,dst,dst_type,dst_id); g.push_back(el); } - if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) { setSource(el,x,y,src,src_type,src_id); el.x2 = el.x1; @@ -597,7 +603,6 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el2.y1 = el.y1; g.push_back(el2); } - if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) { setSource(el,x,y,src,src_type,src_id); el.x2 = el.x1; -- cgit v1.2.3 From 522bbbc1f2a33ee19e027ffa1aeab57bfe3d9e19 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 11 Nov 2019 09:32:28 +0100 Subject: cleanup --- ecp5/gfx.cc | 252 +++++++++++++++++++----------------------------------------- 1 file changed, 78 insertions(+), 174 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 23053b39..a06cbefe 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -451,17 +451,68 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t } } +void straightLine(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id) +{ + setSource(el,x,y,src,src_type,src_id); + setDestination(el,x,y,dst,dst_type,dst_id); + g.push_back(el); +} + +void toSameSideHor(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +{ + int sign = (src_type==dst_type) ? 1 : -1; + setSource(el,x,y,src,src_type,src_id); + el.x2 = el.x1; + el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 + sign * 0.0017f*idx; + g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_ARROW; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el2.x2; + el.y1 = el.y2; + g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); +} + +void toSameSideVer(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +{ + int sign = (src_type==dst_type) ? 1 : -1; + setSource(el,x,y,src,src_type,src_id); + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + sign * 0.0017f*idx; + el.y2 = el.y1; + g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_ARROW; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el.x2; + el.y1 = el2.y2; + g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); +} + void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style) { GraphicElement el; - el.type = GraphicElement::TYPE_LINE; + el.type = GraphicElement::TYPE_ARROW; el.style = style; if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) { - setSource(el,x,y,src,src_type,src_id); - setDestination(el,x,y,dst,dst_type,dst_id); - g.push_back(el); - } + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { if (src_id <= TILE_WIRE_H01E0101) { @@ -487,185 +538,38 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire } } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + 0.0017f*(src_id - TILE_WIRE_V02N0701); - el.y2 = el.y1; - g.push_back(el); - - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = style; - - setDestination(el2,x,y,dst,dst_type,dst_id); - - el.x1 = el.x2; - el.y1 = el2.y2; - g.push_back(el); - - el2.x1 = el.x1; - el2.y1 = el.y1; - g.push_back(el2); - } + toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V02N0701); + } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V02) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + 0.0017f*(src_id - TILE_WIRE_V06N0303); - el.y2 = el.y1; - g.push_back(el); - - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = style; - - setDestination(el2,x,y,dst,dst_type,dst_id); - - el.x1 = el.x2; - el.y1 = el2.y2; - g.push_back(el); - - el2.x1 = el.x1; - el2.y1 = el.y1; - g.push_back(el2); - } + toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); + } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 - 0.0017f*(src_id - TILE_WIRE_V02N0701); - el.y2 = el.y1; - g.push_back(el); - - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = style; - - setDestination(el2,x,y,dst,dst_type,dst_id); - - el.x1 = el.x2; - el.y1 = el2.y2; - g.push_back(el); - - el2.x1 = el.x1; - el2.y1 = el.y1; - g.push_back(el2); - } + toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V02N0701); + } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + 0.0017f*(src_id - TILE_WIRE_V06N0303); - el.y2 = el.y1; - g.push_back(el); - - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = style; - - setDestination(el2,x,y,dst,dst_type,dst_id); - - el.x1 = el.x2; - el.y1 = el2.y2; - g.push_back(el); - - el2.x1 = el.x1; - el2.y1 = el.y1; - g.push_back(el2); - } + toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); + } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { - setSource(el,x,y,src,src_type,src_id); - setDestination(el,x,y,dst,dst_type,dst_id); - - g.push_back(el); - } + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H02) { - setSource(el,x,y,src,src_type,src_id); - setDestination(el,x,y,dst,dst_type,dst_id); - - g.push_back(el); - } + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H02) { - setSource(el,x,y,src,src_type,src_id); - setDestination(el,x,y,dst,dst_type,dst_id); - g.push_back(el); - } + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = el.x1; - el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 + 0.0017f*(src_id - TILE_WIRE_H02W0701); - g.push_back(el); - - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = style; - - setDestination(el2,x,y,dst,dst_type,dst_id); - - el.x1 = el2.x2; - el.y1 = el.y2; - g.push_back(el); - - el2.x1 = el.x1; - el2.y1 = el.y1; - g.push_back(el2); - } + toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H02W0701); + } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = el.x1; - el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 + 0.0017f*(src_id - TILE_WIRE_H02W0701); - g.push_back(el); - - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = style; - - setDestination(el2,x,y,dst,dst_type,dst_id); - - el.x1 = el2.x2; - el.y1 = el.y2; - g.push_back(el); - - el2.x1 = el.x1; - el2.y1 = el.y1; - g.push_back(el2); - } - + toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H02W0701); + } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H06) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = el.x1; - el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 - 0.0017f*(src_id - TILE_WIRE_H06W0303); - g.push_back(el); - - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = style; - - setDestination(el2,x,y,dst,dst_type,dst_id); - - el.x1 = el2.x2; - el.y1 = el.y2; - g.push_back(el); - - el2.x1 = el.x1; - el2.y1 = el.y1; - g.push_back(el2); - } - + toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H06W0303); + } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H02) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = el.x1; - el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 - 0.0017f*(src_id - TILE_WIRE_H06W0303); - g.push_back(el); - - GraphicElement el2; - el2.type = GraphicElement::TYPE_LINE; - el2.style = style; - - setDestination(el2,x,y,dst,dst_type,dst_id); - - el.x1 = el2.x2; - el.y1 = el.y2; - g.push_back(el); - - el2.x1 = el.x1; - el2.y1 = el.y1; - g.push_back(el2); - } - + toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H06W0303); + } } NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From 2827731210e9a6075a5ad38c3738d4ae284ec0e6 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 11 Nov 2019 12:49:26 +0100 Subject: More pips and fix for V01 --- ecp5/gfx.cc | 212 ++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 170 insertions(+), 42 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index a06cbefe..409e8dec 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -77,8 +77,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.style = style; 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; + el.y1 = y + switchbox_y1 + 1; + el.y2 = y + switchbox_y2; g.push_back(el); } } @@ -413,6 +413,13 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, GfxTileWireId src_id) { + if (src_type == id_WIRE_TYPE_H01) { + if (x == src.location.x) + el.x1 = x + switchbox_x1; + else + el.x1 = x + switchbox_x2; + el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); + } if (src_type == id_WIRE_TYPE_H02) { el.x1 = x + switchbox_x1 + 0.0017f*(16 + (src_id - TILE_WIRE_H02W0701)+ 20 *(src.location.x%3)); el.y1 = y + switchbox_y1; @@ -421,6 +428,13 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 10 *(src.location.x%9)); el.y1 = y + switchbox_y1; } + if (src_type == id_WIRE_TYPE_V01) { + el.x1 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (src_id - TILE_WIRE_V01N0001); + if (y == src.location.y) + el.y1 = y + switchbox_y2; + else + el.y1 = y + switchbox_y1; + } if (src_type == id_WIRE_TYPE_V02) { el.x1 = x + switchbox_x1; el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); @@ -433,6 +447,13 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_type, GfxTileWireId dst_id) { + if (dst_type == id_WIRE_TYPE_H01) { + if (x == dst.location.x) + el.x2 = x + switchbox_x1; + else + el.x2 = x + switchbox_x2; + el.y2 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (dst_id - TILE_WIRE_H01E0001); + } if (dst_type == id_WIRE_TYPE_H02) { el.x2 = x + switchbox_x1 + 0.0017f*(16 + (dst_id - TILE_WIRE_H02W0701)+ 20 *(dst.location.x%3)); el.y2 = y + switchbox_y1; @@ -441,6 +462,13 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t el.x2 = x + switchbox_x1 + 0.0017f*(96 + (dst_id - TILE_WIRE_H06W0303)+ 10 *(dst.location.x%9)); el.y2 = y + switchbox_y1; } + if (dst_type == id_WIRE_TYPE_V01) { + el.x2 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (dst_id - TILE_WIRE_V01N0001); + if (y == dst.location.y) + el.y2 = y + switchbox_y2; + else + el.y2 = y + switchbox_y1; + } if (dst_type == id_WIRE_TYPE_V02) { el.x2 = x + switchbox_x1; el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3)); @@ -504,53 +532,102 @@ void toSameSideVer(std::vector &g, GraphicElement &el,int x, int g.push_back(el2); } +void toSameSideH1Ver(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +{ + setSource(el,x,y,src,src_type,src_id); + el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 - 0.0017f*idx; + el.y2 = el.y1; + g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_ARROW; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el.x2; + el.y1 = el2.y2; + g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); +} + +void toSameSideH1Hor(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +{ + setSource(el,x,y,src,src_type,src_id); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_ARROW; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + if (dst_type == id_WIRE_TYPE_H01 || src_type == id_WIRE_TYPE_V01) { + el.x2 = el.x1; + el.y2 = el2.y2; + g.push_back(el); + } else { + el.x2 = el2.x2; + el.y2 = el.y1; + g.push_back(el); + } + + el2.x1 = el.x2; + el2.y1 = el.y2; + g.push_back(el2); +} + +void toSameSideV1Ver(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +{ + setSource(el,x,y,src,src_type,src_id); + el.x2 = el.x1; + el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 - 0.0017f*idx; + g.push_back(el); + + GraphicElement el2; + el2.type = GraphicElement::TYPE_ARROW; + el2.style = style; + + setDestination(el2,x,y,dst,dst_type,dst_id); + + el.x1 = el2.x2; + el.y1 = el.y2; + g.push_back(el); + + el2.x1 = el.x1; + el2.y1 = el.y1; + g.push_back(el2); +} void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style) { GraphicElement el; el.type = GraphicElement::TYPE_ARROW; el.style = style; - if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H01) { + toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H01E0001); + } + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V01) { + toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V01N0001); } - if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { - if (src_id <= TILE_WIRE_H01E0101) { - - el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); - g.push_back(el); - el.x1 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2; - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); - el.x2 = x + switchbox_x1; - g.push_back(el); - } else { - el.x1 = x + switchbox_x2; - el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); - - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); - el.x2 = x + switchbox_x1; - g.push_back(el); - } - } - if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { - toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V02N0701); + if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H02) { + toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H02W0701); } - if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V02) { - toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); - } - if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { - toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V02N0701); - } - if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { - toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) { + toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H02W0701); } - if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H02) { + toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H06W0303); + } + if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_H02) { + if (y == src.location.y) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } else { + toSameSideV1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H02W0701); + } } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H02) { straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); @@ -558,8 +635,9 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H02) { straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); } - if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) { - toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H02W0701); + + if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H06) { + toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) { toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H02W0701); @@ -567,8 +645,58 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H06) { toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H06W0303); } - if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H02) { - toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H06W0303); + if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_H06) { + if (y == src.location.y) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } else { + toSameSideV1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H06W0303); + } + } + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H06) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + + if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V02) { + if (x == src.location.x) { + toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V02N0701); + } else { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + } + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V02) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_V02) { + toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V02N0701); + } + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { + toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V02N0701); + } + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V02) { + toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); + } + + if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { + if (x == src.location.x) { + toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V06N0303); + } else { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + } + if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_V06) { + toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V06N0303); + } + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { + toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V02N0701); + } + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { + toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); } } -- cgit v1.2.3 From da8b5758cd743441999a43c29fa1498c57fd047d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 11 Nov 2019 13:30:11 +0100 Subject: Handle H00 and V00 --- ecp5/gfx.cc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 409e8dec..1a774884 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -447,6 +447,16 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_type, GfxTileWireId dst_id) { + if (dst_type == id_WIRE_TYPE_H00) { + int group = (dst_id - TILE_WIRE_H00L0000) / 2; + el.y2 = y + switchbox_y1 + 0.0017f*(8 - ((dst_id - TILE_WIRE_H00L0000) % 2)*4); + + if (group) { + el.x2 = x + switchbox_x2; + } else { + el.x2 = x + switchbox_x1; + } + } if (dst_type == id_WIRE_TYPE_H01) { if (x == dst.location.x) el.x2 = x + switchbox_x1; @@ -462,6 +472,15 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t el.x2 = x + switchbox_x1 + 0.0017f*(96 + (dst_id - TILE_WIRE_H06W0303)+ 10 *(dst.location.x%9)); el.y2 = y + switchbox_y1; } + if (dst_type == id_WIRE_TYPE_V00) { + int group = (dst_id - TILE_WIRE_V00T0000) / 2; + el.x2 = x + switchbox_x2 - 0.0017f*(8 - ((dst_id - TILE_WIRE_V00T0000) % 2)*4); + if (group) { + el.y2 = y + switchbox_y1; + } else { + el.y2 = y + switchbox_y2; + } + } if (dst_type == id_WIRE_TYPE_V01) { el.x2 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (dst_id - TILE_WIRE_V01N0001); if (y == dst.location.y) @@ -563,7 +582,7 @@ void toSameSideH1Hor(std::vector &g, GraphicElement &el,int x, i el2.style = style; setDestination(el2,x,y,dst,dst_type,dst_id); - if (dst_type == id_WIRE_TYPE_H01 || src_type == id_WIRE_TYPE_V01) { + if (dst_type == id_WIRE_TYPE_H01 || src_type == id_WIRE_TYPE_V01 || dst_type == id_WIRE_TYPE_H00) { el.x2 = el.x1; el.y2 = el2.y2; g.push_back(el); @@ -605,14 +624,21 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire el.type = GraphicElement::TYPE_ARROW; el.style = style; + // To H00 + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H00) { + toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H00L0000 + 30); + } + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H00) { + //toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H00L0000); + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + + // To H01 if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H01) { toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H01E0001); } - if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V01) { - toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V01N0001); - } - - + + // To H02 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H02) { toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H02W0701); } @@ -636,6 +662,7 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); } + // To H06 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H06) { toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H06W0303); } @@ -656,6 +683,21 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); } + // To V00 + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V00) { + //toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V00T0000); + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V00) { + toSameSideV1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, src_id - TILE_WIRE_H02W0701 + 20); + } + + // To V01 + if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V01) { + toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V01N0001); + } + + // To V02 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V02) { if (x == src.location.x) { toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V02N0701); @@ -679,6 +721,7 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); } + // To V06 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { if (x == src.location.x) { toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V06N0303); -- cgit v1.2.3 From 0c77eed07dfa40b7a2564db652c52be74b4fe441 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 1 Dec 2019 11:00:24 +0100 Subject: add more pips --- ecp5/gfx.cc | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 1a774884..5adf591d 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -413,6 +413,16 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, GfxTileWireId src_id) { + if (src_type == id_WIRE_TYPE_H00) { + int group = (src_id - TILE_WIRE_H00L0000) / 2; + el.y1 = y + switchbox_y1 + 0.0017f*(8 - ((src_id - TILE_WIRE_H00L0000) % 2)*4); + + if (group) { + el.x1 = x + switchbox_x2; + } else { + el.x1 = x + switchbox_x1; + } + } if (src_type == id_WIRE_TYPE_H01) { if (x == src.location.x) el.x1 = x + switchbox_x1; @@ -428,6 +438,15 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 10 *(src.location.x%9)); el.y1 = y + switchbox_y1; } + if (src_type == id_WIRE_TYPE_V00) { + int group = (src_id - TILE_WIRE_V00T0000) / 2; + el.x1 = x + switchbox_x2 - 0.0017f*(8 - ((src_id - TILE_WIRE_V00T0000) % 2)*4); + if (group) { + el.y1 = y + switchbox_y1; + } else { + el.y1 = y + switchbox_y2; + } + } if (src_type == id_WIRE_TYPE_V01) { el.x1 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (src_id - TILE_WIRE_V01N0001); if (y == src.location.y) @@ -496,6 +515,15 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t el.x2 = x + switchbox_x1; el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); } + + if (dst_type == id_WIRE_TYPE_NONE) { + if (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI) + { + int gap = (dst_id - TILE_WIRE_FCO) / 24; + el.x2 = x + switchbox_x2; + el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_FCO + 1 + gap*2) + 3*slice_pitch; + } + } } void straightLine(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id) @@ -741,6 +769,27 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); } + + if (src_type == id_WIRE_TYPE_H00 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { + toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_FCO); + } + if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { + toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_FCO); + } + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + + if (src_type == id_WIRE_TYPE_V00 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { + straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + } + } NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From b764f9b13a6bdc00ee3965448786c3e060430516 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 7 Dec 2019 17:21:59 +0100 Subject: Fix edge wires --- ecp5/gfx.cc | 177 ++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 108 insertions(+), 69 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 5adf591d..e78d7c5a 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -77,8 +77,16 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.style = style; el.x1 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (tilewire - TILE_WIRE_V01N0001); el.x2 = el.x1; - el.y1 = y + switchbox_y1 + 1; - el.y2 = y + switchbox_y2; + if (y==h-2) + el.y1 = y + 1.1; + else + el.y1 = y + switchbox_y1 + 1; + + if (y==0) + el.y2 = y + 0.9; + else + el.y2 = y + switchbox_y2; + g.push_back(el); } } @@ -88,8 +96,14 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.x1 = x + switchbox_x1; - el.x2 = x + switchbox_x2 - 1; + if (x==w-1) + el.x1 = x + 0.1; + else + el.x1 = x + switchbox_x1; + if (x==1) + el.x2 = x - 0.1; + else + el.x2 = x + switchbox_x2 - 1; el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (tilewire - TILE_WIRE_H01E0001); el.y2 = el.y1; g.push_back(el); @@ -129,143 +143,168 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } - if (wire_type == id_WIRE_TYPE_H02) { + if (wire_type == id_WIRE_TYPE_H02) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + if (x==0) + el.x1 = 0.9; + else + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); el.x2 = el.x1; el.y1 = y + switchbox_y1; el.y2 = y + switchbox_y1 - 0.0017f*(20 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); - g.push_back(el); - - int x1 = x + 1; - if (x1> w - 1) x1 = w - 1; + if (x!=0 && x!=w-1) g.push_back(el); - el.x2 = x1 + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + if (x==w-2) + el.x2 = x + 1 + 0.1; + else + el.x2 = x + 1 + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); el.y1 = el.y2; - g.push_back(el); + if (x!=w-1) g.push_back(el); el.x1 = el.x2; el.y1 = y + switchbox_y1; - g.push_back(el); + if (x!=w-1 && x!=w-2) g.push_back(el); - int x2 = x - 1; - if (x2<0) x2 = 0; - - el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); - el.x2 = x2 + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + if (x==w-1) + el.x1 = x + 0.1; + else + el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + if (x==1) + el.x2 = x - 1 + 0.9; + else + el.x2 = x - 1 + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); el.y2 = y + switchbox_y1 - 0.0017f*(20 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); el.y1 = el.y2; - g.push_back(el); + if (x!=0) g.push_back(el); el.x1 = el.x2; el.y1 = y + switchbox_y1; - g.push_back(el); + if (x!=0 && x!=1) g.push_back(el); } - if (wire_type == id_WIRE_TYPE_V02) { + if (wire_type == id_WIRE_TYPE_V02) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + if (y==0) + el.y1 = 0.9; + else + el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.y2 = el.y1; el.x1 = x + switchbox_x1; el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); - g.push_back(el); + if (y!=0 && y!=h-1) g.push_back(el); - int y1 = y + 1; - if (y1> h - 1) y1 = h - 1; - - el.y2 = y1 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + if (y==h-2) + el.y2 = y + 1 + 0.1; + else + el.y2 = y + 1 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.x1 = el.x2; - g.push_back(el); + if (y!=h-1) g.push_back(el); el.y1 = el.y2; el.x1 = x + switchbox_x1; - g.push_back(el); - - int y2 = y - 1; - if (y2<0) y2 = 0; + if (y!=h-1 && y!=h-2) g.push_back(el); - el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); - el.y2 = y2 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + if (y==h-1) + el.y1 = y + 0.1; + else + el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + if (y==1) + el.y2 = y - 1 + 0.9; + else + el.y2 = y - 1 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); el.x1 = el.x2; - g.push_back(el); + if (y!=0) g.push_back(el); el.y1 = el.y2; el.x1 = x + switchbox_x1; - g.push_back(el); - } + if (y!=0 && y!=1) g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_H06) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + if (x==0) + el.x1 = 0.9; + else + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); el.x2 = el.x1; el.y1 = y + switchbox_y1; el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); - g.push_back(el); + if (x!=0 && x!=w-1) g.push_back(el); - int x1 = x + 3; - if (x1> w - 1) x1 = w - 1; - - el.x2 = x1 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + if (x==w-2 || x==w-3 || x==w-4) + el.x2 = w - 1 + 0.1; + else + el.x2 = x + 3 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); el.y1 = el.y2; - g.push_back(el); + if (x!=w-1) g.push_back(el); el.x1 = el.x2; el.y1 = y + switchbox_y1; - g.push_back(el); - - int x2 = x - 3; - if (x2<0) x2 = 0; + if (x!=w-1 && x!=w-2 && x!=w-3 && x!=w-4) g.push_back(el); - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); - el.x2 = x2 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + if (x==w-1) + el.x1 = x + 0.1; + else + el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + if (x==1 || x==2 || x==3) + el.x2 = 0.9; + else + el.x2 = x - 3 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); el.y1 = el.y2; - g.push_back(el); + if (x!=0) g.push_back(el); el.x1 = el.x2; el.y1 = y + switchbox_y1; - g.push_back(el); - } + if (x!=0 && x!=1 && x!=2 && x!=3) g.push_back(el); + } if (wire_type == id_WIRE_TYPE_V06) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + if (y==0) + el.y1 = 0.9; + else + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); el.y2 = el.y1; el.x1 = x + switchbox_x1; el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); - g.push_back(el); + if (y!=0 && y!=h-1) g.push_back(el); - int y1 = y + 3; - if (y1> h - 1) y1 = h - 1; - - el.y2 = y1 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + if (y==h-2 || y==h-3 || y==h-4) + el.y2 = h - 1 + 0.1; + else + el.y2 = y + 3 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); el.x1 = el.x2; - g.push_back(el); + if (y!=h-1) g.push_back(el); el.y1 = el.y2; el.x1 = x + switchbox_x1; - g.push_back(el); - - int y2 = y - 3; - if (y2<0) y2 = 0; + if (y!=h-1 && y!=h-2 && y!=h-3 && y!=h-4) g.push_back(el); - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); - el.y2 = y2 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + if (y==h-1) + el.y1 = y + 0.1; + else + el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + if (y==1 || y==2 || y==3) + el.y2 = 0.9; + else + el.y2 = y - 3 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); el.x1 = el.x2; - g.push_back(el); + if (y!=0) g.push_back(el); el.y1 = el.y2; el.x1 = x + switchbox_x1; - g.push_back(el); - } + if (y!=0 && y!=1 && y!=2 && y!=3) g.push_back(el); + } if (wire_type == id_WIRE_TYPE_NONE) { if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) { -- cgit v1.2.3 From 76d2a3f0dbe3ce8349787bf3a2d8fa0d32a1706a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 7 Dec 2019 17:41:22 +0100 Subject: add dcca bels and dummy parts for other bels --- ecp5/arch.cc | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index e80c9438..a5740c82 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -618,8 +618,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y2 = y + switchbox_y2; ret.push_back(el); } - } - if (decal.type == DecalId::TYPE_WIRE) { + } else if (decal.type == DecalId::TYPE_WIRE) { WireId wire; wire.index = decal.z; wire.location = decal.location; @@ -631,8 +630,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GfxTileWireId tilewire = GfxTileWireId(locInfo(wire)->wire_data[wire.index].tile_wire); gfxTileWire(ret, x, y, chip_info->width, chip_info->height, wire_type, tilewire, style); - } - if (decal.type == DecalId::TYPE_PIP) { + } else if (decal.type == DecalId::TYPE_PIP) { PipId pip; pip.index = decal.z; pip.location = decal.location; @@ -644,8 +642,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GfxTileWireId dst_id = GfxTileWireId(locInfo(dst_wire)->wire_data[dst_wire.index].tile_wire); GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_HIDDEN; gfxTilePip(ret, x, y, chip_info->width, chip_info->height, src_wire, getWireType(src_wire), src_id, dst_wire, getWireType(dst_wire), dst_id, style); - } - if (decal.type == DecalId::TYPE_BEL) { + } else if (decal.type == DecalId::TYPE_BEL) { BelId bel; bel.index = decal.z; bel.location = decal.location; @@ -670,9 +667,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 5 + z*26) + 3*slice_pitch - 0.0007f; el.y2 = el.y1 + 0.0017f * 5; ret.push_back(el); - } - - if (bel_type == id_TRELLIS_IO) { + } else if (bel_type == id_TRELLIS_IO) { bool top_bottom = (y==0 || y==(chip_info->height-1)); GraphicElement el; el.type = GraphicElement::TYPE_BOX; @@ -689,6 +684,56 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y2 = y + io_cell_v_y2 + (2 * z + 0.5f) * io_cell_v_pitch; } ret.push_back(el); + } else if (bel_type == id_DCCA) { + //printf("%d,%d id_DCCA\n",x,y); + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + switchbox_x1 + (z)*0.025; + el.y1 = y + 0.14; + el.x2 = x + switchbox_x1 + (z)*0.025 + 0.020; + el.y2 = y + 0.18; + ret.push_back(el); + } else if (bel_type == id_DP16KD) { + //printf("%d,%d id_DP16KD\n",x,y); + } else if (bel_type == id_MULT18X18D) { + //printf("%d,%d id_MULT18X18D\n",x,y); + } else if (bel_type == id_ALU54B) { + //printf("%d,%d id_ALU54B\n",x,y); + } else if (bel_type == id_EHXPLLL) { + //printf("%d,%d id_EHXPLLL\n",x,y); + } else if (bel_type == id_DCUA) { + //printf("%d,%d id_DCUA\n",x,y); + } else if (bel_type == id_EXTREFB) { + //printf("%d,%d id_EXTREFB\n",x,y); + } else if (bel_type == id_PCSCLKDIV) { + //printf("%d,%d id_PCSCLKDIV\n",x,y); + } else if (bel_type == id_IOLOGIC) { + //printf("%d,%d id_IOLOGIC\n",x,y); + } else if (bel_type == id_SIOLOGIC) { + //printf("%d,%d id_SIOLOGIC\n",x,y); + } else if (bel_type == id_DTR) { + //printf("%d,%d id_DTR\n",x,y); + } else if (bel_type == id_USRMCLK) { + //printf("%d,%d id_USRMCLK\n",x,y); + } else if (bel_type == id_SEDGA) { + //printf("%d,%d id_SEDGA\n",x,y); + } else if (bel_type == id_GSR) { + //printf("%d,%d id_GSR\n",x,y); + } else if (bel_type == id_JTAGG) { + //printf("%d,%d id_JTAGG\n",x,y); + } else if (bel_type == id_OSCG) { + //printf("%d,%d id_OSCG\n",x,y); + } else if (bel_type == id_CLKDIVF) { + //printf("%d,%d id_CLKDIVF\n",x,y); + } else if (bel_type == id_DQSBUFM) { + //printf("%d,%d id_DQSBUFM\n",x,y); + } else if (bel_type == id_DDRDLL) { + //printf("%d,%d id_DDRDLL\n",x,y); + } else if (bel_type == id_ECLKSYNCB) { + //printf("%d,%d id_ECLKSYNCB\n",x,y); + } else if (bel_type == id_ECLKBRIDGECS) { + //printf("%d,%d id_ECLKBRIDGECS\n",x,y); } } -- cgit v1.2.3 From 401bee6111a1043fefebf753c94ddd9572ec0dd4 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 7 Dec 2019 18:52:33 +0100 Subject: More bels show properly --- ecp5/arch.cc | 125 +++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 82 insertions(+), 43 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index a5740c82..15ff77b1 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -668,6 +668,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y2 = el.y1 + 0.0017f * 5; ret.push_back(el); } else if (bel_type == id_TRELLIS_IO) { + //printf("%d,%d,%d id_TRELLIS_IO\n",x,y,z); bool top_bottom = (y==0 || y==(chip_info->height-1)); GraphicElement el; el.type = GraphicElement::TYPE_BOX; @@ -675,17 +676,41 @@ std::vector Arch::getDecalGraphics(DecalId decal) const if (top_bottom) { el.x1 = x + io_cell_h_x1 + (2 * (z+1)) * io_cell_h_pitch; el.x2 = x + io_cell_h_x2 + (2 * (z+1) + 0.5f) * io_cell_h_pitch; - el.y1 = y + io_cell_h_y1; - el.y2 = y + io_cell_h_y2; + if (y==chip_info->height-1) { + el.y1 = y + 1- io_cell_h_y1; + el.y2 = y + 1- io_cell_h_y2; + } else { + el.y1 = y + io_cell_h_y1; + el.y2 = y + io_cell_h_y2; + } } else { - el.x1 = x + io_cell_v_x1; - el.x2 = x + io_cell_v_x2; + if (x==0) { + el.x1 = x + 1-io_cell_v_x1; + el.x2 = x + 1-io_cell_v_x2; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = x + io_cell_v_x2; + } el.y1 = y + io_cell_v_y1 + (2 * z) * io_cell_v_pitch; el.y2 = y + io_cell_v_y2 + (2 * z + 0.5f) * io_cell_v_pitch; } ret.push_back(el); + } else if (bel_type == id_IOLOGIC) { + //printf("%d,%d,%d id_IOLOGIC\n",x,y,z); + } else if (bel_type == id_SIOLOGIC) { + //printf("%d,%d,%d id_SIOLOGIC\n",x,y,z); + } else if (bel_type == id_DQSBUFM) { + //printf("%d,%d,%d id_DQSBUFM\n",x,y,z); + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + 0.4; + el.x2 = x + 0.6; + el.y1 = y + 0.4; + el.y2 = y + 0.6; + ret.push_back(el); + } else if (bel_type == id_DCCA) { - //printf("%d,%d id_DCCA\n",x,y); GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; @@ -694,46 +719,60 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.x2 = x + switchbox_x1 + (z)*0.025 + 0.020; el.y2 = y + 0.18; ret.push_back(el); - } else if (bel_type == id_DP16KD) { - //printf("%d,%d id_DP16KD\n",x,y); - } else if (bel_type == id_MULT18X18D) { - //printf("%d,%d id_MULT18X18D\n",x,y); - } else if (bel_type == id_ALU54B) { - //printf("%d,%d id_ALU54B\n",x,y); + } else if (bel_type == id_DP16KD || bel_type == id_MULT18X18D || bel_type == id_ALU54B) { + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y1; + el.y2 = y + slice_y2 + 3*slice_pitch; + ret.push_back(el); } else if (bel_type == id_EHXPLLL) { - //printf("%d,%d id_EHXPLLL\n",x,y); - } else if (bel_type == id_DCUA) { - //printf("%d,%d id_DCUA\n",x,y); - } else if (bel_type == id_EXTREFB) { - //printf("%d,%d id_EXTREFB\n",x,y); - } else if (bel_type == id_PCSCLKDIV) { - //printf("%d,%d id_PCSCLKDIV\n",x,y); - } else if (bel_type == id_IOLOGIC) { - //printf("%d,%d id_IOLOGIC\n",x,y); - } else if (bel_type == id_SIOLOGIC) { - //printf("%d,%d id_SIOLOGIC\n",x,y); - } else if (bel_type == id_DTR) { - //printf("%d,%d id_DTR\n",x,y); - } else if (bel_type == id_USRMCLK) { - //printf("%d,%d id_USRMCLK\n",x,y); - } else if (bel_type == id_SEDGA) { - //printf("%d,%d id_SEDGA\n",x,y); - } else if (bel_type == id_GSR) { - //printf("%d,%d id_GSR\n",x,y); - } else if (bel_type == id_JTAGG) { - //printf("%d,%d id_JTAGG\n",x,y); - } else if (bel_type == id_OSCG) { - //printf("%d,%d id_OSCG\n",x,y); - } else if (bel_type == id_CLKDIVF) { - //printf("%d,%d id_CLKDIVF\n",x,y); - } else if (bel_type == id_DQSBUFM) { - //printf("%d,%d id_DQSBUFM\n",x,y); + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y1; + el.y2 = y + slice_y2; + ret.push_back(el); + } else if (bel_type == id_DCUA || bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK) { + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y1 + (z)*slice_pitch; + el.y2 = y + slice_y2 + (z)*slice_pitch; + ret.push_back(el); + } else if (bel_type == id_SEDGA || bel_type == id_GSR || bel_type == id_JTAGG || bel_type == id_OSCG) { + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y1 + (z)*slice_pitch; + el.y2 = y + slice_y2 + (z)*slice_pitch; + ret.push_back(el); } else if (bel_type == id_DDRDLL) { - //printf("%d,%d id_DDRDLL\n",x,y); - } else if (bel_type == id_ECLKSYNCB) { - //printf("%d,%d id_ECLKSYNCB\n",x,y); - } else if (bel_type == id_ECLKBRIDGECS) { - //printf("%d,%d id_ECLKBRIDGECS\n",x,y); + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + 0.2; + el.x2 = x + 0.8; + el.y1 = y + 0.2; + el.y2 = y + 0.8; + ret.push_back(el); + } else if (bel_type == id_DLLDELD || bel_type == id_CLKDIVF || bel_type == id_ECLKSYNCB || bel_type == id_TRELLIS_ECLKBUF || bel_type == id_ECLKBRIDGECS) { + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + 0.1 + z * 0.05; + el.x2 = x + 0.14 + z * 0.05; + el.y1 = y + 0.475; + el.y2 = y + 0.525; + ret.push_back(el); } } -- cgit v1.2.3 From 275805d78f598b64eb0769969b12362427e76c0d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 7 Dec 2019 19:06:10 +0100 Subject: display IOs properly --- ecp5/arch.cc | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 15ff77b1..a6070ab6 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -667,15 +667,14 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 5 + z*26) + 3*slice_pitch - 0.0007f; el.y2 = el.y1 + 0.0017f * 5; ret.push_back(el); - } else if (bel_type == id_TRELLIS_IO) { - //printf("%d,%d,%d id_TRELLIS_IO\n",x,y,z); + } else if (bel_type == id_TRELLIS_IO || bel_type == id_IOLOGIC || bel_type == id_SIOLOGIC || bel_type == id_DQSBUFM) { bool top_bottom = (y==0 || y==(chip_info->height-1)); GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; if (top_bottom) { - el.x1 = x + io_cell_h_x1 + (2 * (z+1)) * io_cell_h_pitch; - el.x2 = x + io_cell_h_x2 + (2 * (z+1) + 0.5f) * io_cell_h_pitch; + el.x1 = x + io_cell_h_x1 + (z+2) * 0.10; + el.x2 = x + io_cell_h_x1 + (z+2) * 0.10 + 0.08f; if (y==chip_info->height-1) { el.y1 = y + 1- io_cell_h_y1; el.y2 = y + 1- io_cell_h_y2; @@ -691,25 +690,10 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.x1 = x + io_cell_v_x1; el.x2 = x + io_cell_v_x2; } - el.y1 = y + io_cell_v_y1 + (2 * z) * io_cell_v_pitch; - el.y2 = y + io_cell_v_y2 + (2 * z + 0.5f) * io_cell_v_pitch; + el.y1 = y + io_cell_v_y1 + z * 0.10; + el.y2 = y + io_cell_v_y1 + z * 0.10 + 0.08f; } ret.push_back(el); - } else if (bel_type == id_IOLOGIC) { - //printf("%d,%d,%d id_IOLOGIC\n",x,y,z); - } else if (bel_type == id_SIOLOGIC) { - //printf("%d,%d,%d id_SIOLOGIC\n",x,y,z); - } else if (bel_type == id_DQSBUFM) { - //printf("%d,%d,%d id_DQSBUFM\n",x,y,z); - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + 0.4; - el.x2 = x + 0.6; - el.y1 = y + 0.4; - el.y2 = y + 0.6; - ret.push_back(el); - } else if (bel_type == id_DCCA) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; -- cgit v1.2.3 From 7fd856b866f1ddd2f81fdeaf981c15fde51b847d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 8 Dec 2019 09:33:06 +0100 Subject: clangformat run --- ecp5/arch.cc | 57 ++--- ecp5/gfx.cc | 596 +++++++++++++++++++++++++++------------------------ ecp5/gfx.h | 40 ++-- gui/fpgaviewwidget.h | 2 +- 4 files changed, 365 insertions(+), 330 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index a6070ab6..0bac0743 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -597,7 +597,6 @@ bool Arch::route() // ----------------------------------------------------------------------- - std::vector Arch::getDecalGraphics(DecalId decal) const { std::vector ret; @@ -628,7 +627,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; GfxTileWireId tilewire = GfxTileWireId(locInfo(wire)->wire_data[wire.index].tile_wire); - + gfxTileWire(ret, x, y, chip_info->width, chip_info->height, wire_type, tilewire, style); } else if (decal.type == DecalId::TYPE_PIP) { PipId pip; @@ -641,7 +640,8 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GfxTileWireId src_id = GfxTileWireId(locInfo(src_wire)->wire_data[src_wire.index].tile_wire); GfxTileWireId dst_id = GfxTileWireId(locInfo(dst_wire)->wire_data[dst_wire.index].tile_wire); GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_HIDDEN; - gfxTilePip(ret, x, y, chip_info->width, chip_info->height, src_wire, getWireType(src_wire), src_id, dst_wire, getWireType(dst_wire), dst_id, style); + gfxTilePip(ret, x, y, chip_info->width, chip_info->height, src_wire, getWireType(src_wire), src_id, dst_wire, + getWireType(dst_wire), dst_id, style); } else if (decal.type == DecalId::TYPE_BEL) { BelId bel; bel.index = decal.z; @@ -664,34 +664,36 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.style = GraphicElement::STYLE_FRAME; 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 + z*26) + 3*slice_pitch - 0.0007f; + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 5 + z * 26) + + 3 * slice_pitch - 0.0007f; el.y2 = el.y1 + 0.0017f * 5; ret.push_back(el); - } else if (bel_type == id_TRELLIS_IO || bel_type == id_IOLOGIC || bel_type == id_SIOLOGIC || bel_type == id_DQSBUFM) { - bool top_bottom = (y==0 || y==(chip_info->height-1)); + } else if (bel_type == id_TRELLIS_IO || bel_type == id_IOLOGIC || bel_type == id_SIOLOGIC || + bel_type == id_DQSBUFM) { + bool top_bottom = (y == 0 || y == (chip_info->height - 1)); GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; if (top_bottom) { - el.x1 = x + io_cell_h_x1 + (z+2) * 0.10; - el.x2 = x + io_cell_h_x1 + (z+2) * 0.10 + 0.08f; - if (y==chip_info->height-1) { - el.y1 = y + 1- io_cell_h_y1; - el.y2 = y + 1- io_cell_h_y2; + el.x1 = x + io_cell_h_x1 + (z + 2) * 0.10; + el.x2 = x + io_cell_h_x1 + (z + 2) * 0.10 + 0.08f; + if (y == chip_info->height - 1) { + el.y1 = y + 1 - io_cell_h_y1; + el.y2 = y + 1 - io_cell_h_y2; } else { el.y1 = y + io_cell_h_y1; el.y2 = y + io_cell_h_y2; } } else { - if (x==0) { - el.x1 = x + 1-io_cell_v_x1; - el.x2 = x + 1-io_cell_v_x2; + if (x == 0) { + el.x1 = x + 1 - io_cell_v_x1; + el.x2 = x + 1 - io_cell_v_x2; } else { el.x1 = x + io_cell_v_x1; el.x2 = x + io_cell_v_x2; } el.y1 = y + io_cell_v_y1 + z * 0.10; - el.y2 = y + io_cell_v_y1 + z * 0.10 + 0.08f; + el.y2 = y + io_cell_v_y1 + z * 0.10 + 0.08f; } ret.push_back(el); } else if (bel_type == id_DCCA) { @@ -702,7 +704,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = y + 0.14; el.x2 = x + switchbox_x1 + (z)*0.025 + 0.020; el.y2 = y + 0.18; - ret.push_back(el); + ret.push_back(el); } else if (bel_type == id_DP16KD || bel_type == id_MULT18X18D || bel_type == id_ALU54B) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; @@ -710,8 +712,8 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.x1 = x + slice_x1; el.x2 = x + 0.97; el.y1 = y + slice_y1; - el.y2 = y + slice_y2 + 3*slice_pitch; - ret.push_back(el); + el.y2 = y + slice_y2 + 3 * slice_pitch; + ret.push_back(el); } else if (bel_type == id_EHXPLLL) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; @@ -721,7 +723,8 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = y + slice_y1; el.y2 = y + slice_y2; ret.push_back(el); - } else if (bel_type == id_DCUA || bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK) { + } else if (bel_type == id_DCUA || bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || + bel_type == id_USRMCLK) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; @@ -729,7 +732,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.x2 = x + 0.97; el.y1 = y + slice_y1 + (z)*slice_pitch; el.y2 = y + slice_y2 + (z)*slice_pitch; - ret.push_back(el); + ret.push_back(el); } else if (bel_type == id_SEDGA || bel_type == id_GSR || bel_type == id_JTAGG || bel_type == id_OSCG) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; @@ -748,7 +751,8 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = y + 0.2; el.y2 = y + 0.8; ret.push_back(el); - } else if (bel_type == id_DLLDELD || bel_type == id_CLKDIVF || bel_type == id_ECLKSYNCB || bel_type == id_TRELLIS_ECLKBUF || bel_type == id_ECLKBRIDGECS) { + } else if (bel_type == id_DLLDELD || bel_type == id_CLKDIVF || bel_type == id_ECLKSYNCB || + bel_type == id_TRELLIS_ECLKBUF || bel_type == id_ECLKBRIDGECS) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; @@ -780,7 +784,7 @@ DecalXY Arch::getWireDecal(WireId wire) const decalxy.decal.location = wire.location; decalxy.decal.z = wire.index; decalxy.decal.active = getBoundWireNet(wire) != nullptr; - return decalxy; + return decalxy; } DecalXY Arch::getPipDecal(PipId pip) const @@ -790,7 +794,7 @@ DecalXY Arch::getPipDecal(PipId pip) const decalxy.decal.location = pip.location; decalxy.decal.z = pip.index; decalxy.decal.active = getBoundPipNet(pip) != nullptr; - return decalxy; + return decalxy; }; DecalXY Arch::getGroupDecal(GroupId group) const @@ -1248,12 +1252,12 @@ std::vector Arch::getGroups() const { std::vector ret; - for (int y = 1; y < chip_info->height-1; y++) { - for (int x = 1; x < chip_info->width-1; x++) { + for (int y = 1; y < chip_info->height - 1; y++) { + for (int x = 1; x < chip_info->width - 1; x++) { GroupId group; group.type = GroupId::TYPE_SWITCHBOX; group.location.x = x; - group.location. y = y; + group.location.y = y; ret.push_back(group); } } @@ -1286,7 +1290,6 @@ std::vector Arch::getGroupGroups(GroupId group) const // ----------------------------------------------------------------------- - std::vector> Arch::getWireAttrs(WireId wire) const { std::vector> ret; diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index e78d7c5a..5c357dda 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -22,106 +22,100 @@ NEXTPNR_NAMESPACE_BEGIN -void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style) +void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, + GraphicElement::style_t style) { if (wire_type == id_WIRE_TYPE_SLICE && tilewire != GfxTileWireId::TILE_WIRE_NONE) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - if (tilewire >= TILE_WIRE_FCO_SLICE && tilewire <=TILE_WIRE_FCI_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_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; + 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; g.push_back(el); // FX to F connection - top - if (item == (TILE_WIRE_FXD_SLICE-TILE_WIRE_FCO_SLICE)) - { + if (item == (TILE_WIRE_FXD_SLICE - TILE_WIRE_FCO_SLICE)) { el.x2 = el.x1; el.y2 = el.y1 - 0.0017f; g.push_back(el); } // F5 to F connection - bottom - if (item == (TILE_WIRE_F5D_SLICE-TILE_WIRE_FCO_SLICE)) - { + if (item == (TILE_WIRE_F5D_SLICE - TILE_WIRE_FCO_SLICE)) { el.x2 = el.x1; el.y2 = el.y1 + 0.0017f; g.push_back(el); } // connection between slices - if (item == (TILE_WIRE_FCID_SLICE-TILE_WIRE_FCO_SLICE) && tilewire!=TILE_WIRE_FCI_SLICE) - { + 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; g.push_back(el); } } - if (tilewire >= TILE_WIRE_DUMMY_D2 && tilewire <=TILE_WIRE_WAD0A_SLICE) - { + if (tilewire >= TILE_WIRE_DUMMY_D2 && tilewire <= TILE_WIRE_WAD0A_SLICE) { 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; + 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; g.push_back(el); } } if (wire_type == id_WIRE_TYPE_V01) { - if (tilewire >= TILE_WIRE_V01N0001 && tilewire <=TILE_WIRE_V01S0100) - { + if (tilewire >= TILE_WIRE_V01N0001 && tilewire <= TILE_WIRE_V01S0100) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.x1 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (tilewire - TILE_WIRE_V01N0001); + el.x1 = x + switchbox_x2 - 0.0017f * 16 + 0.0017f * (tilewire - TILE_WIRE_V01N0001); el.x2 = el.x1; - if (y==h-2) + if (y == h - 2) el.y1 = y + 1.1; else el.y1 = y + switchbox_y1 + 1; - if (y==0) + if (y == 0) el.y2 = y + 0.9; else el.y2 = y + switchbox_y2; g.push_back(el); - } - } + } + } if (wire_type == id_WIRE_TYPE_H01) { - if (tilewire >= TILE_WIRE_H01E0001 && tilewire <=TILE_WIRE_HL7W0001) - { + if (tilewire >= TILE_WIRE_H01E0001 && tilewire <= TILE_WIRE_HL7W0001) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - if (x==w-1) + if (x == w - 1) el.x1 = x + 0.1; else el.x1 = x + switchbox_x1; - if (x==1) + if (x == 1) el.x2 = x - 0.1; else el.x2 = x + switchbox_x2 - 1; - el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (tilewire - TILE_WIRE_H01E0001); + el.y1 = y + switchbox_y1 + 0.0017f * 16 - 0.0017f * (tilewire - TILE_WIRE_H01E0001); el.y2 = el.y1; g.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 = style; - el.x1 = x + switchbox_x2 - 0.0017f*(8 - ((tilewire - TILE_WIRE_V00T0000) % 2)*4); + 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; - el.y2 = y + switchbox_y1 - 0.0017f*4; + el.y2 = y + switchbox_y1 - 0.0017f * 4; } else { el.y1 = y + switchbox_y2; - el.y2 = y + switchbox_y2 + 0.0017f*4; + el.y2 = y + switchbox_y2 + 0.0017f * 4; } g.push_back(el); } @@ -130,14 +124,14 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.y1 = y + switchbox_y1 + 0.0017f*(8 - ((tilewire - TILE_WIRE_H00L0000) % 2)*4); + el.y1 = y + switchbox_y1 + 0.0017f * (8 - ((tilewire - TILE_WIRE_H00L0000) % 2) * 4); el.y2 = el.y1; if (group) { - el.x1 = x + switchbox_x2 + 0.0017f*4; + el.x1 = x + switchbox_x2 + 0.0017f * 4; el.x2 = x + switchbox_x2; } else { - el.x1 = x + switchbox_x1 - 0.0017f*4; + el.x1 = x + switchbox_x1 - 0.0017f * 4; el.x2 = x + switchbox_x1; } g.push_back(el); @@ -147,245 +141,263 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - if (x==0) + if (x == 0) el.x1 = 0.9; else - el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x1 = x + switchbox_x1 + 0.0017f * (16 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.x2 = el.x1; el.y1 = y + switchbox_y1; - el.y2 = y + switchbox_y1 - 0.0017f*(20 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); - if (x!=0 && x!=w-1) g.push_back(el); + el.y2 = y + switchbox_y1 - 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + if (x != 0 && x != w - 1) + g.push_back(el); - if (x==w-2) + if (x == w - 2) el.x2 = x + 1 + 0.1; else - el.x2 = x + 1 + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x2 = x + 1 + switchbox_x1 + 0.0017f * (16 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.y1 = el.y2; - if (x!=w-1) g.push_back(el); + if (x != w - 1) + g.push_back(el); el.x1 = el.x2; el.y1 = y + switchbox_y1; - if (x!=w-1 && x!=w-2) g.push_back(el); + if (x != w - 1 && x != w - 2) + g.push_back(el); - if (x==w-1) + if (x == w - 1) el.x1 = x + 0.1; else - el.x1 = x + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); - if (x==1) + el.x1 = x + switchbox_x1 + 0.0017f * (16 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + if (x == 1) el.x2 = x - 1 + 0.9; else - el.x2 = x - 1 + switchbox_x1 + 0.0017f*(16 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); - el.y2 = y + switchbox_y1 - 0.0017f*(20 + (tilewire - TILE_WIRE_H02W0701)+ 20 *(x%3)); + el.x2 = x - 1 + switchbox_x1 + 0.0017f * (16 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.y2 = y + switchbox_y1 - 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.y1 = el.y2; - if (x!=0) g.push_back(el); - + if (x != 0) + g.push_back(el); + el.x1 = el.x2; el.y1 = y + switchbox_y1; - if (x!=0 && x!=1) g.push_back(el); - } + if (x != 0 && x != 1) + g.push_back(el); + } if (wire_type == id_WIRE_TYPE_V02) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - if (y==0) + if (y == 0) el.y1 = 0.9; else - el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y1 = y + switchbox_y1 + 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); el.y2 = el.y1; el.x1 = x + switchbox_x1; - el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); - if (y!=0 && y!=h-1) g.push_back(el); + el.x2 = x + switchbox_x1 - 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + if (y != 0 && y != h - 1) + g.push_back(el); - if (y==h-2) + if (y == h - 2) el.y2 = y + 1 + 0.1; else - el.y2 = y + 1 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y2 = y + 1 + switchbox_y1 + 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); el.x1 = el.x2; - if (y!=h-1) g.push_back(el); + if (y != h - 1) + g.push_back(el); el.y1 = el.y2; el.x1 = x + switchbox_x1; - if (y!=h-1 && y!=h-2) g.push_back(el); + if (y != h - 1 && y != h - 2) + g.push_back(el); - if (y==h-1) + if (y == h - 1) el.y1 = y + 0.1; else - el.y1 = y + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); - if (y==1) + el.y1 = y + switchbox_y1 + 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + if (y == 1) el.y2 = y - 1 + 0.9; else - el.y2 = y - 1 + switchbox_y1 + 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); - el.x2 = x + switchbox_x1 - 0.0017f*(20 + (tilewire - TILE_WIRE_V02N0701)+ 20 *(y%3)); + el.y2 = y - 1 + switchbox_y1 + 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + el.x2 = x + switchbox_x1 - 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); el.x1 = el.x2; - if (y!=0) g.push_back(el); - + if (y != 0) + g.push_back(el); + el.y1 = el.y2; el.x1 = x + switchbox_x1; - if (y!=0 && y!=1) g.push_back(el); - } + if (y != 0 && y != 1) + g.push_back(el); + } - if (wire_type == id_WIRE_TYPE_H06) { + if (wire_type == id_WIRE_TYPE_H06) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - if (x==0) + if (x == 0) el.x1 = 0.9; else - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + el.x1 = x + switchbox_x1 + 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); el.x2 = el.x1; el.y1 = y + switchbox_y1; - el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); - if (x!=0 && x!=w-1) g.push_back(el); + el.y2 = y + switchbox_y1 - 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + if (x != 0 && x != w - 1) + g.push_back(el); - if (x==w-2 || x==w-3 || x==w-4) + if (x == w - 2 || x == w - 3 || x == w - 4) el.x2 = w - 1 + 0.1; else - el.x2 = x + 3 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + el.x2 = x + 3 + switchbox_x1 + 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); el.y1 = el.y2; - if (x!=w-1) g.push_back(el); + if (x != w - 1) + g.push_back(el); el.x1 = el.x2; el.y1 = y + switchbox_y1; - if (x!=w-1 && x!=w-2 && x!=w-3 && x!=w-4) g.push_back(el); + if (x != w - 1 && x != w - 2 && x != w - 3 && x != w - 4) + g.push_back(el); - if (x==w-1) + if (x == w - 1) el.x1 = x + 0.1; else - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); - if (x==1 || x==2 || x==3) + el.x1 = x + switchbox_x1 + 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + if (x == 1 || x == 2 || x == 3) el.x2 = 0.9; else - el.x2 = x - 3 + switchbox_x1 + 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); - el.y2 = y + switchbox_y1 - 0.0017f*(96 + (tilewire - TILE_WIRE_H06W0303)+ 10 *(x%9)); + el.x2 = x - 3 + switchbox_x1 + 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + el.y2 = y + switchbox_y1 - 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); el.y1 = el.y2; - if (x!=0) g.push_back(el); - + if (x != 0) + g.push_back(el); + el.x1 = el.x2; el.y1 = y + switchbox_y1; - if (x!=0 && x!=1 && x!=2 && x!=3) g.push_back(el); + if (x != 0 && x != 1 && x != 2 && x != 3) + g.push_back(el); } - if (wire_type == id_WIRE_TYPE_V06) { + if (wire_type == id_WIRE_TYPE_V06) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - if (y==0) + if (y == 0) el.y1 = 0.9; else - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + el.y1 = y + switchbox_y1 + 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); el.y2 = el.y1; el.x1 = x + switchbox_x1; - el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); - if (y!=0 && y!=h-1) g.push_back(el); + el.x2 = x + switchbox_x1 - 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + if (y != 0 && y != h - 1) + g.push_back(el); - if (y==h-2 || y==h-3 || y==h-4) + if (y == h - 2 || y == h - 3 || y == h - 4) el.y2 = h - 1 + 0.1; else - el.y2 = y + 3 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + el.y2 = y + 3 + switchbox_y1 + 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); el.x1 = el.x2; - if (y!=h-1) g.push_back(el); + if (y != h - 1) + g.push_back(el); el.y1 = el.y2; el.x1 = x + switchbox_x1; - if (y!=h-1 && y!=h-2 && y!=h-3 && y!=h-4) g.push_back(el); + if (y != h - 1 && y != h - 2 && y != h - 3 && y != h - 4) + g.push_back(el); - if (y==h-1) + if (y == h - 1) el.y1 = y + 0.1; else - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); - if (y==1 || y==2 || y==3) + el.y1 = y + switchbox_y1 + 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + if (y == 1 || y == 2 || y == 3) el.y2 = 0.9; else - el.y2 = y - 3 + switchbox_y1 + 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); - el.x2 = x + switchbox_x1 - 0.0017f*(96 + (tilewire - TILE_WIRE_V06N0303)+ 10 *(y%9)); + el.y2 = y - 3 + switchbox_y1 + 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + el.x2 = x + switchbox_x1 - 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); el.x1 = el.x2; - if (y!=0) g.push_back(el); - + if (y != 0) + g.push_back(el); + el.y1 = el.y2; el.x1 = x + switchbox_x1; - if (y!=0 && y!=1 && y!=2 && y!=3) g.push_back(el); - } + if (y != 0 && y != 1 && y != 2 && y != 3) + g.push_back(el); + } if (wire_type == id_WIRE_TYPE_NONE) { - if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <=TILE_WIRE_SBOUNCE) - { + if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <= TILE_WIRE_SBOUNCE) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.x1 = x + switchbox_x2 - 0.0017f*4; - el.x2 = x + switchbox_x2 - 0.0017f*8; + 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.y1 = y + switchbox_y2 + 0.0017f * 4; el.y2 = el.y1; } else { - el.y1 = y + switchbox_y1 - 0.0017f*4; + el.y1 = y + switchbox_y1 - 0.0017f * 4; el.y2 = el.y1; } g.push_back(el); } - if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <=TILE_WIRE_EBOUNCE) - { + if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <= TILE_WIRE_EBOUNCE) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.y1 = y + switchbox_y1 + 0.0017f*4; - el.y2 = y + switchbox_y1 + 0.0017f*8; + 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.x1 = x + switchbox_x1 - 0.0017f * 4; el.x2 = el.x1; } else { - el.x1 = x + switchbox_x2 + 0.0017f*4; + el.x1 = x + switchbox_x2 + 0.0017f * 4; el.x2 = el.x1; } g.push_back(el); - } - if (tilewire >= TILE_WIRE_CLK0 && tilewire <=TILE_WIRE_LSR1) - { - GraphicElement el; + } + if (tilewire >= TILE_WIRE_CLK0 && tilewire <= TILE_WIRE_LSR1) { + GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; el.x1 = x + switchbox_x2; - 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.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; g.push_back(el); el.x1 = el.x2; el.y2 = y + slice_y2 - 0.0017f * (3 + (tilewire - TILE_WIRE_CLK0)); g.push_back(el); - for (int i=0;i<4;i++) - { + 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.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; g.push_back(el); } - if (tilewire==TILE_WIRE_CLK1 || tilewire==TILE_WIRE_LSR1) { - for (int i=0;i<2;i++) - { + 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.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; g.push_back(el); } } - } + } - if (tilewire >= TILE_WIRE_FCO && tilewire <=TILE_WIRE_FCI) - { + if (tilewire >= TILE_WIRE_FCO && tilewire <= TILE_WIRE_FCI) { int gap = (tilewire - TILE_WIRE_FCO) / 24; - GraphicElement el; + GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; el.x1 = x + switchbox_x2; el.x2 = x + slice_x1 - 0.005f; - 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; + 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; g.push_back(el); - } + } - if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <=TILE_WIRE_MUXLSR0) - { + if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <= TILE_WIRE_MUXLSR0) { int gap = (tilewire - TILE_WIRE_MUXCLK3) / 2; int part = (tilewire - TILE_WIRE_MUXCLK3) % 2; GraphicElement el; @@ -393,46 +405,49 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.style = style; 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.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; g.push_back(el); } - if (tilewire >= TILE_WIRE_WD3 && tilewire <=TILE_WIRE_WD0) - { + if (tilewire >= TILE_WIRE_WD3 && tilewire <= TILE_WIRE_WD0) { GraphicElement el; - int part = (tilewire - TILE_WIRE_WD3) % 4; - int group = (tilewire - TILE_WIRE_WD3) / 2; + int part = (tilewire - TILE_WIRE_WD3) % 4; + int group = (tilewire - TILE_WIRE_WD3) / 2; el.type = GraphicElement::TYPE_LINE; el.style = style; 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_D2 + 1 + part + 14) + 3*slice_pitch; + 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_D2 + 1 + part + 14) + + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WD1B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + (part & 1) + 14*2) + (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; g.push_back(el); el.x1 = x + slice_x2 + 0.005f; el.y1 = el.y2; g.push_back(el); } - if (tilewire >= TILE_WIRE_WAD3 && tilewire <=TILE_WIRE_WAD0) - { + if (tilewire >= TILE_WIRE_WAD3 && tilewire <= TILE_WIRE_WAD0) { GraphicElement el; - int part = (tilewire - TILE_WIRE_WAD3) % 4; + int part = (tilewire - TILE_WIRE_WAD3) % 4; el.type = GraphicElement::TYPE_LINE; el.style = style; 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_D2 + 1 + part+ 14) + 3*slice_pitch; + 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_D2 + 1 + part + 14) + + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part+ 14*2) + 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; g.push_back(el); el.x1 = x + slice_x2 + 0.005f; @@ -441,45 +456,45 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS // 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_D2 + 1 + part+ 14*2) + 3*slice_pitch; + 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_D2 + 1 + part + 14 * 2) + + 3 * slice_pitch; el.y1 = el.y2; g.push_back(el); } } - } void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, GfxTileWireId src_id) { if (src_type == id_WIRE_TYPE_H00) { int group = (src_id - TILE_WIRE_H00L0000) / 2; - el.y1 = y + switchbox_y1 + 0.0017f*(8 - ((src_id - TILE_WIRE_H00L0000) % 2)*4); + el.y1 = y + switchbox_y1 + 0.0017f * (8 - ((src_id - TILE_WIRE_H00L0000) % 2) * 4); if (group) { el.x1 = x + switchbox_x2; } else { el.x1 = x + switchbox_x1; } - } + } if (src_type == id_WIRE_TYPE_H01) { - if (x == src.location.x) + if (x == src.location.x) el.x1 = x + switchbox_x1; else el.x1 = x + switchbox_x2; - el.y1 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); + el.y1 = y + switchbox_y1 + 0.0017f * 16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); } if (src_type == id_WIRE_TYPE_H02) { - el.x1 = x + switchbox_x1 + 0.0017f*(16 + (src_id - TILE_WIRE_H02W0701)+ 20 *(src.location.x%3)); + el.x1 = x + switchbox_x1 + 0.0017f * (16 + (src_id - TILE_WIRE_H02W0701) + 20 * (src.location.x % 3)); el.y1 = y + switchbox_y1; } if (src_type == id_WIRE_TYPE_H06) { - el.x1 = x + switchbox_x1 + 0.0017f*(96 + (src_id - TILE_WIRE_H06W0303)+ 10 *(src.location.x%9)); + el.x1 = x + switchbox_x1 + 0.0017f * (96 + (src_id - TILE_WIRE_H06W0303) + 10 * (src.location.x % 9)); el.y1 = y + switchbox_y1; } if (src_type == id_WIRE_TYPE_V00) { int group = (src_id - TILE_WIRE_V00T0000) / 2; - el.x1 = x + switchbox_x2 - 0.0017f*(8 - ((src_id - TILE_WIRE_V00T0000) % 2)*4); + el.x1 = x + switchbox_x2 - 0.0017f * (8 - ((src_id - TILE_WIRE_V00T0000) % 2) * 4); if (group) { el.y1 = y + switchbox_y1; } else { @@ -487,19 +502,19 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, } } if (src_type == id_WIRE_TYPE_V01) { - el.x1 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (src_id - TILE_WIRE_V01N0001); - if (y == src.location.y) + el.x1 = x + switchbox_x2 - 0.0017f * 16 + 0.0017f * (src_id - TILE_WIRE_V01N0001); + if (y == src.location.y) el.y1 = y + switchbox_y2; else el.y1 = y + switchbox_y1; } if (src_type == id_WIRE_TYPE_V02) { - el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f*(20 + (src_id - TILE_WIRE_V02N0701)+ 20 *(src.location.y%3)); + el.x1 = x + switchbox_x1; + el.y1 = y + switchbox_y1 + 0.0017f * (20 + (src_id - TILE_WIRE_V02N0701) + 20 * (src.location.y % 3)); } if (src_type == id_WIRE_TYPE_V06) { - el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f*(96 + (src_id - TILE_WIRE_V06N0303)+ 10 *(src.location.y%9)); + el.x1 = x + switchbox_x1; + el.y1 = y + switchbox_y1 + 0.0017f * (96 + (src_id - TILE_WIRE_V06N0303) + 10 * (src.location.y % 9)); } } @@ -507,7 +522,7 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t { if (dst_type == id_WIRE_TYPE_H00) { int group = (dst_id - TILE_WIRE_H00L0000) / 2; - el.y2 = y + switchbox_y1 + 0.0017f*(8 - ((dst_id - TILE_WIRE_H00L0000) % 2)*4); + el.y2 = y + switchbox_y1 + 0.0017f * (8 - ((dst_id - TILE_WIRE_H00L0000) % 2) * 4); if (group) { el.x2 = x + switchbox_x2; @@ -516,23 +531,23 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t } } if (dst_type == id_WIRE_TYPE_H01) { - if (x == dst.location.x) + if (x == dst.location.x) el.x2 = x + switchbox_x1; else el.x2 = x + switchbox_x2; - el.y2 = y + switchbox_y1 + 0.0017f*16 - 0.0017f * (dst_id - TILE_WIRE_H01E0001); + el.y2 = y + switchbox_y1 + 0.0017f * 16 - 0.0017f * (dst_id - TILE_WIRE_H01E0001); } if (dst_type == id_WIRE_TYPE_H02) { - el.x2 = x + switchbox_x1 + 0.0017f*(16 + (dst_id - TILE_WIRE_H02W0701)+ 20 *(dst.location.x%3)); + el.x2 = x + switchbox_x1 + 0.0017f * (16 + (dst_id - TILE_WIRE_H02W0701) + 20 * (dst.location.x % 3)); el.y2 = y + switchbox_y1; } if (dst_type == id_WIRE_TYPE_H06) { - el.x2 = x + switchbox_x1 + 0.0017f*(96 + (dst_id - TILE_WIRE_H06W0303)+ 10 *(dst.location.x%9)); + el.x2 = x + switchbox_x1 + 0.0017f * (96 + (dst_id - TILE_WIRE_H06W0303) + 10 * (dst.location.x % 9)); el.y2 = y + switchbox_y1; } if (dst_type == id_WIRE_TYPE_V00) { int group = (dst_id - TILE_WIRE_V00T0000) / 2; - el.x2 = x + switchbox_x2 - 0.0017f*(8 - ((dst_id - TILE_WIRE_V00T0000) % 2)*4); + el.x2 = x + switchbox_x2 - 0.0017f * (8 - ((dst_id - TILE_WIRE_V00T0000) % 2) * 4); if (group) { el.y2 = y + switchbox_y1; } else { @@ -540,52 +555,54 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t } } if (dst_type == id_WIRE_TYPE_V01) { - el.x2 = x + switchbox_x2 - 0.0017f*16 + 0.0017f * (dst_id - TILE_WIRE_V01N0001); - if (y == dst.location.y) + el.x2 = x + switchbox_x2 - 0.0017f * 16 + 0.0017f * (dst_id - TILE_WIRE_V01N0001); + if (y == dst.location.y) el.y2 = y + switchbox_y2; else el.y2 = y + switchbox_y1; } if (dst_type == id_WIRE_TYPE_V02) { - el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f*(20 + (dst_id - TILE_WIRE_V02N0701)+ 20 *(dst.location.y%3)); + el.x2 = x + switchbox_x1; + el.y2 = y + switchbox_y1 + 0.0017f * (20 + (dst_id - TILE_WIRE_V02N0701) + 20 * (dst.location.y % 3)); } if (dst_type == id_WIRE_TYPE_V06) { el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f*(96 + (dst_id - TILE_WIRE_V06N0303)+ 10 *(dst.location.y%9)); + el.y2 = y + switchbox_y1 + 0.0017f * (96 + (dst_id - TILE_WIRE_V06N0303) + 10 * (dst.location.y % 9)); } if (dst_type == id_WIRE_TYPE_NONE) { - if (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI) - { - int gap = (dst_id - TILE_WIRE_FCO) / 24; + if (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) { + int gap = (dst_id - TILE_WIRE_FCO) / 24; el.x2 = x + switchbox_x2; - el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_FCO + 1 + gap*2) + 3*slice_pitch; - } + el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; + } } } -void straightLine(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id) +void straightLine(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, + GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id) { - setSource(el,x,y,src,src_type,src_id); - setDestination(el,x,y,dst,dst_type,dst_id); + setSource(el, x, y, src, src_type, src_id); + setDestination(el, x, y, dst, dst_type, dst_id); g.push_back(el); } -void toSameSideHor(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +void toSameSideHor(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, + GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, + GraphicElement::style_t style, int idx) { - int sign = (src_type==dst_type) ? 1 : -1; - setSource(el,x,y,src,src_type,src_id); + int sign = (src_type == dst_type) ? 1 : -1; + setSource(el, x, y, src, src_type, src_id); el.x2 = el.x1; - el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 + sign * 0.0017f*idx; + el.y2 = y + switchbox_y1 + (switchbox_y2 - switchbox_y1) / 2 + sign * 0.0017f * idx; g.push_back(el); - - GraphicElement el2; + + GraphicElement el2; el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2,x,y,dst,dst_type,dst_id); - + setDestination(el2, x, y, dst, dst_type, dst_id); + el.x1 = el2.x2; el.y1 = el.y2; g.push_back(el); @@ -595,20 +612,22 @@ void toSameSideHor(std::vector &g, GraphicElement &el,int x, int g.push_back(el2); } -void toSameSideVer(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +void toSameSideVer(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, + GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, + GraphicElement::style_t style, int idx) { - int sign = (src_type==dst_type) ? 1 : -1; - setSource(el,x,y,src,src_type,src_id); - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 + sign * 0.0017f*idx; + int sign = (src_type == dst_type) ? 1 : -1; + setSource(el, x, y, src, src_type, src_id); + el.x2 = x + switchbox_x1 + (switchbox_x2 - switchbox_x1) / 2 + sign * 0.0017f * idx; el.y2 = el.y1; g.push_back(el); - - GraphicElement el2; + + GraphicElement el2; el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2,x,y,dst,dst_type,dst_id); - + setDestination(el2, x, y, dst, dst_type, dst_id); + el.x1 = el.x2; el.y1 = el2.y2; g.push_back(el); @@ -618,19 +637,21 @@ void toSameSideVer(std::vector &g, GraphicElement &el,int x, int g.push_back(el2); } -void toSameSideH1Ver(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, + GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, + GraphicElement::style_t style, int idx) { - setSource(el,x,y,src,src_type,src_id); - el.x2 = x + switchbox_x1 + (switchbox_x2-switchbox_x1)/2 - 0.0017f*idx; + setSource(el, x, y, src, src_type, src_id); + el.x2 = x + switchbox_x1 + (switchbox_x2 - switchbox_x1) / 2 - 0.0017f * idx; el.y2 = el.y1; g.push_back(el); - - GraphicElement el2; + + GraphicElement el2; el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2,x,y,dst,dst_type,dst_id); - + setDestination(el2, x, y, dst, dst_type, dst_id); + el.x1 = el.x2; el.y1 = el2.y2; g.push_back(el); @@ -640,15 +661,17 @@ void toSameSideH1Ver(std::vector &g, GraphicElement &el,int x, i g.push_back(el2); } -void toSameSideH1Hor(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +void toSameSideH1Hor(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, + GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, + GraphicElement::style_t style, int idx) { - setSource(el,x,y,src,src_type,src_id); - - GraphicElement el2; + setSource(el, x, y, src, src_type, src_id); + + GraphicElement el2; el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2,x,y,dst,dst_type,dst_id); + setDestination(el2, x, y, dst, dst_type, dst_id); if (dst_type == id_WIRE_TYPE_H01 || src_type == id_WIRE_TYPE_V01 || dst_type == id_WIRE_TYPE_H00) { el.x2 = el.x1; el.y2 = el2.y2; @@ -664,19 +687,21 @@ void toSameSideH1Hor(std::vector &g, GraphicElement &el,int x, i g.push_back(el2); } -void toSameSideV1Ver(std::vector &g, GraphicElement &el,int x, int y, WireId src, IdString src_type, GfxTileWireId src_id,WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) +void toSameSideV1Ver(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, + GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, + GraphicElement::style_t style, int idx) { - setSource(el,x,y,src,src_type,src_id); + setSource(el, x, y, src, src_type, src_id); el.x2 = el.x1; - el.y2 = y + switchbox_y1 + (switchbox_y2-switchbox_y1)/2 - 0.0017f*idx; + el.y2 = y + switchbox_y1 + (switchbox_y2 - switchbox_y1) / 2 - 0.0017f * idx; g.push_back(el); - - GraphicElement el2; + + GraphicElement el2; el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2,x,y,dst,dst_type,dst_id); - + setDestination(el2, x, y, dst, dst_type, dst_id); + el.x1 = el2.x2; el.y1 = el.y2; g.push_back(el); @@ -685,150 +710,163 @@ void toSameSideV1Ver(std::vector &g, GraphicElement &el,int x, i el2.y1 = el.y1; g.push_back(el2); } -void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style) -{ +void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, + GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, + GraphicElement::style_t style) +{ GraphicElement el; el.type = GraphicElement::TYPE_ARROW; el.style = style; // To H00 if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H00) { - toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H00L0000 + 30); + toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_H00L0000 + 30); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H00) { - //toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H00L0000); - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + // toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H00L0000); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } - + // To H01 if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H01) { - toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H01E0001); + toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H01E0001); } - + // To H02 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H02) { - toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H02W0701); + toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) { - toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H02W0701); + toSameSideHor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H02) { - toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H06W0303); - } + toSameSideHor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H06W0303); + } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_H02) { if (y == src.location.y) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } else { - toSameSideV1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H02W0701); + toSameSideV1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_H02W0701); } } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H02) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H02) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } - + // To H06 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H06) { - toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H06W0303); + toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) { - toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H02W0701); + toSameSideHor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H06) { - toSameSideHor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_H06W0303); + toSameSideHor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_H06) { if (y == src.location.y) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } else { - toSameSideV1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H06W0303); + toSameSideV1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_H06W0303); } } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H06) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } // To V00 if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V00) { - //toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V00T0000); - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + // toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V00T0000); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V00) { - toSameSideV1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, src_id - TILE_WIRE_H02W0701 + 20); + toSameSideV1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_H02W0701 + 20); } // To V01 if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V01) { - toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V01N0001); + toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V01N0001); } // To V02 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V02) { if (x == src.location.x) { - toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V02N0701); + toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_V02N0701); } else { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V02) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_V02) { - toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V02N0701); + toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { - toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V02N0701); + toSameSideVer(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V02) { - toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); + toSameSideVer(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V06N0303); } // To V06 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { if (x == src.location.x) { - toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V06N0303); + toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_V06N0303); } else { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_V06) { - toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V06N0303); + toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V06N0303); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { - toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V02N0701); + toSameSideVer(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { - toSameSideVer(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style,src_id - TILE_WIRE_V06N0303); + toSameSideVer(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V06N0303); } - - if (src_type == id_WIRE_TYPE_H00 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { - toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_FCO); + + if (src_type == id_WIRE_TYPE_H00 && dst_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_FCO); } - if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { - toSameSideH1Ver(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_FCO); + if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_FCO); } - if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_V00 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); - } - if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + if (src_type == id_WIRE_TYPE_V00 && dst_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <=TILE_WIRE_FCI)) { - straightLine(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id); + if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + } + if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } - } NEXTPNR_NAMESPACE_END diff --git a/ecp5/gfx.h b/ecp5/gfx.h index f3fa6a4c..8f8087d3 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -33,7 +33,7 @@ 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 slice_pitch = 0.0374 + 0.0068; const float io_cell_v_x1 = 0.76; const float io_cell_v_x2 = 0.95; @@ -50,7 +50,7 @@ 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, @@ -76,7 +76,6 @@ enum GfxTileWireId TILE_WIRE_CE3_SLICE, TILE_WIRE_FCID_SLICE, - TILE_WIRE_FCOC_SLICE, TILE_WIRE_D5_SLICE, TILE_WIRE_C5_SLICE, @@ -93,7 +92,7 @@ enum GfxTileWireId TILE_WIRE_FXBC_SLICE, TILE_WIRE_FXAC_SLICE, TILE_WIRE_DUMMY_C1, - TILE_WIRE_FXC_SLICE, + TILE_WIRE_FXC_SLICE, TILE_WIRE_F5_SLICE, TILE_WIRE_Q5_SLICE, TILE_WIRE_Q4_SLICE, @@ -126,7 +125,7 @@ enum GfxTileWireId TILE_WIRE_F5B_SLICE, TILE_WIRE_CE1_SLICE, TILE_WIRE_FCIB_SLICE, - + TILE_WIRE_FCOA_SLICE, TILE_WIRE_D1_SLICE, TILE_WIRE_C1_SLICE, @@ -152,10 +151,9 @@ enum GfxTileWireId TILE_WIRE_CE0_SLICE, TILE_WIRE_FCI_SLICE, - TILE_WIRE_CLK0, TILE_WIRE_CLK1, - TILE_WIRE_LSR0, + TILE_WIRE_LSR0, TILE_WIRE_LSR1, TILE_WIRE_FCO, @@ -191,7 +189,7 @@ enum GfxTileWireId TILE_WIRE_D4, TILE_WIRE_C4, TILE_WIRE_B4, - TILE_WIRE_A4, + TILE_WIRE_A4, TILE_WIRE_DI5, TILE_WIRE_DI4, TILE_WIRE_M5, @@ -208,7 +206,6 @@ enum GfxTileWireId TILE_WIRE_CE2, TILE_WIRE_DUMMY_SWB9, - TILE_WIRE_DUMMY_SWB10, TILE_WIRE_D3, TILE_WIRE_C3, @@ -217,7 +214,7 @@ enum GfxTileWireId TILE_WIRE_D2, TILE_WIRE_C2, TILE_WIRE_B2, - TILE_WIRE_A2, + TILE_WIRE_A2, TILE_WIRE_DI3, TILE_WIRE_DI2, TILE_WIRE_M3, @@ -234,7 +231,6 @@ enum GfxTileWireId TILE_WIRE_CE1, TILE_WIRE_DUMMY_SWB14, - TILE_WIRE_DUMMY_SWB15, TILE_WIRE_D1, TILE_WIRE_C1, @@ -243,7 +239,7 @@ enum GfxTileWireId TILE_WIRE_D0, TILE_WIRE_C0, TILE_WIRE_B0, - TILE_WIRE_A0, + TILE_WIRE_A0, TILE_WIRE_DI1, TILE_WIRE_DI0, TILE_WIRE_M1, @@ -259,7 +255,6 @@ enum GfxTileWireId TILE_WIRE_DUMMY_SWB18, TILE_WIRE_CE0, TILE_WIRE_FCI, - TILE_WIRE_MUXCLK3, TILE_WIRE_MUXLSR3, @@ -279,10 +274,10 @@ 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_CLK3_SLICE, TILE_WIRE_LSR3_SLICE, TILE_WIRE_DUMMY_D4, TILE_WIRE_DUMMY_D5, @@ -293,7 +288,6 @@ enum GfxTileWireId TILE_WIRE_DUMMY_D10, TILE_WIRE_DUMMY_D11, - TILE_WIRE_DUMMY_C2, TILE_WIRE_DUMMY_C3, TILE_WIRE_CLK2_SLICE, @@ -307,9 +301,8 @@ enum GfxTileWireId TILE_WIRE_WADO1C_SLICE, TILE_WIRE_WADO0C_SLICE, - TILE_WIRE_WCK1_SLICE, - TILE_WIRE_WRE1_SLICE, + TILE_WIRE_WRE1_SLICE, TILE_WIRE_CLK1_SLICE, TILE_WIRE_LSR1_SLICE, TILE_WIRE_DUMMY_B2, @@ -321,7 +314,6 @@ enum GfxTileWireId TILE_WIRE_WAD1B_SLICE, TILE_WIRE_WAD0B_SLICE, - TILE_WIRE_WCK0_SLICE, TILE_WIRE_WRE0_SLICE, TILE_WIRE_CLK0_SLICE, @@ -335,7 +327,6 @@ enum GfxTileWireId TILE_WIRE_WAD1A_SLICE, TILE_WIRE_WAD0A_SLICE, - TILE_WIRE_V01N0001, TILE_WIRE_V01N0101, TILE_WIRE_V01S0000, @@ -415,7 +406,7 @@ enum GfxTileWireId TILE_WIRE_H06W0103, TILE_WIRE_H06E0103, TILE_WIRE_H06W0003, - TILE_WIRE_H06E0003, + TILE_WIRE_H06E0003, TILE_WIRE_G_HPBX0000, TILE_WIRE_G_HPBX0100, @@ -435,8 +426,11 @@ enum GfxTileWireId TILE_WIRE_G_HPBX1500, }; -void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); -void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style); +void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, + GraphicElement::style_t style); +void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, + GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, + GraphicElement::style_t style); NEXTPNR_NAMESPACE_END diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index 6236daca..c5ce9b18 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -127,7 +127,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions private: const float zoomNear_ = 0.05f; // do not zoom closer than this - float zoomFar_ = 10.0f; // do not zoom further than this + float zoomFar_ = 10.0f; // do not zoom further than this const float zoomLvl1_ = 1.0f; const float zoomLvl2_ = 5.0f; -- cgit v1.2.3 From 16f6aaa68c834a66be92b7f21f17eb8cfcafc1f8 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 13 Dec 2019 14:01:28 +0100 Subject: Add many new wires --- ecp5/constids.inc | 7 + ecp5/gfx.cc | 106 +++++ ecp5/gfx.h | 1116 ++++++++++++++++++++++++++++++++++++++++++++++++ ecp5/trellis_import.py | 21 + 4 files changed, 1250 insertions(+) diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 76c9bc8c..9170f225 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1297,6 +1297,13 @@ X(ECSOUT) X(WIRE_TYPE_NONE) X(WIRE_TYPE_SLICE) +X(WIRE_TYPE_DQS) +X(WIRE_TYPE_IOLOGIC) +X(WIRE_TYPE_PIO) +X(WIRE_TYPE_DDRDLL) +X(WIRE_TYPE_EBR) +X(WIRE_TYPE_MULT18) +X(WIRE_TYPE_ALU54) X(WIRE_TYPE_H00) X(WIRE_TYPE_H01) X(WIRE_TYPE_H02) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 5c357dda..3d37e2a9 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -65,6 +65,102 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } } + if (wire_type == id_WIRE_TYPE_PIO) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + bool top_bottom = (y == 0 || y == (h - 1)); + int gap = 3-(tilewire - TILE_WIRE_PADDOD_PIO)/5; + int num = (tilewire - TILE_WIRE_PADDOD_PIO)%5; + if (top_bottom) { + el.x1 = x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); + el.x2 = el.x1; + if (y == h - 1) { + el.y1 = y + 1 - io_cell_h_y2; + el.y2 = el.y1 - 0.015f; + } else { + el.y1 = y + io_cell_h_y2; + el.y2 = el.y1 + 0.015f; + } + } else { + if (x == 0) { + el.x1 = x + 1 - io_cell_v_x1; + el.x2 = el.x1 + 0.015f; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } + el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y2 = el.y1; + } + g.push_back(el); + } + + if (wire_type == id_WIRE_TYPE_IOLOGIC) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + int gap = 7-(tilewire - TILE_WIRE_JLOADND_IOLOGIC)/42; + int num = (tilewire - TILE_WIRE_JLOADND_IOLOGIC)%42; + if (x == 0) { + el.x1 = x + 1 - io_cell_v_x1; + el.x2 = el.x1 + 0.015f; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } + el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y2 = el.y1; + g.push_back(el); + } + + if (wire_type == id_WIRE_TYPE_DQS) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + int num = (tilewire - TILE_WIRE_DDRDEL_DQS); + if (x == 0) { + el.x1 = x + 1 - io_cell_v_x1; + el.x2 = el.x1 + 0.015f; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } + el.y1 = y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); + el.y2 = el.y1; + g.push_back(el); + } + + if (wire_type == id_WIRE_TYPE_EBR) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_MULT18) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + el.y2 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_ALU54) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_ALU54 + 1) + 3 * slice_pitch; + el.y2 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_ALU54 + 1) + 3 * slice_pitch; + g.push_back(el); + } if (wire_type == id_WIRE_TYPE_V01) { if (tilewire >= TILE_WIRE_V01N0001 && tilewire <= TILE_WIRE_V01S0100) { GraphicElement el; @@ -384,6 +480,16 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } } } + if (tilewire >= TILE_WIRE_JCE0 && tilewire <= TILE_WIRE_JQ7) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + switchbox_x2; + el.x2 = x + slice_x1 - 0.0025f; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + g.push_back(el); + } if (tilewire >= TILE_WIRE_FCO && tilewire <= TILE_WIRE_FCI) { int gap = (tilewire - TILE_WIRE_FCO) / 24; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 8f8087d3..4c9b926f 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -424,6 +424,1122 @@ enum GfxTileWireId TILE_WIRE_G_HPBX1300, TILE_WIRE_G_HPBX1400, TILE_WIRE_G_HPBX1500, + + TILE_WIRE_DDRDEL_DQS, + TILE_WIRE_JRST_DQS, + TILE_WIRE_ECLK_DQS, + TILE_WIRE_JDQSR90_DQS, + TILE_WIRE_JDQSW270_DQS, + TILE_WIRE_JDQSW_DQS, + TILE_WIRE_RDPNTR0_DQS, + TILE_WIRE_RDPNTR1_DQS, + TILE_WIRE_RDPNTR2_DQS, + TILE_WIRE_WRPNTR0_DQS, + TILE_WIRE_WRPNTR1_DQS, + TILE_WIRE_WRPNTR2_DQS, + TILE_WIRE_JDQSI_DQS, + TILE_WIRE_JREAD1_DQS, + TILE_WIRE_JREAD0_DQS, + TILE_WIRE_JREADCLKSEL2_DQS, + TILE_WIRE_JREADCLKSEL1_DQS, + TILE_WIRE_JREADCLKSEL0_DQS, + TILE_WIRE_JSCLK_DQS, + TILE_WIRE_JDYNDELAY0_DQS, + TILE_WIRE_JDYNDELAY1_DQS, + TILE_WIRE_JDYNDELAY2_DQS, + TILE_WIRE_JDYNDELAY3_DQS, + TILE_WIRE_JDYNDELAY4_DQS, + TILE_WIRE_JDYNDELAY5_DQS, + TILE_WIRE_JDYNDELAY6_DQS, + TILE_WIRE_JDYNDELAY7_DQS, + TILE_WIRE_JPAUSE_DQS, + TILE_WIRE_JRDLOADN_DQS, + TILE_WIRE_JRDMOVE_DQS, + TILE_WIRE_JRDDIRECTION_DQS, + TILE_WIRE_JWRLOADN_DQS, + TILE_WIRE_JWRMOVE_DQS, + TILE_WIRE_JWRDIRECTION_DQS, + TILE_WIRE_JDATAVALID_DQS, + TILE_WIRE_JBURSTDET_DQS, + TILE_WIRE_JRDCFLAG_DQS, + TILE_WIRE_JWRCFLAG_DQS, + + TILE_WIRE_JLOADND_IOLOGIC, + TILE_WIRE_JMOVED_IOLOGIC, + TILE_WIRE_JDIRECTIOND_IOLOGIC, + TILE_WIRE_JCFLAGD_IOLOGIC, + TILE_WIRE_IOLDOD_IOLOGIC, + TILE_WIRE_IOLTOD_IOLOGIC, + TILE_WIRE_DID_IOLOGIC, + TILE_WIRE_IOLDODD_IOLOGIC, + TILE_WIRE_IOLDOID_IOLOGIC, + TILE_WIRE_INDDD_IOLOGIC, + TILE_WIRE_PADDID_IOLOGIC, + TILE_WIRE_JCLKD_IOLOGIC, + TILE_WIRE_JCED_IOLOGIC, + TILE_WIRE_JLSRD_IOLOGIC, + TILE_WIRE_JTSDATA0D_IOLOGIC, + TILE_WIRE_JTXDATA0D_IOLOGIC, + TILE_WIRE_JTXDATA1D_IOLOGIC, + TILE_WIRE_JRXDATA0D_IOLOGIC, + TILE_WIRE_JRXDATA1D_IOLOGIC, + TILE_WIRE_JINFFD_IOLOGIC, + TILE_WIRE_ECLKD_IOLOGIC, + TILE_WIRE_JTSDATA1D_IOLOGIC, + TILE_WIRE_JTXDATA2D_IOLOGIC, + TILE_WIRE_JTXDATA3D_IOLOGIC, + TILE_WIRE_JRXDATA2D_IOLOGIC, + TILE_WIRE_JRXDATA3D_IOLOGIC, + TILE_WIRE_DQSR90D_IOLOGIC, + TILE_WIRE_DQSW270D_IOLOGIC, + TILE_WIRE_DQSWD_IOLOGIC, + TILE_WIRE_RDPNTR0D_IOLOGIC, + TILE_WIRE_RDPNTR1D_IOLOGIC, + TILE_WIRE_RDPNTR2D_IOLOGIC, + TILE_WIRE_WRPNTR0D_IOLOGIC, + TILE_WIRE_WRPNTR1D_IOLOGIC, + TILE_WIRE_WRPNTR2D_IOLOGIC, + TILE_WIRE_DUMMYD1_IOLOGIC, + TILE_WIRE_DUMMYD2_IOLOGIC, + TILE_WIRE_DUMMYD3_IOLOGIC, + TILE_WIRE_DUMMYD4_IOLOGIC, + TILE_WIRE_DUMMYD5_IOLOGIC, + TILE_WIRE_DUMMYD6_IOLOGIC, + TILE_WIRE_DUMMYD7_IOLOGIC, + + TILE_WIRE_JLOADNC_IOLOGIC, + TILE_WIRE_JMOVEC_IOLOGIC, + TILE_WIRE_JDIRECTIONC_IOLOGIC, + TILE_WIRE_JCFLAGC_IOLOGIC, + TILE_WIRE_IOLDOC_IOLOGIC, + TILE_WIRE_IOLTOC_IOLOGIC, + TILE_WIRE_DIC_IOLOGIC, + TILE_WIRE_IOLDODC_IOLOGIC, + TILE_WIRE_IOLDOIC_IOLOGIC, + TILE_WIRE_INDDC_IOLOGIC, + TILE_WIRE_PADDIC_IOLOGIC, + TILE_WIRE_JCLKC_IOLOGIC, + TILE_WIRE_JCEC_IOLOGIC, + TILE_WIRE_JLSRC_IOLOGIC, + TILE_WIRE_JTSDATA0C_IOLOGIC, + TILE_WIRE_JTXDATA0C_IOLOGIC, + TILE_WIRE_JTXDATA1C_IOLOGIC, + TILE_WIRE_JRXDATA0C_IOLOGIC, + TILE_WIRE_JRXDATA1C_IOLOGIC, + TILE_WIRE_JINFFC_IOLOGIC, + TILE_WIRE_ECLKC_IOLOGIC, + TILE_WIRE_JTSDATA1C_IOLOGIC, + TILE_WIRE_JTXDATA2C_IOLOGIC, + TILE_WIRE_JTXDATA3C_IOLOGIC, + TILE_WIRE_JRXDATA2C_IOLOGIC, + TILE_WIRE_JRXDATA3C_IOLOGIC, + TILE_WIRE_JTXDATA4C_IOLOGIC, + TILE_WIRE_JTXDATA5C_IOLOGIC, + TILE_WIRE_JTXDATA6C_IOLOGIC, + TILE_WIRE_JSLIPC_IOLOGIC, + TILE_WIRE_JRXDATA4C_IOLOGIC, + TILE_WIRE_JRXDATA5C_IOLOGIC, + TILE_WIRE_JRXDATA6C_IOLOGIC, + TILE_WIRE_DQSR90C_IOLOGIC, + TILE_WIRE_DQSW270C_IOLOGIC, + TILE_WIRE_DQSWC_IOLOGIC, + TILE_WIRE_RDPNTR0C_IOLOGIC, + TILE_WIRE_RDPNTR1C_IOLOGIC, + TILE_WIRE_RDPNTR2C_IOLOGIC, + TILE_WIRE_WRPNTR0C_IOLOGIC, + TILE_WIRE_WRPNTR1C_IOLOGIC, + TILE_WIRE_WRPNTR2C_IOLOGIC, + + TILE_WIRE_JLOADNB_IOLOGIC, + TILE_WIRE_JMOVEB_IOLOGIC, + TILE_WIRE_JDIRECTIONB_IOLOGIC, + TILE_WIRE_JCFLAGB_IOLOGIC, + TILE_WIRE_IOLDOB_IOLOGIC, + TILE_WIRE_IOLTOB_IOLOGIC, + TILE_WIRE_DIB_IOLOGIC, + TILE_WIRE_IOLDODB_IOLOGIC, + TILE_WIRE_IOLDOIB_IOLOGIC, + TILE_WIRE_INDDB_IOLOGIC, + TILE_WIRE_PADDIB_IOLOGIC, + TILE_WIRE_JCLKB_IOLOGIC, + TILE_WIRE_JCEB_IOLOGIC, + TILE_WIRE_JLSRB_IOLOGIC, + TILE_WIRE_JTSDATA0B_IOLOGIC, + TILE_WIRE_JTXDATA0B_IOLOGIC, + TILE_WIRE_JTXDATA1B_IOLOGIC, + TILE_WIRE_JRXDATA0B_IOLOGIC, + TILE_WIRE_JRXDATA1B_IOLOGIC, + TILE_WIRE_JINFFB_IOLOGIC, + TILE_WIRE_ECLKB_IOLOGIC, + TILE_WIRE_JTSDATA1B_IOLOGIC, + TILE_WIRE_JTXDATA2B_IOLOGIC, + TILE_WIRE_JTXDATA3B_IOLOGIC, + TILE_WIRE_JRXDATA2B_IOLOGIC, + TILE_WIRE_JRXDATA3B_IOLOGIC, + TILE_WIRE_DQSR90B_IOLOGIC, + TILE_WIRE_DQSW270B_IOLOGIC, + TILE_WIRE_DQSWB_IOLOGIC, + TILE_WIRE_RDPNTR0B_IOLOGIC, + TILE_WIRE_RDPNTR1B_IOLOGIC, + TILE_WIRE_RDPNTR2B_IOLOGIC, + TILE_WIRE_WRPNTR0B_IOLOGIC, + TILE_WIRE_WRPNTR1B_IOLOGIC, + TILE_WIRE_WRPNTR2B_IOLOGIC, + TILE_WIRE_DUMMYB1_IOLOGIC, + TILE_WIRE_DUMMYB2_IOLOGIC, + TILE_WIRE_DUMMYB3_IOLOGIC, + TILE_WIRE_DUMMYB4_IOLOGIC, + TILE_WIRE_DUMMYB5_IOLOGIC, + TILE_WIRE_DUMMYB6_IOLOGIC, + TILE_WIRE_DUMMYB7_IOLOGIC, + + TILE_WIRE_JLOADNA_IOLOGIC, + TILE_WIRE_JMOVEA_IOLOGIC, + TILE_WIRE_JDIRECTIONA_IOLOGIC, + TILE_WIRE_JCFLAGA_IOLOGIC, + TILE_WIRE_IOLDOA_IOLOGIC, + TILE_WIRE_IOLTOA_IOLOGIC, + TILE_WIRE_DIA_IOLOGIC, + TILE_WIRE_IOLDODA_IOLOGIC, + TILE_WIRE_IOLDOIA_IOLOGIC, + TILE_WIRE_INDDA_IOLOGIC, + TILE_WIRE_PADDIA_IOLOGIC, + TILE_WIRE_JCLKA_IOLOGIC, + TILE_WIRE_JCEA_IOLOGIC, + TILE_WIRE_JLSRA_IOLOGIC, + TILE_WIRE_JTSDATA0A_IOLOGIC, + TILE_WIRE_JTXDATA0A_IOLOGIC, + TILE_WIRE_JTXDATA1A_IOLOGIC, + TILE_WIRE_JRXDATA0A_IOLOGIC, + TILE_WIRE_JRXDATA1A_IOLOGIC, + TILE_WIRE_JINFFA_IOLOGIC, + TILE_WIRE_ECLKA_IOLOGIC, + TILE_WIRE_JTSDATA1A_IOLOGIC, + TILE_WIRE_JTXDATA2A_IOLOGIC, + TILE_WIRE_JTXDATA3A_IOLOGIC, + TILE_WIRE_JRXDATA2A_IOLOGIC, + TILE_WIRE_JRXDATA3A_IOLOGIC, + TILE_WIRE_JTXDATA4A_IOLOGIC, + TILE_WIRE_JTXDATA5A_IOLOGIC, + TILE_WIRE_JTXDATA6A_IOLOGIC, + TILE_WIRE_JSLIPA_IOLOGIC, + TILE_WIRE_JRXDATA4A_IOLOGIC, + TILE_WIRE_JRXDATA5A_IOLOGIC, + TILE_WIRE_JRXDATA6A_IOLOGIC, + TILE_WIRE_DQSR90A_IOLOGIC, + TILE_WIRE_DQSW270A_IOLOGIC, + TILE_WIRE_DQSWA_IOLOGIC, + TILE_WIRE_RDPNTR0A_IOLOGIC, + TILE_WIRE_RDPNTR1A_IOLOGIC, + TILE_WIRE_RDPNTR2A_IOLOGIC, + TILE_WIRE_WRPNTR0A_IOLOGIC, + TILE_WIRE_WRPNTR1A_IOLOGIC, + TILE_WIRE_WRPNTR2A_IOLOGIC, + + TILE_WIRE_PADDOD_PIO, + TILE_WIRE_PADDTD_PIO, + TILE_WIRE_JPADDID_PIO, + TILE_WIRE_IOLDOD_PIO, + TILE_WIRE_IOLTOD_PIO, + TILE_WIRE_PADDOC_PIO, + TILE_WIRE_PADDTC_PIO, + TILE_WIRE_JPADDIC_PIO, + TILE_WIRE_IOLDOC_PIO, + TILE_WIRE_IOLTOC_PIO, + TILE_WIRE_PADDOB_PIO, + TILE_WIRE_PADDTB_PIO, + TILE_WIRE_JPADDIB_PIO, + TILE_WIRE_IOLDOB_PIO, + TILE_WIRE_IOLTOB_PIO, + TILE_WIRE_PADDOA_PIO, + TILE_WIRE_PADDTA_PIO, + TILE_WIRE_JPADDIA_PIO, + TILE_WIRE_IOLDOA_PIO, + TILE_WIRE_IOLTOA_PIO, + + TILE_WIRE_DDRDEL_DDRDLL, + TILE_WIRE_JRST_DDRDLL, + TILE_WIRE_JCLK_DDRDLL, + TILE_WIRE_JUDDCNTLN_DDRDLL, + TILE_WIRE_JFREEZE_DDRDLL, + TILE_WIRE_JLOCK_DDRDLL, + TILE_WIRE_JDIVOSC_DDRDLL, + TILE_WIRE_JDCNTL0_DDRDLL, + TILE_WIRE_JDCNTL1_DDRDLL, + TILE_WIRE_JDCNTL2_DDRDLL, + TILE_WIRE_JDCNTL3_DDRDLL, + TILE_WIRE_JDCNTL4_DDRDLL, + TILE_WIRE_JDCNTL5_DDRDLL, + TILE_WIRE_JDCNTL6_DDRDLL, + TILE_WIRE_JDCNTL7_DDRDLL, + + TILE_WIRE_JADA0_EBR, + TILE_WIRE_JADB0_EBR, + TILE_WIRE_JADA1_EBR, + TILE_WIRE_JADB1_EBR, + TILE_WIRE_JADA2_EBR, + TILE_WIRE_JADB2_EBR, + TILE_WIRE_JADA3_EBR, + TILE_WIRE_JADB3_EBR, + TILE_WIRE_JADA4_EBR, + TILE_WIRE_JADB4_EBR, + TILE_WIRE_JADA5_EBR, + TILE_WIRE_JADB5_EBR, + TILE_WIRE_JADA6_EBR, + TILE_WIRE_JADB6_EBR, + TILE_WIRE_JADA7_EBR, + TILE_WIRE_JADB7_EBR, + TILE_WIRE_JADA8_EBR, + TILE_WIRE_JADB8_EBR, + TILE_WIRE_JADA9_EBR, + TILE_WIRE_JADB9_EBR, + TILE_WIRE_JADA10_EBR, + TILE_WIRE_JADB10_EBR, + TILE_WIRE_JADA11_EBR, + TILE_WIRE_JADB11_EBR, + TILE_WIRE_JADA12_EBR, + TILE_WIRE_JADB12_EBR, + TILE_WIRE_JADA13_EBR, + TILE_WIRE_JADB13_EBR, + TILE_WIRE_JCEA_EBR, + TILE_WIRE_JCEB_EBR, + TILE_WIRE_JCLKA_EBR, + TILE_WIRE_JCLKB_EBR, + TILE_WIRE_JCSA0_EBR, + TILE_WIRE_JCSA1_EBR, + TILE_WIRE_JCSA2_EBR, + TILE_WIRE_JCSB0_EBR, + TILE_WIRE_JCSB1_EBR, + TILE_WIRE_JCSB2_EBR, + TILE_WIRE_JDIA0_EBR, + TILE_WIRE_JDIB0_EBR, + TILE_WIRE_JDOA0_EBR, + TILE_WIRE_JDOB0_EBR, + TILE_WIRE_JDIA1_EBR, + TILE_WIRE_JDIB1_EBR, + TILE_WIRE_JDOA1_EBR, + TILE_WIRE_JDOB1_EBR, + TILE_WIRE_JDIA2_EBR, + TILE_WIRE_JDIB2_EBR, + TILE_WIRE_JDOA2_EBR, + TILE_WIRE_JDOB2_EBR, + TILE_WIRE_JDIA3_EBR, + TILE_WIRE_JDIB3_EBR, + TILE_WIRE_JDOA3_EBR, + TILE_WIRE_JDOB3_EBR, + TILE_WIRE_JDIA4_EBR, + TILE_WIRE_JDIB4_EBR, + TILE_WIRE_JDOA4_EBR, + TILE_WIRE_JDOB4_EBR, + TILE_WIRE_JDIA5_EBR, + TILE_WIRE_JDIB5_EBR, + TILE_WIRE_JDOA5_EBR, + TILE_WIRE_JDOB5_EBR, + TILE_WIRE_JDIA6_EBR, + TILE_WIRE_JDIB6_EBR, + TILE_WIRE_JDOA6_EBR, + TILE_WIRE_JDOB6_EBR, + TILE_WIRE_JDIA7_EBR, + TILE_WIRE_JDIB7_EBR, + TILE_WIRE_JDOA7_EBR, + TILE_WIRE_JDOB7_EBR, + TILE_WIRE_JDIA8_EBR, + TILE_WIRE_JDIB8_EBR, + TILE_WIRE_JDOA8_EBR, + TILE_WIRE_JDOB8_EBR, + TILE_WIRE_JDIA9_EBR, + TILE_WIRE_JDIB9_EBR, + TILE_WIRE_JDOA9_EBR, + TILE_WIRE_JDOB9_EBR, + TILE_WIRE_JDIA10_EBR, + TILE_WIRE_JDIB10_EBR, + TILE_WIRE_JDOA10_EBR, + TILE_WIRE_JDOB10_EBR, + TILE_WIRE_JDIA11_EBR, + TILE_WIRE_JDIB11_EBR, + TILE_WIRE_JDOA11_EBR, + TILE_WIRE_JDOB11_EBR, + TILE_WIRE_JDIA12_EBR, + TILE_WIRE_JDIB12_EBR, + TILE_WIRE_JDOA12_EBR, + TILE_WIRE_JDOB12_EBR, + TILE_WIRE_JDIA13_EBR, + TILE_WIRE_JDIB13_EBR, + TILE_WIRE_JDOA13_EBR, + TILE_WIRE_JDOB13_EBR, + TILE_WIRE_JDIA14_EBR, + TILE_WIRE_JDIB14_EBR, + TILE_WIRE_JDOA14_EBR, + TILE_WIRE_JDOB14_EBR, + TILE_WIRE_JDIA15_EBR, + TILE_WIRE_JDIB15_EBR, + TILE_WIRE_JDOA15_EBR, + TILE_WIRE_JDOB15_EBR, + TILE_WIRE_JDIA16_EBR, + TILE_WIRE_JDIB16_EBR, + TILE_WIRE_JDOA16_EBR, + TILE_WIRE_JDOB16_EBR, + TILE_WIRE_JDIA17_EBR, + TILE_WIRE_JDIB17_EBR, + TILE_WIRE_JDOA17_EBR, + TILE_WIRE_JDOB17_EBR, + TILE_WIRE_JOCEA_EBR, + TILE_WIRE_JOCEB_EBR, + TILE_WIRE_JRSTA_EBR, + TILE_WIRE_JRSTB_EBR, + TILE_WIRE_JWEA_EBR, + TILE_WIRE_JWEB_EBR, + + TILE_WIRE_JCLK0_MULT18, + TILE_WIRE_JCLK1_MULT18, + TILE_WIRE_JCLK2_MULT18, + TILE_WIRE_JCLK3_MULT18, + TILE_WIRE_JCE0_MULT18, + TILE_WIRE_JCE1_MULT18, + TILE_WIRE_JCE2_MULT18, + TILE_WIRE_JCE3_MULT18, + TILE_WIRE_JRST0_MULT18, + TILE_WIRE_JRST1_MULT18, + TILE_WIRE_JRST2_MULT18, + TILE_WIRE_JRST3_MULT18, + TILE_WIRE_JA0_MULT18, + TILE_WIRE_JA1_MULT18, + TILE_WIRE_JA2_MULT18, + TILE_WIRE_JA3_MULT18, + TILE_WIRE_JA4_MULT18, + TILE_WIRE_JA5_MULT18, + TILE_WIRE_JA6_MULT18, + TILE_WIRE_JA7_MULT18, + TILE_WIRE_JA8_MULT18, + TILE_WIRE_JA9_MULT18, + TILE_WIRE_JA10_MULT18, + TILE_WIRE_JA11_MULT18, + TILE_WIRE_JA12_MULT18, + TILE_WIRE_JA13_MULT18, + TILE_WIRE_JA14_MULT18, + TILE_WIRE_JA15_MULT18, + TILE_WIRE_JA16_MULT18, + TILE_WIRE_JA17_MULT18, + TILE_WIRE_JB0_MULT18, + TILE_WIRE_JB1_MULT18, + TILE_WIRE_JB2_MULT18, + TILE_WIRE_JB3_MULT18, + TILE_WIRE_JB4_MULT18, + TILE_WIRE_JB5_MULT18, + TILE_WIRE_JB6_MULT18, + TILE_WIRE_JB7_MULT18, + TILE_WIRE_JB8_MULT18, + TILE_WIRE_JB9_MULT18, + TILE_WIRE_JB10_MULT18, + TILE_WIRE_JB11_MULT18, + TILE_WIRE_JB12_MULT18, + TILE_WIRE_JB13_MULT18, + TILE_WIRE_JB14_MULT18, + TILE_WIRE_JB15_MULT18, + TILE_WIRE_JB16_MULT18, + TILE_WIRE_JB17_MULT18, + TILE_WIRE_JC0_MULT18, + TILE_WIRE_JC1_MULT18, + TILE_WIRE_JC2_MULT18, + TILE_WIRE_JC3_MULT18, + TILE_WIRE_JC4_MULT18, + TILE_WIRE_JC5_MULT18, + TILE_WIRE_JC6_MULT18, + TILE_WIRE_JC7_MULT18, + TILE_WIRE_JC8_MULT18, + TILE_WIRE_JC9_MULT18, + TILE_WIRE_JC10_MULT18, + TILE_WIRE_JC11_MULT18, + TILE_WIRE_JC12_MULT18, + TILE_WIRE_JC13_MULT18, + TILE_WIRE_JC14_MULT18, + TILE_WIRE_JC15_MULT18, + TILE_WIRE_JC16_MULT18, + TILE_WIRE_JC17_MULT18, + TILE_WIRE_JSIGNEDA_MULT18, + TILE_WIRE_JSIGNEDB_MULT18, + TILE_WIRE_JSOURCEA_MULT18, + TILE_WIRE_JSOURCEB_MULT18, + TILE_WIRE_JSRIA0_MULT18, + TILE_WIRE_JSRIA1_MULT18, + TILE_WIRE_JSRIA2_MULT18, + TILE_WIRE_JSRIA3_MULT18, + TILE_WIRE_JSRIA4_MULT18, + TILE_WIRE_JSRIA5_MULT18, + TILE_WIRE_JSRIA6_MULT18, + TILE_WIRE_JSRIA7_MULT18, + TILE_WIRE_JSRIA8_MULT18, + TILE_WIRE_JSRIA9_MULT18, + TILE_WIRE_JSRIA10_MULT18, + TILE_WIRE_JSRIA11_MULT18, + TILE_WIRE_JSRIA12_MULT18, + TILE_WIRE_JSRIA13_MULT18, + TILE_WIRE_JSRIA14_MULT18, + TILE_WIRE_JSRIA15_MULT18, + TILE_WIRE_JSRIA16_MULT18, + TILE_WIRE_JSRIA17_MULT18, + TILE_WIRE_JSRIB0_MULT18, + TILE_WIRE_JSRIB1_MULT18, + TILE_WIRE_JSRIB2_MULT18, + TILE_WIRE_JSRIB3_MULT18, + TILE_WIRE_JSRIB4_MULT18, + TILE_WIRE_JSRIB5_MULT18, + TILE_WIRE_JSRIB6_MULT18, + TILE_WIRE_JSRIB7_MULT18, + TILE_WIRE_JSRIB8_MULT18, + TILE_WIRE_JSRIB9_MULT18, + TILE_WIRE_JSRIB10_MULT18, + TILE_WIRE_JSRIB11_MULT18, + TILE_WIRE_JSRIB12_MULT18, + TILE_WIRE_JSRIB13_MULT18, + TILE_WIRE_JSRIB14_MULT18, + TILE_WIRE_JSRIB15_MULT18, + TILE_WIRE_JSRIB16_MULT18, + TILE_WIRE_JSRIB17_MULT18, + TILE_WIRE_JROA0_MULT18, + TILE_WIRE_JROA1_MULT18, + TILE_WIRE_JROA2_MULT18, + TILE_WIRE_JROA3_MULT18, + TILE_WIRE_JROA4_MULT18, + TILE_WIRE_JROA5_MULT18, + TILE_WIRE_JROA6_MULT18, + TILE_WIRE_JROA7_MULT18, + TILE_WIRE_JROA8_MULT18, + TILE_WIRE_JROA9_MULT18, + TILE_WIRE_JROA10_MULT18, + TILE_WIRE_JROA11_MULT18, + TILE_WIRE_JROA12_MULT18, + TILE_WIRE_JROA13_MULT18, + TILE_WIRE_JROA14_MULT18, + TILE_WIRE_JROA15_MULT18, + TILE_WIRE_JROA16_MULT18, + TILE_WIRE_JROA17_MULT18, + TILE_WIRE_JROB0_MULT18, + TILE_WIRE_JROB1_MULT18, + TILE_WIRE_JROB2_MULT18, + TILE_WIRE_JROB3_MULT18, + TILE_WIRE_JROB4_MULT18, + TILE_WIRE_JROB5_MULT18, + TILE_WIRE_JROB6_MULT18, + TILE_WIRE_JROB7_MULT18, + TILE_WIRE_JROB8_MULT18, + TILE_WIRE_JROB9_MULT18, + TILE_WIRE_JROB10_MULT18, + TILE_WIRE_JROB11_MULT18, + TILE_WIRE_JROB12_MULT18, + TILE_WIRE_JROB13_MULT18, + TILE_WIRE_JROB14_MULT18, + TILE_WIRE_JROB15_MULT18, + TILE_WIRE_JROB16_MULT18, + TILE_WIRE_JROB17_MULT18, + TILE_WIRE_JROC0_MULT18, + TILE_WIRE_JROC1_MULT18, + TILE_WIRE_JROC2_MULT18, + TILE_WIRE_JROC3_MULT18, + TILE_WIRE_JROC4_MULT18, + TILE_WIRE_JROC5_MULT18, + TILE_WIRE_JROC6_MULT18, + TILE_WIRE_JROC7_MULT18, + TILE_WIRE_JROC8_MULT18, + TILE_WIRE_JROC9_MULT18, + TILE_WIRE_JROC10_MULT18, + TILE_WIRE_JROC11_MULT18, + TILE_WIRE_JROC12_MULT18, + TILE_WIRE_JROC13_MULT18, + TILE_WIRE_JROC14_MULT18, + TILE_WIRE_JROC15_MULT18, + TILE_WIRE_JROC16_MULT18, + TILE_WIRE_JROC17_MULT18, + TILE_WIRE_JSROA0_MULT18, + TILE_WIRE_JSROA1_MULT18, + TILE_WIRE_JSROA2_MULT18, + TILE_WIRE_JSROA3_MULT18, + TILE_WIRE_JSROA4_MULT18, + TILE_WIRE_JSROA5_MULT18, + TILE_WIRE_JSROA6_MULT18, + TILE_WIRE_JSROA7_MULT18, + TILE_WIRE_JSROA8_MULT18, + TILE_WIRE_JSROA9_MULT18, + TILE_WIRE_JSROA10_MULT18, + TILE_WIRE_JSROA11_MULT18, + TILE_WIRE_JSROA12_MULT18, + TILE_WIRE_JSROA13_MULT18, + TILE_WIRE_JSROA14_MULT18, + TILE_WIRE_JSROA15_MULT18, + TILE_WIRE_JSROA16_MULT18, + TILE_WIRE_JSROA17_MULT18, + TILE_WIRE_JSROB0_MULT18, + TILE_WIRE_JSROB1_MULT18, + TILE_WIRE_JSROB2_MULT18, + TILE_WIRE_JSROB3_MULT18, + TILE_WIRE_JSROB4_MULT18, + TILE_WIRE_JSROB5_MULT18, + TILE_WIRE_JSROB6_MULT18, + TILE_WIRE_JSROB7_MULT18, + TILE_WIRE_JSROB8_MULT18, + TILE_WIRE_JSROB9_MULT18, + TILE_WIRE_JSROB10_MULT18, + TILE_WIRE_JSROB11_MULT18, + TILE_WIRE_JSROB12_MULT18, + TILE_WIRE_JSROB13_MULT18, + TILE_WIRE_JSROB14_MULT18, + TILE_WIRE_JSROB15_MULT18, + TILE_WIRE_JSROB16_MULT18, + TILE_WIRE_JSROB17_MULT18, + TILE_WIRE_JP0_MULT18, + TILE_WIRE_JP1_MULT18, + TILE_WIRE_JP2_MULT18, + TILE_WIRE_JP3_MULT18, + TILE_WIRE_JP4_MULT18, + TILE_WIRE_JP5_MULT18, + TILE_WIRE_JP6_MULT18, + TILE_WIRE_JP7_MULT18, + TILE_WIRE_JP8_MULT18, + TILE_WIRE_JP9_MULT18, + TILE_WIRE_JP10_MULT18, + TILE_WIRE_JP11_MULT18, + TILE_WIRE_JP12_MULT18, + TILE_WIRE_JP13_MULT18, + TILE_WIRE_JP14_MULT18, + TILE_WIRE_JP15_MULT18, + TILE_WIRE_JP16_MULT18, + TILE_WIRE_JP17_MULT18, + TILE_WIRE_JP18_MULT18, + TILE_WIRE_JP19_MULT18, + TILE_WIRE_JP20_MULT18, + TILE_WIRE_JP21_MULT18, + TILE_WIRE_JP22_MULT18, + TILE_WIRE_JP23_MULT18, + TILE_WIRE_JP24_MULT18, + TILE_WIRE_JP25_MULT18, + TILE_WIRE_JP26_MULT18, + TILE_WIRE_JP27_MULT18, + TILE_WIRE_JP28_MULT18, + TILE_WIRE_JP29_MULT18, + TILE_WIRE_JP30_MULT18, + TILE_WIRE_JP31_MULT18, + TILE_WIRE_JP32_MULT18, + TILE_WIRE_JP33_MULT18, + TILE_WIRE_JP34_MULT18, + TILE_WIRE_JP35_MULT18, + TILE_WIRE_JSIGNEDP_MULT18, + + TILE_WIRE_JCLK0_ALU54, + TILE_WIRE_JCLK1_ALU54, + TILE_WIRE_JCLK2_ALU54, + TILE_WIRE_JCLK3_ALU54, + TILE_WIRE_JCE0_ALU54, + TILE_WIRE_JCE1_ALU54, + TILE_WIRE_JCE2_ALU54, + TILE_WIRE_JCE3_ALU54, + TILE_WIRE_JRST0_ALU54, + TILE_WIRE_JRST1_ALU54, + TILE_WIRE_JRST2_ALU54, + TILE_WIRE_JRST3_ALU54, + TILE_WIRE_JSIGNEDIA_ALU54, + TILE_WIRE_JSIGNEDIB_ALU54, + TILE_WIRE_JSIGNEDCIN_ALU54, + TILE_WIRE_JA0_ALU54, + TILE_WIRE_JA1_ALU54, + TILE_WIRE_JA2_ALU54, + TILE_WIRE_JA3_ALU54, + TILE_WIRE_JA4_ALU54, + TILE_WIRE_JA5_ALU54, + TILE_WIRE_JA6_ALU54, + TILE_WIRE_JA7_ALU54, + TILE_WIRE_JA8_ALU54, + TILE_WIRE_JA9_ALU54, + TILE_WIRE_JA10_ALU54, + TILE_WIRE_JA11_ALU54, + TILE_WIRE_JA12_ALU54, + TILE_WIRE_JA13_ALU54, + TILE_WIRE_JA14_ALU54, + TILE_WIRE_JA15_ALU54, + TILE_WIRE_JA16_ALU54, + TILE_WIRE_JA17_ALU54, + TILE_WIRE_JA18_ALU54, + TILE_WIRE_JA19_ALU54, + TILE_WIRE_JA20_ALU54, + TILE_WIRE_JA21_ALU54, + TILE_WIRE_JA22_ALU54, + TILE_WIRE_JA23_ALU54, + TILE_WIRE_JA24_ALU54, + TILE_WIRE_JA25_ALU54, + TILE_WIRE_JA26_ALU54, + TILE_WIRE_JA27_ALU54, + TILE_WIRE_JA28_ALU54, + TILE_WIRE_JA29_ALU54, + TILE_WIRE_JA30_ALU54, + TILE_WIRE_JA31_ALU54, + TILE_WIRE_JA32_ALU54, + TILE_WIRE_JA33_ALU54, + TILE_WIRE_JA34_ALU54, + TILE_WIRE_JA35_ALU54, + TILE_WIRE_JB0_ALU54, + TILE_WIRE_JB1_ALU54, + TILE_WIRE_JB2_ALU54, + TILE_WIRE_JB3_ALU54, + TILE_WIRE_JB4_ALU54, + TILE_WIRE_JB5_ALU54, + TILE_WIRE_JB6_ALU54, + TILE_WIRE_JB7_ALU54, + TILE_WIRE_JB8_ALU54, + TILE_WIRE_JB9_ALU54, + TILE_WIRE_JB10_ALU54, + TILE_WIRE_JB11_ALU54, + TILE_WIRE_JB12_ALU54, + TILE_WIRE_JB13_ALU54, + TILE_WIRE_JB14_ALU54, + TILE_WIRE_JB15_ALU54, + TILE_WIRE_JB16_ALU54, + TILE_WIRE_JB17_ALU54, + TILE_WIRE_JB18_ALU54, + TILE_WIRE_JB19_ALU54, + TILE_WIRE_JB20_ALU54, + TILE_WIRE_JB21_ALU54, + TILE_WIRE_JB22_ALU54, + TILE_WIRE_JB23_ALU54, + TILE_WIRE_JB24_ALU54, + TILE_WIRE_JB25_ALU54, + TILE_WIRE_JB26_ALU54, + TILE_WIRE_JB27_ALU54, + TILE_WIRE_JB28_ALU54, + TILE_WIRE_JB29_ALU54, + TILE_WIRE_JB30_ALU54, + TILE_WIRE_JB31_ALU54, + TILE_WIRE_JB32_ALU54, + TILE_WIRE_JB33_ALU54, + TILE_WIRE_JB34_ALU54, + TILE_WIRE_JB35_ALU54, + TILE_WIRE_JMA0_ALU54, + TILE_WIRE_JMA1_ALU54, + TILE_WIRE_JMA2_ALU54, + TILE_WIRE_JMA3_ALU54, + TILE_WIRE_JMA4_ALU54, + TILE_WIRE_JMA5_ALU54, + TILE_WIRE_JMA6_ALU54, + TILE_WIRE_JMA7_ALU54, + TILE_WIRE_JMA8_ALU54, + TILE_WIRE_JMA9_ALU54, + TILE_WIRE_JMA10_ALU54, + TILE_WIRE_JMA11_ALU54, + TILE_WIRE_JMA12_ALU54, + TILE_WIRE_JMA13_ALU54, + TILE_WIRE_JMA14_ALU54, + TILE_WIRE_JMA15_ALU54, + TILE_WIRE_JMA16_ALU54, + TILE_WIRE_JMA17_ALU54, + TILE_WIRE_JMA18_ALU54, + TILE_WIRE_JMA19_ALU54, + TILE_WIRE_JMA20_ALU54, + TILE_WIRE_JMA21_ALU54, + TILE_WIRE_JMA22_ALU54, + TILE_WIRE_JMA23_ALU54, + TILE_WIRE_JMA24_ALU54, + TILE_WIRE_JMA25_ALU54, + TILE_WIRE_JMA26_ALU54, + TILE_WIRE_JMA27_ALU54, + TILE_WIRE_JMA28_ALU54, + TILE_WIRE_JMA29_ALU54, + TILE_WIRE_JMA30_ALU54, + TILE_WIRE_JMA31_ALU54, + TILE_WIRE_JMA32_ALU54, + TILE_WIRE_JMA33_ALU54, + TILE_WIRE_JMA34_ALU54, + TILE_WIRE_JMA35_ALU54, + TILE_WIRE_JMB0_ALU54, + TILE_WIRE_JMB1_ALU54, + TILE_WIRE_JMB2_ALU54, + TILE_WIRE_JMB3_ALU54, + TILE_WIRE_JMB4_ALU54, + TILE_WIRE_JMB5_ALU54, + TILE_WIRE_JMB6_ALU54, + TILE_WIRE_JMB7_ALU54, + TILE_WIRE_JMB8_ALU54, + TILE_WIRE_JMB9_ALU54, + TILE_WIRE_JMB10_ALU54, + TILE_WIRE_JMB11_ALU54, + TILE_WIRE_JMB12_ALU54, + TILE_WIRE_JMB13_ALU54, + TILE_WIRE_JMB14_ALU54, + TILE_WIRE_JMB15_ALU54, + TILE_WIRE_JMB16_ALU54, + TILE_WIRE_JMB17_ALU54, + TILE_WIRE_JMB18_ALU54, + TILE_WIRE_JMB19_ALU54, + TILE_WIRE_JMB20_ALU54, + TILE_WIRE_JMB21_ALU54, + TILE_WIRE_JMB22_ALU54, + TILE_WIRE_JMB23_ALU54, + TILE_WIRE_JMB24_ALU54, + TILE_WIRE_JMB25_ALU54, + TILE_WIRE_JMB26_ALU54, + TILE_WIRE_JMB27_ALU54, + TILE_WIRE_JMB28_ALU54, + TILE_WIRE_JMB29_ALU54, + TILE_WIRE_JMB30_ALU54, + TILE_WIRE_JMB31_ALU54, + TILE_WIRE_JMB32_ALU54, + TILE_WIRE_JMB33_ALU54, + TILE_WIRE_JMB34_ALU54, + TILE_WIRE_JMB35_ALU54, + TILE_WIRE_JC0_ALU54, + TILE_WIRE_JC1_ALU54, + TILE_WIRE_JC2_ALU54, + TILE_WIRE_JC3_ALU54, + TILE_WIRE_JC4_ALU54, + TILE_WIRE_JC5_ALU54, + TILE_WIRE_JC6_ALU54, + TILE_WIRE_JC7_ALU54, + TILE_WIRE_JC8_ALU54, + TILE_WIRE_JC9_ALU54, + TILE_WIRE_JC10_ALU54, + TILE_WIRE_JC11_ALU54, + TILE_WIRE_JC12_ALU54, + TILE_WIRE_JC13_ALU54, + TILE_WIRE_JC14_ALU54, + TILE_WIRE_JC15_ALU54, + TILE_WIRE_JC16_ALU54, + TILE_WIRE_JC17_ALU54, + TILE_WIRE_JC18_ALU54, + TILE_WIRE_JC19_ALU54, + TILE_WIRE_JC20_ALU54, + TILE_WIRE_JC21_ALU54, + TILE_WIRE_JC22_ALU54, + TILE_WIRE_JC23_ALU54, + TILE_WIRE_JC24_ALU54, + TILE_WIRE_JC25_ALU54, + TILE_WIRE_JC26_ALU54, + TILE_WIRE_JC27_ALU54, + TILE_WIRE_JC28_ALU54, + TILE_WIRE_JC29_ALU54, + TILE_WIRE_JC30_ALU54, + TILE_WIRE_JC31_ALU54, + TILE_WIRE_JC32_ALU54, + TILE_WIRE_JC33_ALU54, + TILE_WIRE_JC34_ALU54, + TILE_WIRE_JC35_ALU54, + TILE_WIRE_JC36_ALU54, + TILE_WIRE_JC37_ALU54, + TILE_WIRE_JC38_ALU54, + TILE_WIRE_JC39_ALU54, + TILE_WIRE_JC40_ALU54, + TILE_WIRE_JC41_ALU54, + TILE_WIRE_JC42_ALU54, + TILE_WIRE_JC43_ALU54, + TILE_WIRE_JC44_ALU54, + TILE_WIRE_JC45_ALU54, + TILE_WIRE_JC46_ALU54, + TILE_WIRE_JC47_ALU54, + TILE_WIRE_JC48_ALU54, + TILE_WIRE_JC49_ALU54, + TILE_WIRE_JC50_ALU54, + TILE_WIRE_JC51_ALU54, + TILE_WIRE_JC52_ALU54, + TILE_WIRE_JC53_ALU54, + TILE_WIRE_JCFB0_ALU54, + TILE_WIRE_JCFB1_ALU54, + TILE_WIRE_JCFB2_ALU54, + TILE_WIRE_JCFB3_ALU54, + TILE_WIRE_JCFB4_ALU54, + TILE_WIRE_JCFB5_ALU54, + TILE_WIRE_JCFB6_ALU54, + TILE_WIRE_JCFB7_ALU54, + TILE_WIRE_JCFB8_ALU54, + TILE_WIRE_JCFB9_ALU54, + TILE_WIRE_JCFB10_ALU54, + TILE_WIRE_JCFB11_ALU54, + TILE_WIRE_JCFB12_ALU54, + TILE_WIRE_JCFB13_ALU54, + TILE_WIRE_JCFB14_ALU54, + TILE_WIRE_JCFB15_ALU54, + TILE_WIRE_JCFB16_ALU54, + TILE_WIRE_JCFB17_ALU54, + TILE_WIRE_JCFB18_ALU54, + TILE_WIRE_JCFB19_ALU54, + TILE_WIRE_JCFB20_ALU54, + TILE_WIRE_JCFB21_ALU54, + TILE_WIRE_JCFB22_ALU54, + TILE_WIRE_JCFB23_ALU54, + TILE_WIRE_JCFB24_ALU54, + TILE_WIRE_JCFB25_ALU54, + TILE_WIRE_JCFB26_ALU54, + TILE_WIRE_JCFB27_ALU54, + TILE_WIRE_JCFB28_ALU54, + TILE_WIRE_JCFB29_ALU54, + TILE_WIRE_JCFB30_ALU54, + TILE_WIRE_JCFB31_ALU54, + TILE_WIRE_JCFB32_ALU54, + TILE_WIRE_JCFB33_ALU54, + TILE_WIRE_JCFB34_ALU54, + TILE_WIRE_JCFB35_ALU54, + TILE_WIRE_JCFB36_ALU54, + TILE_WIRE_JCFB37_ALU54, + TILE_WIRE_JCFB38_ALU54, + TILE_WIRE_JCFB39_ALU54, + TILE_WIRE_JCFB40_ALU54, + TILE_WIRE_JCFB41_ALU54, + TILE_WIRE_JCFB42_ALU54, + TILE_WIRE_JCFB43_ALU54, + TILE_WIRE_JCFB44_ALU54, + TILE_WIRE_JCFB45_ALU54, + TILE_WIRE_JCFB46_ALU54, + TILE_WIRE_JCFB47_ALU54, + TILE_WIRE_JCFB48_ALU54, + TILE_WIRE_JCFB49_ALU54, + TILE_WIRE_JCFB50_ALU54, + TILE_WIRE_JCFB51_ALU54, + TILE_WIRE_JCFB52_ALU54, + TILE_WIRE_JCFB53_ALU54, + TILE_WIRE_JCIN0_ALU54, + TILE_WIRE_JCIN1_ALU54, + TILE_WIRE_JCIN2_ALU54, + TILE_WIRE_JCIN3_ALU54, + TILE_WIRE_JCIN4_ALU54, + TILE_WIRE_JCIN5_ALU54, + TILE_WIRE_JCIN6_ALU54, + TILE_WIRE_JCIN7_ALU54, + TILE_WIRE_JCIN8_ALU54, + TILE_WIRE_JCIN9_ALU54, + TILE_WIRE_JCIN10_ALU54, + TILE_WIRE_JCIN11_ALU54, + TILE_WIRE_JCIN12_ALU54, + TILE_WIRE_JCIN13_ALU54, + TILE_WIRE_JCIN14_ALU54, + TILE_WIRE_JCIN15_ALU54, + TILE_WIRE_JCIN16_ALU54, + TILE_WIRE_JCIN17_ALU54, + TILE_WIRE_JCIN18_ALU54, + TILE_WIRE_JCIN19_ALU54, + TILE_WIRE_JCIN20_ALU54, + TILE_WIRE_JCIN21_ALU54, + TILE_WIRE_JCIN22_ALU54, + TILE_WIRE_JCIN23_ALU54, + TILE_WIRE_JCIN24_ALU54, + TILE_WIRE_JCIN25_ALU54, + TILE_WIRE_JCIN26_ALU54, + TILE_WIRE_JCIN27_ALU54, + TILE_WIRE_JCIN28_ALU54, + TILE_WIRE_JCIN29_ALU54, + TILE_WIRE_JCIN30_ALU54, + TILE_WIRE_JCIN31_ALU54, + TILE_WIRE_JCIN32_ALU54, + TILE_WIRE_JCIN33_ALU54, + TILE_WIRE_JCIN34_ALU54, + TILE_WIRE_JCIN35_ALU54, + TILE_WIRE_JCIN36_ALU54, + TILE_WIRE_JCIN37_ALU54, + TILE_WIRE_JCIN38_ALU54, + TILE_WIRE_JCIN39_ALU54, + TILE_WIRE_JCIN40_ALU54, + TILE_WIRE_JCIN41_ALU54, + TILE_WIRE_JCIN42_ALU54, + TILE_WIRE_JCIN43_ALU54, + TILE_WIRE_JCIN44_ALU54, + TILE_WIRE_JCIN45_ALU54, + TILE_WIRE_JCIN46_ALU54, + TILE_WIRE_JCIN47_ALU54, + TILE_WIRE_JCIN48_ALU54, + TILE_WIRE_JCIN49_ALU54, + TILE_WIRE_JCIN50_ALU54, + TILE_WIRE_JCIN51_ALU54, + TILE_WIRE_JCIN52_ALU54, + TILE_WIRE_JCIN53_ALU54, + TILE_WIRE_JOP0_ALU54, + TILE_WIRE_JOP1_ALU54, + TILE_WIRE_JOP2_ALU54, + TILE_WIRE_JOP3_ALU54, + TILE_WIRE_JOP4_ALU54, + TILE_WIRE_JOP5_ALU54, + TILE_WIRE_JOP6_ALU54, + TILE_WIRE_JOP7_ALU54, + TILE_WIRE_JOP8_ALU54, + TILE_WIRE_JOP9_ALU54, + TILE_WIRE_JOP10_ALU54, + TILE_WIRE_JR0_ALU54, + TILE_WIRE_JR1_ALU54, + TILE_WIRE_JR2_ALU54, + TILE_WIRE_JR3_ALU54, + TILE_WIRE_JR4_ALU54, + TILE_WIRE_JR5_ALU54, + TILE_WIRE_JR6_ALU54, + TILE_WIRE_JR7_ALU54, + TILE_WIRE_JR8_ALU54, + TILE_WIRE_JR9_ALU54, + TILE_WIRE_JR10_ALU54, + TILE_WIRE_JR11_ALU54, + TILE_WIRE_JR12_ALU54, + TILE_WIRE_JR13_ALU54, + TILE_WIRE_JR14_ALU54, + TILE_WIRE_JR15_ALU54, + TILE_WIRE_JR16_ALU54, + TILE_WIRE_JR17_ALU54, + TILE_WIRE_JR18_ALU54, + TILE_WIRE_JR19_ALU54, + TILE_WIRE_JR20_ALU54, + TILE_WIRE_JR21_ALU54, + TILE_WIRE_JR22_ALU54, + TILE_WIRE_JR23_ALU54, + TILE_WIRE_JR24_ALU54, + TILE_WIRE_JR25_ALU54, + TILE_WIRE_JR26_ALU54, + TILE_WIRE_JR27_ALU54, + TILE_WIRE_JR28_ALU54, + TILE_WIRE_JR29_ALU54, + TILE_WIRE_JR30_ALU54, + TILE_WIRE_JR31_ALU54, + TILE_WIRE_JR32_ALU54, + TILE_WIRE_JR33_ALU54, + TILE_WIRE_JR34_ALU54, + TILE_WIRE_JR35_ALU54, + TILE_WIRE_JR36_ALU54, + TILE_WIRE_JR37_ALU54, + TILE_WIRE_JR38_ALU54, + TILE_WIRE_JR39_ALU54, + TILE_WIRE_JR40_ALU54, + TILE_WIRE_JR41_ALU54, + TILE_WIRE_JR42_ALU54, + TILE_WIRE_JR43_ALU54, + TILE_WIRE_JR44_ALU54, + TILE_WIRE_JR45_ALU54, + TILE_WIRE_JR46_ALU54, + TILE_WIRE_JR47_ALU54, + TILE_WIRE_JR48_ALU54, + TILE_WIRE_JR49_ALU54, + TILE_WIRE_JR50_ALU54, + TILE_WIRE_JR51_ALU54, + TILE_WIRE_JR52_ALU54, + TILE_WIRE_JR53_ALU54, + TILE_WIRE_JCO0_ALU54, + TILE_WIRE_JCO1_ALU54, + TILE_WIRE_JCO2_ALU54, + TILE_WIRE_JCO3_ALU54, + TILE_WIRE_JCO4_ALU54, + TILE_WIRE_JCO5_ALU54, + TILE_WIRE_JCO6_ALU54, + TILE_WIRE_JCO7_ALU54, + TILE_WIRE_JCO8_ALU54, + TILE_WIRE_JCO9_ALU54, + TILE_WIRE_JCO10_ALU54, + TILE_WIRE_JCO11_ALU54, + TILE_WIRE_JCO12_ALU54, + TILE_WIRE_JCO13_ALU54, + TILE_WIRE_JCO14_ALU54, + TILE_WIRE_JCO15_ALU54, + TILE_WIRE_JCO16_ALU54, + TILE_WIRE_JCO17_ALU54, + TILE_WIRE_JCO18_ALU54, + TILE_WIRE_JCO19_ALU54, + TILE_WIRE_JCO20_ALU54, + TILE_WIRE_JCO21_ALU54, + TILE_WIRE_JCO22_ALU54, + TILE_WIRE_JCO23_ALU54, + TILE_WIRE_JCO24_ALU54, + TILE_WIRE_JCO25_ALU54, + TILE_WIRE_JCO26_ALU54, + TILE_WIRE_JCO27_ALU54, + TILE_WIRE_JCO28_ALU54, + TILE_WIRE_JCO29_ALU54, + TILE_WIRE_JCO30_ALU54, + TILE_WIRE_JCO31_ALU54, + TILE_WIRE_JCO32_ALU54, + TILE_WIRE_JCO33_ALU54, + TILE_WIRE_JCO34_ALU54, + TILE_WIRE_JCO35_ALU54, + TILE_WIRE_JCO36_ALU54, + TILE_WIRE_JCO37_ALU54, + TILE_WIRE_JCO38_ALU54, + TILE_WIRE_JCO39_ALU54, + TILE_WIRE_JCO40_ALU54, + TILE_WIRE_JCO41_ALU54, + TILE_WIRE_JCO42_ALU54, + TILE_WIRE_JCO43_ALU54, + TILE_WIRE_JCO44_ALU54, + TILE_WIRE_JCO45_ALU54, + TILE_WIRE_JCO46_ALU54, + TILE_WIRE_JCO47_ALU54, + TILE_WIRE_JCO48_ALU54, + TILE_WIRE_JCO49_ALU54, + TILE_WIRE_JCO50_ALU54, + TILE_WIRE_JCO51_ALU54, + TILE_WIRE_JCO52_ALU54, + TILE_WIRE_JCO53_ALU54, + TILE_WIRE_JEQZ_ALU54, + TILE_WIRE_JEQZM_ALU54, + TILE_WIRE_JEQOM_ALU54, + TILE_WIRE_JEQPAT_ALU54, + TILE_WIRE_JEQPATB_ALU54, + TILE_WIRE_JOVER_ALU54, + TILE_WIRE_JUNDER_ALU54, + TILE_WIRE_JOVERUNDER_ALU54, + TILE_WIRE_JSIGNEDR_ALU54, + + TILE_WIRE_JCE0, + TILE_WIRE_JCE1, + TILE_WIRE_JCE2, + TILE_WIRE_JCE3, + TILE_WIRE_JCLK0, + TILE_WIRE_JCLK1, + TILE_WIRE_JLSR0, + TILE_WIRE_JLSR1, + + TILE_WIRE_JA0, + TILE_WIRE_JA1, + TILE_WIRE_JA2, + TILE_WIRE_JA3, + TILE_WIRE_JA4, + TILE_WIRE_JA5, + TILE_WIRE_JA6, + TILE_WIRE_JA7, + TILE_WIRE_JB0, + TILE_WIRE_JB1, + TILE_WIRE_JB2, + TILE_WIRE_JB3, + TILE_WIRE_JB4, + TILE_WIRE_JB5, + TILE_WIRE_JB6, + TILE_WIRE_JB7, + TILE_WIRE_JC0, + TILE_WIRE_JC1, + TILE_WIRE_JC2, + TILE_WIRE_JC3, + TILE_WIRE_JC4, + TILE_WIRE_JC5, + TILE_WIRE_JC6, + TILE_WIRE_JC7, + TILE_WIRE_JD0, + TILE_WIRE_JD1, + TILE_WIRE_JD2, + TILE_WIRE_JD3, + TILE_WIRE_JD4, + TILE_WIRE_JD5, + TILE_WIRE_JD6, + TILE_WIRE_JD7, + TILE_WIRE_JM0, + TILE_WIRE_JM1, + TILE_WIRE_JM2, + TILE_WIRE_JM3, + TILE_WIRE_JM4, + TILE_WIRE_JM5, + TILE_WIRE_JM6, + TILE_WIRE_JM7, + TILE_WIRE_JF0, + TILE_WIRE_JF1, + TILE_WIRE_JF2, + TILE_WIRE_JF3, + TILE_WIRE_JF4, + TILE_WIRE_JF5, + TILE_WIRE_JF6, + TILE_WIRE_JF7, + TILE_WIRE_JQ0, + TILE_WIRE_JQ1, + TILE_WIRE_JQ2, + TILE_WIRE_JQ3, + TILE_WIRE_JQ4, + TILE_WIRE_JQ5, + TILE_WIRE_JQ6, + TILE_WIRE_JQ7 + }; void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index 68fbfe53..edafebfa 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -50,6 +50,27 @@ def wire_type(name): if name[0].endswith("_SLICE"): return "WIRE_TYPE_SLICE" + if name[0].endswith("_DQS"): + return "WIRE_TYPE_DQS" + + if name[0].endswith("_IOLOGIC"): + return "WIRE_TYPE_IOLOGIC" + + if name[0].endswith("_PIO"): + return "WIRE_TYPE_PIO" + + if name[0].endswith("_DDRDLL"): + return "WIRE_TYPE_DDRDLL" + + if name[0].endswith("_EBR"): + return "WIRE_TYPE_EBR" + + if name[0].endswith("_MULT18"): + return "WIRE_TYPE_MULT18" + + if name[0].endswith("_ALU54"): + return "WIRE_TYPE_ALU54" + if name[0].startswith("H00"): return "WIRE_TYPE_H00" -- cgit v1.2.3 From c0585e98eb6234fa1658586b617cf6717bc391d8 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 13 Dec 2019 14:32:27 +0100 Subject: added siologic --- ecp5/constids.inc | 1 + ecp5/gfx.cc | 20 ++++++++++++++++++-- ecp5/gfx.h | 41 +++++++++++++++++++++++++++++++++++++++++ ecp5/trellis_import.py | 3 +++ 4 files changed, 63 insertions(+), 2 deletions(-) diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 9170f225..656dd1b7 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1299,6 +1299,7 @@ X(WIRE_TYPE_NONE) X(WIRE_TYPE_SLICE) X(WIRE_TYPE_DQS) X(WIRE_TYPE_IOLOGIC) +X(WIRE_TYPE_SIOLOGIC) X(WIRE_TYPE_PIO) X(WIRE_TYPE_DDRDLL) X(WIRE_TYPE_EBR) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 3d37e2a9..188e44ab 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -112,8 +112,24 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); el.y2 = el.y1; g.push_back(el); - } - + } + if (wire_type == id_WIRE_TYPE_SIOLOGIC) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + int gap = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC)/20; + int num = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC)%20; + el.x1 = x + io_cell_h_x1 + (5-gap) * 0.10 + 0.0017f * (num + 1); + el.x2 = el.x1; + if (y == h - 1) { + el.y1 = y + 1 - io_cell_h_y2; + el.y2 = el.y1 - 0.015f; + } else { + el.y1 = y + io_cell_h_y2; + el.y2 = el.y1 + 0.015f; + } + g.push_back(el); + } if (wire_type == id_WIRE_TYPE_DQS) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 4c9b926f..2dda3301 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -636,6 +636,47 @@ enum GfxTileWireId TILE_WIRE_WRPNTR1A_IOLOGIC, TILE_WIRE_WRPNTR2A_IOLOGIC, + TILE_WIRE_JLOADNB_SIOLOGIC, + TILE_WIRE_JMOVEB_SIOLOGIC, + TILE_WIRE_JDIRECTIONB_SIOLOGIC, + TILE_WIRE_JCFLAGB_SIOLOGIC, + TILE_WIRE_IOLDOB_SIOLOGIC, + TILE_WIRE_IOLTOB_SIOLOGIC, + TILE_WIRE_DIB_SIOLOGIC, + TILE_WIRE_IOLDODB_SIOLOGIC, + TILE_WIRE_IOLDOIB_SIOLOGIC, + TILE_WIRE_INDDB_SIOLOGIC, + TILE_WIRE_PADDIB_SIOLOGIC, + TILE_WIRE_JCLKB_SIOLOGIC, + TILE_WIRE_JCEB_SIOLOGIC, + TILE_WIRE_JLSRB_SIOLOGIC, + TILE_WIRE_JTSDATA0B_SIOLOGIC, + TILE_WIRE_JTXDATA0B_SIOLOGIC, + TILE_WIRE_JTXDATA1B_SIOLOGIC, + TILE_WIRE_JRXDATA0B_SIOLOGIC, + TILE_WIRE_JRXDATA1B_SIOLOGIC, + TILE_WIRE_JINFFB_SIOLOGIC, + TILE_WIRE_JLOADNA_SIOLOGIC, + TILE_WIRE_JMOVEA_SIOLOGIC, + TILE_WIRE_JDIRECTIONA_SIOLOGIC, + TILE_WIRE_JCFLAGA_SIOLOGIC, + TILE_WIRE_IOLDOA_SIOLOGIC, + TILE_WIRE_IOLTOA_SIOLOGIC, + TILE_WIRE_DIA_SIOLOGIC, + TILE_WIRE_IOLDODA_SIOLOGIC, + TILE_WIRE_IOLDOIA_SIOLOGIC, + TILE_WIRE_INDDA_SIOLOGIC, + TILE_WIRE_PADDIA_SIOLOGIC, + TILE_WIRE_JCLKA_SIOLOGIC, + TILE_WIRE_JCEA_SIOLOGIC, + TILE_WIRE_JLSRA_SIOLOGIC, + TILE_WIRE_JTSDATA0A_SIOLOGIC, + TILE_WIRE_JTXDATA0A_SIOLOGIC, + TILE_WIRE_JTXDATA1A_SIOLOGIC, + TILE_WIRE_JRXDATA0A_SIOLOGIC, + TILE_WIRE_JRXDATA1A_SIOLOGIC, + TILE_WIRE_JINFFA_SIOLOGIC, + TILE_WIRE_PADDOD_PIO, TILE_WIRE_PADDTD_PIO, TILE_WIRE_JPADDID_PIO, diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index edafebfa..0ae8dde5 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -56,6 +56,9 @@ def wire_type(name): if name[0].endswith("_IOLOGIC"): return "WIRE_TYPE_IOLOGIC" + if name[0].endswith("_SIOLOGIC"): + return "WIRE_TYPE_SIOLOGIC" + if name[0].endswith("_PIO"): return "WIRE_TYPE_PIO" -- cgit v1.2.3 From 2a5f0bbd28481e9809ffe7c7b972252878420888 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 13 Dec 2019 18:24:49 +0100 Subject: new wires in db --- ecp5/constids.inc | 6 +- ecp5/gfx.cc | 4 +- ecp5/gfx.h | 508 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 498 insertions(+), 20 deletions(-) diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 656dd1b7..37577125 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1301,10 +1301,14 @@ X(WIRE_TYPE_DQS) X(WIRE_TYPE_IOLOGIC) X(WIRE_TYPE_SIOLOGIC) X(WIRE_TYPE_PIO) -X(WIRE_TYPE_DDRDLL) X(WIRE_TYPE_EBR) X(WIRE_TYPE_MULT18) X(WIRE_TYPE_ALU54) +X(WIRE_TYPE_DDRDLL) +X(WIRE_TYPE_CCLK) +X(WIRE_TYPE_EXTREF) +X(WIRE_TYPE_DCU) + X(WIRE_TYPE_H00) X(WIRE_TYPE_H01) X(WIRE_TYPE_H02) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 188e44ab..e06bcfa6 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -70,8 +70,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.type = GraphicElement::TYPE_LINE; el.style = style; bool top_bottom = (y == 0 || y == (h - 1)); - int gap = 3-(tilewire - TILE_WIRE_PADDOD_PIO)/5; - int num = (tilewire - TILE_WIRE_PADDOD_PIO)%5; + int gap = 3-(tilewire - TILE_WIRE_PADDOD_PIO)/6; + int num = (tilewire - TILE_WIRE_PADDOD_PIO)%6; if (top_bottom) { el.x1 = x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); el.x2 = el.x1; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 2dda3301..98846c25 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -682,37 +682,25 @@ enum GfxTileWireId TILE_WIRE_JPADDID_PIO, TILE_WIRE_IOLDOD_PIO, TILE_WIRE_IOLTOD_PIO, + TILE_WIRE_INRDD_PIO, TILE_WIRE_PADDOC_PIO, TILE_WIRE_PADDTC_PIO, TILE_WIRE_JPADDIC_PIO, TILE_WIRE_IOLDOC_PIO, TILE_WIRE_IOLTOC_PIO, + TILE_WIRE_INRDC_PIO, TILE_WIRE_PADDOB_PIO, TILE_WIRE_PADDTB_PIO, TILE_WIRE_JPADDIB_PIO, TILE_WIRE_IOLDOB_PIO, TILE_WIRE_IOLTOB_PIO, + TILE_WIRE_INRDB_PIO, TILE_WIRE_PADDOA_PIO, TILE_WIRE_PADDTA_PIO, TILE_WIRE_JPADDIA_PIO, TILE_WIRE_IOLDOA_PIO, TILE_WIRE_IOLTOA_PIO, - - TILE_WIRE_DDRDEL_DDRDLL, - TILE_WIRE_JRST_DDRDLL, - TILE_WIRE_JCLK_DDRDLL, - TILE_WIRE_JUDDCNTLN_DDRDLL, - TILE_WIRE_JFREEZE_DDRDLL, - TILE_WIRE_JLOCK_DDRDLL, - TILE_WIRE_JDIVOSC_DDRDLL, - TILE_WIRE_JDCNTL0_DDRDLL, - TILE_WIRE_JDCNTL1_DDRDLL, - TILE_WIRE_JDCNTL2_DDRDLL, - TILE_WIRE_JDCNTL3_DDRDLL, - TILE_WIRE_JDCNTL4_DDRDLL, - TILE_WIRE_JDCNTL5_DDRDLL, - TILE_WIRE_JDCNTL6_DDRDLL, - TILE_WIRE_JDCNTL7_DDRDLL, + TILE_WIRE_INRDA_PIO, TILE_WIRE_JADA0_EBR, TILE_WIRE_JADB0_EBR, @@ -1579,7 +1567,493 @@ enum GfxTileWireId TILE_WIRE_JQ4, TILE_WIRE_JQ5, TILE_WIRE_JQ6, - TILE_WIRE_JQ7 + TILE_WIRE_JQ7, + + TILE_WIRE_DDRDEL_DDRDLL, + TILE_WIRE_JRST_DDRDLL, + TILE_WIRE_JCLK_DDRDLL, + TILE_WIRE_JUDDCNTLN_DDRDLL, + TILE_WIRE_JFREEZE_DDRDLL, + TILE_WIRE_JLOCK_DDRDLL, + TILE_WIRE_JDIVOSC_DDRDLL, + TILE_WIRE_JDCNTL0_DDRDLL, + TILE_WIRE_JDCNTL1_DDRDLL, + TILE_WIRE_JDCNTL2_DDRDLL, + TILE_WIRE_JDCNTL3_DDRDLL, + TILE_WIRE_JDCNTL4_DDRDLL, + TILE_WIRE_JDCNTL5_DDRDLL, + TILE_WIRE_JDCNTL6_DDRDLL, + TILE_WIRE_JDCNTL7_DDRDLL, + + TILE_WIRE_JPADDI_CCLK, + TILE_WIRE_JPADDO_CCLK, + TILE_WIRE_JPADDT_CCLK, + + TILE_WIRE_REFCLKP_EXTREF, + TILE_WIRE_REFCLKN_EXTREF, + TILE_WIRE_JREFCLKO_EXTREF, + + TILE_WIRE_CH0_RX_REFCLK_DCU, + TILE_WIRE_CH1_RX_REFCLK_DCU, + TILE_WIRE_D_REFCLKI_DCU, + TILE_WIRE_JD_SYNC_PULSE2ND_DCU, + TILE_WIRE_JD_TXBIT_CLKN_TO_ND_DCU, + TILE_WIRE_JD_TXBIT_CLKP_TO_ND_DCU, + TILE_WIRE_JD_TXPLL_LOL_TO_ND_DCU, + TILE_WIRE_JCH0_FF_RX_PCLK_DCU, + TILE_WIRE_JCH1_FF_RX_PCLK_DCU, + TILE_WIRE_JCH0_FF_TX_PCLK_DCU, + TILE_WIRE_JCH1_FF_TX_PCLK_DCU, + TILE_WIRE_JCH0_FFC_CDR_EN_BITSLIP_DCU, + TILE_WIRE_JCH0_FFC_DIV11_MODE_RX_DCU, + TILE_WIRE_JCH0_FFC_DIV11_MODE_TX_DCU, + TILE_WIRE_JCH0_FFC_EI_EN_DCU, + TILE_WIRE_JCH0_FFC_ENABLE_CGALIGN_DCU, + TILE_WIRE_JCH0_FFC_FB_LOOPBACK_DCU, + TILE_WIRE_JCH0_FFC_LANE_RX_RST_DCU, + TILE_WIRE_JCH0_FFC_LANE_TX_RST_DCU, + TILE_WIRE_JCH0_FFC_LDR_CORE2TX_EN_DCU, + TILE_WIRE_JCH0_FFC_PCIE_CT_DCU, + TILE_WIRE_JCH0_FFC_PCIE_DET_EN_DCU, + TILE_WIRE_JCH0_FFC_PFIFO_CLR_DCU, + TILE_WIRE_JCH0_FFC_RATE_MODE_RX_DCU, + TILE_WIRE_JCH0_FFC_RATE_MODE_TX_DCU, + TILE_WIRE_JCH0_FFC_RRST_DCU, + TILE_WIRE_JCH0_FFC_RXPWDNB_DCU, + TILE_WIRE_JCH0_FFC_RX_GEAR_MODE_DCU, + TILE_WIRE_JCH0_FFC_SB_INV_RX_DCU, + TILE_WIRE_JCH0_FFC_SB_PFIFO_LP_DCU, + TILE_WIRE_JCH0_FFC_SIGNAL_DETECT_DCU, + TILE_WIRE_JCH0_FFC_TXPWDNB_DCU, + TILE_WIRE_JCH0_FFC_TX_GEAR_MODE_DCU, + TILE_WIRE_JCH0_FF_EBRD_CLK_DCU, + TILE_WIRE_JCH0_FF_RXI_CLK_DCU, + TILE_WIRE_JCH0_FF_TXI_CLK_DCU, + TILE_WIRE_JCH0_FF_TX_D_0_DCU, + TILE_WIRE_JCH0_FF_TX_D_10_DCU, + TILE_WIRE_JCH0_FF_TX_D_11_DCU, + TILE_WIRE_JCH0_FF_TX_D_12_DCU, + TILE_WIRE_JCH0_FF_TX_D_13_DCU, + TILE_WIRE_JCH0_FF_TX_D_14_DCU, + TILE_WIRE_JCH0_FF_TX_D_15_DCU, + TILE_WIRE_JCH0_FF_TX_D_16_DCU, + TILE_WIRE_JCH0_FF_TX_D_17_DCU, + TILE_WIRE_JCH0_FF_TX_D_18_DCU, + TILE_WIRE_JCH0_FF_TX_D_19_DCU, + TILE_WIRE_JCH0_FF_TX_D_1_DCU, + TILE_WIRE_JCH0_FF_TX_D_20_DCU, + TILE_WIRE_JCH0_FF_TX_D_21_DCU, + TILE_WIRE_JCH0_FF_TX_D_22_DCU, + TILE_WIRE_JCH0_FF_TX_D_23_DCU, + TILE_WIRE_JCH0_FF_TX_D_2_DCU, + TILE_WIRE_JCH0_FF_TX_D_3_DCU, + TILE_WIRE_JCH0_FF_TX_D_4_DCU, + TILE_WIRE_JCH0_FF_TX_D_5_DCU, + TILE_WIRE_JCH0_FF_TX_D_6_DCU, + TILE_WIRE_JCH0_FF_TX_D_7_DCU, + TILE_WIRE_JCH0_FF_TX_D_8_DCU, + TILE_WIRE_JCH0_FF_TX_D_9_DCU, + TILE_WIRE_JCH0_HDINN_DCU, + TILE_WIRE_JCH0_HDINP_DCU, + TILE_WIRE_JCH0_LDR_CORE2TX_DCU, + TILE_WIRE_JCH0_SCIEN_DCU, + TILE_WIRE_JCH0_SCISEL_DCU, + TILE_WIRE_JCH1_FFC_CDR_EN_BITSLIP_DCU, + TILE_WIRE_JCH1_FFC_DIV11_MODE_RX_DCU, + TILE_WIRE_JCH1_FFC_DIV11_MODE_TX_DCU, + TILE_WIRE_JCH1_FFC_EI_EN_DCU, + TILE_WIRE_JCH1_FFC_ENABLE_CGALIGN_DCU, + TILE_WIRE_JCH1_FFC_FB_LOOPBACK_DCU, + TILE_WIRE_JCH1_FFC_LANE_RX_RST_DCU, + TILE_WIRE_JCH1_FFC_LANE_TX_RST_DCU, + TILE_WIRE_JCH1_FFC_LDR_CORE2TX_EN_DCU, + TILE_WIRE_JCH1_FFC_PCIE_CT_DCU, + TILE_WIRE_JCH1_FFC_PCIE_DET_EN_DCU, + TILE_WIRE_JCH1_FFC_PFIFO_CLR_DCU, + TILE_WIRE_JCH1_FFC_RATE_MODE_RX_DCU, + TILE_WIRE_JCH1_FFC_RATE_MODE_TX_DCU, + TILE_WIRE_JCH1_FFC_RRST_DCU, + TILE_WIRE_JCH1_FFC_RXPWDNB_DCU, + TILE_WIRE_JCH1_FFC_RX_GEAR_MODE_DCU, + TILE_WIRE_JCH1_FFC_SB_INV_RX_DCU, + TILE_WIRE_JCH1_FFC_SB_PFIFO_LP_DCU, + TILE_WIRE_JCH1_FFC_SIGNAL_DETECT_DCU, + TILE_WIRE_JCH1_FFC_TXPWDNB_DCU, + TILE_WIRE_JCH1_FFC_TX_GEAR_MODE_DCU, + TILE_WIRE_JCH1_FF_EBRD_CLK_DCU, + TILE_WIRE_JCH1_FF_RXI_CLK_DCU, + TILE_WIRE_JCH1_FF_TXI_CLK_DCU, + TILE_WIRE_JCH1_FF_TX_D_0_DCU, + TILE_WIRE_JCH1_FF_TX_D_10_DCU, + TILE_WIRE_JCH1_FF_TX_D_11_DCU, + TILE_WIRE_JCH1_FF_TX_D_12_DCU, + TILE_WIRE_JCH1_FF_TX_D_13_DCU, + TILE_WIRE_JCH1_FF_TX_D_14_DCU, + TILE_WIRE_JCH1_FF_TX_D_15_DCU, + TILE_WIRE_JCH1_FF_TX_D_16_DCU, + TILE_WIRE_JCH1_FF_TX_D_17_DCU, + TILE_WIRE_JCH1_FF_TX_D_18_DCU, + TILE_WIRE_JCH1_FF_TX_D_19_DCU, + TILE_WIRE_JCH1_FF_TX_D_1_DCU, + TILE_WIRE_JCH1_FF_TX_D_20_DCU, + TILE_WIRE_JCH1_FF_TX_D_21_DCU, + TILE_WIRE_JCH1_FF_TX_D_22_DCU, + TILE_WIRE_JCH1_FF_TX_D_23_DCU, + TILE_WIRE_JCH1_FF_TX_D_2_DCU, + TILE_WIRE_JCH1_FF_TX_D_3_DCU, + TILE_WIRE_JCH1_FF_TX_D_4_DCU, + TILE_WIRE_JCH1_FF_TX_D_5_DCU, + TILE_WIRE_JCH1_FF_TX_D_6_DCU, + TILE_WIRE_JCH1_FF_TX_D_7_DCU, + TILE_WIRE_JCH1_FF_TX_D_8_DCU, + TILE_WIRE_JCH1_FF_TX_D_9_DCU, + TILE_WIRE_JCH1_HDINN_DCU, + TILE_WIRE_JCH1_HDINP_DCU, + TILE_WIRE_JCH1_LDR_CORE2TX_DCU, + TILE_WIRE_JCH1_SCIEN_DCU, + TILE_WIRE_JCH1_SCISEL_DCU, + TILE_WIRE_JD_CIN0_DCU, + TILE_WIRE_JD_CIN10_DCU, + TILE_WIRE_JD_CIN11_DCU, + TILE_WIRE_JD_CIN1_DCU, + TILE_WIRE_JD_CIN2_DCU, + TILE_WIRE_JD_CIN3_DCU, + TILE_WIRE_JD_CIN4_DCU, + TILE_WIRE_JD_CIN5_DCU, + TILE_WIRE_JD_CIN6_DCU, + TILE_WIRE_JD_CIN7_DCU, + TILE_WIRE_JD_CIN8_DCU, + TILE_WIRE_JD_CIN9_DCU, + TILE_WIRE_JD_CYAWSTN_DCU, + TILE_WIRE_JD_FFC_DUAL_RST_DCU, + TILE_WIRE_JD_FFC_MACROPDB_DCU, + TILE_WIRE_JD_FFC_MACRO_RST_DCU, + TILE_WIRE_JD_FFC_SYNC_TOGGLE_DCU, + TILE_WIRE_JD_FFC_TRST_DCU, + TILE_WIRE_JD_SCAN_ENABLE_DCU, + TILE_WIRE_JD_SCAN_IN_0_DCU, + TILE_WIRE_JD_SCAN_IN_1_DCU, + TILE_WIRE_JD_SCAN_IN_2_DCU, + TILE_WIRE_JD_SCAN_IN_3_DCU, + TILE_WIRE_JD_SCAN_IN_4_DCU, + TILE_WIRE_JD_SCAN_IN_5_DCU, + TILE_WIRE_JD_SCAN_IN_6_DCU, + TILE_WIRE_JD_SCAN_IN_7_DCU, + TILE_WIRE_JD_SCAN_MODE_DCU, + TILE_WIRE_JD_SCAN_RESET_DCU, + TILE_WIRE_JD_SCIADDR0_DCU, + TILE_WIRE_JD_SCIADDR1_DCU, + TILE_WIRE_JD_SCIADDR2_DCU, + TILE_WIRE_JD_SCIADDR3_DCU, + TILE_WIRE_JD_SCIADDR4_DCU, + TILE_WIRE_JD_SCIADDR5_DCU, + TILE_WIRE_JD_SCIENAUX_DCU, + TILE_WIRE_JD_SCIRD_DCU, + TILE_WIRE_JD_SCISELAUX_DCU, + TILE_WIRE_JD_SCIWDATA0_DCU, + TILE_WIRE_JD_SCIWDATA1_DCU, + TILE_WIRE_JD_SCIWDATA2_DCU, + TILE_WIRE_JD_SCIWDATA3_DCU, + TILE_WIRE_JD_SCIWDATA4_DCU, + TILE_WIRE_JD_SCIWDATA5_DCU, + TILE_WIRE_JD_SCIWDATA6_DCU, + TILE_WIRE_JD_SCIWDATA7_DCU, + TILE_WIRE_JD_SCIWSTN_DCU, + TILE_WIRE_JCH0_HDOUTN_DCU, + TILE_WIRE_JCH1_HDOUTN_DCU, + TILE_WIRE_JCH0_HDOUTP_DCU, + TILE_WIRE_JCH1_HDOUTP_DCU, + TILE_WIRE_JCH1_FF_RX_D_16_DCU, + TILE_WIRE_JCH1_FF_RX_D_17_DCU, + TILE_WIRE_JCH1_FF_RX_D_18_DCU, + TILE_WIRE_JCH1_FF_RX_D_19_DCU, + TILE_WIRE_JCH1_FF_RX_D_20_DCU, + TILE_WIRE_JCH1_FF_RX_D_21_DCU, + TILE_WIRE_JCH1_FF_RX_D_22_DCU, + TILE_WIRE_JCH1_FF_RX_D_23_DCU, + TILE_WIRE_JCH1_FFS_SKP_DELETED_DCU, + TILE_WIRE_JCH1_FFS_SKP_ADDED_DCU, + TILE_WIRE_JCH1_LDR_RX2CORE_DCU, + TILE_WIRE_JD_SCAN_OUT_7_DCU, + TILE_WIRE_JCH1_FFS_TXFBFIFO_ERROR_DCU, + TILE_WIRE_JCH1_FFS_PCIE_CON_DCU, + TILE_WIRE_JCH1_FFS_PCIE_DONE_DCU, + TILE_WIRE_JD_SCAN_OUT_3_DCU, + TILE_WIRE_JD_COUT1_DCU, + TILE_WIRE_JD_SCAN_OUT_0_DCU, + TILE_WIRE_JD_FFS_PLOL_DCU, + TILE_WIRE_JCH0_FF_RX_D_0_DCU, + TILE_WIRE_JCH0_FF_RX_D_1_DCU, + TILE_WIRE_JCH0_FF_RX_D_2_DCU, + TILE_WIRE_JCH0_FF_RX_D_3_DCU, + TILE_WIRE_JCH0_FF_RX_D_4_DCU, + TILE_WIRE_JCH0_FF_RX_D_5_DCU, + TILE_WIRE_JCH0_FF_RX_D_6_DCU, + TILE_WIRE_JCH0_FF_RX_D_7_DCU, + TILE_WIRE_JCH0_FFS_CC_OVERRUN_DCU, + TILE_WIRE_JCH0_FFS_RLOL_DCU, + TILE_WIRE_JCH0_FF_RX_D_8_DCU, + TILE_WIRE_JCH0_FF_RX_D_9_DCU, + TILE_WIRE_JCH0_FF_RX_D_10_DCU, + TILE_WIRE_JCH0_FF_RX_D_11_DCU, + TILE_WIRE_JCH0_FF_RX_D_12_DCU, + TILE_WIRE_JCH0_FF_RX_D_13_DCU, + TILE_WIRE_JCH0_FF_RX_D_14_DCU, + TILE_WIRE_JCH0_FF_RX_D_15_DCU, + TILE_WIRE_JCH0_FFS_RLOS_DCU, + TILE_WIRE_JCH0_FFS_LS_SYNC_STATUS_DCU, + TILE_WIRE_JCH0_FF_RX_D_16_DCU, + TILE_WIRE_JCH0_FF_RX_D_17_DCU, + TILE_WIRE_JCH0_FF_RX_D_18_DCU, + TILE_WIRE_JCH0_FF_RX_D_19_DCU, + TILE_WIRE_JCH0_FF_RX_D_20_DCU, + TILE_WIRE_JCH0_FF_RX_D_21_DCU, + TILE_WIRE_JCH0_FF_RX_D_22_DCU, + TILE_WIRE_JCH0_FF_RX_D_23_DCU, + TILE_WIRE_JCH0_FF_RX_F_CLK_DCU, + TILE_WIRE_JCH0_FF_RX_H_CLK_DCU, + TILE_WIRE_JD_COUT19_DCU, + TILE_WIRE_JD_COUT16_DCU, + TILE_WIRE_JD_COUT6_DCU, + TILE_WIRE_JD_COUT7_DCU, + TILE_WIRE_JD_COUT8_DCU, + TILE_WIRE_JD_COUT9_DCU, + TILE_WIRE_JD_COUT10_DCU, + TILE_WIRE_JD_COUT17_DCU, + TILE_WIRE_JD_COUT18_DCU, + TILE_WIRE_JCH0_FFS_CC_UNDERRUN_DCU, + TILE_WIRE_JCH0_FFS_RXFBFIFO_ERROR_DCU, + TILE_WIRE_JD_COUT11_DCU, + TILE_WIRE_JD_COUT12_DCU, + TILE_WIRE_JD_COUT13_DCU, + TILE_WIRE_JD_COUT14_DCU, + TILE_WIRE_JD_COUT15_DCU, + TILE_WIRE_JD_COUT0_DCU, + TILE_WIRE_JD_COUT2_DCU, + TILE_WIRE_JD_COUT3_DCU, + TILE_WIRE_JD_COUT4_DCU, + TILE_WIRE_JD_COUT5_DCU, + TILE_WIRE_JD_SCAN_OUT_6_DCU, + TILE_WIRE_JD_SCIINT_DCU, + TILE_WIRE_JD_SCIRDATA0_DCU, + TILE_WIRE_JD_SCIRDATA1_DCU, + TILE_WIRE_JD_SCIRDATA2_DCU, + TILE_WIRE_JD_SCIRDATA3_DCU, + TILE_WIRE_JD_SCIRDATA4_DCU, + TILE_WIRE_JD_SCIRDATA5_DCU, + TILE_WIRE_JD_SCIRDATA6_DCU, + TILE_WIRE_JD_SCIRDATA7_DCU, + TILE_WIRE_JCH1_FF_RX_F_CLK_DCU, + TILE_WIRE_JCH1_FF_RX_H_CLK_DCU, + TILE_WIRE_JCH1_FFS_RXFBFIFO_ERROR_DCU, + TILE_WIRE_JCH1_FFS_CC_UNDERRUN_DCU, + TILE_WIRE_JCH1_FFS_LS_SYNC_STATUS_DCU, + TILE_WIRE_JCH1_FFS_RLOS_DCU, + TILE_WIRE_JCH1_FFS_RLOL_DCU, + TILE_WIRE_JCH1_FFS_CC_OVERRUN_DCU, + TILE_WIRE_JD_SCAN_OUT_4_DCU, + TILE_WIRE_JCH1_FF_TX_F_CLK_DCU, + TILE_WIRE_JCH1_FF_TX_H_CLK_DCU, + TILE_WIRE_JCH1_FF_RX_D_0_DCU, + TILE_WIRE_JCH1_FF_RX_D_1_DCU, + TILE_WIRE_JCH1_FF_RX_D_2_DCU, + TILE_WIRE_JCH1_FF_RX_D_3_DCU, + TILE_WIRE_JCH1_FF_RX_D_4_DCU, + TILE_WIRE_JCH1_FF_RX_D_5_DCU, + TILE_WIRE_JCH1_FF_RX_D_6_DCU, + TILE_WIRE_JCH1_FF_RX_D_7_DCU, + TILE_WIRE_JCH1_FF_RX_D_8_DCU, + TILE_WIRE_JCH1_FF_RX_D_9_DCU, + TILE_WIRE_JCH1_FF_RX_D_10_DCU, + TILE_WIRE_JCH1_FF_RX_D_11_DCU, + TILE_WIRE_JCH1_FF_RX_D_12_DCU, + TILE_WIRE_JCH1_FF_RX_D_13_DCU, + TILE_WIRE_JCH1_FF_RX_D_14_DCU, + TILE_WIRE_JCH1_FF_RX_D_15_DCU, + TILE_WIRE_JD_SCAN_OUT_1_DCU, + TILE_WIRE_JCH0_FFS_PCIE_DONE_DCU, + TILE_WIRE_JCH0_FFS_PCIE_CON_DCU, + TILE_WIRE_JD_SCAN_OUT_2_DCU, + TILE_WIRE_JCH0_FFS_TXFBFIFO_ERROR_DCU, + TILE_WIRE_JD_SCAN_OUT_5_DCU, + TILE_WIRE_JCH0_LDR_RX2CORE_DCU, + TILE_WIRE_JCH0_FFS_SKP_ADDED_DCU, + TILE_WIRE_JCH0_FF_TX_H_CLK_DCU, + TILE_WIRE_JCH0_FF_TX_F_CLK_DCU, + TILE_WIRE_JCH0_FFS_SKP_DELETED_DCU, + + TILE_WIRE_G_CLKI_BDCC0, + TILE_WIRE_G_JCE_BDCC0, + TILE_WIRE_G_CLKO_BDCC0, + TILE_WIRE_G_CLKI_BDCC1, + TILE_WIRE_G_JCE_BDCC1, + TILE_WIRE_G_CLKO_BDCC1, + TILE_WIRE_G_CLKI_BDCC2, + TILE_WIRE_G_JCE_BDCC2, + TILE_WIRE_G_CLKO_BDCC2, + TILE_WIRE_G_CLKI_BDCC3, + TILE_WIRE_G_JCE_BDCC3, + TILE_WIRE_G_CLKO_BDCC3, + TILE_WIRE_G_CLKI_BDCC4, + TILE_WIRE_G_JCE_BDCC4, + TILE_WIRE_G_CLKO_BDCC4, + TILE_WIRE_G_CLKI_BDCC5, + TILE_WIRE_G_JCE_BDCC5, + TILE_WIRE_G_CLKO_BDCC5, + TILE_WIRE_G_CLKI_BDCC6, + TILE_WIRE_G_JCE_BDCC6, + TILE_WIRE_G_CLKO_BDCC6, + TILE_WIRE_G_CLKI_BDCC7, + TILE_WIRE_G_JCE_BDCC7, + TILE_WIRE_G_CLKO_BDCC7, + TILE_WIRE_G_CLKI_BDCC8, + TILE_WIRE_G_JCE_BDCC8, + TILE_WIRE_G_CLKO_BDCC8, + TILE_WIRE_G_CLKI_BDCC9, + TILE_WIRE_G_JCE_BDCC9, + TILE_WIRE_G_CLKO_BDCC9, + TILE_WIRE_G_CLKI_BDCC10, + TILE_WIRE_G_JCE_BDCC10, + TILE_WIRE_G_CLKO_BDCC10, + TILE_WIRE_G_CLKI_BDCC11, + TILE_WIRE_G_JCE_BDCC11, + TILE_WIRE_G_CLKO_BDCC11, + TILE_WIRE_G_CLKI_BDCC12, + TILE_WIRE_G_JCE_BDCC12, + TILE_WIRE_G_CLKO_BDCC12, + TILE_WIRE_G_CLKI_BDCC13, + TILE_WIRE_G_JCE_BDCC13, + TILE_WIRE_G_CLKO_BDCC13, + TILE_WIRE_G_CLKI_BDCC14, + TILE_WIRE_G_JCE_BDCC14, + TILE_WIRE_G_CLKO_BDCC14, + TILE_WIRE_G_CLKI_BDCC15, + TILE_WIRE_G_JCE_BDCC15, + TILE_WIRE_G_CLKO_BDCC15, + + + TILE_WIRE_G_CLKI_TDCC0, + TILE_WIRE_G_JCE_TDCC0, + TILE_WIRE_G_CLKO_TDCC0, + TILE_WIRE_G_CLKI_TDCC1, + TILE_WIRE_G_JCE_TDCC1, + TILE_WIRE_G_CLKO_TDCC1, + TILE_WIRE_G_CLKI_TDCC2, + TILE_WIRE_G_JCE_TDCC2, + TILE_WIRE_G_CLKO_TDCC2, + TILE_WIRE_G_CLKI_TDCC3, + TILE_WIRE_G_JCE_TDCC3, + TILE_WIRE_G_CLKO_TDCC3, + TILE_WIRE_G_CLKI_TDCC4, + TILE_WIRE_G_JCE_TDCC4, + TILE_WIRE_G_CLKO_TDCC4, + TILE_WIRE_G_CLKI_TDCC5, + TILE_WIRE_G_JCE_TDCC5, + TILE_WIRE_G_CLKO_TDCC5, + TILE_WIRE_G_CLKI_TDCC6, + TILE_WIRE_G_JCE_TDCC6, + TILE_WIRE_G_CLKO_TDCC6, + TILE_WIRE_G_CLKI_TDCC7, + TILE_WIRE_G_JCE_TDCC7, + TILE_WIRE_G_CLKO_TDCC7, + TILE_WIRE_G_CLKI_TDCC8, + TILE_WIRE_G_JCE_TDCC8, + TILE_WIRE_G_CLKO_TDCC8, + TILE_WIRE_G_CLKI_TDCC9, + TILE_WIRE_G_JCE_TDCC9, + TILE_WIRE_G_CLKO_TDCC9, + TILE_WIRE_G_CLKI_TDCC10, + TILE_WIRE_G_JCE_TDCC10, + TILE_WIRE_G_CLKO_TDCC10, + TILE_WIRE_G_CLKI_TDCC11, + TILE_WIRE_G_JCE_TDCC11, + TILE_WIRE_G_CLKO_TDCC11, + + TILE_WIRE_G_CLKI_RDCC0, + TILE_WIRE_G_JCE_RDCC0, + TILE_WIRE_G_CLKO_RDCC0, + TILE_WIRE_G_CLKI_RDCC1, + TILE_WIRE_G_JCE_RDCC1, + TILE_WIRE_G_CLKO_RDCC1, + TILE_WIRE_G_CLKI_RDCC2, + TILE_WIRE_G_JCE_RDCC2, + TILE_WIRE_G_CLKO_RDCC2, + TILE_WIRE_G_CLKI_RDCC3, + TILE_WIRE_G_JCE_RDCC3, + TILE_WIRE_G_CLKO_RDCC3, + TILE_WIRE_G_CLKI_RDCC4, + TILE_WIRE_G_JCE_RDCC4, + TILE_WIRE_G_CLKO_RDCC4, + TILE_WIRE_G_CLKI_RDCC5, + TILE_WIRE_G_JCE_RDCC5, + TILE_WIRE_G_CLKO_RDCC5, + TILE_WIRE_G_CLKI_RDCC6, + TILE_WIRE_G_JCE_RDCC6, + TILE_WIRE_G_CLKO_RDCC6, + TILE_WIRE_G_CLKI_RDCC7, + TILE_WIRE_G_JCE_RDCC7, + TILE_WIRE_G_CLKO_RDCC7, + TILE_WIRE_G_CLKI_RDCC8, + TILE_WIRE_G_JCE_RDCC8, + TILE_WIRE_G_CLKO_RDCC8, + TILE_WIRE_G_CLKI_RDCC9, + TILE_WIRE_G_JCE_RDCC9, + TILE_WIRE_G_CLKO_RDCC9, + TILE_WIRE_G_CLKI_RDCC10, + TILE_WIRE_G_JCE_RDCC10, + TILE_WIRE_G_CLKO_RDCC10, + TILE_WIRE_G_CLKI_RDCC11, + TILE_WIRE_G_JCE_RDCC11, + TILE_WIRE_G_CLKO_RDCC11, + TILE_WIRE_G_CLKI_RDCC12, + TILE_WIRE_G_JCE_RDCC12, + TILE_WIRE_G_CLKO_RDCC12, + TILE_WIRE_G_CLKI_RDCC13, + TILE_WIRE_G_JCE_RDCC13, + TILE_WIRE_G_CLKO_RDCC13, + + TILE_WIRE_G_CLKI_LDCC0, + TILE_WIRE_G_JCE_LDCC0, + TILE_WIRE_G_CLKO_LDCC0, + TILE_WIRE_G_CLKI_LDCC1, + TILE_WIRE_G_JCE_LDCC1, + TILE_WIRE_G_CLKO_LDCC1, + TILE_WIRE_G_CLKI_LDCC2, + TILE_WIRE_G_JCE_LDCC2, + TILE_WIRE_G_CLKO_LDCC2, + TILE_WIRE_G_CLKI_LDCC3, + TILE_WIRE_G_JCE_LDCC3, + TILE_WIRE_G_CLKO_LDCC3, + TILE_WIRE_G_CLKI_LDCC4, + TILE_WIRE_G_JCE_LDCC4, + TILE_WIRE_G_CLKO_LDCC4, + TILE_WIRE_G_CLKI_LDCC5, + TILE_WIRE_G_JCE_LDCC5, + TILE_WIRE_G_CLKO_LDCC5, + TILE_WIRE_G_CLKI_LDCC6, + TILE_WIRE_G_JCE_LDCC6, + TILE_WIRE_G_CLKO_LDCC6, + TILE_WIRE_G_CLKI_LDCC7, + TILE_WIRE_G_JCE_LDCC7, + TILE_WIRE_G_CLKO_LDCC7, + TILE_WIRE_G_CLKI_LDCC8, + TILE_WIRE_G_JCE_LDCC8, + TILE_WIRE_G_CLKO_LDCC8, + TILE_WIRE_G_CLKI_LDCC9, + TILE_WIRE_G_JCE_LDCC9, + TILE_WIRE_G_CLKO_LDCC9, + TILE_WIRE_G_CLKI_LDCC10, + TILE_WIRE_G_JCE_LDCC10, + TILE_WIRE_G_CLKO_LDCC10, + TILE_WIRE_G_CLKI_LDCC11, + TILE_WIRE_G_JCE_LDCC11, + TILE_WIRE_G_CLKO_LDCC11, + TILE_WIRE_G_CLKI_LDCC12, + TILE_WIRE_G_JCE_LDCC12, + TILE_WIRE_G_CLKO_LDCC12, + TILE_WIRE_G_CLKI_LDCC13, + TILE_WIRE_G_JCE_LDCC13, + TILE_WIRE_G_CLKO_LDCC13 }; -- cgit v1.2.3 From 6d005f38b5e771341c67e00db054c9d5010e2a56 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 13 Dec 2019 19:44:49 +0100 Subject: add more --- ecp5/gfx.cc | 31 +++++++++++++++++++++++++++++-- ecp5/gfx.h | 8 ++++++-- ecp5/trellis_import.py | 9 +++++++++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index e06bcfa6..232b93d9 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -70,8 +70,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.type = GraphicElement::TYPE_LINE; el.style = style; bool top_bottom = (y == 0 || y == (h - 1)); - int gap = 3-(tilewire - TILE_WIRE_PADDOD_PIO)/6; - int num = (tilewire - TILE_WIRE_PADDOD_PIO)%6; + int gap = 3-(tilewire - TILE_WIRE_PADDOD_PIO)/7; + int num = (tilewire - TILE_WIRE_PADDOD_PIO)%7; if (top_bottom) { el.x1 = x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); el.x2 = el.x1; @@ -95,6 +95,33 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } g.push_back(el); } + if (wire_type == id_WIRE_TYPE_DDRDLL) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + int num = (tilewire - TILE_WIRE_DDRDEL_DDRDLL); + el.x1 = x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); + el.x2 = el.x1; + if (y == h - 1) { + el.y1 = y + 0.2; + el.y2 = el.y1 - 0.015f; + } else { + el.y1 = y + 0.8; + el.y2 = el.y1 + 0.015f; + } + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_CCLK) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + int num = (tilewire - TILE_WIRE_JPADDI_CCLK); + el.x1 = x + slice_x1 + 0.0017f * (num + 1); + el.x2 = el.x1; + el.y1 = y + slice_y2 - 1*slice_pitch; + el.y2 = el.y1 - 0.015f; + g.push_back(el); + } if (wire_type == id_WIRE_TYPE_IOLOGIC) { GraphicElement el; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 98846c25..a35cc34d 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -499,7 +499,7 @@ enum GfxTileWireId TILE_WIRE_WRPNTR0D_IOLOGIC, TILE_WIRE_WRPNTR1D_IOLOGIC, TILE_WIRE_WRPNTR2D_IOLOGIC, - TILE_WIRE_DUMMYD1_IOLOGIC, + TILE_WIRE_JSLIPD_IOLOGIC, TILE_WIRE_DUMMYD2_IOLOGIC, TILE_WIRE_DUMMYD3_IOLOGIC, TILE_WIRE_DUMMYD4_IOLOGIC, @@ -585,7 +585,7 @@ enum GfxTileWireId TILE_WIRE_WRPNTR0B_IOLOGIC, TILE_WIRE_WRPNTR1B_IOLOGIC, TILE_WIRE_WRPNTR2B_IOLOGIC, - TILE_WIRE_DUMMYB1_IOLOGIC, + TILE_WIRE_JSLIPB_IOLOGIC, TILE_WIRE_DUMMYB2_IOLOGIC, TILE_WIRE_DUMMYB3_IOLOGIC, TILE_WIRE_DUMMYB4_IOLOGIC, @@ -683,24 +683,28 @@ enum GfxTileWireId TILE_WIRE_IOLDOD_PIO, TILE_WIRE_IOLTOD_PIO, TILE_WIRE_INRDD_PIO, + TILE_WIRE_LVDSD_PIO, TILE_WIRE_PADDOC_PIO, TILE_WIRE_PADDTC_PIO, TILE_WIRE_JPADDIC_PIO, TILE_WIRE_IOLDOC_PIO, TILE_WIRE_IOLTOC_PIO, TILE_WIRE_INRDC_PIO, + TILE_WIRE_LVDSC_PIO, TILE_WIRE_PADDOB_PIO, TILE_WIRE_PADDTB_PIO, TILE_WIRE_JPADDIB_PIO, TILE_WIRE_IOLDOB_PIO, TILE_WIRE_IOLTOB_PIO, TILE_WIRE_INRDB_PIO, + TILE_WIRE_LVDSB_PIO, TILE_WIRE_PADDOA_PIO, TILE_WIRE_PADDTA_PIO, TILE_WIRE_JPADDIA_PIO, TILE_WIRE_IOLDOA_PIO, TILE_WIRE_IOLTOA_PIO, TILE_WIRE_INRDA_PIO, + TILE_WIRE_LVDSA_PIO, TILE_WIRE_JADA0_EBR, TILE_WIRE_JADB0_EBR, diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index 0ae8dde5..fe342263 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -65,6 +65,15 @@ def wire_type(name): if name[0].endswith("_DDRDLL"): return "WIRE_TYPE_DDRDLL" + if name[0].endswith("_CCLK"): + return "WIRE_TYPE_CCLK" + + if name[0].endswith("_EXTREF"): + return "WIRE_TYPE_EXTREF" + + if name[0].endswith("_DCU"): + return "WIRE_TYPE_DCU" + if name[0].endswith("_EBR"): return "WIRE_TYPE_EBR" -- cgit v1.2.3 From 19eb16045f58be18df9abf8d5b939cd6015bb77d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 08:21:02 +0100 Subject: ebr, mult and alu nice display --- ecp5/arch.cc | 2 +- ecp5/gfx.cc | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 0bac0743..97aee1cc 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -711,7 +711,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; el.x1 = x + slice_x1; el.x2 = x + 0.97; - el.y1 = y + slice_y1; + el.y1 = y + slice_y1 - 1 * slice_pitch; el.y2 = y + slice_y2 + 3 * slice_pitch; ret.push_back(el); } else if (bel_type == id_EHXPLLL) { diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 232b93d9..d68ac5fa 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -181,7 +181,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + el.y2 = el.y1; g.push_back(el); } if (wire_type == id_WIRE_TYPE_MULT18) { @@ -191,17 +191,24 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; - el.y2 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + el.y2 = el.y1; g.push_back(el); } if (wire_type == id_WIRE_TYPE_ALU54) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_ALU54 + 1) + 3 * slice_pitch; - el.y2 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_ALU54 + 1) + 3 * slice_pitch; + int num = (tilewire - TILE_WIRE_JCLK0_ALU54) % 225; + int group = (tilewire - TILE_WIRE_JCLK0_ALU54) / 225; + if (group==0) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + } else { + el.x1 = x + 0.97 + 0.005f; + el.x2 = x + 0.97; + } + el.y1 = y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; + el.y2 = el.y1; g.push_back(el); } if (wire_type == id_WIRE_TYPE_V01) { @@ -528,7 +535,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.type = GraphicElement::TYPE_LINE; el.style = style; el.x1 = x + switchbox_x2; - el.x2 = x + slice_x1 - 0.0025f; + el.x2 = x + switchbox_x2 + 0.005f; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; g.push_back(el); -- cgit v1.2.3 From ebbfb6375d8be60962922936fc7b7cd9b72a4796 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 09:18:24 +0100 Subject: more new wires added --- ecp5/arch.cc | 11 +++++- ecp5/constids.inc | 7 ++++ ecp5/gfx.cc | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++ ecp5/gfx.h | 79 ++++++++++++++++++++++++++++++++++++++++- ecp5/trellis_import.py | 24 +++++++++++++ 5 files changed, 214 insertions(+), 2 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 97aee1cc..f198861a 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -723,7 +723,16 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = y + slice_y1; el.y2 = y + slice_y2; ret.push_back(el); - } else if (bel_type == id_DCUA || bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || + } else if (bel_type == id_DCUA) { + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y2; + el.y2 = y + 0.25; + ret.push_back(el); + } else if (bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 37577125..6d017c0c 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1308,6 +1308,13 @@ X(WIRE_TYPE_DDRDLL) X(WIRE_TYPE_CCLK) X(WIRE_TYPE_EXTREF) X(WIRE_TYPE_DCU) +X(WIRE_TYPE_PLL) +X(WIRE_TYPE_SED) +X(WIRE_TYPE_OSC) +X(WIRE_TYPE_JTAG) +X(WIRE_TYPE_GSR) +X(WIRE_TYPE_DTR) +X(WIRE_TYPE_PCSCLKDIV) X(WIRE_TYPE_H00) X(WIRE_TYPE_H01) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index d68ac5fa..9f69cada 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -211,6 +211,101 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y2 = el.y1; g.push_back(el); } + if (wire_type == id_WIRE_TYPE_PLL) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CLKI_PLL + 1); + el.y2 = el.y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_GSR) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCLK_GSR + 1); + el.y2 = el.y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_JTAG) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_OSC) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_SED) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_DTR) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JSTARTPULSE_DTR + 1); + el.y2 = el.y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_EXTREF) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } + + if (wire_type == id_WIRE_TYPE_DCU) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } + + if (wire_type == id_WIRE_TYPE_PCSCLKDIV) { + int num = (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; + int group = 1-(tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_V01) { if (tilewire >= TILE_WIRE_V01N0001 && tilewire <= TILE_WIRE_V01S0100) { GraphicElement el; diff --git a/ecp5/gfx.h b/ecp5/gfx.h index a35cc34d..d3df3ebe 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -2057,8 +2057,85 @@ enum GfxTileWireId TILE_WIRE_G_CLKO_LDCC12, TILE_WIRE_G_CLKI_LDCC13, TILE_WIRE_G_JCE_LDCC13, - TILE_WIRE_G_CLKO_LDCC13 + TILE_WIRE_G_CLKO_LDCC13, + TILE_WIRE_CLKI_PLL, + TILE_WIRE_JRST_PLL, + TILE_WIRE_JLOCK_PLL, + TILE_WIRE_CLKFB_PLL, + TILE_WIRE_CLKINTFB_PLL, + TILE_WIRE_JREFCLK_PLL, + TILE_WIRE_JSTDBY_PLL, + TILE_WIRE_JPHASEDIR_PLL, + TILE_WIRE_JPHASELOADREG_PLL, + TILE_WIRE_JPHASESEL0_PLL, + TILE_WIRE_JPHASESEL1_PLL, + TILE_WIRE_JPHASESTEP_PLL, + TILE_WIRE_JPLLWAKESYNC_PLL, + TILE_WIRE_JENCLKOP_PLL, + TILE_WIRE_JENCLKOS2_PLL, + TILE_WIRE_JENCLKOS3_PLL, + TILE_WIRE_JENCLKOS_PLL, + TILE_WIRE_JINTLOCK_PLL, + TILE_WIRE_JCLKOP_PLL, + TILE_WIRE_JCLKOS_PLL, + TILE_WIRE_JCLKOS2_PLL, + TILE_WIRE_JCLKOS3_PLL, + + TILE_WIRE_SEDSTDBY_SED, + TILE_WIRE_JSEDENABLE_SED, + TILE_WIRE_JSEDSTART_SED, + TILE_WIRE_JSEDFRCERR_SED, + TILE_WIRE_JSEDDONE_SED, + TILE_WIRE_JSEDINPROG_SED, + TILE_WIRE_JSEDERR_SED, + + TILE_WIRE_SEDSTDBY_OSC, + + TILE_WIRE_JJCE1_JTAG, + TILE_WIRE_JJCE2_JTAG, + TILE_WIRE_JTCK_JTAG, + TILE_WIRE_JTMS_JTAG, + TILE_WIRE_JTDI_JTAG, + TILE_WIRE_JJTDO2_JTAG, + TILE_WIRE_JJTDO1_JTAG, + TILE_WIRE_JTDO_JTAG, + TILE_WIRE_JJTDI_JTAG, + TILE_WIRE_JJTCK_JTAG, + TILE_WIRE_JJRTI2_JTAG, + TILE_WIRE_JJRTI1_JTAG, + TILE_WIRE_JJSHIFT_JTAG, + TILE_WIRE_JJUPDATE_JTAG, + TILE_WIRE_JJRSTN_JTAG, + + TILE_WIRE_JCLK_GSR, + TILE_WIRE_JGSR_GSR, + + TILE_WIRE_JSTARTPULSE_DTR, + TILE_WIRE_JDTROUT0_DTR, + TILE_WIRE_JDTROUT1_DTR, + TILE_WIRE_JDTROUT2_DTR, + TILE_WIRE_JDTROUT3_DTR, + TILE_WIRE_JDTROUT4_DTR, + TILE_WIRE_JDTROUT5_DTR, + TILE_WIRE_JDTROUT6_DTR, + TILE_WIRE_JDTROUT7_DTR, + + TILE_WIRE_CLKI_PCSCLKDIV1, + TILE_WIRE_JRST_PCSCLKDIV1, + TILE_WIRE_CDIVX_PCSCLKDIV1, + TILE_WIRE_JSEL0_PCSCLKDIV1, + TILE_WIRE_JSEL1_PCSCLKDIV1, + TILE_WIRE_JSEL2_PCSCLKDIV1, + TILE_WIRE_CDIV1_PCSCLKDIV1, + + TILE_WIRE_CLKI_PCSCLKDIV0, + TILE_WIRE_JRST_PCSCLKDIV0, + TILE_WIRE_CDIVX_PCSCLKDIV0, + TILE_WIRE_JSEL0_PCSCLKDIV0, + TILE_WIRE_JSEL1_PCSCLKDIV0, + TILE_WIRE_JSEL2_PCSCLKDIV0, + TILE_WIRE_CDIV1_PCSCLKDIV0 }; void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index fe342263..259e5da0 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -83,6 +83,30 @@ def wire_type(name): if name[0].endswith("_ALU54"): return "WIRE_TYPE_ALU54" + if name[0].endswith("_PLL"): + return "WIRE_TYPE_PLL" + + if name[0].endswith("_SED"): + return "WIRE_TYPE_SED" + + if name[0].endswith("_OSC"): + return "WIRE_TYPE_OSC" + + if name[0].endswith("_JTAG"): + return "WIRE_TYPE_JTAG" + + if name[0].endswith("_GSR"): + return "WIRE_TYPE_GSR" + + if name[0].endswith("_DTR"): + return "WIRE_TYPE_DTR" + + if name[0].endswith("_PCSCLKDIV0"): + return "WIRE_TYPE_PCSCLKDIV" + + if name[0].endswith("_PCSCLKDIV1"): + return "WIRE_TYPE_PCSCLKDIV" + if name[0].startswith("H00"): return "WIRE_TYPE_H00" -- cgit v1.2.3 From e118e418e565078971d3e88cc0dac1d6c4a60253 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 09:39:41 +0100 Subject: pips for other type of connection box --- ecp5/gfx.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 9f69cada..f0dabb6d 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -827,6 +827,10 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t el.x2 = x + switchbox_x2; el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; } + if (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7) { + el.x2 = x + switchbox_x2; + el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + } } } @@ -1097,25 +1101,33 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_FCO); } + if (src_type == id_WIRE_TYPE_H00 && dst_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { + toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style , dst_id - TILE_WIRE_JCE0); + } if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_FCO); } + if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { + toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id,style, dst_id - TILE_WIRE_JCE0); + } + if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_NONE && - (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_V00 && dst_type == id_WIRE_TYPE_NONE && - (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_NONE && - (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_NONE && - (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { + ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); } } -- cgit v1.2.3 From 601360b73a5358ce8e14ac33394d4d6fcead71e3 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 10:56:26 +0100 Subject: propagate w and h --- ecp5/gfx.cc | 156 +++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 96 insertions(+), 60 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index f0dabb6d..d56624ef 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -716,7 +716,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } } -void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, GfxTileWireId src_id) +void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id) { if (src_type == id_WIRE_TYPE_H00) { int group = (src_id - TILE_WIRE_H00L0000) / 2; @@ -767,9 +767,15 @@ void setSource(GraphicElement &el, int x, int y, WireId src, IdString src_type, el.x1 = x + switchbox_x1; el.y1 = y + switchbox_y1 + 0.0017f * (96 + (src_id - TILE_WIRE_V06N0303) + 10 * (src.location.y % 9)); } + if (src_type == id_WIRE_TYPE_NONE) { + if (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7) { + el.x1 = src.location.x + switchbox_x2 + 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + } + } } -void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_type, GfxTileWireId dst_id) +void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, IdString dst_type, GfxTileWireId dst_id) { if (dst_type == id_WIRE_TYPE_H00) { int group = (dst_id - TILE_WIRE_H00L0000) / 2; @@ -832,22 +838,44 @@ void setDestination(GraphicElement &el, int x, int y, WireId dst, IdString dst_t el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; } } + + if (dst_type == id_WIRE_TYPE_IOLOGIC) { + int gap = 7-(dst_id - TILE_WIRE_JLOADND_IOLOGIC)/42; + int num = (dst_id - TILE_WIRE_JLOADND_IOLOGIC)%42; + if (dst.location.x == 0) { + el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; + } else { + el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + } + el.y2 = dst.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + } + if (dst_type == id_WIRE_TYPE_SIOLOGIC) { + int gap = (dst_id - TILE_WIRE_JLOADNB_SIOLOGIC)/20; + int num = (dst_id - TILE_WIRE_JLOADNB_SIOLOGIC)%20; + el.x2 = dst.location.x + io_cell_h_x1 + (5-gap) * 0.10 + 0.0017f * (num + 1); + if (dst.location.y == h - 1) { + el.y2 = dst.location.y + 1 - io_cell_h_y2 - 0.015f; + } else { + el.y2 = dst.location.y + io_cell_h_y2 + 0.015f; + } + } + } -void straightLine(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, +void straightLine(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id) { - setSource(el, x, y, src, src_type, src_id); - setDestination(el, x, y, dst, dst_type, dst_id); + setSource(el, x, y, w, h, src, src_type, src_id); + setDestination(el, x, y, w, h, dst, dst_type, dst_id); g.push_back(el); } -void toSameSideHor(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, +void toSameSideHor(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { int sign = (src_type == dst_type) ? 1 : -1; - setSource(el, x, y, src, src_type, src_id); + setSource(el, x, y, w, h, src, src_type, src_id); el.x2 = el.x1; el.y2 = y + switchbox_y1 + (switchbox_y2 - switchbox_y1) / 2 + sign * 0.0017f * idx; g.push_back(el); @@ -856,7 +884,7 @@ void toSameSideHor(std::vector &g, GraphicElement &el, int x, in el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2, x, y, dst, dst_type, dst_id); + setDestination(el2, x, y, w, h, dst, dst_type, dst_id); el.x1 = el2.x2; el.y1 = el.y2; @@ -867,12 +895,12 @@ void toSameSideHor(std::vector &g, GraphicElement &el, int x, in g.push_back(el2); } -void toSameSideVer(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, +void toSameSideVer(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { int sign = (src_type == dst_type) ? 1 : -1; - setSource(el, x, y, src, src_type, src_id); + setSource(el, x, y, w, h, src, src_type, src_id); el.x2 = x + switchbox_x1 + (switchbox_x2 - switchbox_x1) / 2 + sign * 0.0017f * idx; el.y2 = el.y1; g.push_back(el); @@ -881,7 +909,7 @@ void toSameSideVer(std::vector &g, GraphicElement &el, int x, in el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2, x, y, dst, dst_type, dst_id); + setDestination(el2, x, y, w, h, dst, dst_type, dst_id); el.x1 = el.x2; el.y1 = el2.y2; @@ -892,11 +920,11 @@ void toSameSideVer(std::vector &g, GraphicElement &el, int x, in g.push_back(el2); } -void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, +void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { - setSource(el, x, y, src, src_type, src_id); + setSource(el, x, y, w, h, src, src_type, src_id); el.x2 = x + switchbox_x1 + (switchbox_x2 - switchbox_x1) / 2 - 0.0017f * idx; el.y2 = el.y1; g.push_back(el); @@ -905,7 +933,7 @@ void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2, x, y, dst, dst_type, dst_id); + setDestination(el2, x, y, w, h, dst, dst_type, dst_id); el.x1 = el.x2; el.y1 = el2.y2; @@ -916,17 +944,17 @@ void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, g.push_back(el2); } -void toSameSideH1Hor(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, +void toSameSideH1Hor(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { - setSource(el, x, y, src, src_type, src_id); + setSource(el, x, y, w, h, src, src_type, src_id); GraphicElement el2; el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2, x, y, dst, dst_type, dst_id); + setDestination(el2, x, y, w, h, dst, dst_type, dst_id); if (dst_type == id_WIRE_TYPE_H01 || src_type == id_WIRE_TYPE_V01 || dst_type == id_WIRE_TYPE_H00) { el.x2 = el.x1; el.y2 = el2.y2; @@ -942,11 +970,11 @@ void toSameSideH1Hor(std::vector &g, GraphicElement &el, int x, g.push_back(el2); } -void toSameSideV1Ver(std::vector &g, GraphicElement &el, int x, int y, WireId src, IdString src_type, +void toSameSideV1Ver(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { - setSource(el, x, y, src, src_type, src_id); + setSource(el, x, y, w, h, src, src_type, src_id); el.x2 = el.x1; el.y2 = y + switchbox_y1 + (switchbox_y2 - switchbox_y1) / 2 - 0.0017f * idx; g.push_back(el); @@ -955,7 +983,7 @@ void toSameSideV1Ver(std::vector &g, GraphicElement &el, int x, el2.type = GraphicElement::TYPE_ARROW; el2.style = style; - setDestination(el2, x, y, dst, dst_type, dst_id); + setDestination(el2, x, y, w, h, dst, dst_type, dst_id); el.x1 = el2.x2; el.y1 = el.y2; @@ -975,160 +1003,168 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire // To H00 if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H00) { - toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H00L0000 + 30); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H00) { // toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H00L0000); - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } // To H01 if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H01) { - toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H01E0001); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H01E0001); } // To H02 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H02) { - toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H02W0701); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) { - toSameSideHor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701); + toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H02) { - toSameSideHor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H06W0303); + toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_H02) { if (y == src.location.y) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } else { - toSameSideV1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + toSameSideV1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H02W0701); } } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_H02) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H02) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } // To H06 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H06) { - toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H06W0303); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) { - toSameSideHor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701); + toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H06) { - toSameSideHor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H06W0303); + toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_H06) { if (y == src.location.y) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } else { - toSameSideV1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + toSameSideV1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H06W0303); } } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_H06) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } // To V00 if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V00) { // toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V00T0000); - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V00) { - toSameSideV1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + toSameSideV1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701 + 20); } // To V01 if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V01) { - toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V01N0001); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V01N0001); } // To V02 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V02) { if (x == src.location.x) { - toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V02N0701); } else { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V02) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V02) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_V02) { - toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V02N0701); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { - toSameSideVer(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V02N0701); + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V02) { - toSameSideVer(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V06N0303); + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V06N0303); } // To V06 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_V06) { if (x == src.location.x) { - toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V06N0303); } else { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_V06) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_V06) { - toSameSideH1Hor(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V06N0303); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V06N0303); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { - toSameSideVer(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V02N0701); + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { - toSameSideVer(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V06N0303); + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V06N0303); } if (src_type == id_WIRE_TYPE_H00 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { - toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_FCO); + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_FCO); } if (src_type == id_WIRE_TYPE_H00 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { - toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style , dst_id - TILE_WIRE_JCE0); + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style , dst_id - TILE_WIRE_JCE0); } if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { - toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_FCO); + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_FCO); } if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { - toSameSideH1Ver(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id,style, dst_id - TILE_WIRE_JCE0); + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id,style, dst_id - TILE_WIRE_JCE0); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_NONE && ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V00 && dst_type == id_WIRE_TYPE_NONE && ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_NONE && ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_NONE && ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { - straightLine(g, el, x, y, src, src_type, src_id, dst, dst_type, dst_id); + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } + if (src_type == id_WIRE_TYPE_NONE && dst_type == id_WIRE_TYPE_IOLOGIC && + ((src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7))) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } + if (src_type == id_WIRE_TYPE_NONE && dst_type == id_WIRE_TYPE_SIOLOGIC && + ((src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7))) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } } -- cgit v1.2.3 From 7e7e20742d551da270adde59639eaf23f695591d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 12:30:04 +0100 Subject: pips for ios --- ecp5/gfx.cc | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- ecp5/gfx.h | 24 ++++++++++++- 2 files changed, 134 insertions(+), 7 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index d56624ef..6e78f7f7 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -625,6 +625,22 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } } } + + if (tilewire >= TILE_WIRE_JDIA && tilewire <= TILE_WIRE_ECLKD) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; + el.x1 = x + 0.5f; + el.x2 = x + 0.5f + 0.005f; + bool top = (y == (h - 1)); + if (top) + el.y1 = y + 1 - (slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); + else + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } + if (tilewire >= TILE_WIRE_JCE0 && tilewire <= TILE_WIRE_JQ7) { GraphicElement el; el.type = GraphicElement::TYPE_LINE; @@ -772,7 +788,55 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr el.x1 = src.location.x + switchbox_x2 + 0.005f; el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; } + if (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD) { + bool top = (src.location.y == (h - 1)); + el.x1 = src.location.x + 0.5f + 0.005f; + if (top) + el.y1 = src.location.y + 1 - (slice_y2 - 0.0017f * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); + else + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; + } } + if (src_type == id_WIRE_TYPE_IOLOGIC) { + int gap = 7-(src_id - TILE_WIRE_JLOADND_IOLOGIC)/42; + int num = (src_id - TILE_WIRE_JLOADND_IOLOGIC)%42; + if (src.location.x == 0) { + el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; + } else { + el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + } + el.y1 = src.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + } + if (src_type == id_WIRE_TYPE_SIOLOGIC) { + int gap = (src_id - TILE_WIRE_JLOADNB_SIOLOGIC)/20; + int num = (src_id - TILE_WIRE_JLOADNB_SIOLOGIC)%20; + el.x1 = src.location.x + io_cell_h_x1 + (5-gap) * 0.10 + 0.0017f * (num + 1); + if (src.location.y == h - 1) { + el.y1 = src.location.y + 1 - io_cell_h_y2 - 0.015f; + } else { + el.y1 = src.location.y + io_cell_h_y2 + 0.015f; + } + } + if (src_type == id_WIRE_TYPE_PIO) { + bool top_bottom = (src.location.y == 0 || src.location.y == (h - 1)); + int gap = 3-(src_id - TILE_WIRE_PADDOD_PIO)/7; + int num = (src_id - TILE_WIRE_PADDOD_PIO)%7; + if (top_bottom) { + el.x1 = src.location.x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); + if (src.location.y == h - 1) { + el.y1 = src.location.y + 1 - io_cell_h_y2 - 0.015f; + } else { + el.y1 = src.location.y + 1 - io_cell_h_y2 + 0.015f; + } + } else { + if (x == 0) { + el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; + } else { + el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + } + el.y1 = src.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + } + } } void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, IdString dst_type, GfxTileWireId dst_id) @@ -834,8 +898,16 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; } if (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7) { - el.x2 = x + switchbox_x2; - el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + el.x2 = dst.location.x + switchbox_x2; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + } + if (dst_id >= TILE_WIRE_JDIA && dst_id <= TILE_WIRE_ECLKD) { + bool top = (dst.location.y == (h - 1)); + el.x2 = dst.location.x + 0.5f; + if (top) + el.y2 = dst.location.y + 1 - (slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); + else + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; } } @@ -859,6 +931,26 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, el.y2 = dst.location.y + io_cell_h_y2 + 0.015f; } } + if (dst_type == id_WIRE_TYPE_PIO) { + bool top_bottom = (dst.location.y == 0 || dst.location.y == (h - 1)); + int gap = 3-(dst_id - TILE_WIRE_PADDOD_PIO)/7; + int num = (dst_id - TILE_WIRE_PADDOD_PIO)%7; + if (top_bottom) { + el.x2 = dst.location.x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); + if (dst.location.y == h - 1) { + el.y2 = dst.location.y + 1 - io_cell_h_y2 - 0.015f; + } else { + el.y2 = dst.location.y + 1 - io_cell_h_y2 + 0.015f; + } + } else { + if (x == 0) { + el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; + } else { + el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + } + el.y2 = dst.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + } + } } @@ -1158,14 +1250,27 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_NONE && dst_type == id_WIRE_TYPE_IOLOGIC && - ((src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7))) { + if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC) && + (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } + if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_PIO) && + (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_NONE && dst_type == id_WIRE_TYPE_SIOLOGIC && - ((src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7))) { + if (dst_type == id_WIRE_TYPE_NONE && (src_type == id_WIRE_TYPE_IOLOGIC || src_type == id_WIRE_TYPE_SIOLOGIC || src_type == id_WIRE_TYPE_PIO) && + (dst_id >= TILE_WIRE_JDIA && dst_id <= TILE_WIRE_ECLKD)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } + if (src_type == id_WIRE_TYPE_NONE && dst_type == id_WIRE_TYPE_NONE && + (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD) && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } + if (dst_type == id_WIRE_TYPE_NONE && src_type == id_WIRE_TYPE_NONE && + (dst_id >= TILE_WIRE_JDIA && dst_id <= TILE_WIRE_ECLKD) && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } + } NEXTPNR_NAMESPACE_END diff --git a/ecp5/gfx.h b/ecp5/gfx.h index d3df3ebe..8af1a31b 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -2135,7 +2135,29 @@ enum GfxTileWireId TILE_WIRE_JSEL0_PCSCLKDIV0, TILE_WIRE_JSEL1_PCSCLKDIV0, TILE_WIRE_JSEL2_PCSCLKDIV0, - TILE_WIRE_CDIV1_PCSCLKDIV0 + TILE_WIRE_CDIV1_PCSCLKDIV0, + + TILE_WIRE_JDIA, + TILE_WIRE_JDIB, + TILE_WIRE_JDIC, + TILE_WIRE_JDID, + TILE_WIRE_JPADDOA, + TILE_WIRE_JPADDOB, + TILE_WIRE_JPADDOC, + TILE_WIRE_JPADDOD, + TILE_WIRE_JPADDTA, + TILE_WIRE_JPADDTB, + TILE_WIRE_JPADDTC, + TILE_WIRE_JPADDTD, + TILE_WIRE_IOLDOA, + TILE_WIRE_IOLDOB, + TILE_WIRE_IOLDOC, + TILE_WIRE_IOLDOD, + TILE_WIRE_ECLKA, + TILE_WIRE_ECLKB, + TILE_WIRE_ECLKC, + TILE_WIRE_ECLKD + }; void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, -- cgit v1.2.3 From d42ecc081e6ce8316098318cc0072767f445e652 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 13:00:09 +0100 Subject: pips for alu, mult and memory --- ecp5/gfx.cc | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 6e78f7f7..cdeebb91 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -836,7 +836,26 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } el.y1 = src.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); } - } + } + if (src_type == id_WIRE_TYPE_EBR) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + } + if (src_type == id_WIRE_TYPE_MULT18) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.00085f * (src_id - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + } + if (src_type == id_WIRE_TYPE_ALU54) { + int num = (src_id - TILE_WIRE_JCLK0_ALU54) % 225; + int group = (src_id - TILE_WIRE_JCLK0_ALU54) / 225; + if (group==0) { + el.x1 = src.location.x + slice_x1 - 0.005f; + } else { + el.x1 = src.location.x + 0.97 + 0.005f; + } + el.y1 = src.location.y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; + } + } void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, IdString dst_type, GfxTileWireId dst_id) @@ -951,7 +970,24 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, el.y2 = dst.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); } } - + if (dst_type == id_WIRE_TYPE_EBR) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + } + if (dst_type == id_WIRE_TYPE_MULT18) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.00085f * (dst_id - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + } + if (dst_type == id_WIRE_TYPE_ALU54) { + int num = (dst_id - TILE_WIRE_JCLK0_ALU54) % 225; + int group = (dst_id - TILE_WIRE_JCLK0_ALU54) / 225; + if (group==0) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + } else { + el.x2 = dst.location.x + 0.97 + 0.005f; + } + el.y2 = dst.location.y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; + } } void straightLine(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, @@ -1250,10 +1286,14 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC) && + if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_EBR || dst_type == id_WIRE_TYPE_MULT18 || dst_type == id_WIRE_TYPE_ALU54) && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } + if (dst_type == id_WIRE_TYPE_NONE && (src_type == id_WIRE_TYPE_IOLOGIC || src_type == id_WIRE_TYPE_SIOLOGIC || src_type == id_WIRE_TYPE_EBR || src_type == id_WIRE_TYPE_MULT18 || src_type == id_WIRE_TYPE_ALU54) && + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_PIO) && (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); -- cgit v1.2.3 From abf9bc3bb9565dab54e8b5a772c2e60c9f1317d1 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 16:10:41 +0100 Subject: fixes and more pips --- ecp5/gfx.cc | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- ecp5/gfx.h | 2 ++ 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index cdeebb91..29c1b31f 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -855,7 +855,44 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } el.y1 = src.location.y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; } - + if (src_type == id_WIRE_TYPE_PLL) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_CLKI_PLL + 1); + } + if (src_type == id_WIRE_TYPE_GSR) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JCLK_GSR + 1); + } + if (src_type == id_WIRE_TYPE_JTAG) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; + } + if (src_type == id_WIRE_TYPE_OSC) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; + } + if (src_type == id_WIRE_TYPE_SED) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; + } + if (src_type == id_WIRE_TYPE_DTR) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JSTARTPULSE_DTR + 1); + } + if (src_type == id_WIRE_TYPE_EXTREF) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; + } + if (src_type == id_WIRE_TYPE_DCU) { + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + } + if (src_type == id_WIRE_TYPE_PCSCLKDIV) { + int num = (src_id - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; + int group = 1-(src_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; + el.x1 = src.location.x + slice_x1 - 0.005f; + el.y1 = src.location.y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; + } } void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, IdString dst_type, GfxTileWireId dst_id) @@ -988,6 +1025,44 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } el.y2 = dst.location.y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; } + if (dst_type == id_WIRE_TYPE_PLL) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_CLKI_PLL + 1); + } + if (dst_type == id_WIRE_TYPE_GSR) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JCLK_GSR + 1); + } + if (dst_type == id_WIRE_TYPE_JTAG) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; + } + if (dst_type == id_WIRE_TYPE_OSC) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; + } + if (dst_type == id_WIRE_TYPE_SED) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; + } + if (dst_type == id_WIRE_TYPE_DTR) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JSTARTPULSE_DTR + 1); + } + if (dst_type == id_WIRE_TYPE_EXTREF) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; + } + if (dst_type == id_WIRE_TYPE_DCU) { + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + } + if (dst_type == id_WIRE_TYPE_PCSCLKDIV) { + int num = (dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; + int group = 1-(dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; + el.x2 = dst.location.x + slice_x1 - 0.005f; + el.y2 = dst.location.y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; + } } void straightLine(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, @@ -1286,6 +1361,20 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } + + if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_PLL || dst_type == id_WIRE_TYPE_GSR || dst_type == id_WIRE_TYPE_JTAG || dst_type == id_WIRE_TYPE_OSC || + dst_type == id_WIRE_TYPE_SED || dst_type == id_WIRE_TYPE_DTR || dst_type == id_WIRE_TYPE_EXTREF || dst_type == id_WIRE_TYPE_DCU || + dst_type == id_WIRE_TYPE_PCSCLKDIV) && + (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } + if (dst_type == id_WIRE_TYPE_NONE && (src_type == id_WIRE_TYPE_PLL || src_type == id_WIRE_TYPE_GSR || src_type == id_WIRE_TYPE_JTAG || src_type == id_WIRE_TYPE_OSC || + src_type == id_WIRE_TYPE_SED || src_type == id_WIRE_TYPE_DTR || src_type == id_WIRE_TYPE_EXTREF || src_type == id_WIRE_TYPE_DCU || + src_type == id_WIRE_TYPE_PCSCLKDIV) && + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } + if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_EBR || dst_type == id_WIRE_TYPE_MULT18 || dst_type == id_WIRE_TYPE_ALU54) && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 8af1a31b..c082532c 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -2084,10 +2084,12 @@ enum GfxTileWireId TILE_WIRE_SEDSTDBY_SED, TILE_WIRE_JSEDENABLE_SED, + TILE_WIRE_JSEDEXCLK_SED, TILE_WIRE_JSEDSTART_SED, TILE_WIRE_JSEDFRCERR_SED, TILE_WIRE_JSEDDONE_SED, TILE_WIRE_JSEDINPROG_SED, + TILE_WIRE_JAUTODONE_SED, TILE_WIRE_JSEDERR_SED, TILE_WIRE_SEDSTDBY_OSC, -- cgit v1.2.3 From cce27e72f0baf70d3d65c4b7ebd8b0b9c4d177f7 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 16:29:25 +0100 Subject: lot more pips --- ecp5/gfx.cc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 29c1b31f..625a7d7b 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -893,6 +893,30 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr el.x1 = src.location.x + slice_x1 - 0.005f; el.y1 = src.location.y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; } + if (src_type == id_WIRE_TYPE_DQS) { + int num = (src_id - TILE_WIRE_DDRDEL_DQS); + if (src.location.x == 0) { + el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; + } else { + el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + } + el.y1 = src.location.y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); + } + if (src_type == id_WIRE_TYPE_DDRDLL) { + int num = (src_id - TILE_WIRE_DDRDEL_DDRDLL); + el.x1 = src.location.x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); + if (src.location.y == h - 1) { + el.y1 = src.location.y + 0.2 - 0.015f; + } else { + el.y1 = src.location.y + 0.8 + 0.015f; + } + } + if (src_type == id_WIRE_TYPE_CCLK) { + int num = (src_id - TILE_WIRE_JPADDI_CCLK); + el.x1 = src.location.x + slice_x1 + 0.0017f * (num + 1); + el.y1 = src.location.y + slice_y2 - 1*slice_pitch - 0.015f; + } + } void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, IdString dst_type, GfxTileWireId dst_id) @@ -1062,7 +1086,30 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, int group = 1-(dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; el.x2 = dst.location.x + slice_x1 - 0.005f; el.y2 = dst.location.y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; - } + } + if (dst_type == id_WIRE_TYPE_DQS) { + int num = (dst_id - TILE_WIRE_DDRDEL_DQS); + if (dst.location.x == 0) { + el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; + } else { + el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + } + el.y2 = dst.location.y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); + } + if (dst_type == id_WIRE_TYPE_DDRDLL) { + int num = (dst_id - TILE_WIRE_DDRDEL_DDRDLL); + el.x2 = dst.location.x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); + if (dst.location.y == h - 1) { + el.y2 = dst.location.y + 0.2 - 0.015f; + } else { + el.y2 = dst.location.y + 0.8 + 0.015f; + } + } + if (dst_type == id_WIRE_TYPE_CCLK) { + int num = (dst_id - TILE_WIRE_JPADDI_CCLK); + el.x2 = dst.location.x + slice_x1 + 0.0017f * (num + 1); + el.y2 = dst.location.y + slice_y2 - 1*slice_pitch - 0.015f; + } } void straightLine(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, @@ -1361,16 +1408,16 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - + if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_PLL || dst_type == id_WIRE_TYPE_GSR || dst_type == id_WIRE_TYPE_JTAG || dst_type == id_WIRE_TYPE_OSC || dst_type == id_WIRE_TYPE_SED || dst_type == id_WIRE_TYPE_DTR || dst_type == id_WIRE_TYPE_EXTREF || dst_type == id_WIRE_TYPE_DCU || - dst_type == id_WIRE_TYPE_PCSCLKDIV) && + dst_type == id_WIRE_TYPE_PCSCLKDIV || dst_type == id_WIRE_TYPE_DDRDLL || dst_type == id_WIRE_TYPE_CCLK || dst_type == id_WIRE_TYPE_DQS) && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (dst_type == id_WIRE_TYPE_NONE && (src_type == id_WIRE_TYPE_PLL || src_type == id_WIRE_TYPE_GSR || src_type == id_WIRE_TYPE_JTAG || src_type == id_WIRE_TYPE_OSC || src_type == id_WIRE_TYPE_SED || src_type == id_WIRE_TYPE_DTR || src_type == id_WIRE_TYPE_EXTREF || src_type == id_WIRE_TYPE_DCU || - src_type == id_WIRE_TYPE_PCSCLKDIV) && + src_type == id_WIRE_TYPE_PCSCLKDIV || src_type == id_WIRE_TYPE_DDRDLL || src_type == id_WIRE_TYPE_CCLK || src_type == id_WIRE_TYPE_DQS) && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } -- cgit v1.2.3 From fb27f1a031f0517158a07694b0495e239072b6ce Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Dec 2019 16:40:27 +0100 Subject: fix formating --- ecp5/arch.cc | 3 +- ecp5/gfx.cc | 244 +++++++++++++++++++++++++++++++++-------------------------- ecp5/gfx.h | 1 - 3 files changed, 138 insertions(+), 110 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index f198861a..a67bc101 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -732,8 +732,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const el.y1 = y + slice_y2; el.y2 = y + 0.25; ret.push_back(el); - } else if (bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || - bel_type == id_USRMCLK) { + } else if (bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 625a7d7b..858ac5fb 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -70,8 +70,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.type = GraphicElement::TYPE_LINE; el.style = style; bool top_bottom = (y == 0 || y == (h - 1)); - int gap = 3-(tilewire - TILE_WIRE_PADDOD_PIO)/7; - int num = (tilewire - TILE_WIRE_PADDOD_PIO)%7; + int gap = 3 - (tilewire - TILE_WIRE_PADDOD_PIO) / 7; + int num = (tilewire - TILE_WIRE_PADDOD_PIO) % 7; if (top_bottom) { el.x1 = x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); el.x2 = el.x1; @@ -87,9 +87,9 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + 1 - io_cell_v_x1; el.x2 = el.x1 + 0.015f; } else { - el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; - } + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); el.y2 = el.y1; } @@ -118,7 +118,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS int num = (tilewire - TILE_WIRE_JPADDI_CCLK); el.x1 = x + slice_x1 + 0.0017f * (num + 1); el.x2 = el.x1; - el.y1 = y + slice_y2 - 1*slice_pitch; + el.y1 = y + slice_y2 - 1 * slice_pitch; el.y2 = el.y1 - 0.015f; g.push_back(el); } @@ -127,15 +127,15 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - int gap = 7-(tilewire - TILE_WIRE_JLOADND_IOLOGIC)/42; - int num = (tilewire - TILE_WIRE_JLOADND_IOLOGIC)%42; + int gap = 7 - (tilewire - TILE_WIRE_JLOADND_IOLOGIC) / 42; + int num = (tilewire - TILE_WIRE_JLOADND_IOLOGIC) % 42; if (x == 0) { el.x1 = x + 1 - io_cell_v_x1; el.x2 = el.x1 + 0.015f; } else { - el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; - } + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); el.y2 = el.y1; g.push_back(el); @@ -144,9 +144,9 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; - int gap = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC)/20; - int num = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC)%20; - el.x1 = x + io_cell_h_x1 + (5-gap) * 0.10 + 0.0017f * (num + 1); + int gap = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; + int num = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; + el.x1 = x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); el.x2 = el.x1; if (y == h - 1) { el.y1 = y + 1 - io_cell_h_y2; @@ -166,13 +166,13 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + 1 - io_cell_v_x1; el.x2 = el.x1 + 0.015f; } else { - el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; - } + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } el.y1 = y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); el.y2 = el.y1; g.push_back(el); - } + } if (wire_type == id_WIRE_TYPE_EBR) { GraphicElement el; @@ -200,7 +200,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.style = style; int num = (tilewire - TILE_WIRE_JCLK0_ALU54) % 225; int group = (tilewire - TILE_WIRE_JCLK0_ALU54) / 225; - if (group==0) { + if (group == 0) { el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; } else { @@ -280,7 +280,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; el.y2 = el.y1; g.push_back(el); - } + } if (wire_type == id_WIRE_TYPE_DCU) { GraphicElement el; @@ -291,11 +291,11 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; el.y2 = el.y1; g.push_back(el); - } + } if (wire_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; - int group = 1-(tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; + int group = 1 - (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; GraphicElement el; el.type = GraphicElement::TYPE_LINE; el.style = style; @@ -798,19 +798,19 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } } if (src_type == id_WIRE_TYPE_IOLOGIC) { - int gap = 7-(src_id - TILE_WIRE_JLOADND_IOLOGIC)/42; - int num = (src_id - TILE_WIRE_JLOADND_IOLOGIC)%42; + int gap = 7 - (src_id - TILE_WIRE_JLOADND_IOLOGIC) / 42; + int num = (src_id - TILE_WIRE_JLOADND_IOLOGIC) % 42; if (src.location.x == 0) { el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; } else { - el.x1 = src.location.x + io_cell_v_x1 - 0.015f; - } + el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + } el.y1 = src.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); } if (src_type == id_WIRE_TYPE_SIOLOGIC) { - int gap = (src_id - TILE_WIRE_JLOADNB_SIOLOGIC)/20; - int num = (src_id - TILE_WIRE_JLOADNB_SIOLOGIC)%20; - el.x1 = src.location.x + io_cell_h_x1 + (5-gap) * 0.10 + 0.0017f * (num + 1); + int gap = (src_id - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; + int num = (src_id - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; + el.x1 = src.location.x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); if (src.location.y == h - 1) { el.y1 = src.location.y + 1 - io_cell_h_y2 - 0.015f; } else { @@ -819,8 +819,8 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } if (src_type == id_WIRE_TYPE_PIO) { bool top_bottom = (src.location.y == 0 || src.location.y == (h - 1)); - int gap = 3-(src_id - TILE_WIRE_PADDOD_PIO)/7; - int num = (src_id - TILE_WIRE_PADDOD_PIO)%7; + int gap = 3 - (src_id - TILE_WIRE_PADDOD_PIO) / 7; + int num = (src_id - TILE_WIRE_PADDOD_PIO) % 7; if (top_bottom) { el.x1 = src.location.x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); if (src.location.y == h - 1) { @@ -832,8 +832,8 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr if (x == 0) { el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; } else { - el.x1 = src.location.x + io_cell_v_x1 - 0.015f; - } + el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + } el.y1 = src.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); } } @@ -848,7 +848,7 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr if (src_type == id_WIRE_TYPE_ALU54) { int num = (src_id - TILE_WIRE_JCLK0_ALU54) % 225; int group = (src_id - TILE_WIRE_JCLK0_ALU54) / 225; - if (group==0) { + if (group == 0) { el.x1 = src.location.x + slice_x1 - 0.005f; } else { el.x1 = src.location.x + 0.97 + 0.005f; @@ -882,14 +882,14 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr if (src_type == id_WIRE_TYPE_EXTREF) { el.x1 = src.location.x + slice_x1 - 0.005f; el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; - } + } if (src_type == id_WIRE_TYPE_DCU) { el.x1 = src.location.x + slice_x1 - 0.005f; el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; - } + } if (src_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (src_id - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; - int group = 1-(src_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; + int group = 1 - (src_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; el.x1 = src.location.x + slice_x1 - 0.005f; el.y1 = src.location.y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; } @@ -898,10 +898,10 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr if (src.location.x == 0) { el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; } else { - el.x1 = src.location.x + io_cell_v_x1 - 0.015f; - } + el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + } el.y1 = src.location.y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); - } + } if (src_type == id_WIRE_TYPE_DDRDLL) { int num = (src_id - TILE_WIRE_DDRDEL_DDRDLL); el.x1 = src.location.x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); @@ -914,9 +914,8 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr if (src_type == id_WIRE_TYPE_CCLK) { int num = (src_id - TILE_WIRE_JPADDI_CCLK); el.x1 = src.location.x + slice_x1 + 0.0017f * (num + 1); - el.y1 = src.location.y + slice_y2 - 1*slice_pitch - 0.015f; + el.y1 = src.location.y + slice_y2 - 1 * slice_pitch - 0.015f; } - } void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, IdString dst_type, GfxTileWireId dst_id) @@ -992,19 +991,19 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } if (dst_type == id_WIRE_TYPE_IOLOGIC) { - int gap = 7-(dst_id - TILE_WIRE_JLOADND_IOLOGIC)/42; - int num = (dst_id - TILE_WIRE_JLOADND_IOLOGIC)%42; + int gap = 7 - (dst_id - TILE_WIRE_JLOADND_IOLOGIC) / 42; + int num = (dst_id - TILE_WIRE_JLOADND_IOLOGIC) % 42; if (dst.location.x == 0) { el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; } else { - el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; - } + el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + } el.y2 = dst.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); } if (dst_type == id_WIRE_TYPE_SIOLOGIC) { - int gap = (dst_id - TILE_WIRE_JLOADNB_SIOLOGIC)/20; - int num = (dst_id - TILE_WIRE_JLOADNB_SIOLOGIC)%20; - el.x2 = dst.location.x + io_cell_h_x1 + (5-gap) * 0.10 + 0.0017f * (num + 1); + int gap = (dst_id - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; + int num = (dst_id - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; + el.x2 = dst.location.x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); if (dst.location.y == h - 1) { el.y2 = dst.location.y + 1 - io_cell_h_y2 - 0.015f; } else { @@ -1013,8 +1012,8 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } if (dst_type == id_WIRE_TYPE_PIO) { bool top_bottom = (dst.location.y == 0 || dst.location.y == (h - 1)); - int gap = 3-(dst_id - TILE_WIRE_PADDOD_PIO)/7; - int num = (dst_id - TILE_WIRE_PADDOD_PIO)%7; + int gap = 3 - (dst_id - TILE_WIRE_PADDOD_PIO) / 7; + int num = (dst_id - TILE_WIRE_PADDOD_PIO) % 7; if (top_bottom) { el.x2 = dst.location.x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); if (dst.location.y == h - 1) { @@ -1026,8 +1025,8 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, if (x == 0) { el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; } else { - el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; - } + el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + } el.y2 = dst.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); } } @@ -1042,7 +1041,7 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, if (dst_type == id_WIRE_TYPE_ALU54) { int num = (dst_id - TILE_WIRE_JCLK0_ALU54) % 225; int group = (dst_id - TILE_WIRE_JCLK0_ALU54) / 225; - if (group==0) { + if (group == 0) { el.x2 = dst.location.x + slice_x1 - 0.005f; } else { el.x2 = dst.location.x + 0.97 + 0.005f; @@ -1076,14 +1075,14 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, if (dst_type == id_WIRE_TYPE_EXTREF) { el.x2 = dst.location.x + slice_x1 - 0.005f; el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; - } + } if (dst_type == id_WIRE_TYPE_DCU) { el.x2 = dst.location.x + slice_x1 - 0.005f; el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; - } + } if (dst_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; - int group = 1-(dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; + int group = 1 - (dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; el.x2 = dst.location.x + slice_x1 - 0.005f; el.y2 = dst.location.y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; } @@ -1092,10 +1091,10 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, if (dst.location.x == 0) { el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; } else { - el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; - } + el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + } el.y2 = dst.location.y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); - } + } if (dst_type == id_WIRE_TYPE_DDRDLL) { int num = (dst_id - TILE_WIRE_DDRDEL_DDRDLL); el.x2 = dst.location.x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); @@ -1108,20 +1107,20 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, if (dst_type == id_WIRE_TYPE_CCLK) { int num = (dst_id - TILE_WIRE_JPADDI_CCLK); el.x2 = dst.location.x + slice_x1 + 0.0017f * (num + 1); - el.y2 = dst.location.y + slice_y2 - 1*slice_pitch - 0.015f; + el.y2 = dst.location.y + slice_y2 - 1 * slice_pitch - 0.015f; } } -void straightLine(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, - GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id) +void straightLine(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, + IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id) { setSource(el, x, y, w, h, src, src_type, src_id); setDestination(el, x, y, w, h, dst, dst_type, dst_id); g.push_back(el); } -void toSameSideHor(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, - GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, +void toSameSideHor(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, + IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { int sign = (src_type == dst_type) ? 1 : -1; @@ -1145,8 +1144,8 @@ void toSameSideHor(std::vector &g, GraphicElement &el, int x, in g.push_back(el2); } -void toSameSideVer(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, - GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, +void toSameSideVer(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, + IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { int sign = (src_type == dst_type) ? 1 : -1; @@ -1170,8 +1169,8 @@ void toSameSideVer(std::vector &g, GraphicElement &el, int x, in g.push_back(el2); } -void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, - GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, +void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, + IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { setSource(el, x, y, w, h, src, src_type, src_id); @@ -1194,8 +1193,8 @@ void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, g.push_back(el2); } -void toSameSideH1Hor(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, - GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, +void toSameSideH1Hor(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, + IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { setSource(el, x, y, w, h, src, src_type, src_id); @@ -1220,8 +1219,8 @@ void toSameSideH1Hor(std::vector &g, GraphicElement &el, int x, g.push_back(el2); } -void toSameSideV1Ver(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, - GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, +void toSameSideV1Ver(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, + IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style, int idx) { setSource(el, x, y, w, h, src, src_type, src_id); @@ -1263,18 +1262,22 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire // To H01 if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H01) { - toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H01E0001); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_H01E0001); } // To H02 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H02) { - toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H02W0701); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H02) { - toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701); + toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H02) { - toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H06W0303); + toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_H02) { if (y == src.location.y) { @@ -1293,13 +1296,16 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire // To H06 if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_H06) { - toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_H06W0303); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H06) { - toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H02W0701); + toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_H02W0701); } if (src_type == id_WIRE_TYPE_H06 && dst_type == id_WIRE_TYPE_H06) { - toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_H06W0303); + toSameSideHor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_H06W0303); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_H06) { if (y == src.location.y) { @@ -1325,7 +1331,8 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire // To V01 if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V01) { - toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V01N0001); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_V01N0001); } // To V02 @@ -1344,13 +1351,16 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_V02) { - toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V02N0701); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V02) { - toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V02N0701); + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V02) { - toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V06N0303); + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_V06N0303); } // To V06 @@ -1366,13 +1376,16 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_V06) { - toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, dst_id - TILE_WIRE_V06N0303); + toSameSideH1Hor(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_V06N0303); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V06) { - toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V02N0701); + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_V02N0701); } if (src_type == id_WIRE_TYPE_V06 && dst_type == id_WIRE_TYPE_V06) { - toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_V06N0303); + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + src_id - TILE_WIRE_V06N0303); } if (src_type == id_WIRE_TYPE_H00 && dst_type == id_WIRE_TYPE_NONE && @@ -1381,7 +1394,8 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire } if (src_type == id_WIRE_TYPE_H00 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { - toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style , dst_id - TILE_WIRE_JCE0); + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_JCE0); } if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI)) { @@ -1389,64 +1403,80 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire } if (src_type == id_WIRE_TYPE_H01 && dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { - toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id,style, dst_id - TILE_WIRE_JCE0); + toSameSideH1Ver(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, + dst_id - TILE_WIRE_JCE0); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_NONE && - ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { + ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V00 && dst_type == id_WIRE_TYPE_NONE && - ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { + ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_NONE && - ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { + ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_NONE && - ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { + ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - - if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_PLL || dst_type == id_WIRE_TYPE_GSR || dst_type == id_WIRE_TYPE_JTAG || dst_type == id_WIRE_TYPE_OSC || - dst_type == id_WIRE_TYPE_SED || dst_type == id_WIRE_TYPE_DTR || dst_type == id_WIRE_TYPE_EXTREF || dst_type == id_WIRE_TYPE_DCU || - dst_type == id_WIRE_TYPE_PCSCLKDIV || dst_type == id_WIRE_TYPE_DDRDLL || dst_type == id_WIRE_TYPE_CCLK || dst_type == id_WIRE_TYPE_DQS) && + + if (src_type == id_WIRE_TYPE_NONE && + (dst_type == id_WIRE_TYPE_PLL || dst_type == id_WIRE_TYPE_GSR || dst_type == id_WIRE_TYPE_JTAG || + dst_type == id_WIRE_TYPE_OSC || dst_type == id_WIRE_TYPE_SED || dst_type == id_WIRE_TYPE_DTR || + dst_type == id_WIRE_TYPE_EXTREF || dst_type == id_WIRE_TYPE_DCU || dst_type == id_WIRE_TYPE_PCSCLKDIV || + dst_type == id_WIRE_TYPE_DDRDLL || dst_type == id_WIRE_TYPE_CCLK || dst_type == id_WIRE_TYPE_DQS) && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (dst_type == id_WIRE_TYPE_NONE && (src_type == id_WIRE_TYPE_PLL || src_type == id_WIRE_TYPE_GSR || src_type == id_WIRE_TYPE_JTAG || src_type == id_WIRE_TYPE_OSC || - src_type == id_WIRE_TYPE_SED || src_type == id_WIRE_TYPE_DTR || src_type == id_WIRE_TYPE_EXTREF || src_type == id_WIRE_TYPE_DCU || - src_type == id_WIRE_TYPE_PCSCLKDIV || src_type == id_WIRE_TYPE_DDRDLL || src_type == id_WIRE_TYPE_CCLK || src_type == id_WIRE_TYPE_DQS) && + if (dst_type == id_WIRE_TYPE_NONE && + (src_type == id_WIRE_TYPE_PLL || src_type == id_WIRE_TYPE_GSR || src_type == id_WIRE_TYPE_JTAG || + src_type == id_WIRE_TYPE_OSC || src_type == id_WIRE_TYPE_SED || src_type == id_WIRE_TYPE_DTR || + src_type == id_WIRE_TYPE_EXTREF || src_type == id_WIRE_TYPE_DCU || src_type == id_WIRE_TYPE_PCSCLKDIV || + src_type == id_WIRE_TYPE_DDRDLL || src_type == id_WIRE_TYPE_CCLK || src_type == id_WIRE_TYPE_DQS) && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_EBR || dst_type == id_WIRE_TYPE_MULT18 || dst_type == id_WIRE_TYPE_ALU54) && + if (src_type == id_WIRE_TYPE_NONE && + (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_EBR || + dst_type == id_WIRE_TYPE_MULT18 || dst_type == id_WIRE_TYPE_ALU54) && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (dst_type == id_WIRE_TYPE_NONE && (src_type == id_WIRE_TYPE_IOLOGIC || src_type == id_WIRE_TYPE_SIOLOGIC || src_type == id_WIRE_TYPE_EBR || src_type == id_WIRE_TYPE_MULT18 || src_type == id_WIRE_TYPE_ALU54) && + if (dst_type == id_WIRE_TYPE_NONE && + (src_type == id_WIRE_TYPE_IOLOGIC || src_type == id_WIRE_TYPE_SIOLOGIC || src_type == id_WIRE_TYPE_EBR || + src_type == id_WIRE_TYPE_MULT18 || src_type == id_WIRE_TYPE_ALU54) && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_PIO) && + if (src_type == id_WIRE_TYPE_NONE && + (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_PIO) && (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (dst_type == id_WIRE_TYPE_NONE && (src_type == id_WIRE_TYPE_IOLOGIC || src_type == id_WIRE_TYPE_SIOLOGIC || src_type == id_WIRE_TYPE_PIO) && + if (dst_type == id_WIRE_TYPE_NONE && + (src_type == id_WIRE_TYPE_IOLOGIC || src_type == id_WIRE_TYPE_SIOLOGIC || src_type == id_WIRE_TYPE_PIO) && (dst_id >= TILE_WIRE_JDIA && dst_id <= TILE_WIRE_ECLKD)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_NONE && dst_type == id_WIRE_TYPE_NONE && - (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD) && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { + (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD) && + (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (dst_type == id_WIRE_TYPE_NONE && src_type == id_WIRE_TYPE_NONE && - (dst_id >= TILE_WIRE_JDIA && dst_id <= TILE_WIRE_ECLKD) && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { + (dst_id >= TILE_WIRE_JDIA && dst_id <= TILE_WIRE_ECLKD) && + (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - } NEXTPNR_NAMESPACE_END diff --git a/ecp5/gfx.h b/ecp5/gfx.h index c082532c..90bb16a0 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -1935,7 +1935,6 @@ enum GfxTileWireId TILE_WIRE_G_JCE_BDCC15, TILE_WIRE_G_CLKO_BDCC15, - TILE_WIRE_G_CLKI_TDCC0, TILE_WIRE_G_JCE_TDCC0, TILE_WIRE_G_CLKO_TDCC0, -- cgit v1.2.3 From 436260e47ee89879193fb42614b76ac5a5880f3b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Dec 2019 09:21:58 +0100 Subject: move bel creation to gfx.cc --- ecp5/arch.cc | 124 +---------------------------------------------------------- ecp5/gfx.cc | 97 ++++++++++++++++++++++++++++++++++++++++++++++ ecp5/gfx.h | 2 + 3 files changed, 101 insertions(+), 122 deletions(-) diff --git a/ecp5/arch.cc b/ecp5/arch.cc index a67bc101..e678d3b3 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -625,9 +625,7 @@ std::vector Arch::getDecalGraphics(DecalId decal) const int x = decal.location.x; int y = decal.location.y; GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - GfxTileWireId tilewire = GfxTileWireId(locInfo(wire)->wire_data[wire.index].tile_wire); - gfxTileWire(ret, x, y, chip_info->width, chip_info->height, wire_type, tilewire, style); } else if (decal.type == DecalId::TYPE_PIP) { PipId pip; @@ -650,126 +648,8 @@ std::vector Arch::getDecalGraphics(DecalId decal) const int x = decal.location.x; int y = decal.location.y; int z = locInfo(bel)->bel_data[bel.index].z; - - if (bel_type == id_TRELLIS_SLICE) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x1; - el.x2 = x + slice_x2; - el.y1 = y + slice_y1 + (z)*slice_pitch; - el.y2 = y + slice_y2 + (z)*slice_pitch; - ret.push_back(el); - - el.style = GraphicElement::STYLE_FRAME; - 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 + z * 26) + - 3 * slice_pitch - 0.0007f; - el.y2 = el.y1 + 0.0017f * 5; - ret.push_back(el); - } else if (bel_type == id_TRELLIS_IO || bel_type == id_IOLOGIC || bel_type == id_SIOLOGIC || - bel_type == id_DQSBUFM) { - bool top_bottom = (y == 0 || y == (chip_info->height - 1)); - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - if (top_bottom) { - el.x1 = x + io_cell_h_x1 + (z + 2) * 0.10; - el.x2 = x + io_cell_h_x1 + (z + 2) * 0.10 + 0.08f; - if (y == chip_info->height - 1) { - el.y1 = y + 1 - io_cell_h_y1; - el.y2 = y + 1 - io_cell_h_y2; - } else { - el.y1 = y + io_cell_h_y1; - el.y2 = y + io_cell_h_y2; - } - } else { - if (x == 0) { - el.x1 = x + 1 - io_cell_v_x1; - el.x2 = x + 1 - io_cell_v_x2; - } else { - el.x1 = x + io_cell_v_x1; - el.x2 = x + io_cell_v_x2; - } - el.y1 = y + io_cell_v_y1 + z * 0.10; - el.y2 = y + io_cell_v_y1 + z * 0.10 + 0.08f; - } - ret.push_back(el); - } else if (bel_type == id_DCCA) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + switchbox_x1 + (z)*0.025; - el.y1 = y + 0.14; - el.x2 = x + switchbox_x1 + (z)*0.025 + 0.020; - el.y2 = y + 0.18; - ret.push_back(el); - } else if (bel_type == id_DP16KD || bel_type == id_MULT18X18D || bel_type == id_ALU54B) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x1; - el.x2 = x + 0.97; - el.y1 = y + slice_y1 - 1 * slice_pitch; - el.y2 = y + slice_y2 + 3 * slice_pitch; - ret.push_back(el); - } else if (bel_type == id_EHXPLLL) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x1; - el.x2 = x + 0.97; - el.y1 = y + slice_y1; - el.y2 = y + slice_y2; - ret.push_back(el); - } else if (bel_type == id_DCUA) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x1; - el.x2 = x + 0.97; - el.y1 = y + slice_y2; - el.y2 = y + 0.25; - ret.push_back(el); - } else if (bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x1; - el.x2 = x + 0.97; - el.y1 = y + slice_y1 + (z)*slice_pitch; - el.y2 = y + slice_y2 + (z)*slice_pitch; - ret.push_back(el); - } else if (bel_type == id_SEDGA || bel_type == id_GSR || bel_type == id_JTAGG || bel_type == id_OSCG) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + slice_x1; - el.x2 = x + 0.97; - el.y1 = y + slice_y1 + (z)*slice_pitch; - el.y2 = y + slice_y2 + (z)*slice_pitch; - ret.push_back(el); - } else if (bel_type == id_DDRDLL) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + 0.2; - el.x2 = x + 0.8; - el.y1 = y + 0.2; - el.y2 = y + 0.8; - ret.push_back(el); - } else if (bel_type == id_DLLDELD || bel_type == id_CLKDIVF || bel_type == id_ECLKSYNCB || - bel_type == id_TRELLIS_ECLKBUF || bel_type == id_ECLKBRIDGECS) { - GraphicElement el; - el.type = GraphicElement::TYPE_BOX; - el.style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; - el.x1 = x + 0.1 + z * 0.05; - el.x2 = x + 0.14 + z * 0.05; - el.y1 = y + 0.475; - el.y2 = y + 0.525; - ret.push_back(el); - } + GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_INACTIVE; + gfxTileBel(ret, x, y, z, chip_info->width, chip_info->height, bel_type, style); } return ret; diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 858ac5fb..6245bd24 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -22,6 +22,103 @@ NEXTPNR_NAMESPACE_BEGIN +void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, + GraphicElement::style_t style) +{ + GraphicElement el; + el.type = GraphicElement::TYPE_BOX; + el.style = style; + if (bel_type == id_TRELLIS_SLICE) { + el.x1 = x + slice_x1; + el.x2 = x + slice_x2; + el.y1 = y + slice_y1 + (z)*slice_pitch; + el.y2 = y + slice_y2 + (z)*slice_pitch; + g.push_back(el); + + el.style = GraphicElement::STYLE_FRAME; + 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 + z * 26) + + 3 * slice_pitch - 0.0007f; + el.y2 = el.y1 + 0.0017f * 5; + g.push_back(el); + } else if (bel_type == id_TRELLIS_IO || bel_type == id_IOLOGIC || bel_type == id_SIOLOGIC || + bel_type == id_DQSBUFM) { + bool top_bottom = (y == 0 || y == (h - 1)); + if (top_bottom) { + el.x1 = x + io_cell_h_x1 + (z + 2) * 0.10; + el.x2 = x + io_cell_h_x1 + (z + 2) * 0.10 + 0.08f; + if (y == h - 1) { + el.y1 = y + 1 - io_cell_h_y1; + el.y2 = y + 1 - io_cell_h_y2; + } else { + el.y1 = y + io_cell_h_y1; + el.y2 = y + io_cell_h_y2; + } + } else { + if (x == 0) { + el.x1 = x + 1 - io_cell_v_x1; + el.x2 = x + 1 - io_cell_v_x2; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = x + io_cell_v_x2; + } + el.y1 = y + io_cell_v_y1 + z * 0.10; + el.y2 = y + io_cell_v_y1 + z * 0.10 + 0.08f; + } + g.push_back(el); + } else if (bel_type == id_DCCA) { + el.x1 = x + switchbox_x1 + (z)*0.025; + el.y1 = y + 0.14; + el.x2 = x + switchbox_x1 + (z)*0.025 + 0.020; + el.y2 = y + 0.18; + g.push_back(el); + } else if (bel_type == id_DP16KD || bel_type == id_MULT18X18D || bel_type == id_ALU54B) { + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y1 - 1 * slice_pitch; + el.y2 = y + slice_y2 + 3 * slice_pitch; + g.push_back(el); + } else if (bel_type == id_EHXPLLL) { + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y1; + el.y2 = y + slice_y2; + g.push_back(el); + } else if (bel_type == id_DCUA) { + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y2; + el.y2 = y + 0.25; + g.push_back(el); + } else if (bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK) { + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y1 + (z)*slice_pitch; + el.y2 = y + slice_y2 + (z)*slice_pitch; + g.push_back(el); + } else if (bel_type == id_SEDGA || bel_type == id_GSR || bel_type == id_JTAGG || bel_type == id_OSCG) { + el.x1 = x + slice_x1; + el.x2 = x + 0.97; + el.y1 = y + slice_y1 + (z)*slice_pitch; + el.y2 = y + slice_y2 + (z)*slice_pitch; + g.push_back(el); + } else if (bel_type == id_DDRDLL) { + el.x1 = x + 0.2; + el.x2 = x + 0.8; + el.y1 = y + 0.2; + el.y2 = y + 0.8; + g.push_back(el); + } else if (bel_type == id_DLLDELD || bel_type == id_CLKDIVF || bel_type == id_ECLKSYNCB || + bel_type == id_TRELLIS_ECLKBUF || bel_type == id_ECLKBRIDGECS) { + el.x1 = x + 0.1 + z * 0.05; + el.x2 = x + 0.14 + z * 0.05; + el.y1 = y + 0.475; + el.y2 = y + 0.525; + g.push_back(el); + } +} + void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style) { diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 90bb16a0..210ba56d 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -2161,6 +2161,8 @@ enum GfxTileWireId }; +void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, + GraphicElement::style_t style); void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, -- cgit v1.2.3 From fa55a826b240d2e5cd6cbfe412cb1f9d5ee82e3e Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Dec 2019 09:26:25 +0100 Subject: cleanup wire --- ecp5/gfx.cc | 113 ++---------------------------------------------------------- 1 file changed, 3 insertions(+), 110 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 6245bd24..32b4945d 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -122,10 +122,10 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style) { + GraphicElement el; + el.type = GraphicElement::TYPE_LINE; + el.style = style; if (wire_type == id_WIRE_TYPE_SLICE && tilewire != GfxTileWireId::TILE_WIRE_NONE) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; 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; @@ -163,9 +163,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } } if (wire_type == id_WIRE_TYPE_PIO) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; bool top_bottom = (y == 0 || y == (h - 1)); int gap = 3 - (tilewire - TILE_WIRE_PADDOD_PIO) / 7; int num = (tilewire - TILE_WIRE_PADDOD_PIO) % 7; @@ -193,9 +190,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_DDRDLL) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; int num = (tilewire - TILE_WIRE_DDRDEL_DDRDLL); el.x1 = x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); el.x2 = el.x1; @@ -209,9 +203,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_CCLK) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; int num = (tilewire - TILE_WIRE_JPADDI_CCLK); el.x1 = x + slice_x1 + 0.0017f * (num + 1); el.x2 = el.x1; @@ -221,9 +212,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_IOLOGIC) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; int gap = 7 - (tilewire - TILE_WIRE_JLOADND_IOLOGIC) / 42; int num = (tilewire - TILE_WIRE_JLOADND_IOLOGIC) % 42; if (x == 0) { @@ -238,9 +226,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_SIOLOGIC) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; int gap = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; int num = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; el.x1 = x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); @@ -255,9 +240,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_DQS) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; int num = (tilewire - TILE_WIRE_DDRDEL_DQS); if (x == 0) { el.x1 = x + 1 - io_cell_v_x1; @@ -272,9 +254,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_EBR) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; @@ -282,9 +261,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_MULT18) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; @@ -292,9 +268,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_ALU54) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; int num = (tilewire - TILE_WIRE_JCLK0_ALU54) % 225; int group = (tilewire - TILE_WIRE_JCLK0_ALU54) / 225; if (group == 0) { @@ -309,9 +282,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_PLL) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CLKI_PLL + 1); @@ -319,9 +289,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_GSR) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCLK_GSR + 1); @@ -329,9 +296,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_JTAG) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; @@ -339,9 +303,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_OSC) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; @@ -349,9 +310,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_SED) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; @@ -359,9 +317,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_DTR) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JSTARTPULSE_DTR + 1); @@ -369,33 +324,22 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_EXTREF) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; el.y2 = el.y1; g.push_back(el); } - if (wire_type == id_WIRE_TYPE_DCU) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; el.y2 = el.y1; g.push_back(el); } - if (wire_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; int group = 1 - (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; el.y1 = y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; @@ -405,9 +349,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (wire_type == id_WIRE_TYPE_V01) { if (tilewire >= TILE_WIRE_V01N0001 && tilewire <= TILE_WIRE_V01S0100) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + switchbox_x2 - 0.0017f * 16 + 0.0017f * (tilewire - TILE_WIRE_V01N0001); el.x2 = el.x1; if (y == h - 2) @@ -425,9 +366,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_H01) { if (tilewire >= TILE_WIRE_H01E0001 && tilewire <= TILE_WIRE_HL7W0001) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; if (x == w - 1) el.x1 = x + 0.1; else @@ -443,9 +381,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_V00) { int group = (tilewire - TILE_WIRE_V00T0000) / 2; - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + switchbox_x2 - 0.0017f * (8 - ((tilewire - TILE_WIRE_V00T0000) % 2) * 4); el.x2 = el.x1; if (group) { @@ -459,9 +394,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_H00) { int group = (tilewire - TILE_WIRE_H00L0000) / 2; - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.y1 = y + switchbox_y1 + 0.0017f * (8 - ((tilewire - TILE_WIRE_H00L0000) % 2) * 4); el.y2 = el.y1; @@ -476,9 +408,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_H02) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; if (x == 0) el.x1 = 0.9; else @@ -522,9 +451,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_V02) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; if (y == 0) el.y1 = 0.9; else @@ -568,9 +494,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_H06) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; if (x == 0) el.x1 = 0.9; else @@ -613,9 +536,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (wire_type == id_WIRE_TYPE_V06) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; if (y == 0) el.y1 = 0.9; else @@ -659,9 +579,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (wire_type == id_WIRE_TYPE_NONE) { if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <= TILE_WIRE_SBOUNCE) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + switchbox_x2 - 0.0017f * 4; el.x2 = x + switchbox_x2 - 0.0017f * 8; if (tilewire == TILE_WIRE_NBOUNCE) { @@ -674,9 +591,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <= TILE_WIRE_EBOUNCE) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.y1 = y + switchbox_y1 + 0.0017f * 4; el.y2 = y + switchbox_y1 + 0.0017f * 8; if (tilewire == TILE_WIRE_WBOUNCE) { @@ -689,9 +603,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (tilewire >= TILE_WIRE_CLK0 && tilewire <= TILE_WIRE_LSR1) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + switchbox_x2; 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; @@ -724,9 +635,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (tilewire >= TILE_WIRE_JDIA && tilewire <= TILE_WIRE_ECLKD) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + 0.5f; el.x2 = x + 0.5f + 0.005f; bool top = (y == (h - 1)); @@ -739,9 +647,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (tilewire >= TILE_WIRE_JCE0 && tilewire <= TILE_WIRE_JQ7) { - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + switchbox_x2; el.x2 = x + switchbox_x2 + 0.005f; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; @@ -751,9 +656,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (tilewire >= TILE_WIRE_FCO && tilewire <= TILE_WIRE_FCI) { int gap = (tilewire - TILE_WIRE_FCO) / 24; - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; el.x1 = x + switchbox_x2; el.x2 = x + slice_x1 - 0.005f; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; @@ -764,9 +666,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <= TILE_WIRE_MUXLSR0) { int gap = (tilewire - TILE_WIRE_MUXCLK3) / 2; int part = (tilewire - TILE_WIRE_MUXCLK3) % 2; - GraphicElement el; - el.type = GraphicElement::TYPE_LINE; - el.style = style; 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) + @@ -776,11 +675,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (tilewire >= TILE_WIRE_WD3 && tilewire <= TILE_WIRE_WD0) { - GraphicElement el; int part = (tilewire - TILE_WIRE_WD3) % 4; int group = (tilewire - TILE_WIRE_WD3) / 2; - el.type = GraphicElement::TYPE_LINE; - el.style = style; 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_D2 + 1 + part + 14) + @@ -798,10 +694,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } if (tilewire >= TILE_WIRE_WAD3 && tilewire <= TILE_WIRE_WAD0) { - GraphicElement el; int part = (tilewire - TILE_WIRE_WAD3) % 4; - el.type = GraphicElement::TYPE_LINE; - el.style = style; 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_D2 + 1 + part + 14) + -- cgit v1.2.3 From 3d42097e9d5ba0d2811a70718c5e9e3a357f8c50 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Dec 2019 09:45:09 +0100 Subject: cleanup --- ecp5/gfx.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 32b4945d..9afca7d6 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -38,7 +38,7 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int el.style = GraphicElement::STYLE_FRAME; 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 + z * 26) + + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 5 + (3-z) * 26) + 3 * slice_pitch - 0.0007f; el.y2 = el.y1 + 0.0017f * 5; g.push_back(el); @@ -91,13 +91,8 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int el.y1 = y + slice_y2; el.y2 = y + 0.25; g.push_back(el); - } else if (bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK) { - el.x1 = x + slice_x1; - el.x2 = x + 0.97; - el.y1 = y + slice_y1 + (z)*slice_pitch; - el.y2 = y + slice_y2 + (z)*slice_pitch; - g.push_back(el); - } else if (bel_type == id_SEDGA || bel_type == id_GSR || bel_type == id_JTAGG || bel_type == id_OSCG) { + } else if (bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK || + bel_type == id_SEDGA || bel_type == id_GSR || bel_type == id_JTAGG || bel_type == id_OSCG) { el.x1 = x + slice_x1; el.x2 = x + 0.97; el.y1 = y + slice_y1 + (z)*slice_pitch; @@ -132,7 +127,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + slice_x1 - 0.005f; el.x2 = x + slice_x1; 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; + el.y2 = el.y1; g.push_back(el); // FX to F connection - top if (item == (TILE_WIRE_FXD_SLICE - TILE_WIRE_FCO_SLICE)) { @@ -158,7 +153,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS 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; + el.y2 = el.y1; g.push_back(el); } } @@ -650,7 +645,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + switchbox_x2; el.x2 = x + switchbox_x2 + 0.005f; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; - el.y2 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + el.y2 = el.y1; g.push_back(el); } @@ -659,7 +654,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + switchbox_x2; el.x2 = x + slice_x1 - 0.005f; 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; + el.y2 = el.y1; g.push_back(el); } -- cgit v1.2.3 From bbc05f31133a335af39476bed917e0318a1cffcd Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Dec 2019 10:07:55 +0100 Subject: optimize and add some missing pips --- ecp5/gfx.cc | 45 +++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 9afca7d6..706648d6 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -769,6 +769,11 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr el.y1 = y + switchbox_y1 + 0.0017f * (96 + (src_id - TILE_WIRE_V06N0303) + 10 * (src.location.y % 9)); } if (src_type == id_WIRE_TYPE_NONE) { + if (src_id >= TILE_WIRE_FCO && src_id <= TILE_WIRE_FCI) { + int gap = (src_id - TILE_WIRE_FCO) / 24; + el.x1 = src.location.x + switchbox_x2; + el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; + } if (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7) { el.x1 = src.location.x + switchbox_x2 + 0.005f; el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; @@ -1392,24 +1397,16 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire dst_id - TILE_WIRE_JCE0); } - if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_NONE && - ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || - (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { - straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); - } - if (src_type == id_WIRE_TYPE_V00 && dst_type == id_WIRE_TYPE_NONE && - ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || - (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { - straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); - } - if (src_type == id_WIRE_TYPE_V01 && dst_type == id_WIRE_TYPE_NONE && + if ((src_type == id_WIRE_TYPE_H02 || src_type == id_WIRE_TYPE_V00 || src_type == id_WIRE_TYPE_V01 || src_type == id_WIRE_TYPE_V02) + && dst_type == id_WIRE_TYPE_NONE && ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_NONE && - ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || - (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { + if ((dst_type == id_WIRE_TYPE_H02 || dst_type == id_WIRE_TYPE_V00 || dst_type == id_WIRE_TYPE_V01 || dst_type == id_WIRE_TYPE_V02) + && src_type == id_WIRE_TYPE_NONE && + ((src_id >= TILE_WIRE_FCO && src_id <= TILE_WIRE_FCI) || + (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } @@ -1417,7 +1414,9 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire (dst_type == id_WIRE_TYPE_PLL || dst_type == id_WIRE_TYPE_GSR || dst_type == id_WIRE_TYPE_JTAG || dst_type == id_WIRE_TYPE_OSC || dst_type == id_WIRE_TYPE_SED || dst_type == id_WIRE_TYPE_DTR || dst_type == id_WIRE_TYPE_EXTREF || dst_type == id_WIRE_TYPE_DCU || dst_type == id_WIRE_TYPE_PCSCLKDIV || - dst_type == id_WIRE_TYPE_DDRDLL || dst_type == id_WIRE_TYPE_CCLK || dst_type == id_WIRE_TYPE_DQS) && + dst_type == id_WIRE_TYPE_DDRDLL || dst_type == id_WIRE_TYPE_CCLK || dst_type == id_WIRE_TYPE_DQS || + dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_EBR || + dst_type == id_WIRE_TYPE_MULT18 || dst_type == id_WIRE_TYPE_ALU54) && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } @@ -1425,23 +1424,13 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire (src_type == id_WIRE_TYPE_PLL || src_type == id_WIRE_TYPE_GSR || src_type == id_WIRE_TYPE_JTAG || src_type == id_WIRE_TYPE_OSC || src_type == id_WIRE_TYPE_SED || src_type == id_WIRE_TYPE_DTR || src_type == id_WIRE_TYPE_EXTREF || src_type == id_WIRE_TYPE_DCU || src_type == id_WIRE_TYPE_PCSCLKDIV || - src_type == id_WIRE_TYPE_DDRDLL || src_type == id_WIRE_TYPE_CCLK || src_type == id_WIRE_TYPE_DQS) && - (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { - straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); - } - - if (src_type == id_WIRE_TYPE_NONE && - (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_EBR || - dst_type == id_WIRE_TYPE_MULT18 || dst_type == id_WIRE_TYPE_ALU54) && - (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { - straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); - } - if (dst_type == id_WIRE_TYPE_NONE && - (src_type == id_WIRE_TYPE_IOLOGIC || src_type == id_WIRE_TYPE_SIOLOGIC || src_type == id_WIRE_TYPE_EBR || + src_type == id_WIRE_TYPE_DDRDLL || src_type == id_WIRE_TYPE_CCLK || src_type == id_WIRE_TYPE_DQS || + src_type == id_WIRE_TYPE_IOLOGIC || src_type == id_WIRE_TYPE_SIOLOGIC || src_type == id_WIRE_TYPE_EBR || src_type == id_WIRE_TYPE_MULT18 || src_type == id_WIRE_TYPE_ALU54) && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } + if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_IOLOGIC || dst_type == id_WIRE_TYPE_SIOLOGIC || dst_type == id_WIRE_TYPE_PIO) && (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD)) { -- cgit v1.2.3 From 2872b500e3c4a7c627483a1a83b7c0698b2df8cc Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Dec 2019 10:33:12 +0100 Subject: make it more simetric --- ecp5/gfx.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 706648d6..5f2aead4 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -344,7 +344,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (wire_type == id_WIRE_TYPE_V01) { if (tilewire >= TILE_WIRE_V01N0001 && tilewire <= TILE_WIRE_V01S0100) { - el.x1 = x + switchbox_x2 - 0.0017f * 16 + 0.0017f * (tilewire - TILE_WIRE_V01N0001); + el.x1 = x + switchbox_x1 + 0.0017f * (10 + tilewire - TILE_WIRE_V01N0001); el.x2 = el.x1; if (y == h - 2) el.y1 = y + 1.1; @@ -369,7 +369,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x2 = x - 0.1; else el.x2 = x + switchbox_x2 - 1; - el.y1 = y + switchbox_y1 + 0.0017f * 16 - 0.0017f * (tilewire - TILE_WIRE_H01E0001); + el.y1 = y + switchbox_y1 + 0.0017f * (10 + tilewire - TILE_WIRE_H01E0001); el.y2 = el.y1; g.push_back(el); } @@ -406,7 +406,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (x == 0) el.x1 = 0.9; else - el.x1 = x + switchbox_x1 + 0.0017f * (16 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.x1 = x + switchbox_x1 + 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.x2 = el.x1; el.y1 = y + switchbox_y1; el.y2 = y + switchbox_y1 - 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); @@ -416,7 +416,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (x == w - 2) el.x2 = x + 1 + 0.1; else - el.x2 = x + 1 + switchbox_x1 + 0.0017f * (16 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.x2 = x + 1 + switchbox_x1 + 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.y1 = el.y2; if (x != w - 1) g.push_back(el); @@ -429,11 +429,11 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (x == w - 1) el.x1 = x + 0.1; else - el.x1 = x + switchbox_x1 + 0.0017f * (16 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.x1 = x + switchbox_x1 + 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); if (x == 1) el.x2 = x - 1 + 0.9; else - el.x2 = x - 1 + switchbox_x1 + 0.0017f * (16 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.x2 = x - 1 + switchbox_x1 + 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.y2 = y + switchbox_y1 - 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.y1 = el.y2; if (x != 0) @@ -628,7 +628,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } } } - + + // TRELLIS_IO wires if (tilewire >= TILE_WIRE_JDIA && tilewire <= TILE_WIRE_ECLKD) { el.x1 = x + 0.5f; el.x2 = x + 0.5f + 0.005f; @@ -734,10 +735,10 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr el.x1 = x + switchbox_x1; else el.x1 = x + switchbox_x2; - el.y1 = y + switchbox_y1 + 0.0017f * 16 - 0.0017f * (src_id - TILE_WIRE_H01E0001); + el.y1 = y + switchbox_y1 + 0.0017f * (10 + src_id - TILE_WIRE_H01E0001); } if (src_type == id_WIRE_TYPE_H02) { - el.x1 = x + switchbox_x1 + 0.0017f * (16 + (src_id - TILE_WIRE_H02W0701) + 20 * (src.location.x % 3)); + el.x1 = x + switchbox_x1 + 0.0017f * (20 + (src_id - TILE_WIRE_H02W0701) + 20 * (src.location.x % 3)); el.y1 = y + switchbox_y1; } if (src_type == id_WIRE_TYPE_H06) { @@ -754,7 +755,7 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } } if (src_type == id_WIRE_TYPE_V01) { - el.x1 = x + switchbox_x2 - 0.0017f * 16 + 0.0017f * (src_id - TILE_WIRE_V01N0001); + el.x1 = x + switchbox_x1 + 0.0017f * (10 + src_id - TILE_WIRE_V01N0001); if (y == src.location.y) el.y1 = y + switchbox_y2; else @@ -925,10 +926,10 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, el.x2 = x + switchbox_x1; else el.x2 = x + switchbox_x2; - el.y2 = y + switchbox_y1 + 0.0017f * 16 - 0.0017f * (dst_id - TILE_WIRE_H01E0001); + el.y2 = y + switchbox_y1 + 0.0017f * (10 + dst_id - TILE_WIRE_H01E0001); } if (dst_type == id_WIRE_TYPE_H02) { - el.x2 = x + switchbox_x1 + 0.0017f * (16 + (dst_id - TILE_WIRE_H02W0701) + 20 * (dst.location.x % 3)); + el.x2 = x + switchbox_x1 + 0.0017f * (20 + (dst_id - TILE_WIRE_H02W0701) + 20 * (dst.location.x % 3)); el.y2 = y + switchbox_y1; } if (dst_type == id_WIRE_TYPE_H06) { @@ -945,7 +946,7 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } } if (dst_type == id_WIRE_TYPE_V01) { - el.x2 = x + switchbox_x2 - 0.0017f * 16 + 0.0017f * (dst_id - TILE_WIRE_V01N0001); + el.x2 = x + switchbox_x1 + 0.0017f * (10 + dst_id - TILE_WIRE_V01N0001); if (y == dst.location.y) el.y2 = y + switchbox_y2; else -- cgit v1.2.3 From f2b8e347a99b1aac348e4c12a4b0ddeb25118a21 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Dec 2019 10:43:30 +0100 Subject: cleanup and formating --- ecp5/gfx.cc | 24 ++++++++++++------------ ecp5/gfx.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 5f2aead4..68a3ff7d 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -23,7 +23,7 @@ NEXTPNR_NAMESPACE_BEGIN void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, - GraphicElement::style_t style) + GraphicElement::style_t style) { GraphicElement el; el.type = GraphicElement::TYPE_BOX; @@ -34,16 +34,16 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int el.y1 = y + slice_y1 + (z)*slice_pitch; el.y2 = y + slice_y2 + (z)*slice_pitch; g.push_back(el); - + el.style = GraphicElement::STYLE_FRAME; 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 + (3-z) * 26) + + el.y1 = y + slice_y2 - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 5 + (3 - z) * 26) + 3 * slice_pitch - 0.0007f; el.y2 = el.y1 + 0.0017f * 5; g.push_back(el); } else if (bel_type == id_TRELLIS_IO || bel_type == id_IOLOGIC || bel_type == id_SIOLOGIC || - bel_type == id_DQSBUFM) { + bel_type == id_DQSBUFM) { bool top_bottom = (y == 0 || y == (h - 1)); if (top_bottom) { el.x1 = x + io_cell_h_x1 + (z + 2) * 0.10; @@ -105,7 +105,7 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int el.y2 = y + 0.8; g.push_back(el); } else if (bel_type == id_DLLDELD || bel_type == id_CLKDIVF || bel_type == id_ECLKSYNCB || - bel_type == id_TRELLIS_ECLKBUF || bel_type == id_ECLKBRIDGECS) { + bel_type == id_TRELLIS_ECLKBUF || bel_type == id_ECLKBRIDGECS) { el.x1 = x + 0.1 + z * 0.05; el.x2 = x + 0.14 + z * 0.05; el.y1 = y + 0.475; @@ -628,7 +628,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } } } - + // TRELLIS_IO wires if (tilewire >= TILE_WIRE_JDIA && tilewire <= TILE_WIRE_ECLKD) { el.x1 = x + 0.5f; @@ -1247,7 +1247,6 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire dst_id - TILE_WIRE_H00L0000 + 30); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_H00) { - // toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_H00L0000); straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } @@ -1312,7 +1311,6 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire // To V00 if (src_type == id_WIRE_TYPE_V02 && dst_type == id_WIRE_TYPE_V00) { - // toSameSideH1Hor(g,el,x,y,src,src_type,src_id,dst,dst_type,dst_id,style, dst_id - TILE_WIRE_V00T0000); straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } if (src_type == id_WIRE_TYPE_H02 && dst_type == id_WIRE_TYPE_V00) { @@ -1398,14 +1396,16 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire dst_id - TILE_WIRE_JCE0); } - if ((src_type == id_WIRE_TYPE_H02 || src_type == id_WIRE_TYPE_V00 || src_type == id_WIRE_TYPE_V01 || src_type == id_WIRE_TYPE_V02) - && dst_type == id_WIRE_TYPE_NONE && + if ((src_type == id_WIRE_TYPE_H02 || src_type == id_WIRE_TYPE_V00 || src_type == id_WIRE_TYPE_V01 || + src_type == id_WIRE_TYPE_V02) && + dst_type == id_WIRE_TYPE_NONE && ((dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) || (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } - if ((dst_type == id_WIRE_TYPE_H02 || dst_type == id_WIRE_TYPE_V00 || dst_type == id_WIRE_TYPE_V01 || dst_type == id_WIRE_TYPE_V02) - && src_type == id_WIRE_TYPE_NONE && + if ((dst_type == id_WIRE_TYPE_H02 || dst_type == id_WIRE_TYPE_V00 || dst_type == id_WIRE_TYPE_V01 || + dst_type == id_WIRE_TYPE_V02) && + src_type == id_WIRE_TYPE_NONE && ((src_id >= TILE_WIRE_FCO && src_id <= TILE_WIRE_FCI) || (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7))) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 210ba56d..e1e0918a 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -2162,7 +2162,7 @@ enum GfxTileWireId }; void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, - GraphicElement::style_t style); + GraphicElement::style_t style); void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style); void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, -- cgit v1.2.3 From d5174110fa49a18be8507a0edf246ada3de41627 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Dec 2019 10:57:24 +0100 Subject: more pips on connection box --- ecp5/gfx.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 68a3ff7d..1560bdf5 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -1411,6 +1411,15 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } + if (dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) && + src_type == id_WIRE_TYPE_NONE && (src_id >= TILE_WIRE_FCO && src_id <= TILE_WIRE_FCI)) { + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_FCO); + } + if (dst_type == id_WIRE_TYPE_NONE && (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JCE0) && + src_type == id_WIRE_TYPE_NONE && (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JCE0)) { + toSameSideVer(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id, style, src_id - TILE_WIRE_JCE0); + } + if (src_type == id_WIRE_TYPE_NONE && (dst_type == id_WIRE_TYPE_PLL || dst_type == id_WIRE_TYPE_GSR || dst_type == id_WIRE_TYPE_JTAG || dst_type == id_WIRE_TYPE_OSC || dst_type == id_WIRE_TYPE_SED || dst_type == id_WIRE_TYPE_DTR || -- cgit v1.2.3 From b271e5947273656a3fb0d3b173f6dbce856fbb52 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 15 Dec 2019 17:20:48 +0100 Subject: Add global wires --- ecp5/constids.inc | 5 ++- ecp5/gfx.cc | 58 ++++++++++++++++++++++++++++++++++ ecp5/gfx.h | 85 +++++++++++++++++++++++++++++++++++++++----------- ecp5/trellis_import.py | 9 ++++++ 4 files changed, 138 insertions(+), 19 deletions(-) diff --git a/ecp5/constids.inc b/ecp5/constids.inc index 6d017c0c..ce813778 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1325,4 +1325,7 @@ X(WIRE_TYPE_V01) X(WIRE_TYPE_V02) X(WIRE_TYPE_V06) -X(WIRE_TYPE_G_HPBX) \ No newline at end of file +X(WIRE_TYPE_G_HPBX) +X(WIRE_TYPE_G_VPTX) +X(WIRE_TYPE_L_HPBX) +X(WIRE_TYPE_R_HPBX) \ No newline at end of file diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 1560bdf5..ea1a5a10 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -716,6 +716,39 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } } + if (wire_type == id_WIRE_TYPE_G_HPBX) { + el.x1 = x; + el.x2 = x + 1; + el.y1 = y + 0.1f + 0.0017f * (tilewire - TILE_WIRE_G_HPBX0000 + 1); + el.y2 = el.y1; + g.push_back(el); + + el.x1 = x + switchbox_x1 + 0.0017f * (200 + (tilewire - TILE_WIRE_G_HPBX0000)); + el.x2 = el.x1; + el.y2 = y + switchbox_y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_G_VPTX) { + el.x1 = x + 0.1f + 0.0017f * (tilewire - TILE_WIRE_G_VPTX0000 + 1); + el.x2 = el.x1; + el.y1 = y; + el.y2 = y + 1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_L_HPBX) { + el.x1 = x - 3; + el.x2 = x + 0.08f; + el.y1 = y + 0.0017f + 0.0017f * (tilewire - TILE_WIRE_L_HPBX0000 + 1); + el.y2 = el.y1; + g.push_back(el); + } + if (wire_type == id_WIRE_TYPE_R_HPBX) { + el.x1 = x + 0.2; + el.x2 = x + 3; + el.y1 = y + 0.0017f + 0.0017f * (tilewire - TILE_WIRE_R_HPBX0000 + 1); + el.y2 = el.y1; + g.push_back(el); + } } void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id) @@ -770,6 +803,10 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr el.y1 = y + switchbox_y1 + 0.0017f * (96 + (src_id - TILE_WIRE_V06N0303) + 10 * (src.location.y % 9)); } if (src_type == id_WIRE_TYPE_NONE) { + if (src_id >= TILE_WIRE_CLK0 && src_id <= TILE_WIRE_LSR1) { + el.x1 = x + switchbox_x2; + el.y1 = y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch; + } if (src_id >= TILE_WIRE_FCO && src_id <= TILE_WIRE_FCI) { int gap = (src_id - TILE_WIRE_FCO) / 24; el.x1 = src.location.x + switchbox_x2; @@ -907,6 +944,10 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr el.x1 = src.location.x + slice_x1 + 0.0017f * (num + 1); el.y1 = src.location.y + slice_y2 - 1 * slice_pitch - 0.015f; } + if (src_type == id_WIRE_TYPE_G_HPBX) { + el.x1 = x + switchbox_x1 + 0.0017f * (200 + (src_id - TILE_WIRE_G_HPBX0000)); + el.y1 = y + switchbox_y1; + } } void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, IdString dst_type, GfxTileWireId dst_id) @@ -962,6 +1003,10 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } if (dst_type == id_WIRE_TYPE_NONE) { + if (dst_id >= TILE_WIRE_CLK0 && dst_id <= TILE_WIRE_LSR1) { + el.x2 = x + switchbox_x2; + el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch; + } if (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) { int gap = (dst_id - TILE_WIRE_FCO) / 24; el.x2 = x + switchbox_x2; @@ -1100,6 +1145,10 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, el.x2 = dst.location.x + slice_x1 + 0.0017f * (num + 1); el.y2 = dst.location.y + slice_y2 - 1 * slice_pitch - 0.015f; } + if (dst_type == id_WIRE_TYPE_G_HPBX) { + el.x2 = x + switchbox_x1 + 0.0017f * (200 + (dst_id - TILE_WIRE_G_HPBX0000)); + el.y2 = y + switchbox_y1; + } } void straightLine(std::vector &g, GraphicElement &el, int x, int y, int w, int h, WireId src, @@ -1461,6 +1510,15 @@ void gfxTilePip(std::vector &g, int x, int y, int w, int h, Wire (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7)) { straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); } + + if (dst_type == id_WIRE_TYPE_NONE && src_type == id_WIRE_TYPE_G_HPBX && + ((dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7) || + (dst_id >= TILE_WIRE_CLK0 && dst_id <= TILE_WIRE_FCI))) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } + if ((dst_type == id_WIRE_TYPE_H01 || dst_type == id_WIRE_TYPE_V01) && src_type == id_WIRE_TYPE_G_HPBX) { + straightLine(g, el, x, y, w, h, src, src_type, src_id, dst, dst_type, dst_id); + } } NEXTPNR_NAMESPACE_END diff --git a/ecp5/gfx.h b/ecp5/gfx.h index e1e0918a..6044a459 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -408,23 +408,6 @@ enum GfxTileWireId TILE_WIRE_H06W0003, TILE_WIRE_H06E0003, - TILE_WIRE_G_HPBX0000, - TILE_WIRE_G_HPBX0100, - TILE_WIRE_G_HPBX0200, - TILE_WIRE_G_HPBX0300, - TILE_WIRE_G_HPBX0400, - TILE_WIRE_G_HPBX0500, - TILE_WIRE_G_HPBX0600, - TILE_WIRE_G_HPBX0700, - TILE_WIRE_G_HPBX0800, - TILE_WIRE_G_HPBX0900, - TILE_WIRE_G_HPBX1000, - TILE_WIRE_G_HPBX1100, - TILE_WIRE_G_HPBX1200, - TILE_WIRE_G_HPBX1300, - TILE_WIRE_G_HPBX1400, - TILE_WIRE_G_HPBX1500, - TILE_WIRE_DDRDEL_DQS, TILE_WIRE_JRST_DQS, TILE_WIRE_ECLK_DQS, @@ -2157,8 +2140,74 @@ enum GfxTileWireId TILE_WIRE_ECLKA, TILE_WIRE_ECLKB, TILE_WIRE_ECLKC, - TILE_WIRE_ECLKD + TILE_WIRE_ECLKD, + + TILE_WIRE_G_VPTX0000, + TILE_WIRE_G_VPTX0100, + TILE_WIRE_G_VPTX0200, + TILE_WIRE_G_VPTX0300, + TILE_WIRE_G_VPTX0400, + TILE_WIRE_G_VPTX0500, + TILE_WIRE_G_VPTX0600, + TILE_WIRE_G_VPTX0700, + TILE_WIRE_G_VPTX0800, + TILE_WIRE_G_VPTX0900, + TILE_WIRE_G_VPTX1000, + TILE_WIRE_G_VPTX1100, + TILE_WIRE_G_VPTX1200, + TILE_WIRE_G_VPTX1300, + TILE_WIRE_G_VPTX1400, + TILE_WIRE_G_VPTX1500, + + TILE_WIRE_G_HPBX0000, + TILE_WIRE_G_HPBX0100, + TILE_WIRE_G_HPBX0200, + TILE_WIRE_G_HPBX0300, + TILE_WIRE_G_HPBX0400, + TILE_WIRE_G_HPBX0500, + TILE_WIRE_G_HPBX0600, + TILE_WIRE_G_HPBX0700, + TILE_WIRE_G_HPBX0800, + TILE_WIRE_G_HPBX0900, + TILE_WIRE_G_HPBX1000, + TILE_WIRE_G_HPBX1100, + TILE_WIRE_G_HPBX1200, + TILE_WIRE_G_HPBX1300, + TILE_WIRE_G_HPBX1400, + TILE_WIRE_G_HPBX1500, + TILE_WIRE_L_HPBX0000, + TILE_WIRE_L_HPBX0100, + TILE_WIRE_L_HPBX0200, + TILE_WIRE_L_HPBX0300, + TILE_WIRE_L_HPBX0400, + TILE_WIRE_L_HPBX0500, + TILE_WIRE_L_HPBX0600, + TILE_WIRE_L_HPBX0700, + TILE_WIRE_L_HPBX0800, + TILE_WIRE_L_HPBX0900, + TILE_WIRE_L_HPBX1000, + TILE_WIRE_L_HPBX1100, + TILE_WIRE_L_HPBX1200, + TILE_WIRE_L_HPBX1300, + TILE_WIRE_L_HPBX1400, + TILE_WIRE_L_HPBX1500, + TILE_WIRE_R_HPBX0000, + TILE_WIRE_R_HPBX0100, + TILE_WIRE_R_HPBX0200, + TILE_WIRE_R_HPBX0300, + TILE_WIRE_R_HPBX0400, + TILE_WIRE_R_HPBX0500, + TILE_WIRE_R_HPBX0600, + TILE_WIRE_R_HPBX0700, + TILE_WIRE_R_HPBX0800, + TILE_WIRE_R_HPBX0900, + TILE_WIRE_R_HPBX1000, + TILE_WIRE_R_HPBX1100, + TILE_WIRE_R_HPBX1200, + TILE_WIRE_R_HPBX1300, + TILE_WIRE_R_HPBX1400, + TILE_WIRE_R_HPBX1500 }; void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, diff --git a/ecp5/trellis_import.py b/ecp5/trellis_import.py index 259e5da0..9f8a9482 100755 --- a/ecp5/trellis_import.py +++ b/ecp5/trellis_import.py @@ -140,6 +140,15 @@ def wire_type(name): if name[0].startswith("G_HPBX"): return "WIRE_TYPE_G_HPBX" + if name[0].startswith("G_VPTX"): + return "WIRE_TYPE_G_VPTX" + + if name[0].startswith("L_HPBX"): + return "WIRE_TYPE_L_HPBX" + + if name[0].startswith("R_HPBX"): + return "WIRE_TYPE_R_HPBX" + return "WIRE_TYPE_NONE" def is_global(loc): -- cgit v1.2.3 From e4210e7fd31981270c488d64e884a461e039c7d3 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 20 Dec 2019 09:05:58 +0100 Subject: Add all missing wires --- ecp5/gfx.h | 1557 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1556 insertions(+), 1 deletion(-) diff --git a/ecp5/gfx.h b/ecp5/gfx.h index 6044a459..cc01ad9b 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -2207,7 +2207,1562 @@ enum GfxTileWireId TILE_WIRE_R_HPBX1200, TILE_WIRE_R_HPBX1300, TILE_WIRE_R_HPBX1400, - TILE_WIRE_R_HPBX1500 + TILE_WIRE_R_HPBX1500, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TILE_WIRE_JA0_CIBTEST, + TILE_WIRE_JA1_CIBTEST, + TILE_WIRE_JA2_CIBTEST, + TILE_WIRE_JA3_CIBTEST, + TILE_WIRE_JA4_CIBTEST, + TILE_WIRE_JA5_CIBTEST, + TILE_WIRE_JA6_CIBTEST, + TILE_WIRE_JA7_CIBTEST, + TILE_WIRE_JB0_CIBTEST, + TILE_WIRE_JB1_CIBTEST, + TILE_WIRE_JB2_CIBTEST, + TILE_WIRE_JB3_CIBTEST, + TILE_WIRE_JB4_CIBTEST, + TILE_WIRE_JB5_CIBTEST, + TILE_WIRE_JB6_CIBTEST, + TILE_WIRE_JB7_CIBTEST, + TILE_WIRE_JC0_CIBTEST, + TILE_WIRE_JC1_CIBTEST, + TILE_WIRE_JC2_CIBTEST, + TILE_WIRE_JC3_CIBTEST, + TILE_WIRE_JC4_CIBTEST, + TILE_WIRE_JC5_CIBTEST, + TILE_WIRE_JC6_CIBTEST, + TILE_WIRE_JC7_CIBTEST, + TILE_WIRE_JCE0_CIBTEST, + TILE_WIRE_JCE1_CIBTEST, + TILE_WIRE_JCE2_CIBTEST, + TILE_WIRE_JCE3_CIBTEST, + TILE_WIRE_JCLK0_CIBTEST, + TILE_WIRE_JCLK1_CIBTEST, + TILE_WIRE_JD0_CIBTEST, + TILE_WIRE_JD1_CIBTEST, + TILE_WIRE_JD2_CIBTEST, + TILE_WIRE_JD3_CIBTEST, + TILE_WIRE_JD4_CIBTEST, + TILE_WIRE_JD5_CIBTEST, + TILE_WIRE_JD6_CIBTEST, + TILE_WIRE_JD7_CIBTEST, + TILE_WIRE_JF0_CIBTEST, + TILE_WIRE_JF1_CIBTEST, + TILE_WIRE_JF2_CIBTEST, + TILE_WIRE_JF3_CIBTEST, + TILE_WIRE_JF4_CIBTEST, + TILE_WIRE_JF5_CIBTEST, + TILE_WIRE_JF6_CIBTEST, + TILE_WIRE_JF7_CIBTEST, + TILE_WIRE_JLSR0_CIBTEST, + TILE_WIRE_JLSR1_CIBTEST, + TILE_WIRE_JM0_CIBTEST, + TILE_WIRE_JM1_CIBTEST, + TILE_WIRE_JM2_CIBTEST, + TILE_WIRE_JM3_CIBTEST, + TILE_WIRE_JM4_CIBTEST, + TILE_WIRE_JM5_CIBTEST, + TILE_WIRE_JM6_CIBTEST, + TILE_WIRE_JM7_CIBTEST, + TILE_WIRE_JQ0_CIBTEST, + TILE_WIRE_JQ1_CIBTEST, + TILE_WIRE_JQ2_CIBTEST, + TILE_WIRE_JQ3_CIBTEST, + TILE_WIRE_JQ4_CIBTEST, + TILE_WIRE_JQ5_CIBTEST, + TILE_WIRE_JQ6_CIBTEST, + TILE_WIRE_JQ7_CIBTEST, + + + TILE_WIRE_JA0_MULT9, + TILE_WIRE_JA1_MULT9, + TILE_WIRE_JA2_MULT9, + TILE_WIRE_JA3_MULT9, + TILE_WIRE_JA4_MULT9, + TILE_WIRE_JA5_MULT9, + TILE_WIRE_JA6_MULT9, + TILE_WIRE_JA7_MULT9, + TILE_WIRE_JA8_MULT9, + TILE_WIRE_JB0_MULT9, + TILE_WIRE_JB1_MULT9, + TILE_WIRE_JB2_MULT9, + TILE_WIRE_JB3_MULT9, + TILE_WIRE_JB4_MULT9, + TILE_WIRE_JB5_MULT9, + TILE_WIRE_JB6_MULT9, + TILE_WIRE_JB7_MULT9, + TILE_WIRE_JB8_MULT9, + TILE_WIRE_JC0_MULT9, + TILE_WIRE_JC1_MULT9, + TILE_WIRE_JC2_MULT9, + TILE_WIRE_JC3_MULT9, + TILE_WIRE_JC4_MULT9, + TILE_WIRE_JC5_MULT9, + TILE_WIRE_JC6_MULT9, + TILE_WIRE_JC7_MULT9, + TILE_WIRE_JC8_MULT9, + TILE_WIRE_JCE0_MULT9, + TILE_WIRE_JCE1_MULT9, + TILE_WIRE_JCE2_MULT9, + TILE_WIRE_JCE3_MULT9, + TILE_WIRE_JCLK0_MULT9, + TILE_WIRE_JCLK1_MULT9, + TILE_WIRE_JCLK2_MULT9, + TILE_WIRE_JCLK3_MULT9, + TILE_WIRE_JP0_MULT9, + TILE_WIRE_JP1_MULT9, + TILE_WIRE_JP2_MULT9, + TILE_WIRE_JP3_MULT9, + TILE_WIRE_JP4_MULT9, + TILE_WIRE_JP5_MULT9, + TILE_WIRE_JP6_MULT9, + TILE_WIRE_JP7_MULT9, + TILE_WIRE_JP8_MULT9, + TILE_WIRE_JP9_MULT9, + TILE_WIRE_JP10_MULT9, + TILE_WIRE_JP11_MULT9, + TILE_WIRE_JP12_MULT9, + TILE_WIRE_JP13_MULT9, + TILE_WIRE_JP14_MULT9, + TILE_WIRE_JP15_MULT9, + TILE_WIRE_JP16_MULT9, + TILE_WIRE_JP17_MULT9, + TILE_WIRE_JROA0_MULT9, + TILE_WIRE_JROA1_MULT9, + TILE_WIRE_JROA2_MULT9, + TILE_WIRE_JROA3_MULT9, + TILE_WIRE_JROA4_MULT9, + TILE_WIRE_JROA5_MULT9, + TILE_WIRE_JROA6_MULT9, + TILE_WIRE_JROA7_MULT9, + TILE_WIRE_JROA8_MULT9, + TILE_WIRE_JROB0_MULT9, + TILE_WIRE_JROB1_MULT9, + TILE_WIRE_JROB2_MULT9, + TILE_WIRE_JROB3_MULT9, + TILE_WIRE_JROB4_MULT9, + TILE_WIRE_JROB5_MULT9, + TILE_WIRE_JROB6_MULT9, + TILE_WIRE_JROB7_MULT9, + TILE_WIRE_JROB8_MULT9, + TILE_WIRE_JROC0_MULT9, + TILE_WIRE_JROC1_MULT9, + TILE_WIRE_JROC2_MULT9, + TILE_WIRE_JROC3_MULT9, + TILE_WIRE_JROC4_MULT9, + TILE_WIRE_JROC5_MULT9, + TILE_WIRE_JROC6_MULT9, + TILE_WIRE_JROC7_MULT9, + TILE_WIRE_JROC8_MULT9, + TILE_WIRE_JRST0_MULT9, + TILE_WIRE_JRST1_MULT9, + TILE_WIRE_JRST2_MULT9, + TILE_WIRE_JRST3_MULT9, + TILE_WIRE_JSIGNEDA_MULT9, + TILE_WIRE_JSIGNEDB_MULT9, + TILE_WIRE_JSIGNEDP_MULT9, + TILE_WIRE_JSOURCEA_MULT9, + TILE_WIRE_JSOURCEB_MULT9, + TILE_WIRE_JSRIA0_MULT9, + TILE_WIRE_JSRIA1_MULT9, + TILE_WIRE_JSRIA2_MULT9, + TILE_WIRE_JSRIA3_MULT9, + TILE_WIRE_JSRIA4_MULT9, + TILE_WIRE_JSRIA5_MULT9, + TILE_WIRE_JSRIA6_MULT9, + TILE_WIRE_JSRIA7_MULT9, + TILE_WIRE_JSRIA8_MULT9, + TILE_WIRE_JSRIB0_MULT9, + TILE_WIRE_JSRIB1_MULT9, + TILE_WIRE_JSRIB2_MULT9, + TILE_WIRE_JSRIB3_MULT9, + TILE_WIRE_JSRIB4_MULT9, + TILE_WIRE_JSRIB5_MULT9, + TILE_WIRE_JSRIB6_MULT9, + TILE_WIRE_JSRIB7_MULT9, + TILE_WIRE_JSRIB8_MULT9, + TILE_WIRE_JSROA0_MULT9, + TILE_WIRE_JSROA1_MULT9, + TILE_WIRE_JSROA2_MULT9, + TILE_WIRE_JSROA3_MULT9, + TILE_WIRE_JSROA4_MULT9, + TILE_WIRE_JSROA5_MULT9, + TILE_WIRE_JSROA6_MULT9, + TILE_WIRE_JSROA7_MULT9, + TILE_WIRE_JSROA8_MULT9, + TILE_WIRE_JSROB0_MULT9, + TILE_WIRE_JSROB1_MULT9, + TILE_WIRE_JSROB2_MULT9, + TILE_WIRE_JSROB3_MULT9, + TILE_WIRE_JSROB4_MULT9, + TILE_WIRE_JSROB5_MULT9, + TILE_WIRE_JSROB6_MULT9, + TILE_WIRE_JSROB7_MULT9, + TILE_WIRE_JSROB8_MULT9, + + + TILE_WIRE_JC0_PRADD9, + TILE_WIRE_JC1_PRADD9, + TILE_WIRE_JC2_PRADD9, + TILE_WIRE_JC3_PRADD9, + TILE_WIRE_JC4_PRADD9, + TILE_WIRE_JC5_PRADD9, + TILE_WIRE_JC6_PRADD9, + TILE_WIRE_JC7_PRADD9, + TILE_WIRE_JC8_PRADD9, + TILE_WIRE_JCE0_PRADD9, + TILE_WIRE_JCE1_PRADD9, + TILE_WIRE_JCE2_PRADD9, + TILE_WIRE_JCE3_PRADD9, + TILE_WIRE_JCLK0_PRADD9, + TILE_WIRE_JCLK1_PRADD9, + TILE_WIRE_JCLK2_PRADD9, + TILE_WIRE_JCLK3_PRADD9, + TILE_WIRE_JOPPRE_PRADD9, + TILE_WIRE_JPA0_PRADD9, + TILE_WIRE_JPA1_PRADD9, + TILE_WIRE_JPA2_PRADD9, + TILE_WIRE_JPA3_PRADD9, + TILE_WIRE_JPA4_PRADD9, + TILE_WIRE_JPA5_PRADD9, + TILE_WIRE_JPA6_PRADD9, + TILE_WIRE_JPA7_PRADD9, + TILE_WIRE_JPA8_PRADD9, + TILE_WIRE_JPB0_PRADD9, + TILE_WIRE_JPB1_PRADD9, + TILE_WIRE_JPB2_PRADD9, + TILE_WIRE_JPB3_PRADD9, + TILE_WIRE_JPB4_PRADD9, + TILE_WIRE_JPB5_PRADD9, + TILE_WIRE_JPB6_PRADD9, + TILE_WIRE_JPB7_PRADD9, + TILE_WIRE_JPB8_PRADD9, + TILE_WIRE_JPO0_PRADD9, + TILE_WIRE_JPO1_PRADD9, + TILE_WIRE_JPO2_PRADD9, + TILE_WIRE_JPO3_PRADD9, + TILE_WIRE_JPO4_PRADD9, + TILE_WIRE_JPO5_PRADD9, + TILE_WIRE_JPO6_PRADD9, + TILE_WIRE_JPO7_PRADD9, + TILE_WIRE_JPO8_PRADD9, + TILE_WIRE_JRST0_PRADD9, + TILE_WIRE_JRST1_PRADD9, + TILE_WIRE_JRST2_PRADD9, + TILE_WIRE_JRST3_PRADD9, + TILE_WIRE_JSOURCEA_PRADD9, + TILE_WIRE_JSRIA0_PRADD9, + TILE_WIRE_JSRIA1_PRADD9, + TILE_WIRE_JSRIA2_PRADD9, + TILE_WIRE_JSRIA3_PRADD9, + TILE_WIRE_JSRIA4_PRADD9, + TILE_WIRE_JSRIA5_PRADD9, + TILE_WIRE_JSRIA6_PRADD9, + TILE_WIRE_JSRIA7_PRADD9, + TILE_WIRE_JSRIA8_PRADD9, + TILE_WIRE_JSRIB0_PRADD9, + TILE_WIRE_JSRIB1_PRADD9, + TILE_WIRE_JSRIB2_PRADD9, + TILE_WIRE_JSRIB3_PRADD9, + TILE_WIRE_JSRIB4_PRADD9, + TILE_WIRE_JSRIB5_PRADD9, + TILE_WIRE_JSRIB6_PRADD9, + TILE_WIRE_JSRIB7_PRADD9, + TILE_WIRE_JSRIB8_PRADD9, + TILE_WIRE_JSROA0_PRADD9, + TILE_WIRE_JSROA1_PRADD9, + TILE_WIRE_JSROA2_PRADD9, + TILE_WIRE_JSROA3_PRADD9, + TILE_WIRE_JSROA4_PRADD9, + TILE_WIRE_JSROA5_PRADD9, + TILE_WIRE_JSROA6_PRADD9, + TILE_WIRE_JSROA7_PRADD9, + TILE_WIRE_JSROA8_PRADD9, + TILE_WIRE_JSROB0_PRADD9, + TILE_WIRE_JSROB1_PRADD9, + TILE_WIRE_JSROB2_PRADD9, + TILE_WIRE_JSROB3_PRADD9, + TILE_WIRE_JSROB4_PRADD9, + TILE_WIRE_JSROB5_PRADD9, + TILE_WIRE_JSROB6_PRADD9, + TILE_WIRE_JSROB7_PRADD9, + TILE_WIRE_JSROB8_PRADD9, + + + TILE_WIRE_JC0_PRADD18, + TILE_WIRE_JC10_PRADD18, + TILE_WIRE_JC11_PRADD18, + TILE_WIRE_JC12_PRADD18, + TILE_WIRE_JC13_PRADD18, + TILE_WIRE_JC14_PRADD18, + TILE_WIRE_JC15_PRADD18, + TILE_WIRE_JC16_PRADD18, + TILE_WIRE_JC17_PRADD18, + TILE_WIRE_JC1_PRADD18, + TILE_WIRE_JC2_PRADD18, + TILE_WIRE_JC3_PRADD18, + TILE_WIRE_JC4_PRADD18, + TILE_WIRE_JC5_PRADD18, + TILE_WIRE_JC6_PRADD18, + TILE_WIRE_JC7_PRADD18, + TILE_WIRE_JC8_PRADD18, + TILE_WIRE_JC9_PRADD18, + TILE_WIRE_JCE0_PRADD18, + TILE_WIRE_JCE1_PRADD18, + TILE_WIRE_JCE2_PRADD18, + TILE_WIRE_JCE3_PRADD18, + TILE_WIRE_JCLK0_PRADD18, + TILE_WIRE_JCLK1_PRADD18, + TILE_WIRE_JCLK2_PRADD18, + TILE_WIRE_JCLK3_PRADD18, + TILE_WIRE_JOPPRE_PRADD18, + TILE_WIRE_JPA0_PRADD18, + TILE_WIRE_JPA10_PRADD18, + TILE_WIRE_JPA11_PRADD18, + TILE_WIRE_JPA12_PRADD18, + TILE_WIRE_JPA13_PRADD18, + TILE_WIRE_JPA14_PRADD18, + TILE_WIRE_JPA15_PRADD18, + TILE_WIRE_JPA16_PRADD18, + TILE_WIRE_JPA17_PRADD18, + TILE_WIRE_JPA1_PRADD18, + TILE_WIRE_JPA2_PRADD18, + TILE_WIRE_JPA3_PRADD18, + TILE_WIRE_JPA4_PRADD18, + TILE_WIRE_JPA5_PRADD18, + TILE_WIRE_JPA6_PRADD18, + TILE_WIRE_JPA7_PRADD18, + TILE_WIRE_JPA8_PRADD18, + TILE_WIRE_JPA9_PRADD18, + TILE_WIRE_JPB0_PRADD18, + TILE_WIRE_JPB10_PRADD18, + TILE_WIRE_JPB11_PRADD18, + TILE_WIRE_JPB12_PRADD18, + TILE_WIRE_JPB13_PRADD18, + TILE_WIRE_JPB14_PRADD18, + TILE_WIRE_JPB15_PRADD18, + TILE_WIRE_JPB16_PRADD18, + TILE_WIRE_JPB17_PRADD18, + TILE_WIRE_JPB1_PRADD18, + TILE_WIRE_JPB2_PRADD18, + TILE_WIRE_JPB3_PRADD18, + TILE_WIRE_JPB4_PRADD18, + TILE_WIRE_JPB5_PRADD18, + TILE_WIRE_JPB6_PRADD18, + TILE_WIRE_JPB7_PRADD18, + TILE_WIRE_JPB8_PRADD18, + TILE_WIRE_JPB9_PRADD18, + TILE_WIRE_JPO0_PRADD18, + TILE_WIRE_JPO10_PRADD18, + TILE_WIRE_JPO11_PRADD18, + TILE_WIRE_JPO12_PRADD18, + TILE_WIRE_JPO13_PRADD18, + TILE_WIRE_JPO14_PRADD18, + TILE_WIRE_JPO15_PRADD18, + TILE_WIRE_JPO16_PRADD18, + TILE_WIRE_JPO17_PRADD18, + TILE_WIRE_JPO1_PRADD18, + TILE_WIRE_JPO2_PRADD18, + TILE_WIRE_JPO3_PRADD18, + TILE_WIRE_JPO4_PRADD18, + TILE_WIRE_JPO5_PRADD18, + TILE_WIRE_JPO6_PRADD18, + TILE_WIRE_JPO7_PRADD18, + TILE_WIRE_JPO8_PRADD18, + TILE_WIRE_JPO9_PRADD18, + TILE_WIRE_JRST0_PRADD18, + TILE_WIRE_JRST1_PRADD18, + TILE_WIRE_JRST2_PRADD18, + TILE_WIRE_JRST3_PRADD18, + TILE_WIRE_JSOURCEA_PRADD18, + TILE_WIRE_JSRIA0_PRADD18, + TILE_WIRE_JSRIA10_PRADD18, + TILE_WIRE_JSRIA11_PRADD18, + TILE_WIRE_JSRIA12_PRADD18, + TILE_WIRE_JSRIA13_PRADD18, + TILE_WIRE_JSRIA14_PRADD18, + TILE_WIRE_JSRIA15_PRADD18, + TILE_WIRE_JSRIA16_PRADD18, + TILE_WIRE_JSRIA17_PRADD18, + TILE_WIRE_JSRIA1_PRADD18, + TILE_WIRE_JSRIA2_PRADD18, + TILE_WIRE_JSRIA3_PRADD18, + TILE_WIRE_JSRIA4_PRADD18, + TILE_WIRE_JSRIA5_PRADD18, + TILE_WIRE_JSRIA6_PRADD18, + TILE_WIRE_JSRIA7_PRADD18, + TILE_WIRE_JSRIA8_PRADD18, + TILE_WIRE_JSRIA9_PRADD18, + TILE_WIRE_JSRIB0_PRADD18, + TILE_WIRE_JSRIB10_PRADD18, + TILE_WIRE_JSRIB11_PRADD18, + TILE_WIRE_JSRIB12_PRADD18, + TILE_WIRE_JSRIB13_PRADD18, + TILE_WIRE_JSRIB14_PRADD18, + TILE_WIRE_JSRIB15_PRADD18, + TILE_WIRE_JSRIB16_PRADD18, + TILE_WIRE_JSRIB17_PRADD18, + TILE_WIRE_JSRIB1_PRADD18, + TILE_WIRE_JSRIB2_PRADD18, + TILE_WIRE_JSRIB3_PRADD18, + TILE_WIRE_JSRIB4_PRADD18, + TILE_WIRE_JSRIB5_PRADD18, + TILE_WIRE_JSRIB6_PRADD18, + TILE_WIRE_JSRIB7_PRADD18, + TILE_WIRE_JSRIB8_PRADD18, + TILE_WIRE_JSRIB9_PRADD18, + TILE_WIRE_JSROA0_PRADD18, + TILE_WIRE_JSROA10_PRADD18, + TILE_WIRE_JSROA11_PRADD18, + TILE_WIRE_JSROA12_PRADD18, + TILE_WIRE_JSROA13_PRADD18, + TILE_WIRE_JSROA14_PRADD18, + TILE_WIRE_JSROA15_PRADD18, + TILE_WIRE_JSROA16_PRADD18, + TILE_WIRE_JSROA17_PRADD18, + TILE_WIRE_JSROA1_PRADD18, + TILE_WIRE_JSROA2_PRADD18, + TILE_WIRE_JSROA3_PRADD18, + TILE_WIRE_JSROA4_PRADD18, + TILE_WIRE_JSROA5_PRADD18, + TILE_WIRE_JSROA6_PRADD18, + TILE_WIRE_JSROA7_PRADD18, + TILE_WIRE_JSROA8_PRADD18, + TILE_WIRE_JSROA9_PRADD18, + TILE_WIRE_JSROB0_PRADD18, + TILE_WIRE_JSROB10_PRADD18, + TILE_WIRE_JSROB11_PRADD18, + TILE_WIRE_JSROB12_PRADD18, + TILE_WIRE_JSROB13_PRADD18, + TILE_WIRE_JSROB14_PRADD18, + TILE_WIRE_JSROB15_PRADD18, + TILE_WIRE_JSROB16_PRADD18, + TILE_WIRE_JSROB17_PRADD18, + TILE_WIRE_JSROB1_PRADD18, + TILE_WIRE_JSROB2_PRADD18, + TILE_WIRE_JSROB3_PRADD18, + TILE_WIRE_JSROB4_PRADD18, + TILE_WIRE_JSROB5_PRADD18, + TILE_WIRE_JSROB6_PRADD18, + TILE_WIRE_JSROB7_PRADD18, + TILE_WIRE_JSROB8_PRADD18, + TILE_WIRE_JSROB9_PRADD18, + + + TILE_WIRE_JCE0_ALU24, + TILE_WIRE_JCE1_ALU24, + TILE_WIRE_JCE2_ALU24, + TILE_WIRE_JCE3_ALU24, + TILE_WIRE_JCFB0_ALU24, + TILE_WIRE_JCFB10_ALU24, + TILE_WIRE_JCFB11_ALU24, + TILE_WIRE_JCFB12_ALU24, + TILE_WIRE_JCFB13_ALU24, + TILE_WIRE_JCFB14_ALU24, + TILE_WIRE_JCFB15_ALU24, + TILE_WIRE_JCFB16_ALU24, + TILE_WIRE_JCFB17_ALU24, + TILE_WIRE_JCFB18_ALU24, + TILE_WIRE_JCFB19_ALU24, + TILE_WIRE_JCFB1_ALU24, + TILE_WIRE_JCFB20_ALU24, + TILE_WIRE_JCFB21_ALU24, + TILE_WIRE_JCFB22_ALU24, + TILE_WIRE_JCFB23_ALU24, + TILE_WIRE_JCFB2_ALU24, + TILE_WIRE_JCFB3_ALU24, + TILE_WIRE_JCFB4_ALU24, + TILE_WIRE_JCFB5_ALU24, + TILE_WIRE_JCFB6_ALU24, + TILE_WIRE_JCFB7_ALU24, + TILE_WIRE_JCFB8_ALU24, + TILE_WIRE_JCFB9_ALU24, + TILE_WIRE_JCIN0_ALU24, + TILE_WIRE_JCIN10_ALU24, + TILE_WIRE_JCIN11_ALU24, + TILE_WIRE_JCIN12_ALU24, + TILE_WIRE_JCIN13_ALU24, + TILE_WIRE_JCIN14_ALU24, + TILE_WIRE_JCIN15_ALU24, + TILE_WIRE_JCIN16_ALU24, + TILE_WIRE_JCIN17_ALU24, + TILE_WIRE_JCIN18_ALU24, + TILE_WIRE_JCIN19_ALU24, + TILE_WIRE_JCIN1_ALU24, + TILE_WIRE_JCIN20_ALU24, + TILE_WIRE_JCIN21_ALU24, + TILE_WIRE_JCIN22_ALU24, + TILE_WIRE_JCIN23_ALU24, + TILE_WIRE_JCIN2_ALU24, + TILE_WIRE_JCIN3_ALU24, + TILE_WIRE_JCIN4_ALU24, + TILE_WIRE_JCIN5_ALU24, + TILE_WIRE_JCIN6_ALU24, + TILE_WIRE_JCIN7_ALU24, + TILE_WIRE_JCIN8_ALU24, + TILE_WIRE_JCIN9_ALU24, + TILE_WIRE_JCLK0_ALU24, + TILE_WIRE_JCLK1_ALU24, + TILE_WIRE_JCLK2_ALU24, + TILE_WIRE_JCLK3_ALU24, + TILE_WIRE_JCO0_ALU24, + TILE_WIRE_JCO10_ALU24, + TILE_WIRE_JCO11_ALU24, + TILE_WIRE_JCO12_ALU24, + TILE_WIRE_JCO13_ALU24, + TILE_WIRE_JCO14_ALU24, + TILE_WIRE_JCO15_ALU24, + TILE_WIRE_JCO16_ALU24, + TILE_WIRE_JCO17_ALU24, + TILE_WIRE_JCO18_ALU24, + TILE_WIRE_JCO19_ALU24, + TILE_WIRE_JCO1_ALU24, + TILE_WIRE_JCO20_ALU24, + TILE_WIRE_JCO21_ALU24, + TILE_WIRE_JCO22_ALU24, + TILE_WIRE_JCO23_ALU24, + TILE_WIRE_JCO2_ALU24, + TILE_WIRE_JCO3_ALU24, + TILE_WIRE_JCO4_ALU24, + TILE_WIRE_JCO5_ALU24, + TILE_WIRE_JCO6_ALU24, + TILE_WIRE_JCO7_ALU24, + TILE_WIRE_JCO8_ALU24, + TILE_WIRE_JCO9_ALU24, + TILE_WIRE_JMA0_ALU24, + TILE_WIRE_JMA10_ALU24, + TILE_WIRE_JMA11_ALU24, + TILE_WIRE_JMA12_ALU24, + TILE_WIRE_JMA13_ALU24, + TILE_WIRE_JMA14_ALU24, + TILE_WIRE_JMA15_ALU24, + TILE_WIRE_JMA16_ALU24, + TILE_WIRE_JMA17_ALU24, + TILE_WIRE_JMA1_ALU24, + TILE_WIRE_JMA2_ALU24, + TILE_WIRE_JMA3_ALU24, + TILE_WIRE_JMA4_ALU24, + TILE_WIRE_JMA5_ALU24, + TILE_WIRE_JMA6_ALU24, + TILE_WIRE_JMA7_ALU24, + TILE_WIRE_JMA8_ALU24, + TILE_WIRE_JMA9_ALU24, + TILE_WIRE_JMB0_ALU24, + TILE_WIRE_JMB10_ALU24, + TILE_WIRE_JMB11_ALU24, + TILE_WIRE_JMB12_ALU24, + TILE_WIRE_JMB13_ALU24, + TILE_WIRE_JMB14_ALU24, + TILE_WIRE_JMB15_ALU24, + TILE_WIRE_JMB16_ALU24, + TILE_WIRE_JMB17_ALU24, + TILE_WIRE_JMB1_ALU24, + TILE_WIRE_JMB2_ALU24, + TILE_WIRE_JMB3_ALU24, + TILE_WIRE_JMB4_ALU24, + TILE_WIRE_JMB5_ALU24, + TILE_WIRE_JMB6_ALU24, + TILE_WIRE_JMB7_ALU24, + TILE_WIRE_JMB8_ALU24, + TILE_WIRE_JMB9_ALU24, + TILE_WIRE_JOP5_ALU24, + TILE_WIRE_JOP7_ALU24, + TILE_WIRE_JR0_ALU24, + TILE_WIRE_JR10_ALU24, + TILE_WIRE_JR11_ALU24, + TILE_WIRE_JR12_ALU24, + TILE_WIRE_JR13_ALU24, + TILE_WIRE_JR14_ALU24, + TILE_WIRE_JR15_ALU24, + TILE_WIRE_JR16_ALU24, + TILE_WIRE_JR17_ALU24, + TILE_WIRE_JR18_ALU24, + TILE_WIRE_JR19_ALU24, + TILE_WIRE_JR1_ALU24, + TILE_WIRE_JR20_ALU24, + TILE_WIRE_JR21_ALU24, + TILE_WIRE_JR22_ALU24, + TILE_WIRE_JR23_ALU24, + TILE_WIRE_JR2_ALU24, + TILE_WIRE_JR3_ALU24, + TILE_WIRE_JR4_ALU24, + TILE_WIRE_JR5_ALU24, + TILE_WIRE_JR6_ALU24, + TILE_WIRE_JR7_ALU24, + TILE_WIRE_JR8_ALU24, + TILE_WIRE_JR9_ALU24, + TILE_WIRE_JRST0_ALU24, + TILE_WIRE_JRST1_ALU24, + TILE_WIRE_JRST2_ALU24, + TILE_WIRE_JRST3_ALU24, + TILE_WIRE_JSIGNEDIA_ALU24, + TILE_WIRE_JSIGNEDIB_ALU24, + + + + + + + + + + + + + + + TILE_WIRE_G_BANK2ECLK0, + TILE_WIRE_G_BANK2ECLK1, + TILE_WIRE_G_BANK3ECLK0, + TILE_WIRE_G_BANK3ECLK1, + TILE_WIRE_G_BANK6ECLK0, + TILE_WIRE_G_BANK6ECLK1, + TILE_WIRE_G_BANK7ECLK0, + TILE_WIRE_G_BANK7ECLK1, + TILE_WIRE_G_BDCC0CLKI, + TILE_WIRE_G_BDCC10CLKI, + TILE_WIRE_G_BDCC11CLKI, + TILE_WIRE_G_BDCC12CLKI, + TILE_WIRE_G_BDCC13CLKI, + TILE_WIRE_G_BDCC14CLKI, + TILE_WIRE_G_BDCC15CLKI, + TILE_WIRE_G_BDCC1CLKI, + TILE_WIRE_G_BDCC2CLKI, + TILE_WIRE_G_BDCC3CLKI, + TILE_WIRE_G_BDCC4CLKI, + TILE_WIRE_G_BDCC5CLKI, + TILE_WIRE_G_BDCC6CLKI, + TILE_WIRE_G_BDCC7CLKI, + TILE_WIRE_G_BDCC8CLKI, + TILE_WIRE_G_BDCC9CLKI, + TILE_WIRE_G_CLK0_DCS0, + TILE_WIRE_G_CLK0_DCS1, + TILE_WIRE_G_CLK1_DCS0, + TILE_WIRE_G_CLK1_DCS1, + TILE_WIRE_G_CLKO_DCCBL, + TILE_WIRE_G_CLKO_DCCBR, + TILE_WIRE_G_CLKO_DCCTL, + TILE_WIRE_G_CLKO_DCCTR, + TILE_WIRE_G_DCS0, + TILE_WIRE_G_DCS0CLK0, + TILE_WIRE_G_DCS0CLK1, + TILE_WIRE_G_DCS1, + TILE_WIRE_G_DCS1CLK0, + TILE_WIRE_G_DCS1CLK1, + TILE_WIRE_G_DCSOUT_DCS0, + TILE_WIRE_G_DCSOUT_DCS1, + TILE_WIRE_G_HPFE0000, + TILE_WIRE_G_HPFE0100, + TILE_WIRE_G_HPFE0200, + TILE_WIRE_G_HPFE0300, + TILE_WIRE_G_HPFE0400, + TILE_WIRE_G_HPFE0500, + TILE_WIRE_G_HPFE0600, + TILE_WIRE_G_HPFE0700, + TILE_WIRE_G_HPFE0800, + TILE_WIRE_G_HPFE0900, + TILE_WIRE_G_HPFE1000, + TILE_WIRE_G_HPFE1100, + TILE_WIRE_G_HPFE1200, + TILE_WIRE_G_HPFE1300, + TILE_WIRE_G_HPFW0000, + TILE_WIRE_G_HPFW0100, + TILE_WIRE_G_HPFW0200, + TILE_WIRE_G_HPFW0300, + TILE_WIRE_G_HPFW0400, + TILE_WIRE_G_HPFW0500, + TILE_WIRE_G_HPFW0600, + TILE_WIRE_G_HPFW0700, + TILE_WIRE_G_HPFW0800, + TILE_WIRE_G_HPFW0900, + TILE_WIRE_G_HPFW1000, + TILE_WIRE_G_HPFW1100, + TILE_WIRE_G_HPFW1200, + TILE_WIRE_G_HPFW1300, + TILE_WIRE_G_HPRX0000, + TILE_WIRE_G_HPRX0100, + TILE_WIRE_G_HPRX0200, + TILE_WIRE_G_HPRX0300, + TILE_WIRE_G_HPRX0400, + TILE_WIRE_G_HPRX0500, + TILE_WIRE_G_HPRX0600, + TILE_WIRE_G_HPRX0700, + TILE_WIRE_G_HPRX0800, + TILE_WIRE_G_HPRX0900, + TILE_WIRE_G_HPRX1000, + TILE_WIRE_G_HPRX1100, + TILE_WIRE_G_HPRX1200, + TILE_WIRE_G_HPRX1300, + TILE_WIRE_G_HPRX1400, + TILE_WIRE_G_HPRX1500, + TILE_WIRE_G_JBLQPCLKCIB0, + TILE_WIRE_G_JBLQPCLKCIB1, + TILE_WIRE_G_JBRGECLK0, + TILE_WIRE_G_JBRGECLK1, + TILE_WIRE_G_JBRQPCLKCIB0, + TILE_WIRE_G_JBRQPCLKCIB1, + TILE_WIRE_G_JCE_DCCBL, + TILE_WIRE_G_JCE_DCCBR, + TILE_WIRE_G_JCE_DCCTL, + TILE_WIRE_G_JCE_DCCTR, + TILE_WIRE_G_JCLKI_DCCBL, + TILE_WIRE_G_JCLKI_DCCBR, + TILE_WIRE_G_JCLKI_DCCTL, + TILE_WIRE_G_JCLKI_DCCTR, + TILE_WIRE_G_JLCDIVX0, + TILE_WIRE_G_JLCDIVX1, + TILE_WIRE_G_JLECLK1, + TILE_WIRE_G_JLLCPLL0CLKOP, + TILE_WIRE_G_JLLCPLL0CLKOS, + TILE_WIRE_G_JLLCPLL0CLKOS2, + TILE_WIRE_G_JLLCPLL0CLKOS3, + TILE_WIRE_G_JLLMPCLKCIB0, + TILE_WIRE_G_JLLMPCLKCIB1, + TILE_WIRE_G_JLLMPCLKCIB2, + TILE_WIRE_G_JLLMPCLKCIB3, + TILE_WIRE_G_JLLQECLKCIB0, + TILE_WIRE_G_JLLQECLKCIB1, + TILE_WIRE_G_JLLQPCLKCIB0, + TILE_WIRE_G_JLLQPCLKCIB1, + TILE_WIRE_G_JLRCPLL0CLKOP, + TILE_WIRE_G_JLRCPLL0CLKOS, + TILE_WIRE_G_JLRCPLL0CLKOS2, + TILE_WIRE_G_JLRCPLL0CLKOS3, + TILE_WIRE_G_JLRMPCLKCIB0, + TILE_WIRE_G_JLRMPCLKCIB1, + TILE_WIRE_G_JLRMPCLKCIB2, + TILE_WIRE_G_JLRMPCLKCIB3, + TILE_WIRE_G_JLRQECLKCIB0, + TILE_WIRE_G_JLRQECLKCIB1, + TILE_WIRE_G_JLRQPCLKCIB0, + TILE_WIRE_G_JLRQPCLKCIB1, + TILE_WIRE_G_JMODESEL_DCS0, + TILE_WIRE_G_JMODESEL_DCS1, + TILE_WIRE_G_JOSC, + TILE_WIRE_G_JOSC_OSC, + TILE_WIRE_G_JPCLKT00, + TILE_WIRE_G_JPCLKT01, + TILE_WIRE_G_JPCLKT10, + TILE_WIRE_G_JPCLKT11, + TILE_WIRE_G_JPCLKT20, + TILE_WIRE_G_JPCLKT21, + TILE_WIRE_G_JPCLKT30, + TILE_WIRE_G_JPCLKT31, + TILE_WIRE_G_JPCLKT60, + TILE_WIRE_G_JPCLKT61, + TILE_WIRE_G_JPCLKT70, + TILE_WIRE_G_JPCLKT71, + TILE_WIRE_G_JPCSARXCLK0, + TILE_WIRE_G_JPCSARXCLK1, + TILE_WIRE_G_JPCSATXCLK0, + TILE_WIRE_G_JPCSATXCLK1, + TILE_WIRE_G_JPCSBRXCLK0, + TILE_WIRE_G_JPCSBRXCLK1, + TILE_WIRE_G_JPCSBTXCLK0, + TILE_WIRE_G_JPCSBTXCLK1, + TILE_WIRE_G_JRECLK0, + TILE_WIRE_G_JSEDCLKOUT, + TILE_WIRE_G_JSEL0_DCS0, + TILE_WIRE_G_JSEL0_DCS1, + TILE_WIRE_G_JSEL1_DCS0, + TILE_WIRE_G_JSEL1_DCS1, + TILE_WIRE_G_JTLQPCLKCIB0, + TILE_WIRE_G_JTLQPCLKCIB1, + TILE_WIRE_G_JTRQPCLKCIB0, + TILE_WIRE_G_JTRQPCLKCIB1, + TILE_WIRE_G_JULCPLL0CLKOP, + TILE_WIRE_G_JULCPLL0CLKOS, + TILE_WIRE_G_JULCPLL0CLKOS2, + TILE_WIRE_G_JULCPLL0CLKOS3, + TILE_WIRE_G_JULMPCLKCIB0, + TILE_WIRE_G_JULMPCLKCIB1, + TILE_WIRE_G_JULMPCLKCIB2, + TILE_WIRE_G_JULMPCLKCIB3, + TILE_WIRE_G_JULQECLKCIB0, + TILE_WIRE_G_JULQECLKCIB1, + TILE_WIRE_G_JULQPCLKCIB0, + TILE_WIRE_G_JULQPCLKCIB1, + TILE_WIRE_G_JURCPLL0CLKOP, + TILE_WIRE_G_JURCPLL0CLKOS, + TILE_WIRE_G_JURCPLL0CLKOS2, + TILE_WIRE_G_JURCPLL0CLKOS3, + TILE_WIRE_G_JURMPCLKCIB0, + TILE_WIRE_G_JURMPCLKCIB1, + TILE_WIRE_G_JURMPCLKCIB2, + TILE_WIRE_G_JURMPCLKCIB3, + TILE_WIRE_G_JURQECLKCIB0, + TILE_WIRE_G_JURQECLKCIB1, + TILE_WIRE_G_JURQPCLKCIB0, + TILE_WIRE_G_JURQPCLKCIB1, + TILE_WIRE_G_LDCC0CLKI, + TILE_WIRE_G_LDCC10CLKI, + TILE_WIRE_G_LDCC11CLKI, + TILE_WIRE_G_LDCC12CLKI, + TILE_WIRE_G_LDCC13CLKI, + TILE_WIRE_G_LDCC1CLKI, + TILE_WIRE_G_LDCC2CLKI, + TILE_WIRE_G_LDCC3CLKI, + TILE_WIRE_G_LDCC4CLKI, + TILE_WIRE_G_LDCC5CLKI, + TILE_WIRE_G_LDCC6CLKI, + TILE_WIRE_G_LDCC7CLKI, + TILE_WIRE_G_LDCC8CLKI, + TILE_WIRE_G_LDCC9CLKI, + TILE_WIRE_G_LLCPCLKCIB0, + TILE_WIRE_G_LLDDRDEL, + TILE_WIRE_G_LLPCLK0, + TILE_WIRE_G_LLPCLK1, + TILE_WIRE_G_LLPCLK10, + TILE_WIRE_G_LLPCLK11, + TILE_WIRE_G_LLPCLK12, + TILE_WIRE_G_LLPCLK13, + TILE_WIRE_G_LLPCLK14, + TILE_WIRE_G_LLPCLK15, + TILE_WIRE_G_LLPCLK2, + TILE_WIRE_G_LLPCLK3, + TILE_WIRE_G_LLPCLK4, + TILE_WIRE_G_LLPCLK5, + TILE_WIRE_G_LLPCLK6, + TILE_WIRE_G_LLPCLK7, + TILE_WIRE_G_LLPCLK8, + TILE_WIRE_G_LLPCLK9, + TILE_WIRE_G_LRCPCLKCIB0, + TILE_WIRE_G_LRDDRDEL, + TILE_WIRE_G_LRPCLK0, + TILE_WIRE_G_LRPCLK1, + TILE_WIRE_G_LRPCLK10, + TILE_WIRE_G_LRPCLK11, + TILE_WIRE_G_LRPCLK12, + TILE_WIRE_G_LRPCLK13, + TILE_WIRE_G_LRPCLK14, + TILE_WIRE_G_LRPCLK15, + TILE_WIRE_G_LRPCLK2, + TILE_WIRE_G_LRPCLK3, + TILE_WIRE_G_LRPCLK4, + TILE_WIRE_G_LRPCLK5, + TILE_WIRE_G_LRPCLK6, + TILE_WIRE_G_LRPCLK7, + TILE_WIRE_G_LRPCLK8, + TILE_WIRE_G_LRPCLK9, + TILE_WIRE_G_RDCC0CLKI, + TILE_WIRE_G_RDCC10CLKI, + TILE_WIRE_G_RDCC11CLKI, + TILE_WIRE_G_RDCC12CLKI, + TILE_WIRE_G_RDCC13CLKI, + TILE_WIRE_G_RDCC1CLKI, + TILE_WIRE_G_RDCC2CLKI, + TILE_WIRE_G_RDCC3CLKI, + TILE_WIRE_G_RDCC4CLKI, + TILE_WIRE_G_RDCC5CLKI, + TILE_WIRE_G_RDCC6CLKI, + TILE_WIRE_G_RDCC7CLKI, + TILE_WIRE_G_RDCC8CLKI, + TILE_WIRE_G_RDCC9CLKI, + TILE_WIRE_G_TDCC0CLKI, + TILE_WIRE_G_TDCC10CLKI, + TILE_WIRE_G_TDCC11CLKI, + TILE_WIRE_G_TDCC1CLKI, + TILE_WIRE_G_TDCC2CLKI, + TILE_WIRE_G_TDCC3CLKI, + TILE_WIRE_G_TDCC4CLKI, + TILE_WIRE_G_TDCC5CLKI, + TILE_WIRE_G_TDCC6CLKI, + TILE_WIRE_G_TDCC7CLKI, + TILE_WIRE_G_TDCC8CLKI, + TILE_WIRE_G_TDCC9CLKI, + TILE_WIRE_G_ULCPCLKCIB0, + TILE_WIRE_G_ULDDRDEL, + TILE_WIRE_G_ULPCLK0, + TILE_WIRE_G_ULPCLK1, + TILE_WIRE_G_ULPCLK10, + TILE_WIRE_G_ULPCLK11, + TILE_WIRE_G_ULPCLK12, + TILE_WIRE_G_ULPCLK13, + TILE_WIRE_G_ULPCLK14, + TILE_WIRE_G_ULPCLK15, + TILE_WIRE_G_ULPCLK2, + TILE_WIRE_G_ULPCLK3, + TILE_WIRE_G_ULPCLK4, + TILE_WIRE_G_ULPCLK5, + TILE_WIRE_G_ULPCLK6, + TILE_WIRE_G_ULPCLK7, + TILE_WIRE_G_ULPCLK8, + TILE_WIRE_G_ULPCLK9, + TILE_WIRE_G_URCPCLKCIB0, + TILE_WIRE_G_URDDRDEL, + TILE_WIRE_G_URPCLK0, + TILE_WIRE_G_URPCLK1, + TILE_WIRE_G_URPCLK10, + TILE_WIRE_G_URPCLK11, + TILE_WIRE_G_URPCLK12, + TILE_WIRE_G_URPCLK13, + TILE_WIRE_G_URPCLK14, + TILE_WIRE_G_URPCLK15, + TILE_WIRE_G_URPCLK2, + TILE_WIRE_G_URPCLK3, + TILE_WIRE_G_URPCLK4, + TILE_WIRE_G_URPCLK5, + TILE_WIRE_G_URPCLK6, + TILE_WIRE_G_URPCLK7, + TILE_WIRE_G_URPCLK8, + TILE_WIRE_G_URPCLK9, + TILE_WIRE_G_VPFN0000, + TILE_WIRE_G_VPFN0100, + TILE_WIRE_G_VPFN0200, + TILE_WIRE_G_VPFN0300, + TILE_WIRE_G_VPFN0400, + TILE_WIRE_G_VPFN0500, + TILE_WIRE_G_VPFN0600, + TILE_WIRE_G_VPFN0700, + TILE_WIRE_G_VPFN0800, + TILE_WIRE_G_VPFN0900, + TILE_WIRE_G_VPFN1000, + TILE_WIRE_G_VPFN1100, + TILE_WIRE_G_VPFN1200, + TILE_WIRE_G_VPFN1300, + TILE_WIRE_G_VPFN1400, + TILE_WIRE_G_VPFN1500, + TILE_WIRE_G_VPFS0000, + TILE_WIRE_G_VPFS0100, + TILE_WIRE_G_VPFS0200, + TILE_WIRE_G_VPFS0300, + TILE_WIRE_G_VPFS0400, + TILE_WIRE_G_VPFS0500, + TILE_WIRE_G_VPFS0600, + TILE_WIRE_G_VPFS0700, + TILE_WIRE_G_VPFS0800, + TILE_WIRE_G_VPFS0900, + TILE_WIRE_G_VPFS1000, + TILE_WIRE_G_VPFS1100, + + + + + TILE_WIRE_BNK_ECLK0, + TILE_WIRE_BNK_ECLK1, + TILE_WIRE_BNK_INRD, + TILE_WIRE_BNK_LVDS, + TILE_WIRE_CH0_RX_REFCLK, + TILE_WIRE_CH1_RX_REFCLK, + TILE_WIRE_CLK0_PLLREFCS, + TILE_WIRE_CLK1_PLLREFCS, + TILE_WIRE_CLKFB, + TILE_WIRE_CLKI0, + TILE_WIRE_CLKI1, + TILE_WIRE_CLKINTFB, + TILE_WIRE_CLKI_CLKDIV0, + TILE_WIRE_CLKI_CLKDIV1, + TILE_WIRE_DDRDEL, + TILE_WIRE_DDRDEL_DLLDEL, + TILE_WIRE_DLLDEL, + TILE_WIRE_DQSECLK, + TILE_WIRE_DQSG_DQSR90, + TILE_WIRE_DQSG_DQSW, + TILE_WIRE_DQSG_DQSW270, + TILE_WIRE_DQSG_RDPNTR0, + TILE_WIRE_DQSG_RDPNTR1, + TILE_WIRE_DQSG_RDPNTR2, + TILE_WIRE_DQSG_WRPNTR0, + TILE_WIRE_DQSG_WRPNTR1, + TILE_WIRE_DQSG_WRPNTR2, + TILE_WIRE_D_REFCLKI, + TILE_WIRE_ECLKI0, + TILE_WIRE_ECLKI1, + TILE_WIRE_ECLKI_BRGECLKSYNC0, + TILE_WIRE_ECLKI_BRGECLKSYNC1, + TILE_WIRE_ECLKI_ECLKSYNC0, + TILE_WIRE_ECLKI_ECLKSYNC1, + TILE_WIRE_ECSOUT_ECLKBRIDGECS0, + TILE_WIRE_ECSOUT_ECLKBRIDGECS1, + TILE_WIRE_EXTREFCLK, + + TILE_WIRE_INPUT_REFN_APIO, + TILE_WIRE_INPUT_REFP_APIO, + TILE_WIRE_JALIGNWD_CLKDIV0, + TILE_WIRE_JALIGNWD_CLKDIV1, + TILE_WIRE_JA_DLLDEL, + TILE_WIRE_JBRGECLK0, + TILE_WIRE_JBRGECLK1, + TILE_WIRE_JCDIVX_CLKDIV0, + TILE_WIRE_JCDIVX_CLKDIV1, + TILE_WIRE_JCFB0, + TILE_WIRE_JCFB1, + TILE_WIRE_JCFB10, + TILE_WIRE_JCFB11, + TILE_WIRE_JCFB12, + TILE_WIRE_JCFB13, + TILE_WIRE_JCFB14, + TILE_WIRE_JCFB15, + TILE_WIRE_JCFB16, + TILE_WIRE_JCFB17, + TILE_WIRE_JCFB18, + TILE_WIRE_JCFB19, + TILE_WIRE_JCFB2, + TILE_WIRE_JCFB20, + TILE_WIRE_JCFB21, + TILE_WIRE_JCFB22, + TILE_WIRE_JCFB23, + TILE_WIRE_JCFB24, + TILE_WIRE_JCFB25, + TILE_WIRE_JCFB26, + TILE_WIRE_JCFB27, + TILE_WIRE_JCFB28, + TILE_WIRE_JCFB29, + TILE_WIRE_JCFB3, + TILE_WIRE_JCFB30, + TILE_WIRE_JCFB31, + TILE_WIRE_JCFB32, + TILE_WIRE_JCFB33, + TILE_WIRE_JCFB34, + TILE_WIRE_JCFB35, + TILE_WIRE_JCFB36, + TILE_WIRE_JCFB37, + TILE_WIRE_JCFB38, + TILE_WIRE_JCFB39, + TILE_WIRE_JCFB4, + TILE_WIRE_JCFB40, + TILE_WIRE_JCFB41, + TILE_WIRE_JCFB42, + TILE_WIRE_JCFB43, + TILE_WIRE_JCFB44, + TILE_WIRE_JCFB45, + TILE_WIRE_JCFB46, + TILE_WIRE_JCFB47, + TILE_WIRE_JCFB48, + TILE_WIRE_JCFB49, + TILE_WIRE_JCFB5, + TILE_WIRE_JCFB50, + TILE_WIRE_JCFB51, + TILE_WIRE_JCFB52, + TILE_WIRE_JCFB53, + TILE_WIRE_JCFB6, + TILE_WIRE_JCFB7, + TILE_WIRE_JCFB8, + TILE_WIRE_JCFB9, + TILE_WIRE_JCFLAG_DLLDEL, + TILE_WIRE_JCH0RXREFCLKCIB, + TILE_WIRE_JCH1RXREFCLKCIB, + TILE_WIRE_JCIBCLK0, + TILE_WIRE_JCLK0_ECLKBRIDGECS0, + TILE_WIRE_JCLK0_ECLKBRIDGECS1, + TILE_WIRE_JCLK1_ECLKBRIDGECS0, + TILE_WIRE_JCLK1_ECLKBRIDGECS1, + TILE_WIRE_JCLKFB1, + TILE_WIRE_JCLKFB2, + TILE_WIRE_JCLKFB3, + TILE_WIRE_JCO0, + TILE_WIRE_JCO1, + TILE_WIRE_JCO10, + TILE_WIRE_JCO11, + TILE_WIRE_JCO12, + TILE_WIRE_JCO13, + TILE_WIRE_JCO14, + TILE_WIRE_JCO15, + TILE_WIRE_JCO16, + TILE_WIRE_JCO17, + TILE_WIRE_JCO18, + TILE_WIRE_JCO19, + TILE_WIRE_JCO2, + TILE_WIRE_JCO20, + TILE_WIRE_JCO21, + TILE_WIRE_JCO22, + TILE_WIRE_JCO23, + TILE_WIRE_JCO24, + TILE_WIRE_JCO25, + TILE_WIRE_JCO26, + TILE_WIRE_JCO27, + TILE_WIRE_JCO28, + TILE_WIRE_JCO29, + TILE_WIRE_JCO3, + TILE_WIRE_JCO30, + TILE_WIRE_JCO31, + TILE_WIRE_JCO32, + TILE_WIRE_JCO33, + TILE_WIRE_JCO34, + TILE_WIRE_JCO35, + TILE_WIRE_JCO36, + TILE_WIRE_JCO37, + TILE_WIRE_JCO38, + TILE_WIRE_JCO39, + TILE_WIRE_JCO4, + TILE_WIRE_JCO40, + TILE_WIRE_JCO41, + TILE_WIRE_JCO42, + TILE_WIRE_JCO43, + TILE_WIRE_JCO44, + TILE_WIRE_JCO45, + TILE_WIRE_JCO46, + TILE_WIRE_JCO47, + TILE_WIRE_JCO48, + TILE_WIRE_JCO49, + TILE_WIRE_JCO5, + TILE_WIRE_JCO50, + TILE_WIRE_JCO51, + TILE_WIRE_JCO52, + TILE_WIRE_JCO53, + TILE_WIRE_JCO6, + TILE_WIRE_JCO7, + TILE_WIRE_JCO8, + TILE_WIRE_JCO9, + TILE_WIRE_JDDRDLLCLK, + TILE_WIRE_JDIRECTION_DLLDEL, + TILE_WIRE_JDSPC0, + TILE_WIRE_JDSPC1, + TILE_WIRE_JDSPC10, + TILE_WIRE_JDSPC11, + TILE_WIRE_JDSPC12, + TILE_WIRE_JDSPC13, + TILE_WIRE_JDSPC14, + TILE_WIRE_JDSPC15, + TILE_WIRE_JDSPC16, + TILE_WIRE_JDSPC17, + TILE_WIRE_JDSPC18, + TILE_WIRE_JDSPC19, + TILE_WIRE_JDSPC2, + TILE_WIRE_JDSPC20, + TILE_WIRE_JDSPC21, + TILE_WIRE_JDSPC22, + TILE_WIRE_JDSPC23, + TILE_WIRE_JDSPC24, + TILE_WIRE_JDSPC25, + TILE_WIRE_JDSPC26, + TILE_WIRE_JDSPC3, + TILE_WIRE_JDSPC4, + TILE_WIRE_JDSPC5, + TILE_WIRE_JDSPC6, + TILE_WIRE_JDSPC7, + TILE_WIRE_JDSPC8, + TILE_WIRE_JDSPC9, + TILE_WIRE_JD_SYNC_ND_DCU, + TILE_WIRE_JD_TXBIT_CLKN_FROM_ND_DCU, + TILE_WIRE_JD_TXBIT_CLKP_FROM_ND_DCU, + TILE_WIRE_JD_TXPLL_LOL_FROM_ND_DCU, + TILE_WIRE_JECLK0, + TILE_WIRE_JECLK1, + TILE_WIRE_JECLKI0, + TILE_WIRE_JECLKI1, + TILE_WIRE_JECLKO_BRGECLKSYNC0, + TILE_WIRE_JECLKO_BRGECLKSYNC1, + TILE_WIRE_JECLKO_ECLKSYNC0, + TILE_WIRE_JECLKO_ECLKSYNC1, + TILE_WIRE_JINCK, + TILE_WIRE_JINPUT_IN0_APIO, + TILE_WIRE_JINPUT_IN1_APIO, + TILE_WIRE_JINPUT_IP0_APIO, + TILE_WIRE_JINPUT_IP1_APIO, + TILE_WIRE_JJTCK, + TILE_WIRE_JLOADN_DLLDEL, + TILE_WIRE_JMOVE_DLLDEL, + TILE_WIRE_JMSROA0, + TILE_WIRE_JMSROA1, + TILE_WIRE_JMSROA10, + TILE_WIRE_JMSROA11, + TILE_WIRE_JMSROA12, + TILE_WIRE_JMSROA13, + TILE_WIRE_JMSROA14, + TILE_WIRE_JMSROA15, + TILE_WIRE_JMSROA16, + TILE_WIRE_JMSROA17, + TILE_WIRE_JMSROA2, + TILE_WIRE_JMSROA3, + TILE_WIRE_JMSROA4, + TILE_WIRE_JMSROA5, + TILE_WIRE_JMSROA6, + TILE_WIRE_JMSROA7, + TILE_WIRE_JMSROA8, + TILE_WIRE_JMSROA9, + TILE_WIRE_JMUIA0, + TILE_WIRE_JMUIA1, + TILE_WIRE_JMUIA10, + TILE_WIRE_JMUIA11, + TILE_WIRE_JMUIA12, + TILE_WIRE_JMUIA13, + TILE_WIRE_JMUIA14, + TILE_WIRE_JMUIA15, + TILE_WIRE_JMUIA16, + TILE_WIRE_JMUIA17, + TILE_WIRE_JMUIA2, + TILE_WIRE_JMUIA3, + TILE_WIRE_JMUIA4, + TILE_WIRE_JMUIA5, + TILE_WIRE_JMUIA6, + TILE_WIRE_JMUIA7, + TILE_WIRE_JMUIA8, + TILE_WIRE_JMUIA9, + TILE_WIRE_JMUIC0, + TILE_WIRE_JMUIC1, + TILE_WIRE_JMUIC10, + TILE_WIRE_JMUIC11, + TILE_WIRE_JMUIC12, + TILE_WIRE_JMUIC13, + TILE_WIRE_JMUIC14, + TILE_WIRE_JMUIC15, + TILE_WIRE_JMUIC16, + TILE_WIRE_JMUIC17, + TILE_WIRE_JMUIC18, + TILE_WIRE_JMUIC19, + TILE_WIRE_JMUIC2, + TILE_WIRE_JMUIC20, + TILE_WIRE_JMUIC21, + TILE_WIRE_JMUIC22, + TILE_WIRE_JMUIC23, + TILE_WIRE_JMUIC24, + TILE_WIRE_JMUIC25, + TILE_WIRE_JMUIC26, + TILE_WIRE_JMUIC3, + TILE_WIRE_JMUIC4, + TILE_WIRE_JMUIC5, + TILE_WIRE_JMUIC6, + TILE_WIRE_JMUIC7, + TILE_WIRE_JMUIC8, + TILE_WIRE_JMUIC9, + TILE_WIRE_JMULTA0, + TILE_WIRE_JMULTA1, + TILE_WIRE_JMULTA10, + TILE_WIRE_JMULTA11, + TILE_WIRE_JMULTA12, + TILE_WIRE_JMULTA13, + TILE_WIRE_JMULTA14, + TILE_WIRE_JMULTA15, + TILE_WIRE_JMULTA16, + TILE_WIRE_JMULTA17, + TILE_WIRE_JMULTA2, + TILE_WIRE_JMULTA3, + TILE_WIRE_JMULTA4, + TILE_WIRE_JMULTA5, + TILE_WIRE_JMULTA6, + TILE_WIRE_JMULTA7, + TILE_WIRE_JMULTA8, + TILE_WIRE_JMULTA9, + TILE_WIRE_JNEIGHBORECLK0, + TILE_WIRE_JNEIGHBORECLK1, + TILE_WIRE_JNEXTR0, + TILE_WIRE_JNEXTR1, + TILE_WIRE_JNEXTR10, + TILE_WIRE_JNEXTR11, + TILE_WIRE_JNEXTR12, + TILE_WIRE_JNEXTR13, + TILE_WIRE_JNEXTR14, + TILE_WIRE_JNEXTR15, + TILE_WIRE_JNEXTR16, + TILE_WIRE_JNEXTR17, + TILE_WIRE_JNEXTR18, + TILE_WIRE_JNEXTR19, + TILE_WIRE_JNEXTR2, + TILE_WIRE_JNEXTR20, + TILE_WIRE_JNEXTR21, + TILE_WIRE_JNEXTR22, + TILE_WIRE_JNEXTR23, + TILE_WIRE_JNEXTR24, + TILE_WIRE_JNEXTR25, + TILE_WIRE_JNEXTR26, + TILE_WIRE_JNEXTR27, + TILE_WIRE_JNEXTR28, + TILE_WIRE_JNEXTR29, + TILE_WIRE_JNEXTR3, + TILE_WIRE_JNEXTR30, + TILE_WIRE_JNEXTR31, + TILE_WIRE_JNEXTR32, + TILE_WIRE_JNEXTR33, + TILE_WIRE_JNEXTR34, + TILE_WIRE_JNEXTR35, + TILE_WIRE_JNEXTR36, + TILE_WIRE_JNEXTR37, + TILE_WIRE_JNEXTR38, + TILE_WIRE_JNEXTR39, + TILE_WIRE_JNEXTR4, + TILE_WIRE_JNEXTR40, + TILE_WIRE_JNEXTR41, + TILE_WIRE_JNEXTR42, + TILE_WIRE_JNEXTR43, + TILE_WIRE_JNEXTR44, + TILE_WIRE_JNEXTR45, + TILE_WIRE_JNEXTR46, + TILE_WIRE_JNEXTR47, + TILE_WIRE_JNEXTR48, + TILE_WIRE_JNEXTR49, + TILE_WIRE_JNEXTR5, + TILE_WIRE_JNEXTR50, + TILE_WIRE_JNEXTR51, + TILE_WIRE_JNEXTR52, + TILE_WIRE_JNEXTR53, + TILE_WIRE_JNEXTR6, + TILE_WIRE_JNEXTR7, + TILE_WIRE_JNEXTR8, + TILE_WIRE_JNEXTR9, + TILE_WIRE_JOUTPUT_ON0_APIO, + TILE_WIRE_JOUTPUT_ON1_APIO, + TILE_WIRE_JOUTPUT_OP0_APIO, + TILE_WIRE_JOUTPUT_OP1_APIO, + TILE_WIRE_JP0, + TILE_WIRE_JP1, + TILE_WIRE_JP10, + TILE_WIRE_JP11, + TILE_WIRE_JP12, + TILE_WIRE_JP13, + TILE_WIRE_JP14, + TILE_WIRE_JP15, + TILE_WIRE_JP16, + TILE_WIRE_JP17, + TILE_WIRE_JP18, + TILE_WIRE_JP19, + TILE_WIRE_JP2, + TILE_WIRE_JP20, + TILE_WIRE_JP21, + TILE_WIRE_JP22, + TILE_WIRE_JP23, + TILE_WIRE_JP24, + TILE_WIRE_JP25, + TILE_WIRE_JP26, + TILE_WIRE_JP27, + TILE_WIRE_JP28, + TILE_WIRE_JP29, + TILE_WIRE_JP3, + TILE_WIRE_JP30, + TILE_WIRE_JP31, + TILE_WIRE_JP32, + TILE_WIRE_JP33, + TILE_WIRE_JP34, + TILE_WIRE_JP35, + TILE_WIRE_JP36, + TILE_WIRE_JP37, + TILE_WIRE_JP38, + TILE_WIRE_JP39, + TILE_WIRE_JP4, + TILE_WIRE_JP40, + TILE_WIRE_JP41, + TILE_WIRE_JP42, + TILE_WIRE_JP43, + TILE_WIRE_JP44, + TILE_WIRE_JP45, + TILE_WIRE_JP46, + TILE_WIRE_JP47, + TILE_WIRE_JP48, + TILE_WIRE_JP49, + TILE_WIRE_JP5, + TILE_WIRE_JP50, + TILE_WIRE_JP51, + TILE_WIRE_JP52, + TILE_WIRE_JP53, + TILE_WIRE_JP6, + TILE_WIRE_JP7, + TILE_WIRE_JP8, + TILE_WIRE_JP9, + TILE_WIRE_JPADDI, + TILE_WIRE_JPCSCDIVCIB0, + TILE_WIRE_JPCSCDIVCIB1, + TILE_WIRE_JPO0, + TILE_WIRE_JPO1, + TILE_WIRE_JPO10, + TILE_WIRE_JPO11, + TILE_WIRE_JPO12, + TILE_WIRE_JPO13, + TILE_WIRE_JPO14, + TILE_WIRE_JPO15, + TILE_WIRE_JPO16, + TILE_WIRE_JPO17, + TILE_WIRE_JPO2, + TILE_WIRE_JPO3, + TILE_WIRE_JPO4, + TILE_WIRE_JPO5, + TILE_WIRE_JPO6, + TILE_WIRE_JPO7, + TILE_WIRE_JPO8, + TILE_WIRE_JPO9, + TILE_WIRE_JPSROA0, + TILE_WIRE_JPSROA1, + TILE_WIRE_JPSROA10, + TILE_WIRE_JPSROA11, + TILE_WIRE_JPSROA12, + TILE_WIRE_JPSROA13, + TILE_WIRE_JPSROA14, + TILE_WIRE_JPSROA15, + TILE_WIRE_JPSROA16, + TILE_WIRE_JPSROA17, + TILE_WIRE_JPSROA2, + TILE_WIRE_JPSROA3, + TILE_WIRE_JPSROA4, + TILE_WIRE_JPSROA5, + TILE_WIRE_JPSROA6, + TILE_WIRE_JPSROA7, + TILE_WIRE_JPSROA8, + TILE_WIRE_JPSROA9, + TILE_WIRE_JR0, + TILE_WIRE_JR1, + TILE_WIRE_JR10, + TILE_WIRE_JR11, + TILE_WIRE_JR12, + TILE_WIRE_JR13, + TILE_WIRE_JR14, + TILE_WIRE_JR15, + TILE_WIRE_JR16, + TILE_WIRE_JR17, + TILE_WIRE_JR18, + TILE_WIRE_JR19, + TILE_WIRE_JR2, + TILE_WIRE_JR20, + TILE_WIRE_JR21, + TILE_WIRE_JR22, + TILE_WIRE_JR23, + TILE_WIRE_JR24, + TILE_WIRE_JR25, + TILE_WIRE_JR26, + TILE_WIRE_JR27, + TILE_WIRE_JR28, + TILE_WIRE_JR29, + TILE_WIRE_JR3, + TILE_WIRE_JR30, + TILE_WIRE_JR31, + TILE_WIRE_JR32, + TILE_WIRE_JR33, + TILE_WIRE_JR34, + TILE_WIRE_JR35, + TILE_WIRE_JR36, + TILE_WIRE_JR37, + TILE_WIRE_JR38, + TILE_WIRE_JR39, + TILE_WIRE_JR4, + TILE_WIRE_JR40, + TILE_WIRE_JR41, + TILE_WIRE_JR42, + TILE_WIRE_JR43, + TILE_WIRE_JR44, + TILE_WIRE_JR45, + TILE_WIRE_JR46, + TILE_WIRE_JR47, + TILE_WIRE_JR48, + TILE_WIRE_JR49, + TILE_WIRE_JR5, + TILE_WIRE_JR50, + TILE_WIRE_JR51, + TILE_WIRE_JR52, + TILE_WIRE_JR53, + TILE_WIRE_JR6, + TILE_WIRE_JR7, + TILE_WIRE_JR8, + TILE_WIRE_JR9, + TILE_WIRE_JRCDIVX0, + TILE_WIRE_JRCDIVX1, + TILE_WIRE_JREFCLK0_0, + TILE_WIRE_JREFCLK0_1, + TILE_WIRE_JREFCLK0_2, + TILE_WIRE_JREFCLK0_3, + TILE_WIRE_JREFCLK0_4, + TILE_WIRE_JREFCLK0_5, + TILE_WIRE_JREFCLK0_6, + TILE_WIRE_JREFCLK1_0, + TILE_WIRE_JREFCLK1_1, + TILE_WIRE_JREFCLK1_2, + TILE_WIRE_JREFCLK1_3, + TILE_WIRE_JREFCLK1_4, + TILE_WIRE_JREFCLK1_5, + TILE_WIRE_JREFCLK1_6, + TILE_WIRE_JREFCLKFROMND, + TILE_WIRE_JROC27, + TILE_WIRE_JROC28, + TILE_WIRE_JROC29, + TILE_WIRE_JROC30, + TILE_WIRE_JROC31, + TILE_WIRE_JROC32, + TILE_WIRE_JROC33, + TILE_WIRE_JROC34, + TILE_WIRE_JROC35, + TILE_WIRE_JROC36, + TILE_WIRE_JROC37, + TILE_WIRE_JROC38, + TILE_WIRE_JROC39, + TILE_WIRE_JROC40, + TILE_WIRE_JROC41, + TILE_WIRE_JROC42, + TILE_WIRE_JROC43, + TILE_WIRE_JROC44, + TILE_WIRE_JROC45, + TILE_WIRE_JROC46, + TILE_WIRE_JROC47, + TILE_WIRE_JROC48, + TILE_WIRE_JROC49, + TILE_WIRE_JROC50, + TILE_WIRE_JROC51, + TILE_WIRE_JROC52, + TILE_WIRE_JROC53, + TILE_WIRE_JRST_CLKDIV0, + TILE_WIRE_JRST_CLKDIV1, + TILE_WIRE_JSEL_ECLKBRIDGECS0, + TILE_WIRE_JSEL_ECLKBRIDGECS1, + TILE_WIRE_JSEL_PLLREFCS, + TILE_WIRE_JSERDESREFCLK0, + TILE_WIRE_JSERDESREFCLK1, + TILE_WIRE_JSROA0, + TILE_WIRE_JSROA1, + TILE_WIRE_JSROA10, + TILE_WIRE_JSROA11, + TILE_WIRE_JSROA12, + TILE_WIRE_JSROA13, + TILE_WIRE_JSROA14, + TILE_WIRE_JSROA15, + TILE_WIRE_JSROA16, + TILE_WIRE_JSROA17, + TILE_WIRE_JSROA2, + TILE_WIRE_JSROA3, + TILE_WIRE_JSROA4, + TILE_WIRE_JSROA5, + TILE_WIRE_JSROA6, + TILE_WIRE_JSROA7, + TILE_WIRE_JSROA8, + TILE_WIRE_JSROA9, + TILE_WIRE_JSTOP_BRGECLKSYNC0, + TILE_WIRE_JSTOP_BRGECLKSYNC1, + TILE_WIRE_JSTOP_ECLKSYNC0, + TILE_WIRE_JSTOP_ECLKSYNC1, + TILE_WIRE_JTCK_TCK, + TILE_WIRE_JTDI_TDI, + TILE_WIRE_JTDO_TDO, + TILE_WIRE_JTMS_TMS, + TILE_WIRE_JTXREFCLK, + TILE_WIRE_JTXREFCLKCIB, + TILE_WIRE_KEEPWIRE, + TILE_WIRE_PCSCDIV10, + TILE_WIRE_PCSCDIV11, + TILE_WIRE_PCSCDIVI0, + TILE_WIRE_PCSCDIVI1, + TILE_WIRE_PCSCDIVX0, + TILE_WIRE_PCSCDIVX1, + TILE_WIRE_PLLCSOUT_PLLREFCS, + TILE_WIRE_REFCLK0, + TILE_WIRE_REFCLK1, + TILE_WIRE_RXREFCLK0, + TILE_WIRE_RXREFCLK1, + TILE_WIRE_SYNCECLK0, + TILE_WIRE_SYNCECLK1, + TILE_WIRE_Z_DLLDEL }; void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, -- cgit v1.2.3 From c26c5e7b8e9ea5a43ee9a5096dde340c945617b2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 20 Dec 2019 09:07:03 +0100 Subject: clang format --- ecp5/gfx.h | 47 ------------------- ecp5/synth/top.lpf | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 47 deletions(-) create mode 100644 ecp5/synth/top.lpf diff --git a/ecp5/gfx.h b/ecp5/gfx.h index cc01ad9b..db618679 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -2209,33 +2209,6 @@ enum GfxTileWireId TILE_WIRE_R_HPBX1400, TILE_WIRE_R_HPBX1500, - - - - - - - - - - - - - - - - - - - - - - - - - - - TILE_WIRE_JA0_CIBTEST, TILE_WIRE_JA1_CIBTEST, TILE_WIRE_JA2_CIBTEST, @@ -2301,7 +2274,6 @@ enum GfxTileWireId TILE_WIRE_JQ6_CIBTEST, TILE_WIRE_JQ7_CIBTEST, - TILE_WIRE_JA0_MULT9, TILE_WIRE_JA1_MULT9, TILE_WIRE_JA2_MULT9, @@ -2428,7 +2400,6 @@ enum GfxTileWireId TILE_WIRE_JSROB7_MULT9, TILE_WIRE_JSROB8_MULT9, - TILE_WIRE_JC0_PRADD9, TILE_WIRE_JC1_PRADD9, TILE_WIRE_JC2_PRADD9, @@ -2516,7 +2487,6 @@ enum GfxTileWireId TILE_WIRE_JSROB7_PRADD9, TILE_WIRE_JSROB8_PRADD9, - TILE_WIRE_JC0_PRADD18, TILE_WIRE_JC10_PRADD18, TILE_WIRE_JC11_PRADD18, @@ -2676,7 +2646,6 @@ enum GfxTileWireId TILE_WIRE_JSROB8_PRADD18, TILE_WIRE_JSROB9_PRADD18, - TILE_WIRE_JCE0_ALU24, TILE_WIRE_JCE1_ALU24, TILE_WIRE_JCE2_ALU24, @@ -2826,19 +2795,6 @@ enum GfxTileWireId TILE_WIRE_JSIGNEDIA_ALU24, TILE_WIRE_JSIGNEDIB_ALU24, - - - - - - - - - - - - - TILE_WIRE_G_BANK2ECLK0, TILE_WIRE_G_BANK2ECLK1, TILE_WIRE_G_BANK3ECLK0, @@ -3163,9 +3119,6 @@ enum GfxTileWireId TILE_WIRE_G_VPFS1000, TILE_WIRE_G_VPFS1100, - - - TILE_WIRE_BNK_ECLK0, TILE_WIRE_BNK_ECLK1, TILE_WIRE_BNK_INRD, diff --git a/ecp5/synth/top.lpf b/ecp5/synth/top.lpf new file mode 100644 index 00000000..dddc9552 --- /dev/null +++ b/ecp5/synth/top.lpf @@ -0,0 +1,132 @@ +BLOCK RESETPATHS; +BLOCK ASYNCPATHS; +LOCATE COMP "serial_tx" SITE "L4"; +IOBUF PORT "serial_tx" IO_TYPE=LVCMOS33; +LOCATE COMP "serial_rx" SITE "M1"; +IOBUF PORT "serial_rx" IO_TYPE=LVCMOS33; +LOCATE COMP "clk25" SITE "G2"; +IOBUF PORT "clk25" IO_TYPE=LVCMOS33; +LOCATE COMP "rst" SITE "R1"; +IOBUF PORT "rst" IO_TYPE=LVCMOS33; +LOCATE COMP "sdram_clock" SITE "F19"; +IOBUF PORT "sdram_clock" IO_TYPE=LVCMOS33; +LOCATE COMP "wifi_gpio0" SITE "L2"; +IOBUF PORT "wifi_gpio0" IO_TYPE=LVCMOS33; +LOCATE COMP "sdram_a[0]" SITE "M20"; +IOBUF PORT "sdram_a[0]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[0]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[1]" SITE "M19"; +IOBUF PORT "sdram_a[1]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[1]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[2]" SITE "L20"; +IOBUF PORT "sdram_a[2]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[2]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[3]" SITE "L19"; +IOBUF PORT "sdram_a[3]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[3]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[4]" SITE "K20"; +IOBUF PORT "sdram_a[4]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[4]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[5]" SITE "K19"; +IOBUF PORT "sdram_a[5]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[5]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[6]" SITE "K18"; +IOBUF PORT "sdram_a[6]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[6]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[7]" SITE "J20"; +IOBUF PORT "sdram_a[7]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[7]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[8]" SITE "J19"; +IOBUF PORT "sdram_a[8]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[8]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[9]" SITE "H20"; +IOBUF PORT "sdram_a[9]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[9]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[10]" SITE "N19"; +IOBUF PORT "sdram_a[10]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[10]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[11]" SITE "G20"; +IOBUF PORT "sdram_a[11]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[11]" SLEWRATE=FAST; +LOCATE COMP "sdram_a[12]" SITE "G19"; +IOBUF PORT "sdram_a[12]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_a[12]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[0]" SITE "J16"; +IOBUF PORT "sdram_dq[0]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[0]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[1]" SITE "L18"; +IOBUF PORT "sdram_dq[1]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[1]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[2]" SITE "M18"; +IOBUF PORT "sdram_dq[2]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[2]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[3]" SITE "N18"; +IOBUF PORT "sdram_dq[3]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[3]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[4]" SITE "P18"; +IOBUF PORT "sdram_dq[4]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[4]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[5]" SITE "T18"; +IOBUF PORT "sdram_dq[5]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[5]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[6]" SITE "T17"; +IOBUF PORT "sdram_dq[6]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[6]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[7]" SITE "U20"; +IOBUF PORT "sdram_dq[7]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[7]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[8]" SITE "E19"; +IOBUF PORT "sdram_dq[8]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[8]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[9]" SITE "D20"; +IOBUF PORT "sdram_dq[9]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[9]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[10]" SITE "D19"; +IOBUF PORT "sdram_dq[10]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[10]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[11]" SITE "C20"; +IOBUF PORT "sdram_dq[11]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[11]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[12]" SITE "E18"; +IOBUF PORT "sdram_dq[12]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[12]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[13]" SITE "F18"; +IOBUF PORT "sdram_dq[13]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[13]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[14]" SITE "J18"; +IOBUF PORT "sdram_dq[14]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[14]" SLEWRATE=FAST; +LOCATE COMP "sdram_dq[15]" SITE "J17"; +IOBUF PORT "sdram_dq[15]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dq[15]" SLEWRATE=FAST; +LOCATE COMP "sdram_we_n" SITE "T20"; +IOBUF PORT "sdram_we_n" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_we_n" SLEWRATE=FAST; +LOCATE COMP "sdram_ras_n" SITE "R20"; +IOBUF PORT "sdram_ras_n" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_ras_n" SLEWRATE=FAST; +LOCATE COMP "sdram_cas_n" SITE "T19"; +IOBUF PORT "sdram_cas_n" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_cas_n" SLEWRATE=FAST; +LOCATE COMP "sdram_cs_n" SITE "P20"; +IOBUF PORT "sdram_cs_n" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_cs_n" SLEWRATE=FAST; +LOCATE COMP "sdram_cke" SITE "F20"; +IOBUF PORT "sdram_cke" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_cke" SLEWRATE=FAST; +LOCATE COMP "sdram_ba[0]" SITE "P19"; +IOBUF PORT "sdram_ba[0]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_ba[0]" SLEWRATE=FAST; +LOCATE COMP "sdram_ba[1]" SITE "N20"; +IOBUF PORT "sdram_ba[1]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_ba[1]" SLEWRATE=FAST; +LOCATE COMP "sdram_dm[0]" SITE "U19"; +IOBUF PORT "sdram_dm[0]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dm[0]" SLEWRATE=FAST; +LOCATE COMP "sdram_dm[1]" SITE "E20"; +IOBUF PORT "sdram_dm[1]" IO_TYPE=LVCMOS33; +IOBUF PORT "sdram_dm[1]" SLEWRATE=FAST; + +FREQUENCY PORT "clk25" 25.0 MHz; + +FREQUENCY PORT "clk25" 25.0 MHz; \ No newline at end of file -- cgit v1.2.3 From a05954249a46f87a218aad7db6db28f2a02444ec Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 20 Dec 2019 14:02:00 +0100 Subject: optimize and set order --- ecp5/gfx.cc | 512 ++++++++++++++++++++++++++++-------------------------------- 1 file changed, 236 insertions(+), 276 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index ea1a5a10..884388a8 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -156,253 +156,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y2 = el.y1; g.push_back(el); } - } - if (wire_type == id_WIRE_TYPE_PIO) { - bool top_bottom = (y == 0 || y == (h - 1)); - int gap = 3 - (tilewire - TILE_WIRE_PADDOD_PIO) / 7; - int num = (tilewire - TILE_WIRE_PADDOD_PIO) % 7; - if (top_bottom) { - el.x1 = x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); - el.x2 = el.x1; - if (y == h - 1) { - el.y1 = y + 1 - io_cell_h_y2; - el.y2 = el.y1 - 0.015f; - } else { - el.y1 = y + io_cell_h_y2; - el.y2 = el.y1 + 0.015f; - } - } else { - if (x == 0) { - el.x1 = x + 1 - io_cell_v_x1; - el.x2 = el.x1 + 0.015f; - } else { - el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; - } - el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); - el.y2 = el.y1; - } - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_DDRDLL) { - int num = (tilewire - TILE_WIRE_DDRDEL_DDRDLL); - el.x1 = x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); - el.x2 = el.x1; - if (y == h - 1) { - el.y1 = y + 0.2; - el.y2 = el.y1 - 0.015f; - } else { - el.y1 = y + 0.8; - el.y2 = el.y1 + 0.015f; - } - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_CCLK) { - int num = (tilewire - TILE_WIRE_JPADDI_CCLK); - el.x1 = x + slice_x1 + 0.0017f * (num + 1); - el.x2 = el.x1; - el.y1 = y + slice_y2 - 1 * slice_pitch; - el.y2 = el.y1 - 0.015f; - g.push_back(el); - } - - if (wire_type == id_WIRE_TYPE_IOLOGIC) { - int gap = 7 - (tilewire - TILE_WIRE_JLOADND_IOLOGIC) / 42; - int num = (tilewire - TILE_WIRE_JLOADND_IOLOGIC) % 42; - if (x == 0) { - el.x1 = x + 1 - io_cell_v_x1; - el.x2 = el.x1 + 0.015f; - } else { - el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; - } - el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_SIOLOGIC) { - int gap = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; - int num = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; - el.x1 = x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); - el.x2 = el.x1; - if (y == h - 1) { - el.y1 = y + 1 - io_cell_h_y2; - el.y2 = el.y1 - 0.015f; - } else { - el.y1 = y + io_cell_h_y2; - el.y2 = el.y1 + 0.015f; - } - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_DQS) { - int num = (tilewire - TILE_WIRE_DDRDEL_DQS); - if (x == 0) { - el.x1 = x + 1 - io_cell_v_x1; - el.x2 = el.x1 + 0.015f; - } else { - el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; - } - el.y1 = y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); - el.y2 = el.y1; - g.push_back(el); - } - - if (wire_type == id_WIRE_TYPE_EBR) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_MULT18) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_ALU54) { - int num = (tilewire - TILE_WIRE_JCLK0_ALU54) % 225; - int group = (tilewire - TILE_WIRE_JCLK0_ALU54) / 225; - if (group == 0) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - } else { - el.x1 = x + 0.97 + 0.005f; - el.x2 = x + 0.97; - } - el.y1 = y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_PLL) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CLKI_PLL + 1); - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_GSR) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCLK_GSR + 1); - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_JTAG) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_OSC) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_SED) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_DTR) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JSTARTPULSE_DTR + 1); - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_EXTREF) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_DCU) { - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_PCSCLKDIV) { - int num = (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; - int group = 1 - (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; - el.x1 = x + slice_x1 - 0.005f; - el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; - el.y2 = el.y1; - g.push_back(el); - } - - if (wire_type == id_WIRE_TYPE_V01) { - if (tilewire >= TILE_WIRE_V01N0001 && tilewire <= TILE_WIRE_V01S0100) { - el.x1 = x + switchbox_x1 + 0.0017f * (10 + tilewire - TILE_WIRE_V01N0001); - el.x2 = el.x1; - if (y == h - 2) - el.y1 = y + 1.1; - else - el.y1 = y + switchbox_y1 + 1; - - if (y == 0) - el.y2 = y + 0.9; - else - el.y2 = y + switchbox_y2; - - g.push_back(el); - } - } - if (wire_type == id_WIRE_TYPE_H01) { - if (tilewire >= TILE_WIRE_H01E0001 && tilewire <= TILE_WIRE_HL7W0001) { - if (x == w - 1) - el.x1 = x + 0.1; - else - el.x1 = x + switchbox_x1; - if (x == 1) - el.x2 = x - 0.1; - else - el.x2 = x + switchbox_x2 - 1; - el.y1 = y + switchbox_y1 + 0.0017f * (10 + tilewire - TILE_WIRE_H01E0001); - el.y2 = el.y1; - g.push_back(el); - } - } - if (wire_type == id_WIRE_TYPE_V00) { - int group = (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; - el.y2 = y + switchbox_y1 - 0.0017f * 4; - } else { - el.y1 = y + switchbox_y2; - el.y2 = y + switchbox_y2 + 0.0017f * 4; - } - g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_H00) { - int group = (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) { - el.x1 = x + switchbox_x2 + 0.0017f * 4; - el.x2 = x + switchbox_x2; - } else { - el.x1 = x + switchbox_x1 - 0.0017f * 4; - el.x2 = x + switchbox_x1; - } - g.push_back(el); - } - - if (wire_type == id_WIRE_TYPE_H02) { + } else if (wire_type == id_WIRE_TYPE_H02) { if (x == 0) el.x1 = 0.9; else @@ -443,9 +197,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y1 = y + switchbox_y1; if (x != 0 && x != 1) g.push_back(el); - } - - if (wire_type == id_WIRE_TYPE_V02) { + } else if (wire_type == id_WIRE_TYPE_V02) { if (y == 0) el.y1 = 0.9; else @@ -486,9 +238,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + switchbox_x1; if (y != 0 && y != 1) g.push_back(el); - } - - if (wire_type == id_WIRE_TYPE_H06) { + } else if (wire_type == id_WIRE_TYPE_H06) { if (x == 0) el.x1 = 0.9; else @@ -529,8 +279,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y1 = y + switchbox_y1; if (x != 0 && x != 1 && x != 2 && x != 3) g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_V06) { + } else if (wire_type == id_WIRE_TYPE_V06) { if (y == 0) el.y1 = 0.9; else @@ -571,8 +320,62 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + switchbox_x1; if (y != 0 && y != 1 && y != 2 && y != 3) g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_NONE) { + } else if (wire_type == id_WIRE_TYPE_V01) { + if (tilewire >= TILE_WIRE_V01N0001 && tilewire <= TILE_WIRE_V01S0100) { + el.x1 = x + switchbox_x1 + 0.0017f * (10 + tilewire - TILE_WIRE_V01N0001); + el.x2 = el.x1; + if (y == h - 2) + el.y1 = y + 1.1; + else + el.y1 = y + switchbox_y1 + 1; + + if (y == 0) + el.y2 = y + 0.9; + else + el.y2 = y + switchbox_y2; + + g.push_back(el); + } + } else if (wire_type == id_WIRE_TYPE_H01) { + if (tilewire >= TILE_WIRE_H01E0001 && tilewire <= TILE_WIRE_HL7W0001) { + if (x == w - 1) + el.x1 = x + 0.1; + else + el.x1 = x + switchbox_x1; + if (x == 1) + el.x2 = x - 0.1; + else + el.x2 = x + switchbox_x2 - 1; + el.y1 = y + switchbox_y1 + 0.0017f * (10 + tilewire - TILE_WIRE_H01E0001); + el.y2 = el.y1; + g.push_back(el); + } + } else if (wire_type == id_WIRE_TYPE_V00) { + int group = (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; + el.y2 = y + switchbox_y1 - 0.0017f * 4; + } else { + el.y1 = y + switchbox_y2; + el.y2 = y + switchbox_y2 + 0.0017f * 4; + } + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_H00) { + int group = (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) { + el.x1 = x + switchbox_x2 + 0.0017f * 4; + el.x2 = x + switchbox_x2; + } else { + el.x1 = x + switchbox_x1 - 0.0017f * 4; + el.x2 = x + switchbox_x1; + } + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_NONE) { if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <= TILE_WIRE_SBOUNCE) { el.x1 = x + switchbox_x2 - 0.0017f * 4; el.x2 = x + switchbox_x2 - 0.0017f * 8; @@ -584,8 +387,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y2 = el.y1; } g.push_back(el); - } - if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <= TILE_WIRE_EBOUNCE) { + } else if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <= TILE_WIRE_EBOUNCE) { el.y1 = y + switchbox_y1 + 0.0017f * 4; el.y2 = y + switchbox_y1 + 0.0017f * 8; if (tilewire == TILE_WIRE_WBOUNCE) { @@ -596,8 +398,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x2 = el.x1; } g.push_back(el); - } - if (tilewire >= TILE_WIRE_CLK0 && tilewire <= TILE_WIRE_LSR1) { + } else if (tilewire >= TILE_WIRE_CLK0 && tilewire <= TILE_WIRE_LSR1) { el.x1 = x + switchbox_x2; 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; @@ -630,7 +431,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } // TRELLIS_IO wires - if (tilewire >= TILE_WIRE_JDIA && tilewire <= TILE_WIRE_ECLKD) { + else if (tilewire >= TILE_WIRE_JDIA && tilewire <= TILE_WIRE_ECLKD) { el.x1 = x + 0.5f; el.x2 = x + 0.5f + 0.005f; bool top = (y == (h - 1)); @@ -642,7 +443,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } - if (tilewire >= TILE_WIRE_JCE0 && tilewire <= TILE_WIRE_JQ7) { + else if (tilewire >= TILE_WIRE_JCE0 && tilewire <= TILE_WIRE_JQ7) { el.x1 = x + switchbox_x2; el.x2 = x + switchbox_x2 + 0.005f; el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; @@ -650,7 +451,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } - if (tilewire >= TILE_WIRE_FCO && tilewire <= TILE_WIRE_FCI) { + else if (tilewire >= TILE_WIRE_FCO && tilewire <= TILE_WIRE_FCI) { int gap = (tilewire - TILE_WIRE_FCO) / 24; el.x1 = x + switchbox_x2; el.x2 = x + slice_x1 - 0.005f; @@ -659,7 +460,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } - if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <= TILE_WIRE_MUXLSR0) { + else if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <= TILE_WIRE_MUXLSR0) { int gap = (tilewire - TILE_WIRE_MUXCLK3) / 2; int part = (tilewire - TILE_WIRE_MUXCLK3) % 2; el.x1 = x + slice_x2 + 0.0051f; @@ -670,7 +471,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } - if (tilewire >= TILE_WIRE_WD3 && tilewire <= TILE_WIRE_WD0) { + else if (tilewire >= TILE_WIRE_WD3 && tilewire <= TILE_WIRE_WD0) { int part = (tilewire - TILE_WIRE_WD3) % 4; int group = (tilewire - TILE_WIRE_WD3) / 2; el.x1 = x + slice_x2 + 0.005f; @@ -688,8 +489,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x1 = x + slice_x2 + 0.005f; el.y1 = el.y2; g.push_back(el); - } - if (tilewire >= TILE_WIRE_WAD3 && tilewire <= TILE_WIRE_WAD0) { + } else if (tilewire >= TILE_WIRE_WAD3 && tilewire <= TILE_WIRE_WAD0) { int part = (tilewire - TILE_WIRE_WAD3) % 4; el.x1 = x + slice_x2 + 0.005f; el.x2 = x + slice_x2 + 0.005f + 0.0017f * (8 - part); @@ -715,8 +515,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y1 = el.y2; g.push_back(el); } - } - if (wire_type == id_WIRE_TYPE_G_HPBX) { + } else if (wire_type == id_WIRE_TYPE_G_HPBX) { el.x1 = x; el.x2 = x + 1; el.y1 = y + 0.1f + 0.0017f * (tilewire - TILE_WIRE_G_HPBX0000 + 1); @@ -727,27 +526,188 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x2 = el.x1; el.y2 = y + switchbox_y1; g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_G_VPTX) { + } else if (wire_type == id_WIRE_TYPE_G_VPTX) { el.x1 = x + 0.1f + 0.0017f * (tilewire - TILE_WIRE_G_VPTX0000 + 1); el.x2 = el.x1; el.y1 = y; el.y2 = y + 1; g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_L_HPBX) { + } else if (wire_type == id_WIRE_TYPE_L_HPBX) { el.x1 = x - 3; el.x2 = x + 0.08f; el.y1 = y + 0.0017f + 0.0017f * (tilewire - TILE_WIRE_L_HPBX0000 + 1); el.y2 = el.y1; g.push_back(el); - } - if (wire_type == id_WIRE_TYPE_R_HPBX) { + } else if (wire_type == id_WIRE_TYPE_R_HPBX) { el.x1 = x + 0.2; el.x2 = x + 3; el.y1 = y + 0.0017f + 0.0017f * (tilewire - TILE_WIRE_R_HPBX0000 + 1); el.y2 = el.y1; g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_PIO) { + bool top_bottom = (y == 0 || y == (h - 1)); + int gap = 3 - (tilewire - TILE_WIRE_PADDOD_PIO) / 7; + int num = (tilewire - TILE_WIRE_PADDOD_PIO) % 7; + if (top_bottom) { + el.x1 = x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); + el.x2 = el.x1; + if (y == h - 1) { + el.y1 = y + 1 - io_cell_h_y2; + el.y2 = el.y1 - 0.015f; + } else { + el.y1 = y + io_cell_h_y2; + el.y2 = el.y1 + 0.015f; + } + } else { + if (x == 0) { + el.x1 = x + 1 - io_cell_v_x1; + el.x2 = el.x1 + 0.015f; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } + el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y2 = el.y1; + } + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_DDRDLL) { + int num = (tilewire - TILE_WIRE_DDRDEL_DDRDLL); + el.x1 = x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); + el.x2 = el.x1; + if (y == h - 1) { + el.y1 = y + 0.2; + el.y2 = el.y1 - 0.015f; + } else { + el.y1 = y + 0.8; + el.y2 = el.y1 + 0.015f; + } + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_CCLK) { + int num = (tilewire - TILE_WIRE_JPADDI_CCLK); + el.x1 = x + slice_x1 + 0.0017f * (num + 1); + el.x2 = el.x1; + el.y1 = y + slice_y2 - 1 * slice_pitch; + el.y2 = el.y1 - 0.015f; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_IOLOGIC) { + int gap = 7 - (tilewire - TILE_WIRE_JLOADND_IOLOGIC) / 42; + int num = (tilewire - TILE_WIRE_JLOADND_IOLOGIC) % 42; + if (x == 0) { + el.x1 = x + 1 - io_cell_v_x1; + el.x2 = el.x1 + 0.015f; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } + el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_SIOLOGIC) { + int gap = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; + int num = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; + el.x1 = x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); + el.x2 = el.x1; + if (y == h - 1) { + el.y1 = y + 1 - io_cell_h_y2; + el.y2 = el.y1 - 0.015f; + } else { + el.y1 = y + io_cell_h_y2; + el.y2 = el.y1 + 0.015f; + } + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_DQS) { + int num = (tilewire - TILE_WIRE_DDRDEL_DQS); + if (x == 0) { + el.x1 = x + 1 - io_cell_v_x1; + el.x2 = el.x1 + 0.015f; + } else { + el.x1 = x + io_cell_v_x1; + el.x2 = el.x1 - 0.015f; + } + el.y1 = y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_EBR) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_MULT18) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_ALU54) { + int num = (tilewire - TILE_WIRE_JCLK0_ALU54) % 225; + int group = (tilewire - TILE_WIRE_JCLK0_ALU54) / 225; + if (group == 0) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + } else { + el.x1 = x + 0.97 + 0.005f; + el.x2 = x + 0.97; + } + el.y1 = y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_PLL) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CLKI_PLL + 1); + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_GSR) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCLK_GSR + 1); + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_JTAG) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_OSC) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_SED) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_DTR) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JSTARTPULSE_DTR + 1); + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_EXTREF) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_DCU) { + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + el.y2 = el.y1; + g.push_back(el); + } else if (wire_type == id_WIRE_TYPE_PCSCLKDIV) { + int num = (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; + int group = 1 - (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; + el.x1 = x + slice_x1 - 0.005f; + el.x2 = x + slice_x1; + el.y1 = y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; + el.y2 = el.y1; + g.push_back(el); } } -- cgit v1.2.3 From d399346de0f258a4871ce6e5162481586175f76d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 20 Dec 2019 15:25:10 +0100 Subject: Add options to enable/disable displayed elements --- gui/base.qrc | 4 ++++ gui/basewindow.cc | 44 ++++++++++++++++++++++++++++++++++ gui/basewindow.h | 6 +++++ gui/fpgaviewwidget.cc | 61 +++++++++++++++++++++++++++++++++++------------- gui/fpgaviewwidget.h | 6 +++++ gui/resources/bel.png | Bin 0 -> 516 bytes gui/resources/group.png | Bin 0 -> 529 bytes gui/resources/pip.png | Bin 0 -> 367 bytes gui/resources/wire.png | Bin 0 -> 365 bytes 9 files changed, 105 insertions(+), 16 deletions(-) create mode 100644 gui/resources/bel.png create mode 100644 gui/resources/group.png create mode 100644 gui/resources/pip.png create mode 100644 gui/resources/wire.png diff --git a/gui/base.qrc b/gui/base.qrc index 85d1432a..63612bf4 100644 --- a/gui/base.qrc +++ b/gui/base.qrc @@ -24,5 +24,9 @@ resources/open_json.png resources/save_json.png resources/py.png + resources/bel.png + resources/wire.png + resources/pip.png + resources/group.png diff --git a/gui/basewindow.cc b/gui/basewindow.cc index 550a4b93..7290f73c 100644 --- a/gui/basewindow.cc +++ b/gui/basewindow.cc @@ -225,6 +225,38 @@ void BaseMainWindow::createMenusAndBars() actionZoomOutbound->setIcon(QIcon(":/icons/resources/shape_square.png")); connect(actionZoomOutbound, &QAction::triggered, fpgaView, &FPGAViewWidget::zoomOutbound); + actionDisplayBel = new QAction("Enable/Disable Bels", this); + actionDisplayBel->setIcon(QIcon(":/icons/resources/bel.png")); + actionDisplayBel->setCheckable(true); + actionDisplayBel->setChecked(true); + connect(actionDisplayBel, &QAction::triggered, this, &BaseMainWindow::enableDisableDecals); + + actionDisplayWire = new QAction("Enable/Disable Wires", this); + actionDisplayWire->setIcon(QIcon(":/icons/resources/wire.png")); + actionDisplayWire->setCheckable(true); + actionDisplayWire->setChecked(true); + connect(actionDisplayWire, &QAction::triggered, this, &BaseMainWindow::enableDisableDecals); + + actionDisplayPip = new QAction("Enable/Disable Pips", this); + actionDisplayPip->setIcon(QIcon(":/icons/resources/pip.png")); + actionDisplayPip->setCheckable(true); +#ifdef ARCH_ECP5 + actionDisplayPip->setChecked(false); +#else + actionDisplayPip->setChecked(true); +#endif + connect(actionDisplayPip, &QAction::triggered, this, &BaseMainWindow::enableDisableDecals); + + actionDisplayGroups = new QAction("Enable/Disable Groups", this); + actionDisplayGroups->setIcon(QIcon(":/icons/resources/group.png")); + actionDisplayGroups->setCheckable(true); + actionDisplayGroups->setChecked(true); + connect(actionDisplayGroups, &QAction::triggered, this, &BaseMainWindow::enableDisableDecals); + + // set initial state + fpgaView->enableDisableDecals(actionDisplayBel->isChecked(), actionDisplayWire->isChecked(), + actionDisplayPip->isChecked(), actionDisplayGroups->isChecked()); + // Add main menu menuBar = new QMenuBar(); menuBar->setGeometry(QRect(0, 0, 1024, 27)); @@ -281,6 +313,11 @@ void BaseMainWindow::createMenusAndBars() deviceViewToolBar->addAction(actionZoomOut); deviceViewToolBar->addAction(actionZoomSelected); deviceViewToolBar->addAction(actionZoomOutbound); + deviceViewToolBar->addSeparator(); + deviceViewToolBar->addAction(actionDisplayBel); + deviceViewToolBar->addAction(actionDisplayWire); + deviceViewToolBar->addAction(actionDisplayPip); + deviceViewToolBar->addAction(actionDisplayGroups); // Add status bar with progress bar statusBar = new QStatusBar(); @@ -293,6 +330,13 @@ void BaseMainWindow::createMenusAndBars() setStatusBar(statusBar); } +void BaseMainWindow::enableDisableDecals() +{ + fpgaView->enableDisableDecals(actionDisplayBel->isChecked(), actionDisplayWire->isChecked(), + actionDisplayPip->isChecked(), actionDisplayGroups->isChecked()); + ctx->refreshUi(); +} + void BaseMainWindow::open_json() { QString fileName = QFileDialog::getOpenFileName(this, QString("Open JSON"), QString(), QString("*.json")); diff --git a/gui/basewindow.h b/gui/basewindow.h index 305cb6c9..7562307e 100644 --- a/gui/basewindow.h +++ b/gui/basewindow.h @@ -56,6 +56,7 @@ class BaseMainWindow : public QMainWindow protected: void createMenusAndBars(); void disableActions(); + void enableDisableDecals(); virtual void onDisableActions(){}; virtual void onUpdateActions(){}; @@ -122,6 +123,11 @@ class BaseMainWindow : public QMainWindow QAction *actionPlay; QAction *actionPause; QAction *actionStop; + + QAction *actionDisplayBel; + QAction *actionDisplayWire; + QAction *actionDisplayPip; + QAction *actionDisplayGroups; }; NEXTPNR_NAMESPACE_END diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc index f2929d6e..2e1bbf63 100644 --- a/gui/fpgaviewwidget.cc +++ b/gui/fpgaviewwidget.cc @@ -66,6 +66,11 @@ FPGAViewWidget::FPGAViewWidget(QWidget *parent) renderRunner_->start(); renderRunner_->startTimer(1000 / 2); // render lines 2 times per second setMouseTracking(true); + + displayBel_ = false; + displayWire_ = false; + displayPip_ = false; + displayGroup_ = false; } FPGAViewWidget::~FPGAViewWidget() {} @@ -333,6 +338,14 @@ void FPGAViewWidget::paintGL() void FPGAViewWidget::pokeRenderer(void) { renderRunner_->poke(); } +void FPGAViewWidget::enableDisableDecals(bool bels, bool wires, bool pips, bool groups) +{ + displayBel_ = bels; + displayWire_ = wires; + displayPip_ = pips; + displayGroup_ = groups; +} + void FPGAViewWidget::renderLines(void) { if (ctx_ == nullptr) @@ -379,17 +392,25 @@ void FPGAViewWidget::renderLines(void) // Local copy of decals, taken as fast as possible to not block the P&R. if (decalsChanged) { - for (auto bel : ctx_->getBels()) { - belDecals.push_back({ctx_->getBelDecal(bel), bel}); + if (displayBel_) { + for (auto bel : ctx_->getBels()) { + belDecals.push_back({ctx_->getBelDecal(bel), bel}); + } } - for (auto wire : ctx_->getWires()) { - wireDecals.push_back({ctx_->getWireDecal(wire), wire}); + if (displayWire_) { + for (auto wire : ctx_->getWires()) { + wireDecals.push_back({ctx_->getWireDecal(wire), wire}); + } } - for (auto pip : ctx_->getPips()) { - pipDecals.push_back({ctx_->getPipDecal(pip), pip}); + if (displayPip_) { + for (auto pip : ctx_->getPips()) { + pipDecals.push_back({ctx_->getPipDecal(pip), pip}); + } } - for (auto group : ctx_->getGroups()) { - groupDecals.push_back({ctx_->getGroupDecal(group), group}); + if (displayGroup_) { + for (auto group : ctx_->getGroups()) { + groupDecals.push_back({ctx_->getGroupDecal(group), group}); + } } } } @@ -430,20 +451,28 @@ void FPGAViewWidget::renderLines(void) data->bbGlobal.clear(); // Draw Bels. - for (auto const &decal : belDecals) { - renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first); + if (displayBel_) { + for (auto const &decal : belDecals) { + renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first); + } } // Draw Wires. - for (auto const &decal : wireDecals) { - renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first); + if (displayWire_) { + for (auto const &decal : wireDecals) { + renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first); + } } // Draw Pips. - for (auto const &decal : pipDecals) { - renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first); + if (displayPip_) { + for (auto const &decal : pipDecals) { + renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first); + } } // Draw Groups. - for (auto const &decal : groupDecals) { - renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first); + if (displayGroup_) { + for (auto const &decal : groupDecals) { + renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first); + } } // Bounding box should be calculated by now. diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index c5ce9b18..735590ba 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -119,6 +119,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions void zoomOut(); void zoomSelected(); void zoomOutbound(); + void enableDisableDecals(bool bels, bool wires, bool pips, bool groups); Q_SIGNALS: void clickedBel(BelId bel, bool add); @@ -227,6 +228,11 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions QMatrix4x4 viewMove_; float zoom_; + bool displayBel_; + bool displayWire_; + bool displayPip_; + bool displayGroup_; + struct { QColor background; diff --git a/gui/resources/bel.png b/gui/resources/bel.png new file mode 100644 index 00000000..2aab6d46 Binary files /dev/null and b/gui/resources/bel.png differ diff --git a/gui/resources/group.png b/gui/resources/group.png new file mode 100644 index 00000000..2d508549 Binary files /dev/null and b/gui/resources/group.png differ diff --git a/gui/resources/pip.png b/gui/resources/pip.png new file mode 100644 index 00000000..7bd87ae8 Binary files /dev/null and b/gui/resources/pip.png differ diff --git a/gui/resources/wire.png b/gui/resources/wire.png new file mode 100644 index 00000000..5fa55d90 Binary files /dev/null and b/gui/resources/wire.png differ -- cgit v1.2.3 From 50f87a6024859d197eefa8de0b0b616b1e03e239 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 28 Dec 2019 13:51:02 +0100 Subject: add newline at eof --- ecp5/constids.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecp5/constids.inc b/ecp5/constids.inc index ce813778..b38e23ef 100644 --- a/ecp5/constids.inc +++ b/ecp5/constids.inc @@ -1328,4 +1328,4 @@ X(WIRE_TYPE_V06) X(WIRE_TYPE_G_HPBX) X(WIRE_TYPE_G_VPTX) X(WIRE_TYPE_L_HPBX) -X(WIRE_TYPE_R_HPBX) \ No newline at end of file +X(WIRE_TYPE_R_HPBX) -- cgit v1.2.3 From 6ebe2fd03471e9f5511086f4726dc31a35d537dc Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 28 Dec 2019 14:08:58 +0100 Subject: remove synt example --- ecp5/synth/top.lpf | 132 ----------------------------------------------------- 1 file changed, 132 deletions(-) delete mode 100644 ecp5/synth/top.lpf diff --git a/ecp5/synth/top.lpf b/ecp5/synth/top.lpf deleted file mode 100644 index dddc9552..00000000 --- a/ecp5/synth/top.lpf +++ /dev/null @@ -1,132 +0,0 @@ -BLOCK RESETPATHS; -BLOCK ASYNCPATHS; -LOCATE COMP "serial_tx" SITE "L4"; -IOBUF PORT "serial_tx" IO_TYPE=LVCMOS33; -LOCATE COMP "serial_rx" SITE "M1"; -IOBUF PORT "serial_rx" IO_TYPE=LVCMOS33; -LOCATE COMP "clk25" SITE "G2"; -IOBUF PORT "clk25" IO_TYPE=LVCMOS33; -LOCATE COMP "rst" SITE "R1"; -IOBUF PORT "rst" IO_TYPE=LVCMOS33; -LOCATE COMP "sdram_clock" SITE "F19"; -IOBUF PORT "sdram_clock" IO_TYPE=LVCMOS33; -LOCATE COMP "wifi_gpio0" SITE "L2"; -IOBUF PORT "wifi_gpio0" IO_TYPE=LVCMOS33; -LOCATE COMP "sdram_a[0]" SITE "M20"; -IOBUF PORT "sdram_a[0]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[0]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[1]" SITE "M19"; -IOBUF PORT "sdram_a[1]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[1]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[2]" SITE "L20"; -IOBUF PORT "sdram_a[2]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[2]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[3]" SITE "L19"; -IOBUF PORT "sdram_a[3]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[3]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[4]" SITE "K20"; -IOBUF PORT "sdram_a[4]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[4]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[5]" SITE "K19"; -IOBUF PORT "sdram_a[5]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[5]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[6]" SITE "K18"; -IOBUF PORT "sdram_a[6]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[6]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[7]" SITE "J20"; -IOBUF PORT "sdram_a[7]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[7]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[8]" SITE "J19"; -IOBUF PORT "sdram_a[8]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[8]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[9]" SITE "H20"; -IOBUF PORT "sdram_a[9]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[9]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[10]" SITE "N19"; -IOBUF PORT "sdram_a[10]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[10]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[11]" SITE "G20"; -IOBUF PORT "sdram_a[11]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[11]" SLEWRATE=FAST; -LOCATE COMP "sdram_a[12]" SITE "G19"; -IOBUF PORT "sdram_a[12]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_a[12]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[0]" SITE "J16"; -IOBUF PORT "sdram_dq[0]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[0]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[1]" SITE "L18"; -IOBUF PORT "sdram_dq[1]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[1]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[2]" SITE "M18"; -IOBUF PORT "sdram_dq[2]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[2]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[3]" SITE "N18"; -IOBUF PORT "sdram_dq[3]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[3]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[4]" SITE "P18"; -IOBUF PORT "sdram_dq[4]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[4]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[5]" SITE "T18"; -IOBUF PORT "sdram_dq[5]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[5]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[6]" SITE "T17"; -IOBUF PORT "sdram_dq[6]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[6]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[7]" SITE "U20"; -IOBUF PORT "sdram_dq[7]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[7]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[8]" SITE "E19"; -IOBUF PORT "sdram_dq[8]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[8]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[9]" SITE "D20"; -IOBUF PORT "sdram_dq[9]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[9]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[10]" SITE "D19"; -IOBUF PORT "sdram_dq[10]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[10]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[11]" SITE "C20"; -IOBUF PORT "sdram_dq[11]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[11]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[12]" SITE "E18"; -IOBUF PORT "sdram_dq[12]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[12]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[13]" SITE "F18"; -IOBUF PORT "sdram_dq[13]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[13]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[14]" SITE "J18"; -IOBUF PORT "sdram_dq[14]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[14]" SLEWRATE=FAST; -LOCATE COMP "sdram_dq[15]" SITE "J17"; -IOBUF PORT "sdram_dq[15]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dq[15]" SLEWRATE=FAST; -LOCATE COMP "sdram_we_n" SITE "T20"; -IOBUF PORT "sdram_we_n" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_we_n" SLEWRATE=FAST; -LOCATE COMP "sdram_ras_n" SITE "R20"; -IOBUF PORT "sdram_ras_n" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_ras_n" SLEWRATE=FAST; -LOCATE COMP "sdram_cas_n" SITE "T19"; -IOBUF PORT "sdram_cas_n" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_cas_n" SLEWRATE=FAST; -LOCATE COMP "sdram_cs_n" SITE "P20"; -IOBUF PORT "sdram_cs_n" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_cs_n" SLEWRATE=FAST; -LOCATE COMP "sdram_cke" SITE "F20"; -IOBUF PORT "sdram_cke" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_cke" SLEWRATE=FAST; -LOCATE COMP "sdram_ba[0]" SITE "P19"; -IOBUF PORT "sdram_ba[0]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_ba[0]" SLEWRATE=FAST; -LOCATE COMP "sdram_ba[1]" SITE "N20"; -IOBUF PORT "sdram_ba[1]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_ba[1]" SLEWRATE=FAST; -LOCATE COMP "sdram_dm[0]" SITE "U19"; -IOBUF PORT "sdram_dm[0]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dm[0]" SLEWRATE=FAST; -LOCATE COMP "sdram_dm[1]" SITE "E20"; -IOBUF PORT "sdram_dm[1]" IO_TYPE=LVCMOS33; -IOBUF PORT "sdram_dm[1]" SLEWRATE=FAST; - -FREQUENCY PORT "clk25" 25.0 MHz; - -FREQUENCY PORT "clk25" 25.0 MHz; \ No newline at end of file -- cgit v1.2.3 From 6cca93543bb9177f3ead83590c0d835c0bb8a3eb Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 28 Dec 2019 14:27:14 +0100 Subject: move constants to gfx.cc --- ecp5/gfx.cc | 18 ++++++++++++++++++ ecp5/gfx.h | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 884388a8..c1c08377 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -22,6 +22,24 @@ NEXTPNR_NAMESPACE_BEGIN +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; + void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, GraphicElement::style_t style) { diff --git a/ecp5/gfx.h b/ecp5/gfx.h index db618679..947b5551 100644 --- a/ecp5/gfx.h +++ b/ecp5/gfx.h @@ -29,24 +29,6 @@ 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; - enum GfxTileWireId { TILE_WIRE_NONE, -- cgit v1.2.3 From 59f4755e8f7de0266f4ab1f07f986a424bb321a2 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 28 Dec 2019 15:01:36 +0100 Subject: made most of frequent numbers constants --- ecp5/gfx.cc | 558 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 285 insertions(+), 273 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index c1c08377..3f64f0f0 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -24,6 +24,7 @@ NEXTPNR_NAMESPACE_BEGIN const float slice_x1 = 0.92; 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; @@ -33,13 +34,24 @@ 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_gap = 0.10; 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; +const float wire_distance = 0.0017f; +const float wire_distance_small = 0.00085f; + +const float wire_length = 0.005f; +const float wire_length_long = 0.015f; + +const float dll_cell_x1 = 0.2; +const float dll_cell_x2 = 0.8; +const float dll_cell_y1 = 0.2; +const float dll_cell_y2 = 0.8; + void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, GraphicElement::style_t style) { @@ -54,18 +66,18 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int g.push_back(el); el.style = GraphicElement::STYLE_FRAME; - 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 + (3 - z) * 26) + + el.x1 = x + slice_x2 + 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 + 0.0017f * 5; + el.y2 = el.y1 + wire_distance * 5; g.push_back(el); } else if (bel_type == id_TRELLIS_IO || bel_type == id_IOLOGIC || bel_type == id_SIOLOGIC || bel_type == id_DQSBUFM) { bool top_bottom = (y == 0 || y == (h - 1)); if (top_bottom) { - el.x1 = x + io_cell_h_x1 + (z + 2) * 0.10; - el.x2 = x + io_cell_h_x1 + (z + 2) * 0.10 + 0.08f; + el.x1 = x + io_cell_h_x1 + (z + 2) * io_cell_gap; + el.x2 = x + io_cell_h_x1 + (z + 2) * io_cell_gap + 0.08f; if (y == h - 1) { el.y1 = y + 1 - io_cell_h_y1; el.y2 = y + 1 - io_cell_h_y2; @@ -81,8 +93,8 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int el.x1 = x + io_cell_v_x1; el.x2 = x + io_cell_v_x2; } - el.y1 = y + io_cell_v_y1 + z * 0.10; - el.y2 = y + io_cell_v_y1 + z * 0.10 + 0.08f; + el.y1 = y + io_cell_v_y1 + z * io_cell_gap; + el.y2 = y + io_cell_v_y1 + z * io_cell_gap + 0.08f; } g.push_back(el); } else if (bel_type == id_DCCA) { @@ -93,34 +105,34 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int g.push_back(el); } else if (bel_type == id_DP16KD || bel_type == id_MULT18X18D || bel_type == id_ALU54B) { el.x1 = x + slice_x1; - el.x2 = x + 0.97; + el.x2 = x + slice_x2_wide; el.y1 = y + slice_y1 - 1 * slice_pitch; el.y2 = y + slice_y2 + 3 * slice_pitch; g.push_back(el); } else if (bel_type == id_EHXPLLL) { el.x1 = x + slice_x1; - el.x2 = x + 0.97; + el.x2 = x + slice_x2_wide; el.y1 = y + slice_y1; el.y2 = y + slice_y2; g.push_back(el); } else if (bel_type == id_DCUA) { el.x1 = x + slice_x1; - el.x2 = x + 0.97; + el.x2 = x + slice_x2_wide; el.y1 = y + slice_y2; el.y2 = y + 0.25; g.push_back(el); } else if (bel_type == id_EXTREFB || bel_type == id_PCSCLKDIV || bel_type == id_DTR || bel_type == id_USRMCLK || bel_type == id_SEDGA || bel_type == id_GSR || bel_type == id_JTAGG || bel_type == id_OSCG) { el.x1 = x + slice_x1; - el.x2 = x + 0.97; + el.x2 = x + slice_x2_wide; el.y1 = y + slice_y1 + (z)*slice_pitch; el.y2 = y + slice_y2 + (z)*slice_pitch; g.push_back(el); } else if (bel_type == id_DDRDLL) { - el.x1 = x + 0.2; - el.x2 = x + 0.8; - el.y1 = y + 0.2; - el.y2 = y + 0.8; + el.x1 = x + dll_cell_x1; + el.x2 = x + dll_cell_x2; + el.y1 = y + dll_cell_y1; + el.y2 = y + dll_cell_y2; g.push_back(el); } else if (bel_type == id_DLLDELD || bel_type == id_CLKDIVF || bel_type == id_ECLKSYNCB || bel_type == id_TRELLIS_ECLKBUF || bel_type == id_ECLKBRIDGECS) { @@ -142,35 +154,35 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS 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.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_FCO_SLICE + 1 + gap * 2) + 3 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_FCO_SLICE + 1 + gap * 2) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); // 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; + el.y2 = el.y1 - wire_distance; g.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; + el.y2 = el.y1 + wire_distance; g.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; + el.y2 = el.y1 - wire_distance * 3; g.push_back(el); } } if (tilewire >= TILE_WIRE_DUMMY_D2 && tilewire <= TILE_WIRE_WAD0A_SLICE) { int gap = (tilewire - TILE_WIRE_DUMMY_D2) / 12; - el.x1 = x + slice_x2 + 0.005f; + el.x1 = x + slice_x2 + wire_length; el.x2 = x + slice_x2; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_DUMMY_D2 + 1 + gap * 14) + 3 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_DUMMY_D2 + 1 + gap * 14) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); } @@ -178,17 +190,17 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (x == 0) el.x1 = 0.9; else - el.x1 = x + switchbox_x1 + 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.x1 = x + switchbox_x1 + wire_distance * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.x2 = el.x1; el.y1 = y + switchbox_y1; - el.y2 = y + switchbox_y1 - 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.y2 = y + switchbox_y1 - wire_distance * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); if (x != 0 && x != w - 1) g.push_back(el); if (x == w - 2) el.x2 = x + 1 + 0.1; else - el.x2 = x + 1 + switchbox_x1 + 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.x2 = x + 1 + switchbox_x1 + wire_distance * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.y1 = el.y2; if (x != w - 1) g.push_back(el); @@ -201,12 +213,12 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (x == w - 1) el.x1 = x + 0.1; else - el.x1 = x + switchbox_x1 + 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.x1 = x + switchbox_x1 + wire_distance * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); if (x == 1) el.x2 = x - 1 + 0.9; else - el.x2 = x - 1 + switchbox_x1 + 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); - el.y2 = y + switchbox_y1 - 0.0017f * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.x2 = x - 1 + switchbox_x1 + wire_distance * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); + el.y2 = y + switchbox_y1 - wire_distance * (20 + (tilewire - TILE_WIRE_H02W0701) + 20 * (x % 3)); el.y1 = el.y2; if (x != 0) g.push_back(el); @@ -219,17 +231,17 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (y == 0) el.y1 = 0.9; else - el.y1 = y + switchbox_y1 + 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + el.y1 = y + switchbox_y1 + wire_distance * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); el.y2 = el.y1; el.x1 = x + switchbox_x1; - el.x2 = x + switchbox_x1 - 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + el.x2 = x + switchbox_x1 - wire_distance * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); if (y != 0 && y != h - 1) g.push_back(el); if (y == h - 2) el.y2 = y + 1 + 0.1; else - el.y2 = y + 1 + switchbox_y1 + 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + el.y2 = y + 1 + switchbox_y1 + wire_distance * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); el.x1 = el.x2; if (y != h - 1) g.push_back(el); @@ -242,12 +254,12 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (y == h - 1) el.y1 = y + 0.1; else - el.y1 = y + switchbox_y1 + 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + el.y1 = y + switchbox_y1 + wire_distance * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); if (y == 1) el.y2 = y - 1 + 0.9; else - el.y2 = y - 1 + switchbox_y1 + 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); - el.x2 = x + switchbox_x1 - 0.0017f * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + el.y2 = y - 1 + switchbox_y1 + wire_distance * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); + el.x2 = x + switchbox_x1 - wire_distance * (20 + (tilewire - TILE_WIRE_V02N0701) + 20 * (y % 3)); el.x1 = el.x2; if (y != 0) g.push_back(el); @@ -260,17 +272,17 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (x == 0) el.x1 = 0.9; else - el.x1 = x + switchbox_x1 + 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + el.x1 = x + switchbox_x1 + wire_distance * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); el.x2 = el.x1; el.y1 = y + switchbox_y1; - el.y2 = y + switchbox_y1 - 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + el.y2 = y + switchbox_y1 - wire_distance * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); if (x != 0 && x != w - 1) g.push_back(el); if (x == w - 2 || x == w - 3 || x == w - 4) el.x2 = w - 1 + 0.1; else - el.x2 = x + 3 + switchbox_x1 + 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + el.x2 = x + 3 + switchbox_x1 + wire_distance * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); el.y1 = el.y2; if (x != w - 1) g.push_back(el); @@ -283,12 +295,12 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (x == w - 1) el.x1 = x + 0.1; else - el.x1 = x + switchbox_x1 + 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + el.x1 = x + switchbox_x1 + wire_distance * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); if (x == 1 || x == 2 || x == 3) el.x2 = 0.9; else - el.x2 = x - 3 + switchbox_x1 + 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); - el.y2 = y + switchbox_y1 - 0.0017f * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + el.x2 = x - 3 + switchbox_x1 + wire_distance * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); + el.y2 = y + switchbox_y1 - wire_distance * (96 + (tilewire - TILE_WIRE_H06W0303) + 10 * (x % 9)); el.y1 = el.y2; if (x != 0) g.push_back(el); @@ -301,17 +313,17 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (y == 0) el.y1 = 0.9; else - el.y1 = y + switchbox_y1 + 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + el.y1 = y + switchbox_y1 + wire_distance * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); el.y2 = el.y1; el.x1 = x + switchbox_x1; - el.x2 = x + switchbox_x1 - 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + el.x2 = x + switchbox_x1 - wire_distance * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); if (y != 0 && y != h - 1) g.push_back(el); if (y == h - 2 || y == h - 3 || y == h - 4) el.y2 = h - 1 + 0.1; else - el.y2 = y + 3 + switchbox_y1 + 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + el.y2 = y + 3 + switchbox_y1 + wire_distance * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); el.x1 = el.x2; if (y != h - 1) g.push_back(el); @@ -324,12 +336,12 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS if (y == h - 1) el.y1 = y + 0.1; else - el.y1 = y + switchbox_y1 + 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + el.y1 = y + switchbox_y1 + wire_distance * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); if (y == 1 || y == 2 || y == 3) el.y2 = 0.9; else - el.y2 = y - 3 + switchbox_y1 + 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); - el.x2 = x + switchbox_x1 - 0.0017f * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + el.y2 = y - 3 + switchbox_y1 + wire_distance * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); + el.x2 = x + switchbox_x1 - wire_distance * (96 + (tilewire - TILE_WIRE_V06N0303) + 10 * (y % 9)); el.x1 = el.x2; if (y != 0) g.push_back(el); @@ -340,7 +352,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } else if (wire_type == id_WIRE_TYPE_V01) { if (tilewire >= TILE_WIRE_V01N0001 && tilewire <= TILE_WIRE_V01S0100) { - el.x1 = x + switchbox_x1 + 0.0017f * (10 + tilewire - TILE_WIRE_V01N0001); + el.x1 = x + switchbox_x1 + wire_distance * (10 + tilewire - TILE_WIRE_V01N0001); el.x2 = el.x1; if (y == h - 2) el.y1 = y + 1.1; @@ -364,82 +376,82 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.x2 = x - 0.1; else el.x2 = x + switchbox_x2 - 1; - el.y1 = y + switchbox_y1 + 0.0017f * (10 + tilewire - TILE_WIRE_H01E0001); + el.y1 = y + switchbox_y1 + wire_distance * (10 + tilewire - TILE_WIRE_H01E0001); el.y2 = el.y1; g.push_back(el); } } else if (wire_type == id_WIRE_TYPE_V00) { int group = (tilewire - TILE_WIRE_V00T0000) / 2; - el.x1 = x + switchbox_x2 - 0.0017f * (8 - ((tilewire - TILE_WIRE_V00T0000) % 2) * 4); + el.x1 = x + switchbox_x2 - wire_distance * (8 - ((tilewire - TILE_WIRE_V00T0000) % 2) * 4); el.x2 = el.x1; if (group) { el.y1 = y + switchbox_y1; - el.y2 = y + switchbox_y1 - 0.0017f * 4; + el.y2 = y + switchbox_y1 - wire_distance * 4; } else { el.y1 = y + switchbox_y2; - el.y2 = y + switchbox_y2 + 0.0017f * 4; + el.y2 = y + switchbox_y2 + wire_distance * 4; } g.push_back(el); } else if (wire_type == id_WIRE_TYPE_H00) { int group = (tilewire - TILE_WIRE_H00L0000) / 2; - el.y1 = y + switchbox_y1 + 0.0017f * (8 - ((tilewire - TILE_WIRE_H00L0000) % 2) * 4); + el.y1 = y + switchbox_y1 + wire_distance * (8 - ((tilewire - TILE_WIRE_H00L0000) % 2) * 4); el.y2 = el.y1; if (group) { - el.x1 = x + switchbox_x2 + 0.0017f * 4; + el.x1 = x + switchbox_x2 + wire_distance * 4; el.x2 = x + switchbox_x2; } else { - el.x1 = x + switchbox_x1 - 0.0017f * 4; + el.x1 = x + switchbox_x1 - wire_distance * 4; el.x2 = x + switchbox_x1; } g.push_back(el); } else if (wire_type == id_WIRE_TYPE_NONE) { if (tilewire >= TILE_WIRE_NBOUNCE && tilewire <= TILE_WIRE_SBOUNCE) { - el.x1 = x + switchbox_x2 - 0.0017f * 4; - el.x2 = x + switchbox_x2 - 0.0017f * 8; + el.x1 = x + switchbox_x2 - wire_distance * 4; + el.x2 = x + switchbox_x2 - wire_distance * 8; if (tilewire == TILE_WIRE_NBOUNCE) { - el.y1 = y + switchbox_y2 + 0.0017f * 4; + el.y1 = y + switchbox_y2 + wire_distance * 4; el.y2 = el.y1; } else { - el.y1 = y + switchbox_y1 - 0.0017f * 4; + el.y1 = y + switchbox_y1 - wire_distance * 4; el.y2 = el.y1; } g.push_back(el); } else if (tilewire >= TILE_WIRE_WBOUNCE && tilewire <= TILE_WIRE_EBOUNCE) { - el.y1 = y + switchbox_y1 + 0.0017f * 4; - el.y2 = y + switchbox_y1 + 0.0017f * 8; + el.y1 = y + switchbox_y1 + wire_distance * 4; + el.y2 = y + switchbox_y1 + wire_distance * 8; if (tilewire == TILE_WIRE_WBOUNCE) { - el.x1 = x + switchbox_x1 - 0.0017f * 4; + el.x1 = x + switchbox_x1 - wire_distance * 4; el.x2 = el.x1; } else { - el.x1 = x + switchbox_x2 + 0.0017f * 4; + el.x1 = x + switchbox_x2 + wire_distance * 4; el.x2 = el.x1; } g.push_back(el); } else if (tilewire >= TILE_WIRE_CLK0 && tilewire <= TILE_WIRE_LSR1) { el.x1 = x + switchbox_x2; - 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.x2 = x + slice_x2 + 15*wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (3 + (tilewire - TILE_WIRE_CLK0)); + el.y2 = y + slice_y2 - wire_distance * (3 + (tilewire - TILE_WIRE_CLK0)); g.push_back(el); 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.x1 = x + slice_x2 + 15*wire_distance + wire_distance; + el.x2 = x + slice_x2 + 15*wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; el.y1 = y + slice_y2 - - 0.0017f * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 1 + tilewire - TILE_WIRE_CLK0) + + wire_distance * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 1 + tilewire - TILE_WIRE_CLK0) + i * slice_pitch; el.y2 = el.y1; g.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.x1 = x + slice_x2 + 3*wire_distance; + el.x2 = x + slice_x2 + 15*wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; el.y1 = y + slice_y2 - - 0.0017f * + wire_distance * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 - 1 + (tilewire - TILE_WIRE_CLK0) / 2) + i * slice_pitch; el.y2 = el.y1; @@ -451,20 +463,20 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS // TRELLIS_IO wires else if (tilewire >= TILE_WIRE_JDIA && tilewire <= TILE_WIRE_ECLKD) { el.x1 = x + 0.5f; - el.x2 = x + 0.5f + 0.005f; + el.x2 = x + 0.5f + wire_length; bool top = (y == (h - 1)); if (top) - el.y1 = y + 1 - (slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); + el.y1 = y + 1 - (slice_y2 - wire_distance * (tilewire - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); else - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (tilewire >= TILE_WIRE_JCE0 && tilewire <= TILE_WIRE_JQ7) { el.x1 = x + switchbox_x2; - el.x2 = x + switchbox_x2 + 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + el.x2 = x + switchbox_x2 + wire_length; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); } @@ -472,8 +484,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS else if (tilewire >= TILE_WIRE_FCO && tilewire <= TILE_WIRE_FCI) { int gap = (tilewire - TILE_WIRE_FCO) / 24; el.x1 = x + switchbox_x2; - el.x2 = x + slice_x1 - 0.005f; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; + el.x2 = x + slice_x1 - wire_length; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); } @@ -481,9 +493,9 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS else if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <= TILE_WIRE_MUXLSR0) { int gap = (tilewire - TILE_WIRE_MUXCLK3) / 2; int part = (tilewire - TILE_WIRE_MUXCLK3) % 2; - 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) + + el.x1 = x + slice_x2 + 3*wire_distance; + el.x2 = x + slice_x2 + 15*wire_distance; + el.y1 = y + slice_y2 - wire_distance * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + gap * 26) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); @@ -492,43 +504,43 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS else if (tilewire >= TILE_WIRE_WD3 && tilewire <= TILE_WIRE_WD0) { int part = (tilewire - TILE_WIRE_WD3) % 4; int group = (tilewire - TILE_WIRE_WD3) / 2; - 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_D2 + 1 + part + 14) + + el.x1 = x + slice_x2 + wire_length; + el.x2 = x + slice_x2 + wire_length + wire_distance * (4 - part); + el.y1 = y + slice_y2 - wire_distance * (TILE_WIRE_WDO3C_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + 14) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WD1B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + (part & 1) + 14 * 2) + + el.y2 = y + slice_y2 - wire_distance * (TILE_WIRE_WD1B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + (part & 1) + 14 * 2) + (3 - group) * slice_pitch; g.push_back(el); - el.x1 = x + slice_x2 + 0.005f; + el.x1 = x + slice_x2 + wire_length; el.y1 = el.y2; g.push_back(el); } else if (tilewire >= TILE_WIRE_WAD3 && tilewire <= TILE_WIRE_WAD0) { int part = (tilewire - TILE_WIRE_WAD3) % 4; - 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_D2 + 1 + part + 14) + + el.x1 = x + slice_x2 + wire_length; + el.x2 = x + slice_x2 + wire_length + wire_distance * (8 - part); + el.y1 = y + slice_y2 - wire_distance * (TILE_WIRE_WADO3C_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + 14) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); el.x1 = el.x2; - el.y2 = y + slice_y2 - 0.0017f * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + 14 * 2) + + el.y2 = y + slice_y2 - wire_distance * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + 14 * 2) + 2 * slice_pitch; g.push_back(el); - el.x1 = x + slice_x2 + 0.005f; + el.x1 = x + slice_x2 + wire_length; el.y1 = el.y2; g.push_back(el); // 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_D2 + 1 + part + 14 * 2) + + el.x1 = x + slice_x2 + wire_length; + el.x2 = x + slice_x2 + wire_length + wire_distance * (8 - part); + el.y2 = y + slice_y2 - wire_distance * (TILE_WIRE_WAD3B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + 14 * 2) + 3 * slice_pitch; el.y1 = el.y2; g.push_back(el); @@ -536,16 +548,16 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } else if (wire_type == id_WIRE_TYPE_G_HPBX) { el.x1 = x; el.x2 = x + 1; - el.y1 = y + 0.1f + 0.0017f * (tilewire - TILE_WIRE_G_HPBX0000 + 1); + el.y1 = y + 0.1f + wire_distance * (tilewire - TILE_WIRE_G_HPBX0000 + 1); el.y2 = el.y1; g.push_back(el); - el.x1 = x + switchbox_x1 + 0.0017f * (200 + (tilewire - TILE_WIRE_G_HPBX0000)); + el.x1 = x + switchbox_x1 + wire_distance * (200 + (tilewire - TILE_WIRE_G_HPBX0000)); el.x2 = el.x1; el.y2 = y + switchbox_y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_G_VPTX) { - el.x1 = x + 0.1f + 0.0017f * (tilewire - TILE_WIRE_G_VPTX0000 + 1); + el.x1 = x + 0.1f + wire_distance * (tilewire - TILE_WIRE_G_VPTX0000 + 1); el.x2 = el.x1; el.y1 = y; el.y2 = y + 1; @@ -553,13 +565,13 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } else if (wire_type == id_WIRE_TYPE_L_HPBX) { el.x1 = x - 3; el.x2 = x + 0.08f; - el.y1 = y + 0.0017f + 0.0017f * (tilewire - TILE_WIRE_L_HPBX0000 + 1); + el.y1 = y + wire_distance + wire_distance * (tilewire - TILE_WIRE_L_HPBX0000 + 1); el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_R_HPBX) { el.x1 = x + 0.2; el.x2 = x + 3; - el.y1 = y + 0.0017f + 0.0017f * (tilewire - TILE_WIRE_R_HPBX0000 + 1); + el.y1 = y + wire_distance + wire_distance * (tilewire - TILE_WIRE_R_HPBX0000 + 1); el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_PIO) { @@ -567,163 +579,163 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS int gap = 3 - (tilewire - TILE_WIRE_PADDOD_PIO) / 7; int num = (tilewire - TILE_WIRE_PADDOD_PIO) % 7; if (top_bottom) { - el.x1 = x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); + el.x1 = x + io_cell_h_x1 + (gap + 2) * io_cell_gap + wire_distance * (num + 1); el.x2 = el.x1; if (y == h - 1) { el.y1 = y + 1 - io_cell_h_y2; - el.y2 = el.y1 - 0.015f; + el.y2 = el.y1 - wire_length_long; } else { el.y1 = y + io_cell_h_y2; - el.y2 = el.y1 + 0.015f; + el.y2 = el.y1 + wire_length_long; } } else { if (x == 0) { el.x1 = x + 1 - io_cell_v_x1; - el.x2 = el.x1 + 0.015f; + el.x2 = el.x1 + wire_length_long; } else { el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; + el.x2 = el.x1 - wire_length_long; } - el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y1 = y + io_cell_v_y1 + gap * io_cell_gap + wire_distance * (num + 1); el.y2 = el.y1; } g.push_back(el); } else if (wire_type == id_WIRE_TYPE_DDRDLL) { int num = (tilewire - TILE_WIRE_DDRDEL_DDRDLL); - el.x1 = x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); + el.x1 = x + io_cell_h_x1 + 0.2 + wire_distance * (num + 1); el.x2 = el.x1; if (y == h - 1) { - el.y1 = y + 0.2; - el.y2 = el.y1 - 0.015f; + el.y1 = y + dll_cell_y1; + el.y2 = el.y1 - wire_length_long; } else { - el.y1 = y + 0.8; - el.y2 = el.y1 + 0.015f; + el.y1 = y + dll_cell_y2; + el.y2 = el.y1 + wire_length_long; } g.push_back(el); } else if (wire_type == id_WIRE_TYPE_CCLK) { int num = (tilewire - TILE_WIRE_JPADDI_CCLK); - el.x1 = x + slice_x1 + 0.0017f * (num + 1); + el.x1 = x + slice_x1 + wire_distance * (num + 1); el.x2 = el.x1; el.y1 = y + slice_y2 - 1 * slice_pitch; - el.y2 = el.y1 - 0.015f; + el.y2 = el.y1 - wire_length_long; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_IOLOGIC) { int gap = 7 - (tilewire - TILE_WIRE_JLOADND_IOLOGIC) / 42; int num = (tilewire - TILE_WIRE_JLOADND_IOLOGIC) % 42; if (x == 0) { el.x1 = x + 1 - io_cell_v_x1; - el.x2 = el.x1 + 0.015f; + el.x2 = el.x1 + wire_length_long; } else { el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; + el.x2 = el.x1 - wire_length_long; } - el.y1 = y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y1 = y + io_cell_v_y1 + gap * io_cell_gap + wire_distance * (num + 1); el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_SIOLOGIC) { int gap = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; int num = (tilewire - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; - el.x1 = x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); + el.x1 = x + io_cell_h_x1 + (5 - gap) * io_cell_gap + wire_distance * (num + 1); el.x2 = el.x1; if (y == h - 1) { el.y1 = y + 1 - io_cell_h_y2; - el.y2 = el.y1 - 0.015f; + el.y2 = el.y1 - wire_length_long; } else { el.y1 = y + io_cell_h_y2; - el.y2 = el.y1 + 0.015f; + el.y2 = el.y1 + wire_length_long; } g.push_back(el); } else if (wire_type == id_WIRE_TYPE_DQS) { int num = (tilewire - TILE_WIRE_DDRDEL_DQS); if (x == 0) { el.x1 = x + 1 - io_cell_v_x1; - el.x2 = el.x1 + 0.015f; + el.x2 = el.x1 + wire_length_long; } else { el.x1 = x + io_cell_v_x1; - el.x2 = el.x1 - 0.015f; + el.x2 = el.x1 - wire_length_long; } - el.y1 = y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); + el.y1 = y + io_cell_v_y1 + 8 * io_cell_gap + wire_distance * (num + 1); el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_EBR) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_MULT18) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.00085f * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance_small * (tilewire - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_ALU54) { int num = (tilewire - TILE_WIRE_JCLK0_ALU54) % 225; int group = (tilewire - TILE_WIRE_JCLK0_ALU54) / 225; if (group == 0) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; } else { - el.x1 = x + 0.97 + 0.005f; - el.x2 = x + 0.97; + el.x1 = x + slice_x2_wide + wire_length; + el.x2 = x + slice_x2_wide; } - el.y1 = y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance_small * (num + 1) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_PLL) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CLKI_PLL + 1); + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_CLKI_PLL + 1); el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_GSR) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JCLK_GSR + 1); + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_JCLK_GSR + 1); el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_JTAG) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_OSC) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_SED) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_DTR) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_JSTARTPULSE_DTR + 1); + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_JSTARTPULSE_DTR + 1); el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_EXTREF) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_DCU) { - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (tilewire - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; el.y2 = el.y1; g.push_back(el); } else if (wire_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; int group = 1 - (tilewire - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; - el.x1 = x + slice_x1 - 0.005f; + el.x1 = x + slice_x1 - wire_length; el.x2 = x + slice_x1; - el.y1 = y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (num + 1) + group * slice_pitch; el.y2 = el.y1; g.push_back(el); } @@ -733,7 +745,7 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr { if (src_type == id_WIRE_TYPE_H00) { int group = (src_id - TILE_WIRE_H00L0000) / 2; - el.y1 = y + switchbox_y1 + 0.0017f * (8 - ((src_id - TILE_WIRE_H00L0000) % 2) * 4); + el.y1 = y + switchbox_y1 + wire_distance * (8 - ((src_id - TILE_WIRE_H00L0000) % 2) * 4); if (group) { el.x1 = x + switchbox_x2; @@ -746,19 +758,19 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr el.x1 = x + switchbox_x1; else el.x1 = x + switchbox_x2; - el.y1 = y + switchbox_y1 + 0.0017f * (10 + src_id - TILE_WIRE_H01E0001); + el.y1 = y + switchbox_y1 + wire_distance * (10 + src_id - TILE_WIRE_H01E0001); } if (src_type == id_WIRE_TYPE_H02) { - el.x1 = x + switchbox_x1 + 0.0017f * (20 + (src_id - TILE_WIRE_H02W0701) + 20 * (src.location.x % 3)); + el.x1 = x + switchbox_x1 + wire_distance * (20 + (src_id - TILE_WIRE_H02W0701) + 20 * (src.location.x % 3)); el.y1 = y + switchbox_y1; } if (src_type == id_WIRE_TYPE_H06) { - el.x1 = x + switchbox_x1 + 0.0017f * (96 + (src_id - TILE_WIRE_H06W0303) + 10 * (src.location.x % 9)); + el.x1 = x + switchbox_x1 + wire_distance * (96 + (src_id - TILE_WIRE_H06W0303) + 10 * (src.location.x % 9)); el.y1 = y + switchbox_y1; } if (src_type == id_WIRE_TYPE_V00) { int group = (src_id - TILE_WIRE_V00T0000) / 2; - el.x1 = x + switchbox_x2 - 0.0017f * (8 - ((src_id - TILE_WIRE_V00T0000) % 2) * 4); + el.x1 = x + switchbox_x2 - wire_distance * (8 - ((src_id - TILE_WIRE_V00T0000) % 2) * 4); if (group) { el.y1 = y + switchbox_y1; } else { @@ -766,7 +778,7 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } } if (src_type == id_WIRE_TYPE_V01) { - el.x1 = x + switchbox_x1 + 0.0017f * (10 + src_id - TILE_WIRE_V01N0001); + el.x1 = x + switchbox_x1 + wire_distance * (10 + src_id - TILE_WIRE_V01N0001); if (y == src.location.y) el.y1 = y + switchbox_y2; else @@ -774,53 +786,53 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } if (src_type == id_WIRE_TYPE_V02) { el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f * (20 + (src_id - TILE_WIRE_V02N0701) + 20 * (src.location.y % 3)); + el.y1 = y + switchbox_y1 + wire_distance * (20 + (src_id - TILE_WIRE_V02N0701) + 20 * (src.location.y % 3)); } if (src_type == id_WIRE_TYPE_V06) { el.x1 = x + switchbox_x1; - el.y1 = y + switchbox_y1 + 0.0017f * (96 + (src_id - TILE_WIRE_V06N0303) + 10 * (src.location.y % 9)); + el.y1 = y + switchbox_y1 + wire_distance * (96 + (src_id - TILE_WIRE_V06N0303) + 10 * (src.location.y % 9)); } if (src_type == id_WIRE_TYPE_NONE) { if (src_id >= TILE_WIRE_CLK0 && src_id <= TILE_WIRE_LSR1) { el.x1 = x + switchbox_x2; - el.y1 = y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch; + el.y1 = y + slice_y2 - wire_distance * (src_id - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch; } if (src_id >= TILE_WIRE_FCO && src_id <= TILE_WIRE_FCI) { int gap = (src_id - TILE_WIRE_FCO) / 24; el.x1 = src.location.x + switchbox_x2; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; } if (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7) { - el.x1 = src.location.x + switchbox_x2 + 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + el.x1 = src.location.x + switchbox_x2 + wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; } if (src_id >= TILE_WIRE_JDIA && src_id <= TILE_WIRE_ECLKD) { bool top = (src.location.y == (h - 1)); - el.x1 = src.location.x + 0.5f + 0.005f; + el.x1 = src.location.x + 0.5f + wire_length; if (top) - el.y1 = src.location.y + 1 - (slice_y2 - 0.0017f * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); + el.y1 = src.location.y + 1 - (slice_y2 - wire_distance * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); else - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; } } if (src_type == id_WIRE_TYPE_IOLOGIC) { int gap = 7 - (src_id - TILE_WIRE_JLOADND_IOLOGIC) / 42; int num = (src_id - TILE_WIRE_JLOADND_IOLOGIC) % 42; if (src.location.x == 0) { - el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; + el.x1 = src.location.x + 1 - io_cell_v_x1 + wire_length_long; } else { - el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + el.x1 = src.location.x + io_cell_v_x1 - wire_length_long; } - el.y1 = src.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y1 = src.location.y + io_cell_v_y1 + gap * io_cell_gap + wire_distance * (num + 1); } if (src_type == id_WIRE_TYPE_SIOLOGIC) { int gap = (src_id - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; int num = (src_id - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; - el.x1 = src.location.x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); + el.x1 = src.location.x + io_cell_h_x1 + (5 - gap) * io_cell_gap + wire_distance * (num + 1); if (src.location.y == h - 1) { - el.y1 = src.location.y + 1 - io_cell_h_y2 - 0.015f; + el.y1 = src.location.y + 1 - io_cell_h_y2 - wire_length_long; } else { - el.y1 = src.location.y + io_cell_h_y2 + 0.015f; + el.y1 = src.location.y + io_cell_h_y2 + wire_length_long; } } if (src_type == id_WIRE_TYPE_PIO) { @@ -828,102 +840,102 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr int gap = 3 - (src_id - TILE_WIRE_PADDOD_PIO) / 7; int num = (src_id - TILE_WIRE_PADDOD_PIO) % 7; if (top_bottom) { - el.x1 = src.location.x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); + el.x1 = src.location.x + io_cell_h_x1 + (gap + 2) * io_cell_gap + wire_distance * (num + 1); if (src.location.y == h - 1) { - el.y1 = src.location.y + 1 - io_cell_h_y2 - 0.015f; + el.y1 = src.location.y + 1 - io_cell_h_y2 - wire_length_long; } else { - el.y1 = src.location.y + 1 - io_cell_h_y2 + 0.015f; + el.y1 = src.location.y + 1 - io_cell_h_y2 + wire_length_long; } } else { if (x == 0) { - el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; + el.x1 = src.location.x + 1 - io_cell_v_x1 + wire_length_long; } else { - el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + el.x1 = src.location.x + io_cell_v_x1 - wire_length_long; } - el.y1 = src.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y1 = src.location.y + io_cell_v_y1 + gap * io_cell_gap + wire_distance * (num + 1); } } if (src_type == id_WIRE_TYPE_EBR) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; } if (src_type == id_WIRE_TYPE_MULT18) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.00085f * (src_id - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance_small * (src_id - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; } if (src_type == id_WIRE_TYPE_ALU54) { int num = (src_id - TILE_WIRE_JCLK0_ALU54) % 225; int group = (src_id - TILE_WIRE_JCLK0_ALU54) / 225; if (group == 0) { - el.x1 = src.location.x + slice_x1 - 0.005f; + el.x1 = src.location.x + slice_x1 - wire_length; } else { - el.x1 = src.location.x + 0.97 + 0.005f; + el.x1 = src.location.x + slice_x2_wide + wire_length; } - el.y1 = src.location.y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; + el.y1 = src.location.y + slice_y2 - wire_distance_small * (num + 1) + 3 * slice_pitch; } if (src_type == id_WIRE_TYPE_PLL) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_CLKI_PLL + 1); + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_CLKI_PLL + 1); } if (src_type == id_WIRE_TYPE_GSR) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JCLK_GSR + 1); + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_JCLK_GSR + 1); } if (src_type == id_WIRE_TYPE_JTAG) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; } if (src_type == id_WIRE_TYPE_OSC) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; } if (src_type == id_WIRE_TYPE_SED) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; } if (src_type == id_WIRE_TYPE_DTR) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_JSTARTPULSE_DTR + 1); + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_JSTARTPULSE_DTR + 1); } if (src_type == id_WIRE_TYPE_EXTREF) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; } if (src_type == id_WIRE_TYPE_DCU) { - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (src_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; } if (src_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (src_id - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; int group = 1 - (src_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; - el.x1 = src.location.x + slice_x1 - 0.005f; - el.y1 = src.location.y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; + el.x1 = src.location.x + slice_x1 - wire_length; + el.y1 = src.location.y + slice_y2 - wire_distance * (num + 1) + group * slice_pitch; } if (src_type == id_WIRE_TYPE_DQS) { int num = (src_id - TILE_WIRE_DDRDEL_DQS); if (src.location.x == 0) { - el.x1 = src.location.x + 1 - io_cell_v_x1 + 0.015f; + el.x1 = src.location.x + 1 - io_cell_v_x1 + wire_length_long; } else { - el.x1 = src.location.x + io_cell_v_x1 - 0.015f; + el.x1 = src.location.x + io_cell_v_x1 - wire_length_long; } - el.y1 = src.location.y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); + el.y1 = src.location.y + io_cell_v_y1 + 8 * io_cell_gap + wire_distance * (num + 1); } if (src_type == id_WIRE_TYPE_DDRDLL) { int num = (src_id - TILE_WIRE_DDRDEL_DDRDLL); - el.x1 = src.location.x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); + el.x1 = src.location.x + io_cell_h_x1 + dll_cell_x1 + wire_distance * (num + 1); if (src.location.y == h - 1) { - el.y1 = src.location.y + 0.2 - 0.015f; + el.y1 = src.location.y + dll_cell_y1 - wire_length_long; } else { - el.y1 = src.location.y + 0.8 + 0.015f; + el.y1 = src.location.y + dll_cell_y2 + wire_length_long; } } if (src_type == id_WIRE_TYPE_CCLK) { int num = (src_id - TILE_WIRE_JPADDI_CCLK); - el.x1 = src.location.x + slice_x1 + 0.0017f * (num + 1); - el.y1 = src.location.y + slice_y2 - 1 * slice_pitch - 0.015f; + el.x1 = src.location.x + slice_x1 + wire_distance * (num + 1); + el.y1 = src.location.y + slice_y2 - 1 * slice_pitch - wire_length_long; } if (src_type == id_WIRE_TYPE_G_HPBX) { - el.x1 = x + switchbox_x1 + 0.0017f * (200 + (src_id - TILE_WIRE_G_HPBX0000)); + el.x1 = x + switchbox_x1 + wire_distance * (200 + (src_id - TILE_WIRE_G_HPBX0000)); el.y1 = y + switchbox_y1; } } @@ -932,7 +944,7 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, { if (dst_type == id_WIRE_TYPE_H00) { int group = (dst_id - TILE_WIRE_H00L0000) / 2; - el.y2 = y + switchbox_y1 + 0.0017f * (8 - ((dst_id - TILE_WIRE_H00L0000) % 2) * 4); + el.y2 = y + switchbox_y1 + wire_distance * (8 - ((dst_id - TILE_WIRE_H00L0000) % 2) * 4); if (group) { el.x2 = x + switchbox_x2; @@ -945,19 +957,19 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, el.x2 = x + switchbox_x1; else el.x2 = x + switchbox_x2; - el.y2 = y + switchbox_y1 + 0.0017f * (10 + dst_id - TILE_WIRE_H01E0001); + el.y2 = y + switchbox_y1 + wire_distance * (10 + dst_id - TILE_WIRE_H01E0001); } if (dst_type == id_WIRE_TYPE_H02) { - el.x2 = x + switchbox_x1 + 0.0017f * (20 + (dst_id - TILE_WIRE_H02W0701) + 20 * (dst.location.x % 3)); + el.x2 = x + switchbox_x1 + wire_distance * (20 + (dst_id - TILE_WIRE_H02W0701) + 20 * (dst.location.x % 3)); el.y2 = y + switchbox_y1; } if (dst_type == id_WIRE_TYPE_H06) { - el.x2 = x + switchbox_x1 + 0.0017f * (96 + (dst_id - TILE_WIRE_H06W0303) + 10 * (dst.location.x % 9)); + el.x2 = x + switchbox_x1 + wire_distance * (96 + (dst_id - TILE_WIRE_H06W0303) + 10 * (dst.location.x % 9)); el.y2 = y + switchbox_y1; } if (dst_type == id_WIRE_TYPE_V00) { int group = (dst_id - TILE_WIRE_V00T0000) / 2; - el.x2 = x + switchbox_x2 - 0.0017f * (8 - ((dst_id - TILE_WIRE_V00T0000) % 2) * 4); + el.x2 = x + switchbox_x2 - wire_distance * (8 - ((dst_id - TILE_WIRE_V00T0000) % 2) * 4); if (group) { el.y2 = y + switchbox_y1; } else { @@ -965,7 +977,7 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } } if (dst_type == id_WIRE_TYPE_V01) { - el.x2 = x + switchbox_x1 + 0.0017f * (10 + dst_id - TILE_WIRE_V01N0001); + el.x2 = x + switchbox_x1 + wire_distance * (10 + dst_id - TILE_WIRE_V01N0001); if (y == dst.location.y) el.y2 = y + switchbox_y2; else @@ -973,34 +985,34 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } if (dst_type == id_WIRE_TYPE_V02) { el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f * (20 + (dst_id - TILE_WIRE_V02N0701) + 20 * (dst.location.y % 3)); + el.y2 = y + switchbox_y1 + wire_distance * (20 + (dst_id - TILE_WIRE_V02N0701) + 20 * (dst.location.y % 3)); } if (dst_type == id_WIRE_TYPE_V06) { el.x2 = x + switchbox_x1; - el.y2 = y + switchbox_y1 + 0.0017f * (96 + (dst_id - TILE_WIRE_V06N0303) + 10 * (dst.location.y % 9)); + el.y2 = y + switchbox_y1 + wire_distance * (96 + (dst_id - TILE_WIRE_V06N0303) + 10 * (dst.location.y % 9)); } if (dst_type == id_WIRE_TYPE_NONE) { if (dst_id >= TILE_WIRE_CLK0 && dst_id <= TILE_WIRE_LSR1) { el.x2 = x + switchbox_x2; - el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch; + el.y2 = y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch; } if (dst_id >= TILE_WIRE_FCO && dst_id <= TILE_WIRE_FCI) { int gap = (dst_id - TILE_WIRE_FCO) / 24; el.x2 = x + switchbox_x2; - el.y2 = y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; + el.y2 = y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; } if (dst_id >= TILE_WIRE_JCE0 && dst_id <= TILE_WIRE_JQ7) { el.x2 = dst.location.x + switchbox_x2; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_JCE0 + 1) + 3 * slice_pitch; } if (dst_id >= TILE_WIRE_JDIA && dst_id <= TILE_WIRE_ECLKD) { bool top = (dst.location.y == (h - 1)); el.x2 = dst.location.x + 0.5f; if (top) - el.y2 = dst.location.y + 1 - (slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); + el.y2 = dst.location.y + 1 - (slice_y2 - wire_distance * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); else - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; } } @@ -1008,20 +1020,20 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, int gap = 7 - (dst_id - TILE_WIRE_JLOADND_IOLOGIC) / 42; int num = (dst_id - TILE_WIRE_JLOADND_IOLOGIC) % 42; if (dst.location.x == 0) { - el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; + el.x2 = dst.location.x + 1 - io_cell_v_x1 + wire_length_long; } else { - el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + el.x2 = dst.location.x + io_cell_v_x1 - wire_length_long; } - el.y2 = dst.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y2 = dst.location.y + io_cell_v_y1 + gap * io_cell_gap + wire_distance * (num + 1); } if (dst_type == id_WIRE_TYPE_SIOLOGIC) { int gap = (dst_id - TILE_WIRE_JLOADNB_SIOLOGIC) / 20; int num = (dst_id - TILE_WIRE_JLOADNB_SIOLOGIC) % 20; - el.x2 = dst.location.x + io_cell_h_x1 + (5 - gap) * 0.10 + 0.0017f * (num + 1); + el.x2 = dst.location.x + io_cell_h_x1 + (5 - gap) * io_cell_gap + wire_distance * (num + 1); if (dst.location.y == h - 1) { - el.y2 = dst.location.y + 1 - io_cell_h_y2 - 0.015f; + el.y2 = dst.location.y + 1 - io_cell_h_y2 - wire_length_long; } else { - el.y2 = dst.location.y + io_cell_h_y2 + 0.015f; + el.y2 = dst.location.y + io_cell_h_y2 + wire_length_long; } } if (dst_type == id_WIRE_TYPE_PIO) { @@ -1029,102 +1041,102 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, int gap = 3 - (dst_id - TILE_WIRE_PADDOD_PIO) / 7; int num = (dst_id - TILE_WIRE_PADDOD_PIO) % 7; if (top_bottom) { - el.x2 = dst.location.x + io_cell_h_x1 + (gap + 2) * 0.10 + 0.0017f * (num + 1); + el.x2 = dst.location.x + io_cell_h_x1 + (gap + 2) * io_cell_gap + wire_distance * (num + 1); if (dst.location.y == h - 1) { - el.y2 = dst.location.y + 1 - io_cell_h_y2 - 0.015f; + el.y2 = dst.location.y + 1 - io_cell_h_y2 - wire_length_long; } else { - el.y2 = dst.location.y + 1 - io_cell_h_y2 + 0.015f; + el.y2 = dst.location.y + 1 - io_cell_h_y2 + wire_length_long; } } else { if (x == 0) { - el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; + el.x2 = dst.location.x + 1 - io_cell_v_x1 + wire_length_long; } else { - el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + el.x2 = dst.location.x + io_cell_v_x1 - wire_length_long; } - el.y2 = dst.location.y + io_cell_v_y1 + gap * 0.10 + 0.0017f * (num + 1); + el.y2 = dst.location.y + io_cell_v_y1 + gap * io_cell_gap + wire_distance * (num + 1); } } if (dst_type == id_WIRE_TYPE_EBR) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_JADA0_EBR + 1) + 3 * slice_pitch; } if (dst_type == id_WIRE_TYPE_MULT18) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.00085f * (dst_id - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance_small * (dst_id - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; } if (dst_type == id_WIRE_TYPE_ALU54) { int num = (dst_id - TILE_WIRE_JCLK0_ALU54) % 225; int group = (dst_id - TILE_WIRE_JCLK0_ALU54) / 225; if (group == 0) { - el.x2 = dst.location.x + slice_x1 - 0.005f; + el.x2 = dst.location.x + slice_x1 - wire_length; } else { - el.x2 = dst.location.x + 0.97 + 0.005f; + el.x2 = dst.location.x + slice_x2_wide + wire_length; } - el.y2 = dst.location.y + slice_y2 - 0.00085f * (num + 1) + 3 * slice_pitch; + el.y2 = dst.location.y + slice_y2 - wire_distance_small * (num + 1) + 3 * slice_pitch; } if (dst_type == id_WIRE_TYPE_PLL) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_CLKI_PLL + 1); + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_CLKI_PLL + 1); } if (dst_type == id_WIRE_TYPE_GSR) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JCLK_GSR + 1); + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_JCLK_GSR + 1); } if (dst_type == id_WIRE_TYPE_JTAG) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_JJCE1_JTAG + 1) + 1 * slice_pitch; } if (dst_type == id_WIRE_TYPE_OSC) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_SEDSTDBY_OSC + 1) + 2 * slice_pitch; } if (dst_type == id_WIRE_TYPE_SED) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_SEDSTDBY_SED + 1) + 3 * slice_pitch; } if (dst_type == id_WIRE_TYPE_DTR) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_JSTARTPULSE_DTR + 1); + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_JSTARTPULSE_DTR + 1); } if (dst_type == id_WIRE_TYPE_EXTREF) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_REFCLKP_EXTREF + 1) + 1 * slice_pitch; } if (dst_type == id_WIRE_TYPE_DCU) { - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (dst_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; } if (dst_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; int group = 1 - (dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) / 7; - el.x2 = dst.location.x + slice_x1 - 0.005f; - el.y2 = dst.location.y + slice_y2 - 0.0017f * (num + 1) + group * slice_pitch; + el.x2 = dst.location.x + slice_x1 - wire_length; + el.y2 = dst.location.y + slice_y2 - wire_distance * (num + 1) + group * slice_pitch; } if (dst_type == id_WIRE_TYPE_DQS) { int num = (dst_id - TILE_WIRE_DDRDEL_DQS); if (dst.location.x == 0) { - el.x2 = dst.location.x + 1 - io_cell_v_x1 + 0.015f; + el.x2 = dst.location.x + 1 - io_cell_v_x1 + wire_length_long; } else { - el.x2 = dst.location.x + io_cell_v_x1 - 0.015f; + el.x2 = dst.location.x + io_cell_v_x1 - wire_length_long; } - el.y2 = dst.location.y + io_cell_v_y1 + 8 * 0.10 + 0.0017f * (num + 1); + el.y2 = dst.location.y + io_cell_v_y1 + 8 * io_cell_gap + wire_distance * (num + 1); } if (dst_type == id_WIRE_TYPE_DDRDLL) { int num = (dst_id - TILE_WIRE_DDRDEL_DDRDLL); - el.x2 = dst.location.x + io_cell_h_x1 + 0.2 + 0.0017f * (num + 1); + el.x2 = dst.location.x + io_cell_h_x1 + dll_cell_x1 + wire_distance * (num + 1); if (dst.location.y == h - 1) { - el.y2 = dst.location.y + 0.2 - 0.015f; + el.y2 = dst.location.y + dll_cell_y1 - wire_length_long; } else { - el.y2 = dst.location.y + 0.8 + 0.015f; + el.y2 = dst.location.y + dll_cell_y2 + wire_length_long; } } if (dst_type == id_WIRE_TYPE_CCLK) { int num = (dst_id - TILE_WIRE_JPADDI_CCLK); - el.x2 = dst.location.x + slice_x1 + 0.0017f * (num + 1); - el.y2 = dst.location.y + slice_y2 - 1 * slice_pitch - 0.015f; + el.x2 = dst.location.x + slice_x1 + wire_distance * (num + 1); + el.y2 = dst.location.y + slice_y2 - 1 * slice_pitch - wire_length_long; } if (dst_type == id_WIRE_TYPE_G_HPBX) { - el.x2 = x + switchbox_x1 + 0.0017f * (200 + (dst_id - TILE_WIRE_G_HPBX0000)); + el.x2 = x + switchbox_x1 + wire_distance * (200 + (dst_id - TILE_WIRE_G_HPBX0000)); el.y2 = y + switchbox_y1; } } @@ -1144,7 +1156,7 @@ void toSameSideHor(std::vector &g, GraphicElement &el, int x, in int sign = (src_type == dst_type) ? 1 : -1; setSource(el, x, y, w, h, src, src_type, src_id); el.x2 = el.x1; - el.y2 = y + switchbox_y1 + (switchbox_y2 - switchbox_y1) / 2 + sign * 0.0017f * idx; + el.y2 = y + switchbox_y1 + (switchbox_y2 - switchbox_y1) / 2 + sign * wire_distance * idx; g.push_back(el); GraphicElement el2; @@ -1168,7 +1180,7 @@ void toSameSideVer(std::vector &g, GraphicElement &el, int x, in { int sign = (src_type == dst_type) ? 1 : -1; setSource(el, x, y, w, h, src, src_type, src_id); - el.x2 = x + switchbox_x1 + (switchbox_x2 - switchbox_x1) / 2 + sign * 0.0017f * idx; + el.x2 = x + switchbox_x1 + (switchbox_x2 - switchbox_x1) / 2 + sign * wire_distance * idx; el.y2 = el.y1; g.push_back(el); @@ -1192,7 +1204,7 @@ void toSameSideH1Ver(std::vector &g, GraphicElement &el, int x, GraphicElement::style_t style, int idx) { setSource(el, x, y, w, h, src, src_type, src_id); - el.x2 = x + switchbox_x1 + (switchbox_x2 - switchbox_x1) / 2 - 0.0017f * idx; + el.x2 = x + switchbox_x1 + (switchbox_x2 - switchbox_x1) / 2 - wire_distance * idx; el.y2 = el.y1; g.push_back(el); @@ -1243,7 +1255,7 @@ void toSameSideV1Ver(std::vector &g, GraphicElement &el, int x, { setSource(el, x, y, w, h, src, src_type, src_id); el.x2 = el.x1; - el.y2 = y + switchbox_y1 + (switchbox_y2 - switchbox_y1) / 2 - 0.0017f * idx; + el.y2 = y + switchbox_y1 + (switchbox_y2 - switchbox_y1) / 2 - wire_distance * idx; g.push_back(el); GraphicElement el2; -- cgit v1.2.3 From fb5480cde349008ab74e6b7179ac1b1fc8ffef1f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 28 Dec 2019 15:02:13 +0100 Subject: clangformat --- ecp5/gfx.cc | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index 3f64f0f0..dc6bed21 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -66,7 +66,7 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int g.push_back(el); el.style = GraphicElement::STYLE_FRAME; - el.x1 = x + slice_x2 + 15*wire_distance; + el.x1 = x + slice_x2 + 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; @@ -430,7 +430,7 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); } else if (tilewire >= TILE_WIRE_CLK0 && tilewire <= TILE_WIRE_LSR1) { el.x1 = x + switchbox_x2; - el.x2 = x + slice_x2 + 15*wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; + el.x2 = x + slice_x2 + 15 * wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; el.y1 = y + slice_y2 - wire_distance * (tilewire - TILE_WIRE_CLK0 - 5) + 3 * slice_pitch; el.y2 = el.y1; g.push_back(el); @@ -438,8 +438,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS el.y2 = y + slice_y2 - wire_distance * (3 + (tilewire - TILE_WIRE_CLK0)); g.push_back(el); for (int i = 0; i < 4; i++) { - el.x1 = x + slice_x2 + 15*wire_distance + wire_distance; - el.x2 = x + slice_x2 + 15*wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; + el.x1 = x + slice_x2 + 15 * wire_distance + wire_distance; + el.x2 = x + slice_x2 + 15 * wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; el.y1 = y + slice_y2 - wire_distance * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 1 + tilewire - TILE_WIRE_CLK0) + i * slice_pitch; @@ -448,8 +448,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS } if (tilewire == TILE_WIRE_CLK1 || tilewire == TILE_WIRE_LSR1) { for (int i = 0; i < 2; i++) { - el.x1 = x + slice_x2 + 3*wire_distance; - el.x2 = x + slice_x2 + 15*wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; + el.x1 = x + slice_x2 + 3 * wire_distance; + el.x2 = x + slice_x2 + 15 * wire_distance + (8 - (tilewire - TILE_WIRE_CLK0)) * wire_distance; el.y1 = y + slice_y2 - wire_distance * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 - 1 + (tilewire - TILE_WIRE_CLK0) / 2) + @@ -493,8 +493,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS else if (tilewire >= TILE_WIRE_MUXCLK3 && tilewire <= TILE_WIRE_MUXLSR0) { int gap = (tilewire - TILE_WIRE_MUXCLK3) / 2; int part = (tilewire - TILE_WIRE_MUXCLK3) % 2; - el.x1 = x + slice_x2 + 3*wire_distance; - el.x2 = x + slice_x2 + 15*wire_distance; + el.x1 = x + slice_x2 + 3 * wire_distance; + el.x2 = x + slice_x2 + 15 * wire_distance; el.y1 = y + slice_y2 - wire_distance * (TILE_WIRE_CLK3_SLICE - TILE_WIRE_DUMMY_D2 + 1 + part + gap * 26) + 3 * slice_pitch; el.y2 = el.y1; @@ -512,7 +512,8 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS g.push_back(el); el.x1 = el.x2; - el.y2 = y + slice_y2 - wire_distance * (TILE_WIRE_WD1B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + (part & 1) + 14 * 2) + + el.y2 = y + slice_y2 - + wire_distance * (TILE_WIRE_WD1B_SLICE - TILE_WIRE_DUMMY_D2 + 1 + (part & 1) + 14 * 2) + (3 - group) * slice_pitch; g.push_back(el); @@ -800,7 +801,8 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr if (src_id >= TILE_WIRE_FCO && src_id <= TILE_WIRE_FCI) { int gap = (src_id - TILE_WIRE_FCO) / 24; el.x1 = src.location.x + switchbox_x2; - el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_FCO + 1 + gap * 2) + 3 * slice_pitch; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_FCO + 1 + gap * 2) + + 3 * slice_pitch; } if (src_id >= TILE_WIRE_JCE0 && src_id <= TILE_WIRE_JQ7) { el.x1 = src.location.x + switchbox_x2 + wire_length; @@ -810,7 +812,8 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr bool top = (src.location.y == (h - 1)); el.x1 = src.location.x + 0.5f + wire_length; if (top) - el.y1 = src.location.y + 1 - (slice_y2 - wire_distance * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); + el.y1 = src.location.y + 1 - + (slice_y2 - wire_distance * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); else el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; } @@ -861,7 +864,8 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } if (src_type == id_WIRE_TYPE_MULT18) { el.x1 = src.location.x + slice_x1 - wire_length; - el.y1 = src.location.y + slice_y2 - wire_distance_small * (src_id - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + el.y1 = src.location.y + slice_y2 - wire_distance_small * (src_id - TILE_WIRE_JCLK0_MULT18 + 1) + + 3 * slice_pitch; } if (src_type == id_WIRE_TYPE_ALU54) { int num = (src_id - TILE_WIRE_JCLK0_ALU54) % 225; @@ -903,7 +907,8 @@ void setSource(GraphicElement &el, int x, int y, int w, int h, WireId src, IdStr } if (src_type == id_WIRE_TYPE_DCU) { el.x1 = src.location.x + slice_x1 - wire_length; - el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + el.y1 = src.location.y + slice_y2 - wire_distance * (src_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + + 0 * slice_pitch; } if (src_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (src_id - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; @@ -1010,7 +1015,8 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, bool top = (dst.location.y == (h - 1)); el.x2 = dst.location.x + 0.5f; if (top) - el.y2 = dst.location.y + 1 - (slice_y2 - wire_distance * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); + el.y2 = dst.location.y + 1 - + (slice_y2 - wire_distance * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch); else el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_JDIA + 1) + 3 * slice_pitch; } @@ -1062,7 +1068,8 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } if (dst_type == id_WIRE_TYPE_MULT18) { el.x2 = dst.location.x + slice_x1 - wire_length; - el.y2 = dst.location.y + slice_y2 - wire_distance_small * (dst_id - TILE_WIRE_JCLK0_MULT18 + 1) + 3 * slice_pitch; + el.y2 = dst.location.y + slice_y2 - wire_distance_small * (dst_id - TILE_WIRE_JCLK0_MULT18 + 1) + + 3 * slice_pitch; } if (dst_type == id_WIRE_TYPE_ALU54) { int num = (dst_id - TILE_WIRE_JCLK0_ALU54) % 225; @@ -1104,7 +1111,8 @@ void setDestination(GraphicElement &el, int x, int y, int w, int h, WireId dst, } if (dst_type == id_WIRE_TYPE_DCU) { el.x2 = dst.location.x + slice_x1 - wire_length; - el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + 0 * slice_pitch; + el.y2 = dst.location.y + slice_y2 - wire_distance * (dst_id - TILE_WIRE_CH0_RX_REFCLK_DCU + 1) + + 0 * slice_pitch; } if (dst_type == id_WIRE_TYPE_PCSCLKDIV) { int num = (dst_id - TILE_WIRE_CLKI_PCSCLKDIV1) % 7; -- cgit v1.2.3