Skip to content

Commit 7c841f5

Browse files
committed
making formatting changes
1 parent 421e4be commit 7c841f5

16 files changed

+83
-39
lines changed

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4957,9 +4957,9 @@ static bool parse_noc_router_connection_list(pugi::xml_node router_tag, const pu
49574957
}
49584958

49594959
// make sure that the current router isn't connected to itself
4960-
if (router_id == converted_connection){
4960+
if (router_id == converted_connection) {
49614961
archfpga_throw(loc_data.filename_c_str(), loc_data.line(router_tag),
4962-
"The router with id:%d was added to its own connection list. A router cannot connect to itself.", router_id);
4962+
"The router with id:%d was added to its own connection list. A router cannot connect to itself.", router_id);
49634963
}
49644964

49654965
// if we are here then a legal router id was supplied, so store it

vpr/src/base/noc_link.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@
4343

4444
class NocLink {
4545
private:
46-
4746
// the two routers that are connected by this link
4847
NocRouterId source_router; /*!< The router which has this link as an outgoing edge*/
49-
NocRouterId sink_router; /*!< The router which uses this link as an incoming edge*/
48+
NocRouterId sink_router; /*!< The router which uses this link as an incoming edge*/
5049

5150
double bandwidth_usage; /*!< Represents the bandwidth of the data being transmitted on the link. Units in bps*/
5251

vpr/src/base/noc_router.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ClusterBlockId NocRouter::get_router_block_ref(void) const {
2727
}
2828

2929
// setters
30-
void NocRouter::set_router_block_ref(ClusterBlockId router_block_ref_id){
30+
void NocRouter::set_router_block_ref(ClusterBlockId router_block_ref_id) {
3131
router_block_ref = router_block_ref_id;
3232
return;
3333
}

vpr/src/base/noc_router.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class NocRouter {
4646
int router_grid_position_x; /*<! Represents the horizontal grid position on the device the physical router tile is located*/
4747
int router_grid_position_y; /*<! Represents the vertical grid position on the device the physical router is located*/
4848

49-
ClusterBlockId router_block_ref;/*<! A unique identifier that represents a router block in the clustered netlist that is placed on the physical router*/
49+
ClusterBlockId router_block_ref; /*<! A unique identifier that represents a router block in the clustered netlist that is placed on the physical router*/
5050

5151
public:
5252
NocRouter(int id, int grid_position_x, int grid_position_y);

vpr/src/base/noc_storage.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
#include "noc_storage.h"
33

4-
54
NocStorage::NocStorage() {
65
clear_noc();
76
}
@@ -79,17 +78,17 @@ void NocStorage::add_link(NocRouterId source, NocRouterId sink) {
7978
return;
8079
}
8180

82-
void NocStorage::set_noc_link_bandwidth(double link_bandwidth){
81+
void NocStorage::set_noc_link_bandwidth(double link_bandwidth) {
8382
noc_link_bandwidth = link_bandwidth;
8483
return;
8584
}
8685

87-
void NocStorage::set_noc_link_latency(double link_latency){
86+
void NocStorage::set_noc_link_latency(double link_latency) {
8887
noc_link_latency = link_latency;
8988
return;
9089
}
9190

92-
void NocStorage::set_noc_router_latency(double router_latency){
91+
void NocStorage::set_noc_router_latency(double router_latency) {
9392
noc_router_latency = router_latency;
9493
return;
9594
}
@@ -148,7 +147,6 @@ NocLinkId NocStorage::get_parallel_link(NocLinkId current_link) const {
148147
}
149148

150149
void NocStorage::echo_noc(char* file_name) const {
151-
152150
FILE* fp;
153151
fp = vtr::fopen(file_name, "w");
154152

@@ -184,10 +182,9 @@ void NocStorage::echo_noc(char* file_name) const {
184182

185183
// go through the outgoing links of the current router and print the connecting router
186184
for (auto link_id = router_connections.begin(); link_id != router_connections.end(); link_id++) {
187-
188185
const NocRouterId connecting_router_id = get_single_noc_link(*link_id).get_sink_router();
189-
190-
fprintf(fp, " %d", get_single_noc_router(connecting_router_id).get_router_user_id());
186+
187+
fprintf(fp, " %d", get_single_noc_router(connecting_router_id).get_router_user_id());
191188
}
192189

193190
fprintf(fp, "\n\n");
@@ -196,5 +193,4 @@ void NocStorage::echo_noc(char* file_name) const {
196193
fclose(fp);
197194

198195
return;
199-
200196
}

vpr/src/base/noc_storage.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ constexpr NocLinkId INVALID_LINK_ID(-1);
5252

5353
class NocStorage {
5454
private:
55-
5655
vtr::vector<NocRouterId, NocRouter> router_storage; /*<! Contains all the routers in the NoC*/
5756

5857
// list of outgoing links for each router
@@ -64,8 +63,7 @@ class NocStorage {
6463
*/
6564
vtr::vector<NocRouterId, std::vector<NocLinkId>> router_link_list;
6665

67-
vtr::vector<NocLinkId, NocLink> link_storage;/*<! Contains all the links in the NoC*/
68-
66+
vtr::vector<NocLinkId, NocLink> link_storage; /*<! Contains all the links in the NoC*/
6967

7068
/**
7169
* @brief The user provides an ID for the router when describing the NoC
@@ -172,9 +170,8 @@ class NocStorage {
172170

173171
double get_noc_router_latency(void) const;
174172

175-
176173
// getters for routers
177-
174+
178175
/**
179176
* @brief Given a unique router identifier, get the corresponding router
180177
* within the NoC. The router cannot be modified, so the intended use

vpr/src/base/setup_noc.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "vtr_math.h"
1010
#include "echo_files.h"
1111

12-
1312
void setup_noc(const t_arch& arch) {
1413
// variable to store all the noc router tiles within the FPGA device
1514
// physical routers
@@ -119,7 +118,7 @@ void generate_noc(const t_arch& arch, NocContext& noc_ctx, std::vector<t_noc_rou
119118
}
120119

121120
void create_noc_routers(const t_noc_inf& noc_info, NocStorage* noc_model, std::vector<t_noc_router_tile_position>& noc_router_tiles) {
122-
// keep track of the shortest distance between a user described router (noc description in the arch file) and a physical router on the FPGA
121+
// keep track of the shortest distance between a user described router (noc description in the arch file) and a physical router on the FPGA
123122
double shortest_distance;
124123
double curr_calculated_distance;
125124
// stores the index of a physical router within the noc_router_tiles that is closest to a given user described router
@@ -140,7 +139,7 @@ void create_noc_routers(const t_noc_inf& noc_info, NocStorage* noc_model, std::v
140139
int error_case_physical_router_index_1;
141140
int error_case_physical_router_index_2;
142141

143-
// keep track of the router assignments (store the user router id that was assigned to each physical router tile)
142+
// keep track of the router assignments (store the user router id that was assigned to each physical router tile)
144143
// this is used in error checking, after determining the closest physical router for a user described router in the arch file, the datastructure below can be used to check if that physical router was already assigned previously
145144
std::vector<int> router_assignments;
146145
router_assignments.resize(noc_router_tiles.size(), PHYSICAL_ROUTER_NOT_ASSIGNED);
@@ -245,4 +244,3 @@ void create_noc_links(const t_noc_inf* noc_info, NocStorage* noc_model) {
245244

246245
return;
247246
}
248-

vpr/src/base/setup_noc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*
99
*/
1010

11-
1211
/**
1312
* @file
1413
* @brief This is the setup_noc header file. The main purpose of

vpr/src/base/vpr_context.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ struct NocContext : public Context {
427427
* The NoC model is created once from the architecture file description.
428428
*/
429429
NocStorage noc_model;
430-
431430
};
432431

433432
/**

vpr/src/draw/draw_noc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ NocLinkType determine_noc_link_type(ezgl::point2d link_start_point, ezgl::point2
363363
// get the dot product of the two connecting line
364364
double dot_product_of_link_and_horizontal_line = (x_coord_end - x_coord_start) * (x_coord_horziontal_end - x_coord_horizontal_start) + (y_coord_end - y_coord_start) * (y_coord_horizontal_end - y_coord_horizontal_start);
365365
// calculate the angle
366-
double angle = acos(dot_product_of_link_and_horizontal_line /(link_magnitude * HORIZONTAL_LINE_LENGTH));
366+
double angle = acos(dot_product_of_link_and_horizontal_line / (link_magnitude * HORIZONTAL_LINE_LENGTH));
367367

368368
// the angle is in the first or fourth quandrant of the unit circle
369369
if ((angle > 0) && (angle < (PI_RADIAN / 2))) {

0 commit comments

Comments
 (0)