Skip to content

Commit 3b2794d

Browse files
committed
cleaned up implementation and formatted code
1 parent ff2c9d2 commit 3b2794d

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# release #Build with compiler optimization
1818
# debug #Build with debug info and no compiler optimization
1919
# strict #Build VPR with warnings treated as errors
20-
BUILD_TYPE ?= debug
20+
BUILD_TYPE ?= release
2121

2222
#Convert to lower case for consistency
2323
BUILD_TYPE := $(shell echo $(BUILD_TYPE) | tr '[:upper:]' '[:lower:]')

libs/libarchfpga/src/parse_switchblocks.cpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ using vtr::t_formula_data;
4141
/*---- Functions for Parsing Switchblocks from Architecture ----*/
4242

4343
//Load an XML wireconn specification into a t_wireconn_inf
44-
t_wireconn_inf parse_wireconn(pugi::xml_node node, const pugiutil::loc_data& loc_data, const t_arch_switch_inf* Switches, int num_switches);
44+
t_wireconn_inf parse_wireconn(pugi::xml_node node, const pugiutil::loc_data& loc_data, const t_arch_switch_inf* switches, int num_switches);
4545

4646
//Process the desired order of a wireconn
4747
static void parse_switchpoint_order(const char* order, SwitchPointOrder& switchpoint_order);
4848

4949
//Process a wireconn defined in the inline style (using attributes)
50-
void parse_wireconn_inline(pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* Switches, int num_switches);
50+
void parse_wireconn_inline(pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* switches, int num_switches);
5151

5252
//Process a wireconn defined in the multinode style (more advanced specification)
53-
void parse_wireconn_multinode(pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* Switches, int num_switches);
53+
void parse_wireconn_multinode(pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* switches, int num_switches);
5454

