Skip to content

Support 3D Custom Switch Blocks #2370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 108 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
4af1381
extended e_side structure to contain above layer and below layer to g…
saaramahmoudi Aug 3, 2023
a3393e9
refactor for loops with e_side as iterator to always use SIDES array
saaramahmoudi Aug 3, 2023
76f7419
refactor index_into_correct_chan for custom switchblocks
saaramahmoudi Aug 8, 2023
4ff0ed6
make format
saaramahmoudi Aug 8, 2023
81155d5
removed the update that will change rr_graph for 2d cases
saaramahmoudi Aug 8, 2023
2b93973
modified the functions to determine custom switch blocks locations ba…
saaramahmoudi Aug 8, 2023
17beb30
modified index_into_correct_chan to consider layers to index to the c…
saaramahmoudi Aug 8, 2023
08cf7e9
modified wireconnection parsing while using custom switchblocks with …
saaramahmoudi Aug 10, 2023
92ebe0f
added edges to connect track to track in different layers, no additio…
saaramahmoudi Aug 15, 2023
f00977f
factor out the get_switchblocks_edges function and connect two layers…
saaramahmoudi Aug 15, 2023
f31a5fa
make format
saaramahmoudi Aug 15, 2023
8cbfc30
updated parsing custom switchblocks architecture syntax to connect bo…
saaramahmoudi Aug 17, 2023
84a5763
Merge branch 'master' into 3d_track_to_track_conn
saaramahmoudi Aug 25, 2023
50fbfce
add extra nodes (CHANX) in switchblocks with length = 0
saaramahmoudi Aug 25, 2023
4dac4a5
make format
saaramahmoudi Aug 25, 2023
99a7f2a
Merge branch 'master' into 3d_track_to_track_conn
saaramahmoudi Aug 31, 2023
9c6c9ad
Merge branch 'master' into 3d_track_to_track_conn
saaramahmoudi Aug 31, 2023
3939af1
add extra nodes for track-to-track connections in rr graph
saaramahmoudi Sep 1, 2023
15be495
set node attributes for custom extra nodes added to rrgraph to suppor…
saaramahmoudi Sep 1, 2023
e71b4a5
make format
saaramahmoudi Sep 1, 2023
2fe5adf
added track-to_track edges to correct node index in rr_graph
saaramahmoudi Sep 1, 2023
93d6b31
changed the hash function for sb_conn_map to use vtr::hash_combine
saaramahmoudi Sep 1, 2023
0891ca8
factor out counting extra nodes
saaramahmoudi Sep 14, 2023
aa804c2
debug: chanx nodes should have been added by (y,x)
saaramahmoudi Sep 15, 2023
6ba6321
removed extra TODOs and uncomment check_rr_graph
saaramahmoudi Sep 15, 2023
b0b6f5d
minor bug: offset to extra nodes was assigned to zero in the middle o…
saaramahmoudi Sep 15, 2023
eba99d2
update rr_graph serializer to have NONE as direction for extra chanx …
saaramahmoudi Sep 15, 2023
e55ecc8
debug: memory leak in rr_node_indices_ fixed
saaramahmoudi Sep 21, 2023
4e8580c
make format
saaramahmoudi Sep 21, 2023
c89ccf2
merge with master branch - conflicts solved
saaramahmoudi Sep 21, 2023
1d5eb35
generate_rr_graph_serializer
saaramahmoudi Sep 21, 2023
96aed46
resolved conflicts
saaramahmoudi Sep 21, 2023
f0d29f1
add support to read back rr graph with NONE direction CHANX nodes
saaramahmoudi Sep 21, 2023
6e44ce0
add one extra node per one destination in each switchblocks
saaramahmoudi Oct 4, 2023
830965c
debug: extra nodes was calculated incorrectly
saaramahmoudi Oct 5, 2023
45b890b
avoid adding same edge between chanx->chanx multiple times
saaramahmoudi Oct 5, 2023
17709bf
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
saaramahmoudi Oct 5, 2023
5e12d1d
avoid adding same edge multiple times
saaramahmoudi Oct 9, 2023
91f016a
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
saaramahmoudi Oct 9, 2023
1ada54e
fixed extra chanx connections between dice in rr graph
saaramahmoudi Oct 10, 2023
1370c03
removed unnecessary loop in the switchblocks pattern
saaramahmoudi Oct 19, 2023
b704e47
Merge branch '6d_router_lookahead' of https://github.com/verilog-to-r…
saaramahmoudi Oct 25, 2023
a4f452f
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
saaramahmoudi Nov 29, 2023
58631f6
refactor switch blocks sides
saaramahmoudi Nov 29, 2023
5e2d636
update functions comments to be doxygen and remove duplicated comments
saaramahmoudi Nov 30, 2023
5a0b6d7
refactoring custom switchblocks functions
saaramahmoudi Nov 30, 2023
b275f1f
renaming the switch block 2D and 3D side variables
saaramahmoudi Nov 30, 2023
31e75dd
commented custom 3d switchblocks structs
saaramahmoudi Nov 30, 2023
a68257a
changed the function argument from pass by value to pass by ref const
saaramahmoudi Nov 30, 2023
626824d
commented rrgraph functions and extra nodes for 3D custom switchblocks
saaramahmoudi Nov 30, 2023
bf4f1c2
comment 3d custom switch block rrgraph-related functions
saaramahmoudi Nov 30, 2023
f7e6620
make format
saaramahmoudi Nov 30, 2023
56c9fd5
minor debug: total 3d array length and coords_out_of_bounds was incor…
saaramahmoudi Dec 4, 2023
59f5bd5
revert back index_into_correct_chan to return a single chanx/chany fo…
saaramahmoudi Dec 4, 2023
cf52ff2
modified index_into_correct_chan to use chanx/chany based on src side…
saaramahmoudi Dec 4, 2023
3208266
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
saaramahmoudi Dec 4, 2023
8fb915d
Merge branch 'debug_6d_router_lookahead' of https://github.com/verilo…
saaramahmoudi Dec 4, 2023
e7f0629
added a new 3D architecture file with only inter-die connections in SBs
saaramahmoudi Dec 4, 2023
c78fc92
removed extra pinlocations tag within the 3D SB arch file
saaramahmoudi Dec 4, 2023
f274fbc
make format
saaramahmoudi Dec 4, 2023
c46aec0
removed duplicated code by making a helper function
saaramahmoudi Dec 5, 2023
18b2c5c
fixed switch id between 3D SB edges
saaramahmoudi Dec 5, 2023
0ac347b
make format
saaramahmoudi Dec 5, 2023
5326869
Merge branch 'master' into 3d_track_to_track_conn
saaramahmoudi Dec 6, 2023
c31ea65
vpr: set bounding box to net bounding box for high fanout nets
amin1377 Dec 8, 2023
c83fb79
Merge branch '3d_track_to_track_conn' of https://github.com/verilog-t…
amin1377 Dec 8, 2023
87f57cf
Merge branch 'master' into 3d_track_to_track_conn
saaramahmoudi Dec 10, 2023
630d731
return length 0 for extra chanx nodes
saaramahmoudi Dec 13, 2023
256ce68
assign delayless switch to extra rr edges created for 3D custom SBs
saaramahmoudi Dec 19, 2023
4684ed5
Merge branch 'master' into 3d_track_to_track_conn
saaramahmoudi Dec 19, 2023
d32c95b
vpr: placement experiment: remove src block for per-layer bounding box
amin1377 Dec 19, 2023
898d6f5
vpr: placer experiment: time delay profiler
amin1377 Dec 20, 2023
e4c9c96
vpr: placer experiment: turn on router debugger in delay profiling
amin1377 Dec 20, 2023
562f8cf
vpr: placer experiment: make the placer delay lookahead a 4D array
amin1377 Dec 21, 2023
41ae52c
vpr: placer experiment: update capnp proto with the new format
amin1377 Dec 21, 2023
54f28ce
vpr: placer experiment: update place lookahead dump with the new format
amin1377 Dec 21, 2023
68d4316
vpr: placer profiler: fix the index of sampling locations
amin1377 Dec 21, 2023
44fb542
vpr: placer profiler: fix the debugger sink node
amin1377 Dec 21, 2023
2e62d56
vpr: placer profiler: fix the loop boundries of sampling matrix
amin1377 Dec 21, 2023
fe072b8
vpr: placer lookup: add layer num to warning message
amin1377 Dec 21, 2023
886c55a
Merge branch 'simple_place_delay_model' of https://github.com/verilog…
amin1377 Dec 21, 2023
cf09b6a
Merge branch 'simple_place_delay_model' of https://github.com/verilog…
amin1377 Dec 21, 2023
7233203
Merge branch 'simple_place_delay_model' of https://github.com/verilog…
amin1377 Dec 22, 2023
071b529
Merge branch 'simple_place_delay_model' of https://github.com/verilog…
amin1377 Jan 5, 2024
760b5a0
vpr: place: add chanz_place_cost_fac which will be used by net_cost f…
amin1377 Apr 3, 2024
bcc7ca5
vpr: place: use chanz cost to cube bounding box cost
amin1377 Apr 3, 2024
1c10e7d
vpr: place: initialize chanz_place_cost_fac
amin1377 Apr 3, 2024
36ceeca
vpr: place: pass num_sink_per_layer to get_net_cost
amin1377 Apr 3, 2024
445e6d0
vpr: place: update layer min/max when cube bounding box is used
amin1377 Apr 3, 2024
240ae79
Merge branch 'bounding_box_3d_height' of https://github.com/verilog-t…
amin1377 Apr 3, 2024
d439ff8
vpr: place: base chanz_place_cost_fac on the average number of inter-…
amin1377 Apr 3, 2024
70c0645
Merge branch 'bounding_box_3d_height' of https://github.com/verilog-t…
amin1377 Apr 3, 2024
f46a775
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
saaramahmoudi Apr 19, 2024
a3a3599
only resize the 3D SB matrix if it is being used
saaramahmoudi Apr 19, 2024
1309a04
Merge branch 'master' into 3d_track_to_track_conn
saaramahmoudi May 19, 2024
6ede692
added support for fan-out for intermediate nodes in 3D custom switchb…
saaramahmoudi May 20, 2024
006675f
removed dead code and added the command line option to control 3D cus…
saaramahmoudi May 20, 2024
620fd73
[vpr][router] print layer num of to block
amin1377 May 29, 2024
a38913c
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Aug 14, 2024
792c276
[git] add .cache to git ignore
amin1377 Aug 14, 2024
377aed4
[log] fix printing location for 3d loc
amin1377 Aug 14, 2024
832d967
[vpr][route] print net num in log msg
amin1377 Aug 16, 2024
8a7a330
[test][strong] add strong 3d graph
amin1377 Aug 16, 2024
a909cf2
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Aug 27, 2024
174bb0f
[vpr][route] fix seg fault when router debug is enabled
amin1377 Aug 29, 2024
1cebe67
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Sep 9, 2024
c078262
[vpr][route] add all route tree nodes if no node from the target laye…
amin1377 Sep 9, 2024
b681f8d
[vpr][base] fix the bug with format coordinate (3d)
amin1377 Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 71 additions & 30 deletions libs/libarchfpga/src/parse_switchblocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ static void parse_comma_separated_wire_points(const char* ch, std::vector<t_wire
/* Parses the number of connections type */
static void parse_num_conns(std::string num_conns, t_wireconn_inf& wireconn);

/* Set connection from_side and to_side for custom switch block pattern*/
static void set_switch_func_type(SB_Side_Connection& conn, const char* func_type);

/* parse switch_override in wireconn */
static void parse_switch_override(const char* switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* switches, int num_switches);

Expand Down Expand Up @@ -269,6 +272,70 @@ static void parse_num_conns(std::string num_conns, t_wireconn_inf& wireconn) {
wireconn.num_conns_formula = num_conns;
}

//set sides for a specific conn for custom switch block pattern
static void set_switch_func_type(SB_Side_Connection& conn, const char* func_type) {
if (0 == strcmp(func_type, "lt")) {
conn.set_sides(LEFT, TOP);
} else if (0 == strcmp(func_type, "lr")) {
conn.set_sides(LEFT, RIGHT);
} else if (0 == strcmp(func_type, "lb")) {
conn.set_sides(LEFT, BOTTOM);
} else if (0 == strcmp(func_type, "la")) {
conn.set_sides(LEFT, ABOVE);
} else if (0 == strcmp(func_type, "lu")) {
conn.set_sides(LEFT, UNDER);
} else if (0 == strcmp(func_type, "tl")) {
conn.set_sides(TOP, LEFT);
} else if (0 == strcmp(func_type, "tb")) {
conn.set_sides(TOP, BOTTOM);
} else if (0 == strcmp(func_type, "tr")) {
conn.set_sides(TOP, RIGHT);
} else if (0 == strcmp(func_type, "ta")) {
conn.set_sides(TOP, ABOVE);
} else if (0 == strcmp(func_type, "tu")) {
conn.set_sides(TOP, UNDER);
} else if (0 == strcmp(func_type, "rt")) {
conn.set_sides(RIGHT, TOP);
} else if (0 == strcmp(func_type, "rl")) {
conn.set_sides(RIGHT, LEFT);
} else if (0 == strcmp(func_type, "rb")) {
conn.set_sides(RIGHT, BOTTOM);
} else if (0 == strcmp(func_type, "ra")) {
conn.set_sides(RIGHT, ABOVE);
} else if (0 == strcmp(func_type, "ru")) {
conn.set_sides(RIGHT, UNDER);
} else if (0 == strcmp(func_type, "bl")) {
conn.set_sides(BOTTOM, LEFT);
} else if (0 == strcmp(func_type, "bt")) {
conn.set_sides(BOTTOM, TOP);
} else if (0 == strcmp(func_type, "br")) {
conn.set_sides(BOTTOM, RIGHT);
} else if (0 == strcmp(func_type, "ba")) {
conn.set_sides(BOTTOM, ABOVE);
} else if (0 == strcmp(func_type, "bu")) {
conn.set_sides(BOTTOM, UNDER);
} else if (0 == strcmp(func_type, "al")) {
conn.set_sides(ABOVE, LEFT);
} else if (0 == strcmp(func_type, "at")) {
conn.set_sides(ABOVE, TOP);
} else if (0 == strcmp(func_type, "ar")) {
conn.set_sides(ABOVE, RIGHT);
} else if (0 == strcmp(func_type, "ab")) {
conn.set_sides(ABOVE, BOTTOM);
} else if (0 == strcmp(func_type, "ul")) {
conn.set_sides(UNDER, LEFT);
} else if (0 == strcmp(func_type, "ut")) {
conn.set_sides(UNDER, TOP);
} else if (0 == strcmp(func_type, "ur")) {
conn.set_sides(UNDER, RIGHT);
} else if (0 == strcmp(func_type, "ub")) {
conn.set_sides(UNDER, BOTTOM);
} else {
/* unknown permutation function */
archfpga_throw(__FILE__, __LINE__, "Unknown permutation function specified: %s\n", func_type);
}
}

/* Loads permutation funcs specified under Node into t_switchblock_inf. Node should be
* <switchfuncs> */
void read_sb_switchfuncs(pugi::xml_node Node, t_switchblock_inf* sb, const pugiutil::loc_data& loc_data) {
Expand Down Expand Up @@ -300,34 +367,8 @@ void read_sb_switchfuncs(pugi::xml_node Node, t_switchblock_inf* sb, const pugiu
func_formula = get_attribute(SubElem, "formula", loc_data).as_string(nullptr);

/* go through all the possible cases of func_type */
if (0 == strcmp(func_type, "lt")) {
conn.set_sides(LEFT, TOP);
} else if (0 == strcmp(func_type, "lr")) {
conn.set_sides(LEFT, RIGHT);
} else if (0 == strcmp(func_type, "lb")) {
conn.set_sides(LEFT, BOTTOM);
} else if (0 == strcmp(func_type, "tl")) {
conn.set_sides(TOP, LEFT);
} else if (0 == strcmp(func_type, "tb")) {
conn.set_sides(TOP, BOTTOM);
} else if (0 == strcmp(func_type, "tr")) {
conn.set_sides(TOP, RIGHT);
} else if (0 == strcmp(func_type, "rt")) {
conn.set_sides(RIGHT, TOP);
} else if (0 == strcmp(func_type, "rl")) {
conn.set_sides(RIGHT, LEFT);
} else if (0 == strcmp(func_type, "rb")) {
conn.set_sides(RIGHT, BOTTOM);
} else if (0 == strcmp(func_type, "bl")) {
conn.set_sides(BOTTOM, LEFT);
} else if (0 == strcmp(func_type, "bt")) {
conn.set_sides(BOTTOM, TOP);
} else if (0 == strcmp(func_type, "br")) {
conn.set_sides(BOTTOM, RIGHT);
} else {
/* unknown permutation function */
archfpga_throw(__FILE__, __LINE__, "Unknown permutation function specified: %s\n", func_type);
}
set_switch_func_type(conn, func_type);

func_ptr = &(sb->permutation_map[conn]);

/* Here we load the specified switch function(s) */
Expand Down Expand Up @@ -404,8 +445,8 @@ static void check_bidir_switchblock(const t_permutation_map* permutation_map) {
SB_Side_Connection conn;

/* iterate over all combinations of from_side -> to side */
for (e_side from_side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side to_side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side from_side : SIDES) {
for (e_side to_side : SIDES) {
/* can't connect a switchblock side to itself */
if (from_side == to_side) {
continue;
Expand Down
9 changes: 8 additions & 1 deletion libs/libarchfpga/src/physical_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,18 @@ enum e_side : unsigned char {
RIGHT = 1,
BOTTOM = 2,
LEFT = 3,
NUM_SIDES
NUM_SIDES = 4,
ABOVE = 5,
UNDER = 6,
NUM_OF_TOTAL_SIDES,
};

constexpr std::array<e_side, NUM_SIDES> SIDES = {{TOP, RIGHT, BOTTOM, LEFT}}; //Set of all side orientations
constexpr std::array<const char*, NUM_SIDES> SIDE_STRING = {{"TOP", "RIGHT", "BOTTOM", "LEFT"}}; //String versions of side orientations

constexpr std::array<e_side, NUM_OF_TOTAL_SIDES> TOTAL_SIDES = {{TOP, RIGHT, BOTTOM, LEFT, ABOVE, UNDER}}; //Set of all side orientations including different layers
constexpr std::array<const char*, NUM_OF_TOTAL_SIDES> TOTAL_SIDE_STRING = {{"TOP", "RIGHT", "BOTTOM", "LEFT", "ABOVE", "UNDER"}}; //String versions of side orientations including different layers

/* pin location distributions */
enum e_pin_location_distr {
E_SPREAD_PIN_DISTR,
Expand Down
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/read_fpga_interchange_arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ struct ArchReader {
type.pin_height_offset.resize(type.num_pins, 0);

type.pinloc.resize({1, 1, 4}, std::vector<bool>(type.num_pins, false));
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side side : SIDES) {
for (int pin = 0; pin < type.num_pins; pin++) {
type.pinloc[0][0][side][pin] = true;
type.pin_width_offset[pin] = 0;
Expand Down
12 changes: 6 additions & 6 deletions libs/libarchfpga/src/read_xml_arch_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
int num_sides = 4 * (type->width * type->height);
int side_index = 0;
int count = 0;
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side side : SIDES) {
for (int width = 0; width < type->width; ++width) {
for (int height = 0; height < type->height; ++height) {
for (int pin_offset = 0; pin_offset < (type->num_pins / num_sides) + 1; ++pin_offset) {
Expand All @@ -526,7 +526,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
while (ipin < type->num_pins) {
for (int width = 0; width < type->width; ++width) {
for (int height = 0; height < type->height; ++height) {
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side side : SIDES) {
if (((width == 0 && side == LEFT)
|| (height == type->height - 1 && side == TOP)
|| (width == type->width - 1 && side == RIGHT)
Expand Down Expand Up @@ -567,7 +567,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
while (ipin < input_pins.size()) {
for (int width = 0; width < type->width; ++width) {
for (int height = 0; height < type->height; ++height) {
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side side : SIDES) {
if (ipin < input_pins.size()) {
//Pins still to allocate

Expand All @@ -590,7 +590,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
while (ipin < output_pins.size()) {
for (int width = 0; width < type->width; ++width) {
for (int height = 0; height < type->height; ++height) {
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side side : SIDES) {
if (((width == 0 && side == LEFT)
|| (height == type->height - 1 && side == TOP)
|| (width == type->width - 1 && side == RIGHT)
Expand Down Expand Up @@ -621,7 +621,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
for (int layer = 0; layer < num_of_avail_layer; ++layer) {
for (int width = 0; width < type->width; ++width) {
for (int height = 0; height < type->height; ++height) {
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side side : SIDES) {
for (auto token : pin_locs->assignments[sub_tile_index][width][height][layer][side]) {
auto pin_range = ProcessPinString<t_sub_tile*>(Locations,
&sub_tile,
Expand Down Expand Up @@ -3398,7 +3398,7 @@ static void ProcessPinLocations(pugi::xml_node Locations,
for (int l = 0; l < num_of_avail_layer; ++l) {
for (int w = 0; w < PhysicalTileType->width; ++w) {
for (int h = 0; h < PhysicalTileType->height; ++h) {
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
for (e_side side : SIDES) {
for (auto token : pin_locs->assignments[sub_tile_index][w][h][l][side]) {
InstPort inst_port(token.c_str());

Expand Down
10 changes: 7 additions & 3 deletions libs/librrgraph/src/base/check_rr_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,13 @@ void check_rr_node(const RRGraphView& rr_graph,
tracks_per_node = ((rr_type == CHANX) ? chan_width.x_list[ylow] : chan_width.y_list[xlow]);
}

if (ptc_num >= nodes_per_chan) {
VPR_ERROR(VPR_ERROR_ROUTE,
"in check_rr_node: inode %d (type %d) has a ptc_num of %d.\n", inode, rr_type, ptc_num);
//if a chanx/chany has length 0, it means it is used to connect different dice together
//hence, the ptc number can be larger than nodes_per_chan
if(xlow != xhigh || ylow != yhigh) {
if (ptc_num >= nodes_per_chan) {
VPR_ERROR(VPR_ERROR_ROUTE,
"in check_rr_node: inode %d (type %d) has a ptc_num of %d.\n", inode, rr_type, ptc_num);
}
}

if (capacity != tracks_per_node) {
Expand Down
2 changes: 1 addition & 1 deletion libs/librrgraph/src/base/rr_rc_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ short find_create_rr_rc_data(const float R, const float C, std::vector<t_rr_rc_d
match);

if (itr == rr_rc_data.end()) {
//Note found -> create it
//Not found -> create it
rr_rc_data.emplace_back(R, C);

itr = --rr_rc_data.end(); //Iterator to inserted value
Expand Down
16 changes: 12 additions & 4 deletions libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* https://github.com/duck2/uxsdcxx
* Modify only if your build process doesn't involve regenerating this file.
*
* Cmdline: uxsdcxx/uxsdcxx.py /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: bf49388f038e0d0e4a12403ebb964b42
* Cmdline: uxsdcxx/uxsdcxx.py /home/sara/Desktop/rr_3d/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/sara/Desktop/rr_3d/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: aad09e42e426be6012c2f65ddb636cd0
*/

#include <functional>
Expand Down Expand Up @@ -1577,7 +1577,7 @@ template<std::size_t N>
constexpr const char *lookup_switch_type[] = {"UXSD_INVALID", "mux", "tristate", "pass_gate", "short", "buffer"};
constexpr const char *lookup_pin_type[] = {"UXSD_INVALID", "OPEN", "OUTPUT", "INPUT"};
constexpr const char *lookup_node_type[] = {"UXSD_INVALID", "CHANX", "CHANY", "SOURCE", "SINK", "OPIN", "IPIN"};
constexpr const char *lookup_node_direction[] = {"UXSD_INVALID", "INC_DIR", "DEC_DIR", "BI_DIR"};
constexpr const char *lookup_node_direction[] = {"UXSD_INVALID", "INC_DIR", "DEC_DIR", "BI_DIR", "NONE"};
constexpr const char *lookup_loc_side[] = {"UXSD_INVALID", "LEFT", "RIGHT", "TOP", "BOTTOM", "RIGHT_LEFT", "RIGHT_BOTTOM", "RIGHT_BOTTOM_LEFT", "TOP_RIGHT", "TOP_BOTTOM", "TOP_LEFT", "TOP_RIGHT_BOTTOM", "TOP_RIGHT_LEFT", "TOP_BOTTOM_LEFT", "TOP_RIGHT_BOTTOM_LEFT", "BOTTOM_LEFT"};

/* Lexers(string->token functions) for enums. */
Expand Down Expand Up @@ -1771,6 +1771,14 @@ inline enum_node_type lex_enum_node_type(const char *in, bool throw_on_invalid,
inline enum_node_direction lex_enum_node_direction(const char *in, bool throw_on_invalid, const std::function<void(const char *)> * report_error){
unsigned int len = strlen(in);
switch(len){
case 4:
switch(*((triehash_uu32*)&in[0])){
case onechar('N', 0, 32) | onechar('O', 8, 32) | onechar('N', 16, 32) | onechar('E', 24, 32):
return enum_node_direction::NONE;
break;
default: break;
}
break;
case 6:
switch(*((triehash_uu32*)&in[0])){
case onechar('B', 0, 32) | onechar('I', 8, 32) | onechar('_', 16, 32) | onechar('D', 24, 32):
Expand Down
10 changes: 7 additions & 3 deletions libs/librrgraph/src/io/gen/rr_graph_uxsdcxx_capnp.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* https://github.com/duck2/uxsdcxx
* Modify only if your build process doesn't involve regenerating this file.
*
* Cmdline: uxsdcxx/uxsdcap.py /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: bf49388f038e0d0e4a12403ebb964b42
* Cmdline: uxsdcxx/uxsdcap.py /home/sara/Desktop/rr_3d/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/sara/Desktop/rr_3d/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: aad09e42e426be6012c2f65ddb636cd0
*/

#include <functional>
Expand Down Expand Up @@ -238,6 +238,8 @@ inline enum_node_direction conv_enum_node_direction(ucap::NodeDirection e, const
return enum_node_direction::DEC_DIR;
case ucap::NodeDirection::BI_DIR:
return enum_node_direction::BI_DIR;
case ucap::NodeDirection::NONE:
return enum_node_direction::NONE;
default:
(*report_error)("Unknown enum_node_direction");
throw std::runtime_error("Unreachable!");
Expand All @@ -254,6 +256,8 @@ inline ucap::NodeDirection conv_to_enum_node_direction(enum_node_direction e) {
return ucap::NodeDirection::DEC_DIR;
case enum_node_direction::BI_DIR:
return ucap::NodeDirection::BI_DIR;
case enum_node_direction::NONE:
return ucap::NodeDirection::NONE;
default:
throw std::runtime_error("Unknown enum_node_direction");
}
Expand Down
8 changes: 4 additions & 4 deletions libs/librrgraph/src/io/gen/rr_graph_uxsdcxx_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* https://github.com/duck2/uxsdcxx
* Modify only if your build process doesn't involve regenerating this file.
*
* Cmdline: uxsdcxx/uxsdcxx.py /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: bf49388f038e0d0e4a12403ebb964b42
* Cmdline: uxsdcxx/uxsdcxx.py /home/sara/Desktop/rr_3d/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* Input file: /home/sara/Desktop/rr_3d/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
* md5sum of input file: aad09e42e426be6012c2f65ddb636cd0
*/

#include <functional>
Expand All @@ -27,7 +27,7 @@ enum class enum_pin_type {UXSD_INVALID = 0, OPEN, OUTPUT, INPUT};

enum class enum_node_type {UXSD_INVALID = 0, CHANX, CHANY, SOURCE, SINK, OPIN, IPIN};

enum class enum_node_direction {UXSD_INVALID = 0, INC_DIR, DEC_DIR, BI_DIR};
enum class enum_node_direction {UXSD_INVALID = 0, INC_DIR, DEC_DIR, BI_DIR, NONE};

enum class enum_loc_side {UXSD_INVALID = 0, LEFT, RIGHT, TOP, BOTTOM, RIGHT_LEFT, RIGHT_BOTTOM, RIGHT_BOTTOM_LEFT, TOP_RIGHT, TOP_BOTTOM, TOP_LEFT, TOP_RIGHT_BOTTOM, TOP_RIGHT_LEFT, TOP_BOTTOM_LEFT, TOP_RIGHT_BOTTOM_LEFT, BOTTOM_LEFT};

Expand Down
1 change: 1 addition & 0 deletions libs/librrgraph/src/io/rr_graph.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
<xs:enumeration value="INC_DIR"/>
<xs:enumeration value="DEC_DIR"/>
<xs:enumeration value="BI_DIR"/>
<xs:enumeration value="NONE"/>
</xs:restriction>
</xs:simpleType>

Expand Down
4 changes: 4 additions & 0 deletions libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,8 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
return Direction::DEC;
case uxsd::enum_node_direction::BI_DIR:
return Direction::BIDIR;
case uxsd::enum_node_direction::NONE:
return Direction::NONE;
default:
report_error(
"Invalid node direction %d", direction);
Expand All @@ -1897,6 +1899,8 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
return uxsd::enum_node_direction::DEC_DIR;
case Direction::BIDIR:
return uxsd::enum_node_direction::BI_DIR;
case Direction::NONE:
return uxsd::enum_node_direction::NONE;
default:
report_error(
"Invalid direction %d", direction);
Expand Down
1 change: 0 additions & 1 deletion libs/librrgraph/src/utils/describe_rr_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ std::string describe_rr_node(const RRGraphView& rr_graph,
bool is_flat) {

std::string msg = vtr::string_fmt("RR node: %d", inode);

if (rr_graph.node_type(inode) == CHANX || rr_graph.node_type(inode) == CHANY) {
auto cost_index = rr_graph.node_cost_index(inode);

Expand Down
9 changes: 5 additions & 4 deletions libs/libvtrcapnproto/gen/rr_graph_uxsdcxx.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# https://github.com/duck2/uxsdcxx
# Modify only if your build process doesn't involve regenerating this file.
#
# Cmdline: uxsdcxx/uxsdcap.py /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
# Input file: /home/smahmoudi/Desktop/vtr/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
# md5sum of input file: bf49388f038e0d0e4a12403ebb964b42
# Cmdline: uxsdcxx/uxsdcap.py /home/sara/Desktop/rr_3d/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
# Input file: /home/sara/Desktop/rr_3d/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
# md5sum of input file: aad09e42e426be6012c2f65ddb636cd0

@0xf7009c96d0510b05;
@0x8112499188102de5;
using Cxx = import "/capnp/c++.capnp";
$Cxx.namespace("ucap");

Expand Down Expand Up @@ -41,6 +41,7 @@ enum NodeDirection {
incDir @1;
decDir @2;
biDir @3;
none @4;
}

enum LocSide {
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/pack/post_routing_pb_pin_fixup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static void update_cluster_pin_with_post_routing_results(const Netlist<>& net_li
* Deposit all the sides
*/
if (wanted_sides.empty()) {
for (e_side side : {TOP, BOTTOM, LEFT, RIGHT}) {
for (e_side side : SIDES) {
wanted_sides.push_back(side);
}
}
Expand Down
Loading