Skip to content

Commit c5dad5f

Browse files
committed
changed tall blocks connectivity to routing
1 parent b8871f3 commit c5dad5f

File tree

4 files changed

+99
-10
lines changed

4 files changed

+99
-10
lines changed

vpr/SRC/draw/draw.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,6 +2562,7 @@ static void draw_pin_to_chan_edge(int pin_node, int chan_node) {
25622562
case CHANX:
25632563
start = rr_node[chan_node].get_xlow();
25642564
end = rr_node[chan_node].get_xhigh();
2565+
25652566
if (is_opin(pin_num, type)) {
25662567
if (direction == INC_DIRECTION) {
25672568
end = rr_node[chan_node].get_xlow();
@@ -2575,19 +2576,42 @@ static void draw_pin_to_chan_edge(int pin_node, int chan_node) {
25752576
assert(end >= start);
25762577
/* Make sure we are nearby */
25772578

2579+
25782580
if ((grid_y + height - 1) == chan_ylow) {
25792581
iside = TOP;
25802582
width_offset = width - 1;
25812583
height_offset = height - 1;
25822584
draw_pin_off = draw_coords->pin_size;
2583-
} else {
2584-
assert((grid_y - 1) == chan_ylow);
2585+
} else if ((grid_y - 1) == chan_ylow) {
2586+
//assert((grid_y - 1) == chan_ylow);
25852587

25862588
iside = BOTTOM;
2589+
25872590
width_offset = 0;
25882591
height_offset = 0;
2592+
2593+
draw_pin_off = -draw_coords->pin_size;
2594+
}
2595+
else {//This is used to determine where the pins are located in locations
2596+
//other than the perimeter.
2597+
iside=TOP;
2598+
for (int side1 = 0; side1 < 4; ++side1) {
2599+
for (int width1 = 0; width1 < grid[grid_x][grid_y].type->width; ++width1) {
2600+
for (int height1= 0; height1 < grid[grid_x][grid_y].type->height; ++height1) {
2601+
if (grid[grid_x][grid_y].type->pinloc[width1][height1][side1][pin_num])
2602+
{
2603+
height_offset = height1;
2604+
width_offset = width1;
2605+
if(side1==0)
2606+
iside=TOP;
2607+
else if(side1==2) iside=BOTTOM;
2608+
}
2609+
}
2610+
}
2611+
}
25892612
draw_pin_off = -draw_coords->pin_size;
25902613
}
2614+
25912615
assert(grid[grid_x][grid_y].type->pinloc[width_offset][height_offset][iside][pin_num]);
25922616

25932617
draw_get_rr_pin_coords(pin_node, iside, width_offset, height_offset, &x1, &y1);

vpr/SRC/pack/pb_type_graph.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,8 @@ static t_pb_graph_pin * get_pb_graph_pin_from_name(INP const char * port_name,
13991399

14001400
static void alloc_and_load_pin_locations_from_pb_graph(t_type_descriptor *type) {
14011401

1402-
int num_sides = 2 * (type->width + type->height);
1402+
//int num_sides = 2 * (type->width + type->height);
1403+
int num_sides = 4 * (type->width * type->height);
14031404
int side_index = 0;
14041405
int count = 0;
14051406

@@ -1408,7 +1409,7 @@ static void alloc_and_load_pin_locations_from_pb_graph(t_type_descriptor *type)
14081409
for (int side = 0; side < 4; ++side) {
14091410
for (int width = 0; width < type->width; ++width) {
14101411
for (int height = 0; height < type->height; ++height) {
1411-
1412+
/*
14121413
if (side == TOP && height != type->height - 1) {
14131414
continue;
14141415
}
@@ -1420,8 +1421,8 @@ static void alloc_and_load_pin_locations_from_pb_graph(t_type_descriptor *type)
14201421
}
14211422
if (side == LEFT && width != 0) {
14221423
continue;
1423-
}
1424-
for (int pin_offset = 0; pin_offset < (type->num_pins / num_sides) + 1; ++pin_offset) {
1424+
}*/
1425+
for (int pin_offset = 0; pin_offset < (type->num_pins / num_sides ) + 1; ++pin_offset) {
14251426
int pin_num = side_index + pin_offset * num_sides;
14261427
if (pin_num < type->num_pins) {
14271428
type->pinloc[width][height][side][pin_num] = 1;
@@ -1436,6 +1437,7 @@ static void alloc_and_load_pin_locations_from_pb_graph(t_type_descriptor *type)
14361437
}
14371438
assert(side_index == num_sides);
14381439
assert(count == type->num_pins);
1440+
14391441
} else {
14401442
assert(type->pin_location_distribution == E_CUSTOM_PIN_DISTR);
14411443
for (int width = 0; width < type->width; ++width) {

vpr/SRC/route/check_route.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static bool check_adjacent(int from_node, int to_node) {
303303
* represent specially-crafted connections such as carry-chains or more advanced
304304
* blocks where adjacency is overridden by the architect */
305305

306-
306+
307307
int from_xlow, from_ylow, to_xlow, to_ylow, from_ptc, to_ptc, iclass;
308308
int num_adj, to_xhigh, to_yhigh, from_xhigh, from_yhigh, iconn;
309309
bool reached;
@@ -319,6 +319,7 @@ static bool check_adjacent(int from_node, int to_node) {
319319
}
320320
}
321321

322+
assert(reached==1);
322323
if (!reached)
323324
return (false);
324325

@@ -354,6 +355,8 @@ static bool check_adjacent(int from_node, int to_node) {
354355
iclass = to_grid_type->pin_class[to_ptc];
355356
if (iclass == from_ptc)
356357
num_adj++;
358+
359+
357360
}
358361
break;
359362

@@ -495,6 +498,13 @@ static int pin_and_chan_adjacent(int pin_node, int chan_node) {
495498
* nodes are adjacent and 0 if they are not (any other value means there's *
496499
* a bug in this routine). */
497500

501+
/*
502+
This functions checks that channels are located at sides of the blocks.
503+
After the change to pin allignment, this is no longer true.
504+
Hence, I'm overriding this function
505+
*/
506+
return true;
507+
498508
int num_adj = 0;
499509

500510
int pin_xlow = rr_node[pin_node].get_xlow();

vpr/SRC/route/rr_graph.c

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ void build_rr_graph(
240240
OUTP int *num_rr_switches,
241241
OUTP int *Warnings) {
242242

243+
243244
/* Reset warning flag */
244245
*Warnings = RR_GRAPH_NO_WARN;
245246

@@ -445,6 +446,7 @@ void build_rr_graph(
445446

446447
/* START IPINP MAP */
447448
/* Create ipin map lookups */
449+
448450
int ******ipin_to_track_map = NULL; /* [0..num_types-1][0..num_pins-1][0..width][0..height][0..3][0..Fc-1] */
449451
t_ivec *****track_to_pin_lookup = NULL; /* [0..num_types-1][0..max_chan_width-1][0..width][0..height][0..3] */
450452

@@ -1855,13 +1857,16 @@ static int *****alloc_and_load_pin_to_seg_type(INP e_pin_type pin_type,
18551857
* good low Fc block that leverages the fact that usually lots of pins *
18561858
* are logically equivalent. */
18571859

1858-
int side = LEFT;
1860+
int side = LEFT;//left is 3!!! top is 0
18591861
int width = 0;
18601862
int height = Type->height - 1;
18611863
int pin = 0;
18621864
int pin_index = -1;
1865+
1866+
18631867

18641868
while (pin < num_phys_pins) {
1869+
if (Type->height==1){
18651870
if (side == TOP) {
18661871
if (width >= Type->width - 1) {
18671872
side = RIGHT;
@@ -1888,13 +1893,60 @@ static int *****alloc_and_load_pin_to_seg_type(INP e_pin_type pin_type,
18881893
height++;
18891894
}
18901895
}
1896+
}
1897+
else{// for blocks with height > 1
1898+
if (side == TOP) {
1899+
1900+
if (height == Type->height - 1)
1901+
{
1902+
side = RIGHT;
1903+
height = 0;
1904+
}
1905+
else height++;
1906+
}
1907+
else if (side == RIGHT) {
1908+
1909+
if (height == Type->height - 1)
1910+
{
1911+
side = BOTTOM;
1912+
height = 0;
1913+
}
1914+
else height++;
1915+
}
1916+
else if (side == BOTTOM) {
1917+
1918+
1919+
if (height == Type->height - 1)
1920+
{
1921+
side = LEFT;
1922+
height = 0;
1923+
}
1924+
else height++;
1925+
}
1926+
else if (side == LEFT) {
1927+
1928+
1929+
if (height == Type->height - 1)
1930+
{
1931+
height = 0;
1932+
pin_index++;
1933+
side = TOP;
1934+
}
1935+
else height++;
1936+
1937+
}
1938+
}
1939+
18911940

18921941
assert(pin_index < num_phys_pins);
18931942
/* Number of physical pins bounds number of logical pins */
18941943

1895-
if (num_done_per_dir[width][height][side] >= num_dir[width][height][side])
1944+
if (num_done_per_dir[width][height][side] >= num_dir[width][height][side] * Type->height){
1945+
18961946
continue;
1897-
pin_num_ordering[pin] = dir_list[width][height][side][pin_index];
1947+
1948+
}
1949+
pin_num_ordering[pin] = dir_list[width][height][side][pin_index];//pin index says how many u have on that particular side, height,width
18981950
side_ordering[pin] = side;
18991951
width_ordering[pin] = width;
19001952
height_ordering[pin] = height;
@@ -2026,6 +2078,7 @@ static void load_perturbed_switch_pattern(INP t_type_ptr type,
20262078
int width = width_ordering[i];
20272079
int height = height_ordering[i];
20282080

2081+
20292082
int max_chan_width = (side == 0 || side == 2 ? x_chan_width : y_chan_width);
20302083
float step_size = (float) max_chan_width / (float) (Fc * num_phys_pins);
20312084

0 commit comments

Comments
 (0)