@@ -1686,12 +1686,12 @@ static void draw_rr_edges(int inode, ezgl::renderer* g) {
1686
1686
return ; /* Nothing to draw. */
1687
1687
}
1688
1688
1689
- from_ptc_num = device_ctx. rr_nodes [inode]. ptc_num ( );
1689
+ from_ptc_num = rr_graph. node_ptc_num ( RRNodeId (inode) );
1690
1690
1691
1691
for (t_edge_size iedge = 0 , l = device_ctx.rr_nodes [inode].num_edges (); iedge < l; iedge++) {
1692
1692
to_node = device_ctx.rr_nodes [inode].edge_sink_node (iedge);
1693
1693
to_type = rr_graph.node_type (RRNodeId (to_node));
1694
- to_ptc_num = device_ctx. rr_nodes [to_node]. ptc_num ( );
1694
+ to_ptc_num = rr_graph. node_ptc_num ( RRNodeId (to_node) );
1695
1695
bool edge_configurable = device_ctx.rr_nodes [inode].edge_is_configurable (iedge);
1696
1696
1697
1697
switch (from_type) {
@@ -2193,18 +2193,18 @@ ezgl::rectangle draw_get_rr_chan_bbox(int inode) {
2193
2193
+ draw_coords->get_tile_width ();
2194
2194
bottom = draw_coords->tile_y [rr_graph.node_ylow (rr_node)]
2195
2195
+ draw_coords->get_tile_width ()
2196
- + (1 . + device_ctx. rr_nodes [inode]. ptc_num ( ));
2196
+ + (1 . + rr_graph. node_track_num (rr_node ));
2197
2197
top = draw_coords->tile_y [rr_graph.node_ylow (rr_node)]
2198
2198
+ draw_coords->get_tile_width ()
2199
- + (1 . + device_ctx. rr_nodes [inode]. ptc_num ( ));
2199
+ + (1 . + rr_graph. node_track_num (rr_node ));
2200
2200
break ;
2201
2201
case CHANY:
2202
2202
left = draw_coords->tile_x [rr_graph.node_xlow (rr_node)]
2203
2203
+ draw_coords->get_tile_width ()
2204
- + (1 . + device_ctx. rr_nodes [inode]. ptc_num ( ));
2204
+ + (1 . + rr_graph. node_track_num (rr_node ));
2205
2205
right = draw_coords->tile_x [rr_graph.node_xlow (rr_node)]
2206
2206
+ draw_coords->get_tile_width ()
2207
- + (1 . + device_ctx. rr_nodes [inode]. ptc_num ( ));
2207
+ + (1 . + rr_graph. node_track_num (rr_node ));
2208
2208
bottom = draw_coords->tile_y [rr_graph.node_ylow (rr_node)];
2209
2209
top = draw_coords->tile_y [rr_graph.node_yhigh (rr_node)]
2210
2210
+ draw_coords->get_tile_width ();
@@ -2257,7 +2257,7 @@ static void draw_rr_pin(int inode, const ezgl::color& color, ezgl::renderer* g)
2257
2257
auto & device_ctx = g_vpr_ctx.device ();
2258
2258
const auto & rr_graph = device_ctx.rr_graph ;
2259
2259
2260
- int ipin = device_ctx. rr_nodes [inode]. ptc_num ( );
2260
+ int ipin = rr_graph. node_pin_num ( RRNodeId (inode) );
2261
2261
2262
2262
g->set_color (color);
2263
2263
@@ -2305,7 +2305,7 @@ void draw_get_rr_pin_coords(const t_rr_node& node, float* xcen, float* ycen, con
2305
2305
xc = draw_coords->tile_x [i];
2306
2306
yc = draw_coords->tile_y [j];
2307
2307
2308
- ipin = node. ptc_num ( );
2308
+ ipin = rr_graph. node_pin_num (rr_node );
2309
2309
type = device_ctx.grid [i][j].type ;
2310
2310
pins_per_sub_tile = type->num_pins / type->capacity ;
2311
2311
k = ipin / pins_per_sub_tile;
@@ -2352,6 +2352,7 @@ static void draw_rr_src_sink(int inode, ezgl::color color, ezgl::renderer* g) {
2352
2352
t_draw_coords* draw_coords = get_draw_coords_vars ();
2353
2353
2354
2354
auto & device_ctx = g_vpr_ctx.device ();
2355
+ const auto & rr_graph = device_ctx.rr_graph ;
2355
2356
2356
2357
float xcen, ycen;
2357
2358
draw_get_rr_src_sink_coords (device_ctx.rr_nodes [inode], &xcen, &ycen);
@@ -2363,7 +2364,7 @@ static void draw_rr_src_sink(int inode, ezgl::color color, ezgl::renderer* g) {
2363
2364
{xcen + draw_coords->pin_size , ycen + draw_coords->pin_size });
2364
2365
2365
2366
std::string str = vtr::string_fmt (" %d" ,
2366
- device_ctx. rr_nodes [inode]. ptc_num ( ));
2367
+ rr_graph. node_class_num ( RRNodeId (inode) ));
2367
2368
g->set_color (ezgl::BLACK);
2368
2369
g->draw_text ({xcen, ycen}, str.c_str (), 2 * draw_coords->pin_size ,
2369
2370
2 * draw_coords->pin_size );
@@ -2389,8 +2390,8 @@ static void draw_get_rr_src_sink_coords(const t_rr_node& node, float* xcen, floa
2389
2390
class_per_height = num_class / (height - 1 );
2390
2391
}
2391
2392
2392
- int class_height_offset = node. class_num ( ) / class_per_height; // Offset wrt block height
2393
- int class_height_shift = node. class_num ( ) % class_per_height; // Offset within unit block
2393
+ int class_height_offset = rr_graph. node_class_num (rr_node ) / class_per_height; // Offset wrt block height
2394
+ int class_height_shift = rr_graph. node_class_num (rr_node ) % class_per_height; // Offset within unit block
2394
2395
2395
2396
float xc = draw_coords->tile_x [rr_graph.node_xlow (rr_node)];
2396
2397
float yc = draw_coords->tile_y [rr_graph.node_ylow (rr_node) + class_height_offset];
@@ -2619,7 +2620,7 @@ static int get_track_num(int inode, const vtr::OffsetMatrix<int>& chanx_track, c
2619
2620
RRNodeId rr_node = RRNodeId (inode);
2620
2621
2621
2622
if (get_draw_state_vars ()->draw_route_type == DETAILED)
2622
- return (device_ctx. rr_nodes [inode]. ptc_num ( ));
2623
+ return (rr_graph. node_track_num (rr_node ));
2623
2624
2624
2625
/* GLOBAL route stuff below. */
2625
2626
@@ -2765,7 +2766,7 @@ static int draw_check_rr_node_hit(float click_x, float click_y) {
2765
2766
t_physical_tile_type_ptr type = device_ctx.grid [i][j].type ;
2766
2767
int width_offset = device_ctx.grid [i][j].width_offset ;
2767
2768
int height_offset = device_ctx.grid [i][j].height_offset ;
2768
- int ipin = device_ctx. rr_nodes [inode]. ptc_num ( );
2769
+ int ipin = rr_graph. node_pin_num (rr_node );
2769
2770
float xcen, ycen;
2770
2771
for (const e_side& iside : SIDES) {
2771
2772
// If pin exists on this side of the block, then get pin coordinates
@@ -3141,10 +3142,11 @@ static void draw_pin_to_chan_edge(int pin_node, int chan_node, ezgl::renderer* g
3141
3142
auto & device_ctx = g_vpr_ctx.device ();
3142
3143
const auto & rr_graph = device_ctx.rr_graph ;
3143
3144
3144
- const t_rr_node& pin_rr = device_ctx.rr_nodes [pin_node];
3145
- const t_rr_node& chan_rr = device_ctx.rr_nodes [chan_node];
3145
+ // const t_rr_node& pin_rr = device_ctx.rr_nodes[pin_node];
3146
+ auto pin_rr = RRNodeId (pin_node);
3147
+ auto chan_rr = RRNodeId (chan_node);
3146
3148
3147
- const t_grid_tile& grid_tile = device_ctx.grid [rr_graph.node_xlow (pin_rr. id ()) ][rr_graph.node_ylow (pin_rr. id () )];
3149
+ const t_grid_tile& grid_tile = device_ctx.grid [rr_graph.node_xlow (pin_rr) ][rr_graph.node_ylow (pin_rr)];
3148
3150
t_physical_tile_type_ptr grid_type = grid_tile.type ;
3149
3151
3150
3152
float x1 = 0 , y1 = 0 ;
@@ -3186,8 +3188,8 @@ static void draw_pin_to_chan_edge(int pin_node, int chan_node, ezgl::renderer* g
3186
3188
*/
3187
3189
std::vector<e_side> pin_candidate_sides;
3188
3190
for (const e_side& pin_candidate_side : SIDES) {
3189
- if ((rr_graph.is_node_on_specific_side (pin_rr. id () , pin_candidate_side))
3190
- && (grid_type->pinloc [grid_tile.width_offset ][grid_tile.height_offset ][pin_candidate_side][pin_rr. pin_num ( )])) {
3191
+ if ((rr_graph.is_node_on_specific_side (pin_rr, pin_candidate_side))
3192
+ && (grid_type->pinloc [grid_tile.width_offset ][grid_tile.height_offset ][pin_candidate_side][rr_graph. node_pin_num (pin_rr )])) {
3191
3193
pin_candidate_sides.push_back (pin_candidate_side);
3192
3194
}
3193
3195
}
@@ -3200,13 +3202,13 @@ static void draw_pin_to_chan_edge(int pin_node, int chan_node, ezgl::renderer* g
3200
3202
pin_side = pin_candidate_sides[0 ];
3201
3203
} else {
3202
3204
VTR_ASSERT (1 < pin_candidate_sides.size ());
3203
- if (CHANX == channel_type && rr_graph.node_ylow (pin_rr. id ()) <= rr_graph.node_ylow (chan_rr. id () )) {
3205
+ if (CHANX == channel_type && rr_graph.node_ylow (pin_rr) <= rr_graph.node_ylow (chan_rr)) {
3204
3206
pin_side = TOP;
3205
- } else if (CHANX == channel_type && rr_graph.node_ylow (pin_rr. id ()) - 1 >= rr_graph.node_ylow (chan_rr. id () )) {
3207
+ } else if (CHANX == channel_type && rr_graph.node_ylow (pin_rr) - 1 >= rr_graph.node_ylow (chan_rr)) {
3206
3208
pin_side = BOTTOM;
3207
- } else if (CHANY == channel_type && rr_graph.node_xlow (pin_rr. id ()) <= rr_graph.node_xlow (chan_rr. id () )) {
3209
+ } else if (CHANY == channel_type && rr_graph.node_xlow (pin_rr) <= rr_graph.node_xlow (chan_rr)) {
3208
3210
pin_side = RIGHT;
3209
- } else if (CHANY == channel_type && rr_graph.node_xlow (pin_rr. id ()) - 1 >= rr_graph.node_xlow (chan_rr. id () )) {
3211
+ } else if (CHANY == channel_type && rr_graph.node_xlow (pin_rr) - 1 >= rr_graph.node_xlow (chan_rr)) {
3210
3212
pin_side = LEFT;
3211
3213
}
3212
3214
/* The inferred side must be in the list of sides of the pin rr_node!!! */
@@ -3259,7 +3261,7 @@ static void draw_pin_to_chan_edge(int pin_node, int chan_node, ezgl::renderer* g
3259
3261
y1 += draw_pin_offset;
3260
3262
y2 = chan_bbox.bottom ();
3261
3263
x2 = x1;
3262
- if (is_opin (pin_rr. pin_num ( ), grid_type)) {
3264
+ if (is_opin (rr_graph. node_pin_num (pin_rr ), grid_type)) {
3263
3265
if (chan_rr_direction == Direction::INC) {
3264
3266
x2 = chan_bbox.left ();
3265
3267
} else if (chan_rr_direction == Direction::DEC) {
@@ -3272,7 +3274,7 @@ static void draw_pin_to_chan_edge(int pin_node, int chan_node, ezgl::renderer* g
3272
3274
x1 += draw_pin_offset;
3273
3275
x2 = chan_bbox.left ();
3274
3276
y2 = y1;
3275
- if (is_opin (pin_rr. pin_num ( ), grid_type)) {
3277
+ if (is_opin (rr_graph. node_pin_num (pin_rr ), grid_type)) {
3276
3278
if (chan_rr_direction == Direction::INC) {
3277
3279
y2 = chan_bbox.bottom ();
3278
3280
} else if (chan_rr_direction == Direction::DEC) {
@@ -3289,7 +3291,7 @@ static void draw_pin_to_chan_edge(int pin_node, int chan_node, ezgl::renderer* g
3289
3291
g->draw_line ({x1, y1}, {x2, y2});
3290
3292
3291
3293
// don't draw the ex, or triangle unless zoomed in really far
3292
- if (chan_rr_direction == Direction::BIDIR || !is_opin (pin_rr. pin_num ( ), grid_type)) {
3294
+ if (chan_rr_direction == Direction::BIDIR || !is_opin (rr_graph. node_pin_num (pin_rr ), grid_type)) {
3293
3295
draw_x (x2, y2, 0.7 * draw_coords->pin_size , g);
3294
3296
} else {
3295
3297
float xend = x2 + (x1 - x2) / 10 .;
0 commit comments