5454# include < X11/keysym.h>
5555# endif
5656
57- void draw_chany_to_chany_edge (RRNodeId from_node, RRNodeId to_node, int to_track, short switch_type, ezgl::renderer* g) {
57+ void draw_chany_to_chany_edge (RRNodeId from_node, RRNodeId to_node, short switch_type, ezgl::renderer* g) {
5858 t_draw_state* draw_state = get_draw_state_vars ();
5959 t_draw_coords* draw_coords = get_draw_coords_vars ();
6060 auto & device_ctx = g_vpr_ctx.device ();
@@ -100,7 +100,7 @@ void draw_chany_to_chany_edge(RRNodeId from_node, RRNodeId to_node, int to_track
100100 /* UDSD Modification by WMF Begin */
101101 else {
102102 if (rr_graph.node_direction (to_node) != Direction::BIDIR) {
103- if (to_track % 2 == 0 ) { /* INC wire starts at bottom edge */
103+ if (rr_graph. node_direction (to_node) == Direction::INC ) { /* INC wire starts at bottom edge */
104104
105105 y2 = to_chan.bottom ();
106106 /* since no U-turns from_track must be INC as well */
@@ -144,7 +144,7 @@ void draw_chany_to_chany_edge(RRNodeId from_node, RRNodeId to_node, int to_track
144144 }
145145}
146146
147- void draw_chanx_to_chanx_edge (RRNodeId from_node, RRNodeId to_node, int to_track, short switch_type, ezgl::renderer* g) {
147+ void draw_chanx_to_chanx_edge (RRNodeId from_node, RRNodeId to_node, short switch_type, ezgl::renderer* g) {
148148 /* Draws a connection between two x-channel segments. Passing in the track *
149149 * numbers allows this routine to be used for both rr_graph and routing *
150150 * drawing-> */
@@ -191,7 +191,7 @@ void draw_chanx_to_chanx_edge(RRNodeId from_node, RRNodeId to_node, int to_track
191191 else {
192192 if (rr_graph.node_direction (to_node) != Direction::BIDIR) {
193193 /* must connect to to_node's wire beginning at x2 */
194- if (to_track % 2 == 0 ) { /* INC wire starts at leftmost edge */
194+ if (rr_graph. node_direction (to_node) == Direction::INC ) { /* INC wire starts at leftmost edge */
195195 VTR_ASSERT (from_xlow < to_xlow);
196196 x2 = to_chan.left ();
197197 /* since no U-turns from_track must be INC as well */
@@ -236,7 +236,7 @@ void draw_chanx_to_chanx_edge(RRNodeId from_node, RRNodeId to_node, int to_track
236236 }
237237}
238238
239- void draw_chanx_to_chany_edge (int chanx_node, int chanx_track, int chany_node, int chany_track , enum e_edge_dir edge_dir, short switch_type, ezgl::renderer* g) {
239+ void draw_chanx_to_chany_edge (int chanx_node, int chany_node, enum e_edge_dir edge_dir, short switch_type, ezgl::renderer* g) {
240240 t_draw_state* draw_state = get_draw_state_vars ();
241241 t_draw_coords* draw_coords = get_draw_coords_vars ();
242242 auto & device_ctx = g_vpr_ctx.device ();
@@ -259,6 +259,7 @@ void draw_chanx_to_chany_edge(int chanx_node, int chanx_track, int chany_node, i
259259 y1 = chanx_bbox.bottom ();
260260 x2 = chany_bbox.left ();
261261
262+ // these values xhigh/low yhigh/low mark the cordinates for the begining and ends of the wire.
262263 chanx_xlow = rr_graph.node_xlow (RRNodeId (chanx_node));
263264 chanx_y = rr_graph.node_ylow (RRNodeId (chanx_node));
264265 chany_x = rr_graph.node_xlow (RRNodeId (chany_node));
@@ -267,26 +268,23 @@ void draw_chanx_to_chany_edge(int chanx_node, int chanx_track, int chany_node, i
267268 if (chanx_xlow <= chany_x) { /* Can draw connection going right */
268269 /* Connection not at end of the CHANX segment. */
269270 x1 = draw_coords->tile_x [chany_x] + draw_coords->get_tile_width ();
270-
271- if (rr_graph.node_direction (RRNodeId (chanx_node)) != Direction::BIDIR) {
271+ if (rr_graph.node_direction (RRNodeId (chanx_node)) != Direction::BIDIR && (SwitchType)switch_type != SwitchType::SHORT) {
272272 if (edge_dir == FROM_X_TO_Y) {
273- if ((chanx_track % 2 ) == 1 ) { /* If dec wire, then going left */
273+ if (rr_graph. node_direction ( RRNodeId (chanx_node)) == Direction::DEC ) { /* If dec wire, then going left */
274274 x1 = draw_coords->tile_x [chany_x + 1 ];
275275 }
276276 }
277277 }
278-
279278 } else { /* Must draw connection going left. */
280279 x1 = chanx_bbox.left ();
281280 }
282-
283281 if (chany_ylow <= chanx_y) { /* Can draw connection going up. */
284282 /* Connection not at end of the CHANY segment. */
285283 y2 = draw_coords->tile_y [chanx_y] + draw_coords->get_tile_width ();
286284
287- if (rr_graph.node_direction (RRNodeId (chany_node)) != Direction::BIDIR) {
285+ if (rr_graph.node_direction (RRNodeId (chany_node)) != Direction::BIDIR && (SwitchType)switch_type != SwitchType::SHORT ) {
288286 if (edge_dir == FROM_Y_TO_X) {
289- if ((chany_track % 2 ) == 1 ) { /* If dec wire, then going down */
287+ if (rr_graph. node_direction ( RRNodeId (chany_node)) == Direction::DEC ) { /* If dec wire, then going down */
290288 y2 = draw_coords->tile_y [chanx_y + 1 ];
291289 }
292290 }
0 commit comments