aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-12-08 09:33:06 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2019-12-08 09:33:06 +0100
commit7fd856b866f1ddd2f81fdeaf981c15fde51b847d (patch)
treee9d8422bc12530ebb01da859019d7c8d166eeb26
parent275805d78f598b64eb0769969b12362427e76c0d (diff)
downloadnextpnr-7fd856b866f1ddd2f81fdeaf981c15fde51b847d.tar.gz
nextpnr-7fd856b866f1ddd2f81fdeaf981c15fde51b847d.tar.bz2
nextpnr-7fd856b866f1ddd2f81fdeaf981c15fde51b847d.zip
clangformat run
-rw-r--r--ecp5/arch.cc57
-rw-r--r--ecp5/gfx.cc596
-rw-r--r--ecp5/gfx.h40
-rw-r--r--gui/fpgaviewwidget.h2
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<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
{
std::vector<GraphicElement> ret;
@@ -628,7 +627,7 @@ std::vector<GraphicElement> 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<GraphicElement> 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<GraphicElement> 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<GraphicElement> 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<GraphicElement> 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<GraphicElement> 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<GraphicElement> 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<GraphicElement> 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<GroupId> Arch::getGroups() const
{
std::vector<GroupId> 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<GroupId> Arch::getGroupGroups(GroupId group) const
// -----------------------------------------------------------------------
-
std::vector<std::pair<IdString, std::string>> Arch::getWireAttrs(WireId wire) const
{
std::vector<std::pair<IdString, std::string>> 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<GraphicElement> &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style)
+void gfxTileWire(std::vector<GraphicElement> &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<GraphicElement> &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<GraphicElement> &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<GraphicElement> &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<GraphicElement> &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<GraphicElement> &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<GraphicElement> &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<GraphicElement> &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<GraphicElement> &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<GraphicElement> &g, GraphicElement &el,int x, int
g.push_back(el2);
}
-void toSameSideVer(std::vector<GraphicElement> &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<GraphicElement> &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<GraphicElement> &g, GraphicElement &el,int x, int
g.push_back(el2);
}
-void toSameSideH1Ver(std::vector<GraphicElement> &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<GraphicElement> &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<GraphicElement> &g, GraphicElement &el,int x, i
g.push_back(el2);
}
-void toSameSideH1Hor(std::vector<GraphicElement> &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<GraphicElement> &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<GraphicElement> &g, GraphicElement &el,int x, i
g.push_back(el2);
}
-void toSameSideV1Ver(std::vector<GraphicElement> &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<GraphicElement> &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<GraphicElement> &g, GraphicElement &el,int x, i
el2.y1 = el.y1;
g.push_back(el2);
}
-void gfxTilePip(std::vector<GraphicElement> &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<GraphicElement> &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<GraphicElement> &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire, GraphicElement::style_t style);
-void gfxTilePip(std::vector<GraphicElement> &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<GraphicElement> &g, int x, int y, int w, int h, IdString wire_type, GfxTileWireId tilewire,
+ GraphicElement::style_t style);
+void gfxTilePip(std::vector<GraphicElement> &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;