5555
//Process a <from> or <to> sub-node of a multinode wireconn
5656
t_wire_switchpoints parse_wireconn_from_to_node(pugi::xml_node node, const pugiutil::loc_data& loc_data);
@@ -66,7 +66,7 @@ static void parse_comma_separated_wire_points(const char* ch, std::vector<t_wire
6666
static void parse_num_conns(std::string num_conns, t_wireconn_inf& wireconn);
6767

6868
/* parse switch_override in wireconn */
69-
static void parse_switch_override(const char* switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* Switches, int num_switches);
69+
static void parse_switch_override(const char* switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* switches, int num_switches);
7070

7171
/* checks for correctness of a unidir switchblock. */
7272
static void check_unidir_switchblock(const t_switchblock_inf* sb);
@@ -82,7 +82,7 @@ static void check_wireconn(const t_arch* arch, const t_wireconn_inf& wireconn);
8282
/*---- Functions for Parsing Switchblocks from Architecture ----*/
8383

8484
/* Reads-in the wire connections specified for the switchblock in the xml arch file */
85-
void read_sb_wireconns(const t_arch_switch_inf* Switches, int num_switches, pugi::xml_node Node, t_switchblock_inf* sb, const pugiutil::loc_data& loc_data) {
85+
void read_sb_wireconns(const t_arch_switch_inf* switches, int num_switches, pugi::xml_node Node, t_switchblock_inf* sb, const pugiutil::loc_data& loc_data) {
8686
/* Make sure that Node is a switchblock */
8787
check_node(Node, "switchblock", loc_data);
8888

@@ -97,31 +97,31 @@ void read_sb_wireconns(const t_arch_switch_inf* Switches, int num_switches, pugi
9797
SubElem = get_first_child(Node, "wireconn", loc_data);
9898
}
9999
for (int i = 0; i < num_wireconns; i++) {
100-
t_wireconn_inf wc = parse_wireconn(SubElem, loc_data, Switches, num_switches); // need to pass in switch info for switch override
100+
t_wireconn_inf wc = parse_wireconn(SubElem, loc_data, switches, num_switches); // need to pass in switch info for switch override
101101
sb->wireconns.push_back(wc);
102102
SubElem = SubElem.next_sibling(SubElem.name());
103103
}
104104

105105
return;
106106
}
107107

108-
t_wireconn_inf parse_wireconn(pugi::xml_node node, const pugiutil::loc_data& loc_data, const t_arch_switch_inf* Switches, int num_switches) {
108+
t_wireconn_inf parse_wireconn(pugi::xml_node node, const pugiutil::loc_data& loc_data, const t_arch_switch_inf* switches, int num_switches) {
109109
t_wireconn_inf wc;
110110

111111
size_t num_children = count_children(node, "from", loc_data, ReqOpt::OPTIONAL);
112112
num_children += count_children(node, "to", loc_data, ReqOpt::OPTIONAL);
113113

114114
if (num_children == 0) {
115-
parse_wireconn_inline(node, loc_data, wc, Switches, num_switches);
115+
parse_wireconn_inline(node, loc_data, wc, switches, num_switches);
116116
} else {
117117
VTR_ASSERT(num_children > 0);
118-
parse_wireconn_multinode(node, loc_data, wc, Switches, num_switches);
118+
parse_wireconn_multinode(node, loc_data, wc, switches, num_switches);
119119
}
120120

121121
return wc;
122122
}
123123

124-
void parse_wireconn_inline(pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* Switches, int num_switches) {
124+
void parse_wireconn_inline(pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* switches, int num_switches) {
125125
//Parse an inline wireconn definition, using attributes
126126
expect_only_attributes(node, {"num_conns", "from_type", "to_type", "from_switchpoint", "to_switchpoint", "from_order", "to_order", "switch_override"}, loc_data);
127127

@@ -150,13 +150,13 @@ void parse_wireconn_inline(pugi::xml_node node, const pugiutil::loc_data& loc_da
150150

151151
char_prop = get_attribute(node, "to_order", loc_data, ReqOpt::OPTIONAL).value();
152152
parse_switchpoint_order(char_prop, wc.to_switchpoint_order);
153-
153+
154154
// parse switch overrides if they exist:
155155
char_prop = get_attribute(node, "switch_override", loc_data, ReqOpt::OPTIONAL).value();
156-
parse_switch_override(char_prop, wc, Switches, num_switches);
156+
parse_switch_override(char_prop, wc, switches, num_switches);
157157
}
158158

159-
void parse_wireconn_multinode(pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* Switches, int num_switches) {
159+
void parse_wireconn_multinode(pugi::xml_node node, const pugiutil::loc_data& loc_data, t_wireconn_inf& wc, const t_arch_switch_inf* switches, int num_switches) {
160160
expect_only_children(node, {"from", "to"}, loc_data);
161161

162162
/* get the connection style */
@@ -170,7 +170,7 @@ void parse_wireconn_multinode(pugi::xml_node node, const pugiutil::loc_data& loc
170170
parse_switchpoint_order(char_prop, wc.to_switchpoint_order);
171171

172172
char_prop = get_attribute(node, "switch_override", loc_data, ReqOpt::OPTIONAL).value();
173-
parse_switch_override(char_prop, wc, Switches, num_switches);
173+
parse_switch_override(char_prop, wc, switches, num_switches);
174174

175175
size_t num_from_children = count_children(node, "from", loc_data);
176176
size_t num_to_children = count_children(node, "to", loc_data);
@@ -341,17 +341,16 @@ void read_sb_switchfuncs(pugi::xml_node Node, t_switchblock_inf* sb, const pugiu
341341
return;
342342
}
343343

344-
static void parse_switch_override(const char* switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* Switches, int num_switches){
345-
344+
static void parse_switch_override(const char* switch_override, t_wireconn_inf& wireconn, const t_arch_switch_inf* switches, int num_switches) {
346345
// check to see if user did not specify a switch_override
347346
if (switch_override == std::string("")) {
348347
wireconn.switch_override_indx = DEFAULT_SWITCH; //Default
349348
return;
350349
}
351350

352351
// iterate through the valid switch names in the arch looking for the requested switch_override
353-
for(int i = 0; i < num_switches; i++){
354-
if(0 == strcmp(switch_override, Switches[i].name)){
352+
for (int i = 0; i < num_switches; i++) {
353+
if (0 == strcmp(switch_override, switches[i].name)) {
355354
wireconn.switch_override_indx = i;
356355
return;
357356
}

libs/libarchfpga/src/physical_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ enum class e_sb_type {
532532
};
533533

534534
constexpr int NO_SWITCH = -1;
535-
constexpr int DEFAULT_SWITCH = -2;
535+
constexpr int DEFAULT_SWITCH = -2;
536536

537537
/* Describes the type for a physical tile
538538
* name: unique identifier for type
@@ -1688,7 +1688,7 @@ struct t_wireconn_inf {
16881688
std::vector<t_wire_switchpoints> to_switchpoint_set; //The set of segment/wirepoints representing the 'to' set (union of all t_wire_switchpoints in vector)
16891689
SwitchPointOrder from_switchpoint_order = SwitchPointOrder::FIXED; //The desired from_switchpoint_set ordering
16901690
SwitchPointOrder to_switchpoint_order = SwitchPointOrder::FIXED; //The desired to_switchpoint_set ordering
1691-
int switch_override_indx = NO_SWITCH; // index in switch array of the switch used to override wire_switch of the 'to' set.
1691+
int switch_override_indx = DEFAULT_SWITCH; // index in switch array of the switch used to override wire_switch of the 'to' set.
16921692

16931693
std::string num_conns_formula; /* Specifies how many connections should be made for this wireconn.
16941694
*

notes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
non-configurable edges is the thing to search in vpr

vpr/src/route/build_switchblocks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,10 +985,10 @@ static void compute_wireconn_connections(
985985
sb_edge.to_wire = to_wire;
986986

987987
// if the switch override has been set, use that. Otherwise use default
988-
if(wireconn_ptr->switch_override_indx != DEFAULT_SWITCH){
988+
if (wireconn_ptr->switch_override_indx != DEFAULT_SWITCH) {
989989
sb_edge.switch_ind = wireconn_ptr->switch_override_indx;
990990
} else {
991-
sb_edge.switch_ind = to_chan_details[to_x][to_y][to_wire].arch_wire_switch();
991+
sb_edge.switch_ind = to_chan_details[to_x][to_y][to_wire].arch_wire_switch();
992992
}
993993
VTR_LOGV(verbose, " make_conn: %d -> %d switch=%d\n", sb_edge.from_wire, sb_edge.to_wire, sb_edge.switch_ind);
994994

0 commit comments

Comments
 (0)