Skip to content

Commit 1aef7c9

Browse files
committed
Merge branch 'master' of github.com:w0lek/vtr-verilog-to-routing
2 parents 41d22f8 + bb0dbd1 commit 1aef7c9

File tree

124 files changed

+103103
-5196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+103103
-5196
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ jobs:
141141
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on',
142142
suite: 'vtr_reg_basic'
143143
},
144+
{
145+
name: 'Basic with highest assertion level',
146+
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=4 -DWITH_BLIFEXPLORER=on',
147+
suite: 'vtr_reg_basic'
148+
},
144149
{
145150
name: 'Basic_odin',
146151
params: '-DCMAKE_COMPILE_WARNING_AS_ERROR=on -DVTR_ASSERT_LEVEL=3 -DWITH_BLIFEXPLORER=on -DWITH_PARMYS=OFF -DWITH_ODIN=on',

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ tags
144144
#
145145
.vscode
146146
.history
147+
.cache
147148
#eclipse project
148149
.project
149150

@@ -153,4 +154,4 @@ tags
153154
.idea
154155
cmake-build-debug
155156
cmake-build-release
156-
/.metadata/
157+
/.metadata/

doc/src/vpr/command_line_usage.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,13 @@ VPR uses a negotiated congestion algorithm (based on Pathfinder) to perform rout
12921292
* `swns` - setup Worst Negative Slack (sWNS) [ns]
12931293
* `stns` - Setup Total Negative Slack (sTNS) [ns]
12941294

1295+
.. option:: --route_verbosity <int>
1296+
1297+
Controls the verbosity of routing output.
1298+
High values produce more detailed output, which can be useful for debugging or understanding the routing process.
1299+
1300+
**Default**: ``1``
1301+
12951302
.. _timing_driven_router_options:
12961303

12971304
Timing-Driven Router Options

libs/libarchfpga/src/parse_switchblocks.cpp

Lines changed: 71 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ static void parse_comma_separated_wire_points(const char* ch, std::vector<t_wire
6565
/* Parses the number of connections type */
6666
static void parse_num_conns(std::string num_conns, t_wireconn_inf& wireconn);
6767

68+
/* Set connection from_side and to_side for custom switch block pattern*/
69+
static void set_switch_func_type(SB_Side_Connection& conn, const char* func_type);
70+
6871
/* parse switch_override in wireconn */
6972
static void parse_switch_override(const char* switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* switches, int num_switches);
7073

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

275+
//set sides for a specific conn for custom switch block pattern
276+
static void set_switch_func_type(SB_Side_Connection& conn, const char* func_type) {
277+
if (0 == strcmp(func_type, "lt")) {
278+
conn.set_sides(LEFT, TOP);
279+
} else if (0 == strcmp(func_type, "lr")) {
280+
conn.set_sides(LEFT, RIGHT);
281+
} else if (0 == strcmp(func_type, "lb")) {
282+
conn.set_sides(LEFT, BOTTOM);
283+
} else if (0 == strcmp(func_type, "la")) {
284+
conn.set_sides(LEFT, ABOVE);
285+
} else if (0 == strcmp(func_type, "lu")) {
286+
conn.set_sides(LEFT, UNDER);
287+
} else if (0 == strcmp(func_type, "tl")) {
288+
conn.set_sides(TOP, LEFT);
289+
} else if (0 == strcmp(func_type, "tb")) {
290+
conn.set_sides(TOP, BOTTOM);
291+
} else if (0 == strcmp(func_type, "tr")) {
292+
conn.set_sides(TOP, RIGHT);
293+
} else if (0 == strcmp(func_type, "ta")) {
294+
conn.set_sides(TOP, ABOVE);
295+
} else if (0 == strcmp(func_type, "tu")) {
296+
conn.set_sides(TOP, UNDER);
297+
} else if (0 == strcmp(func_type, "rt")) {
298+
conn.set_sides(RIGHT, TOP);
299+
} else if (0 == strcmp(func_type, "rl")) {
300+
conn.set_sides(RIGHT, LEFT);
301+
} else if (0 == strcmp(func_type, "rb")) {
302+
conn.set_sides(RIGHT, BOTTOM);
303+
} else if (0 == strcmp(func_type, "ra")) {
304+
conn.set_sides(RIGHT, ABOVE);
305+
} else if (0 == strcmp(func_type, "ru")) {
306+
conn.set_sides(RIGHT, UNDER);
307+
} else if (0 == strcmp(func_type, "bl")) {
308+
conn.set_sides(BOTTOM, LEFT);
309+
} else if (0 == strcmp(func_type, "bt")) {
310+
conn.set_sides(BOTTOM, TOP);
311+
} else if (0 == strcmp(func_type, "br")) {
312+
conn.set_sides(BOTTOM, RIGHT);
313+
} else if (0 == strcmp(func_type, "ba")) {
314+
conn.set_sides(BOTTOM, ABOVE);
315+
} else if (0 == strcmp(func_type, "bu")) {
316+
conn.set_sides(BOTTOM, UNDER);
317+
} else if (0 == strcmp(func_type, "al")) {
318+
conn.set_sides(ABOVE, LEFT);
319+
} else if (0 == strcmp(func_type, "at")) {
320+
conn.set_sides(ABOVE, TOP);
321+
} else if (0 == strcmp(func_type, "ar")) {
322+
conn.set_sides(ABOVE, RIGHT);
323+
} else if (0 == strcmp(func_type, "ab")) {
324+
conn.set_sides(ABOVE, BOTTOM);
325+
} else if (0 == strcmp(func_type, "ul")) {
326+
conn.set_sides(UNDER, LEFT);
327+
} else if (0 == strcmp(func_type, "ut")) {
328+
conn.set_sides(UNDER, TOP);
329+
} else if (0 == strcmp(func_type, "ur")) {
330+
conn.set_sides(UNDER, RIGHT);
331+
} else if (0 == strcmp(func_type, "ub")) {
332+
conn.set_sides(UNDER, BOTTOM);
333+
} else {
334+
/* unknown permutation function */
335+
archfpga_throw(__FILE__, __LINE__, "Unknown permutation function specified: %s\n", func_type);
336+
}
337+
}
338+
272339
/* Loads permutation funcs specified under Node into t_switchblock_inf. Node should be
273340
* <switchfuncs> */
274341
void read_sb_switchfuncs(pugi::xml_node Node, t_switchblock_inf* sb, const pugiutil::loc_data& loc_data) {
@@ -300,34 +367,8 @@ void read_sb_switchfuncs(pugi::xml_node Node, t_switchblock_inf* sb, const pugiu
300367
func_formula = get_attribute(SubElem, "formula", loc_data).as_string(nullptr);
301368

302369
/* go through all the possible cases of func_type */
303-
if (0 == strcmp(func_type, "lt")) {
304-
conn.set_sides(LEFT, TOP);
305-
} else if (0 == strcmp(func_type, "lr")) {
306-
conn.set_sides(LEFT, RIGHT);
307-
} else if (0 == strcmp(func_type, "lb")) {
308-
conn.set_sides(LEFT, BOTTOM);
309-
} else if (0 == strcmp(func_type, "tl")) {
310-
conn.set_sides(TOP, LEFT);
311-
} else if (0 == strcmp(func_type, "tb")) {
312-
conn.set_sides(TOP, BOTTOM);
313-
} else if (0 == strcmp(func_type, "tr")) {
314-
conn.set_sides(TOP, RIGHT);
315-
} else if (0 == strcmp(func_type, "rt")) {
316-
conn.set_sides(RIGHT, TOP);
317-
} else if (0 == strcmp(func_type, "rl")) {
318-
conn.set_sides(RIGHT, LEFT);
319-
} else if (0 == strcmp(func_type, "rb")) {
320-
conn.set_sides(RIGHT, BOTTOM);
321-
} else if (0 == strcmp(func_type, "bl")) {
322-
conn.set_sides(BOTTOM, LEFT);
323-
} else if (0 == strcmp(func_type, "bt")) {
324-
conn.set_sides(BOTTOM, TOP);
325-
} else if (0 == strcmp(func_type, "br")) {
326-
conn.set_sides(BOTTOM, RIGHT);
327-
} else {
328-
/* unknown permutation function */
329-
archfpga_throw(__FILE__, __LINE__, "Unknown permutation function specified: %s\n", func_type);
330-
}
370+
set_switch_func_type(conn, func_type);
371+
331372
func_ptr = &(sb->permutation_map[conn]);
332373

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

406447
/* iterate over all combinations of from_side -> to side */
407-
for (e_side from_side : {TOP, RIGHT, BOTTOM, LEFT}) {
408-
for (e_side to_side : {TOP, RIGHT, BOTTOM, LEFT}) {
448+
for (e_side from_side : TOTAL_2D_SIDES) {
449+
for (e_side to_side : TOTAL_2D_SIDES) {
409450
/* can't connect a switchblock side to itself */
410451
if (from_side == to_side) {
411452
continue;

libs/libarchfpga/src/physical_types.h

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,17 @@ enum e_side : unsigned char {
176176
RIGHT = 1,
177177
BOTTOM = 2,
178178
LEFT = 3,
179-
NUM_SIDES
179+
NUM_2D_SIDES = 4,
180+
ABOVE = 5,
181+
UNDER = 7,
182+
NUM_3D_SIDES = 6,
180183
};
181-
constexpr std::array<e_side, NUM_SIDES> SIDES = {{TOP, RIGHT, BOTTOM, LEFT}}; //Set of all side orientations
182-
constexpr std::array<const char*, NUM_SIDES> SIDE_STRING = {{"TOP", "RIGHT", "BOTTOM", "LEFT"}}; //String versions of side orientations
184+
185+
constexpr std::array<e_side, NUM_2D_SIDES> TOTAL_2D_SIDES = {{TOP, RIGHT, BOTTOM, LEFT}}; //Set of all side orientations
186+
constexpr std::array<const char*, NUM_2D_SIDES> TOTAL_2D_SIDE_STRINGS = {{"TOP", "RIGHT", "BOTTOM", "LEFT"}}; //String versions of side orientations
187+
188+
constexpr std::array<e_side, NUM_3D_SIDES> TOTAL_3D_SIDES = {{TOP, RIGHT, BOTTOM, LEFT, ABOVE, UNDER}}; //Set of all side orientations including different layers
189+
constexpr std::array<const char*, NUM_3D_SIDES> TOTAL_3D_SIDE_STRINGS = {{"TOP", "RIGHT", "BOTTOM", "LEFT", "ABOVE", "UNDER"}}; //String versions of side orientations including different layers
183190

184191
/* pin location distributions */
185192
enum class e_pin_location_distr {
@@ -822,10 +829,11 @@ struct t_physical_pin {
822829

823830
/**
824831
* @brief Describes The location of a physical tile
825-
* @param layer_num The die number of the physical tile. If the FPGA only has one die, or the physical tile is located
826-
* on the base die, layer_num is equal to zero. If it is one the die above base die, it is one, etc.
827832
* @param x The x location of the physical tile on the given die
828833
* @param y The y location of the physical tile on the given die
834+
* @param layer_num The die number of the physical tile. If the FPGA only has one die, or the physical tile is located
835+
* on the base die, layer_num is equal to zero. If the physical tile is location on the die immediately
836+
* above the base die, the layer_num is 1 and so on.
829837
*/
830838
struct t_physical_tile_loc {
831839
int x = OPEN;
@@ -1975,10 +1983,12 @@ struct t_router {
19751983

19761984
/** A value representing the approximate horizontal position on the FPGA device where the router
19771985
* tile is located*/
1978-
double device_x_position = -1;
1986+
float device_x_position = -1;
19791987
/** A value representing the approximate vertical position on the FPGA device where the router
19801988
* tile is located*/
1981-
double device_y_position = -1;
1989+
float device_y_position = -1;
1990+
/** A value representing the exact layer in the FPGA device where the router tile is located.*/
1991+
int device_layer_position = -1;
19821992

19831993
/** A list of router ids that are connected to the current router*/
19841994
std::vector<int> connection_list;

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ struct ArchReader {
480480
type.pin_height_offset.resize(type.num_pins, 0);
481481

482482
type.pinloc.resize({1, 1, 4}, std::vector<bool>(type.num_pins, false));
483-
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
483+
for (e_side side : TOTAL_2D_SIDES) {
484484
for (int pin = 0; pin < type.num_pins; pin++) {
485485
type.pinloc[0][0][side][pin] = true;
486486
type.pin_width_offset[pin] = 0;

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
579579
int num_sides = 4 * (type->width * type->height);
580580
int side_index = 0;
581581
int count = 0;
582-
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
582+
for (e_side side : TOTAL_2D_SIDES) {
583583
for (int width = 0; width < type->width; ++width) {
584584
for (int height = 0; height < type->height; ++height) {
585585
for (int pin_offset = 0; pin_offset < (type->num_pins / num_sides) + 1; ++pin_offset) {
@@ -604,7 +604,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
604604
while (ipin < type->num_pins) {
605605
for (int width = 0; width < type->width; ++width) {
606606
for (int height = 0; height < type->height; ++height) {
607-
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
607+
for (e_side side : TOTAL_2D_SIDES) {
608608
if (((width == 0 && side == LEFT)
609609
|| (height == type->height - 1 && side == TOP)
610610
|| (width == type->width - 1 && side == RIGHT)
@@ -645,7 +645,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
645645
while (ipin < input_pins.size()) {
646646
for (int width = 0; width < type->width; ++width) {
647647
for (int height = 0; height < type->height; ++height) {
648-
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
648+
for (e_side side : TOTAL_2D_SIDES) {
649649
if (ipin < input_pins.size()) {
650650
//Pins still to allocate
651651

@@ -668,7 +668,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
668668
while (ipin < output_pins.size()) {
669669
for (int width = 0; width < type->width; ++width) {
670670
for (int height = 0; height < type->height; ++height) {
671-
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
671+
for (e_side side : TOTAL_2D_SIDES) {
672672
if (((width == 0 && side == LEFT)
673673
|| (height == type->height - 1 && side == TOP)
674674
|| (width == type->width - 1 && side == RIGHT)
@@ -699,8 +699,8 @@ static void LoadPinLoc(pugi::xml_node Locations,
699699
for (int layer = 0; layer < num_of_avail_layer; ++layer) {
700700
for (int width = 0; width < type->width; ++width) {
701701
for (int height = 0; height < type->height; ++height) {
702-
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
703-
for (const auto& token : pin_locs->assignments[sub_tile_index][width][height][layer][side]) {
702+
for (e_side side : TOTAL_2D_SIDES) {
703+
for (auto token : pin_locs->assignments[sub_tile_index][width][height][layer][side]) {
704704
auto pin_range = ProcessPinString<t_sub_tile*>(Locations,
705705
&sub_tile,
706706
token.c_str(),
@@ -3393,9 +3393,9 @@ static void ProcessPinLocations(pugi::xml_node Locations,
33933393
for (int l = 0; l < num_of_avail_layer; ++l) {
33943394
for (int w = 0; w < PhysicalTileType->width; ++w) {
33953395
for (int h = 0; h < PhysicalTileType->height; ++h) {
3396-
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
3397-
for (const auto& token : pin_locs->assignments[sub_tile_index][w][h][l][side]) {
3398-
InstPort inst_port(token);
3396+
for (e_side side : TOTAL_2D_SIDES) {
3397+
for (auto token : pin_locs->assignments[sub_tile_index][w][h][l][side]) {
3398+
InstPort inst_port(token.c_str());
33993399

34003400
//A pin specification should contain only the block name, and not any instance count information
34013401
if (inst_port.instance_low_index() != InstPort::UNSPECIFIED || inst_port.instance_high_index() != InstPort::UNSPECIFIED) {
@@ -4766,9 +4766,9 @@ static int find_switch_by_name(const t_arch& arch, const std::string& switch_nam
47664766
}
47674767

47684768
static e_side string_to_side(const std::string& side_str) {
4769-
e_side side = NUM_SIDES;
4769+
e_side side = NUM_2D_SIDES;
47704770
if (side_str.empty()) {
4771-
side = NUM_SIDES;
4771+
side = NUM_2D_SIDES;
47724772
} else if (side_str == "left") {
47734773
side = LEFT;
47744774
} else if (side_str == "right") {

0 commit comments

Comments
 (0)