Skip to content

Commit 02c231d

Browse files
remove the set_noc_link_bandwidth() call after generating the noc
1 parent 192f639 commit 02c231d

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

vpr/src/base/setup_noc.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ void setup_noc(const t_arch& arch) {
5151
// generate noc model
5252
generate_noc(arch, noc_ctx, noc_router_tiles);
5353

54-
// store the general noc properties
55-
noc_ctx.noc_model.set_noc_link_bandwidth(arch.noc->link_bandwidth);
54+
/* store the general noc properties
55+
* noc_ctx.noc_model.set_noc_link_bandwidth(...) is not called because all
56+
* link bandwidths were set when create_noc_links(...) was called.
57+
*/
5658
noc_ctx.noc_model.set_noc_link_latency(arch.noc->link_latency);
5759
noc_ctx.noc_model.set_noc_router_latency(arch.noc->router_latency);
5860

@@ -131,7 +133,6 @@ void create_noc_routers(const t_noc_inf& noc_info,
131133
const std::vector<t_noc_router_tile_position>& noc_router_tiles) {
132134
// keep track of the shortest distance between a user described router (noc description in the arch file) and a physical router on the FPGA
133135
double shortest_distance;
134-
// double curr_calculated_distance;
135136
// stores the index of a physical router within the noc_router_tiles that is closest to a given user described router
136137
int closest_physical_router;
137138

vpr/src/base/setup_noc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void generate_noc(const t_arch& arch,
100100
const std::vector<t_noc_router_tile_position>& list_of_noc_router_tiles);
101101

102102
/**
103-
* @brief Go through the outers described by the user
103+
* @brief Go through the routers described by the user
104104
* in the architecture description file and assigns it a corresponding
105105
* physical router tile in the FPGA. Each logical router has a grid
106106
* location, so the closest physical router to the grid location is then

vpr/src/noc/noc_link.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,25 @@ NocLink::NocLink(NocLinkId link_id, NocRouterId source, NocRouterId sink,
1111
, latency(lat) { }
1212

1313
// getters
14-
NocRouterId NocLink::get_source_router(void) const {
14+
NocRouterId NocLink::get_source_router() const {
1515
return source_router;
1616
}
1717

18-
NocRouterId NocLink::get_sink_router(void) const {
18+
NocRouterId NocLink::get_sink_router() const {
1919
return sink_router;
2020
}
2121

22-
double NocLink::get_bandwidth_usage(void) const {
22+
double NocLink::get_bandwidth_usage() const {
2323
return bandwidth_usage;
2424
}
2525

2626
//setters
2727
void NocLink::set_source_router(NocRouterId source) {
2828
source_router = source;
29-
return;
3029
}
3130

3231
void NocLink::set_sink_router(NocRouterId sink) {
3332
sink_router = sink;
34-
return;
3533
}
3634

3735
void NocLink::set_bandwidth_usage(double new_bandwidth_usage) {
@@ -40,7 +38,6 @@ void NocLink::set_bandwidth_usage(double new_bandwidth_usage) {
4038

4139
void NocLink::set_bandwidth(double new_bandwidth) {
4240
bandwidth = new_bandwidth;
43-
return;
4441
}
4542

4643
double NocLink::get_bandwidth() const {

vpr/src/noc/noc_storage.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ void NocStorage::add_link(NocRouterId source, NocRouterId sink, double bandwidth
128128
}
129129

130130
void NocStorage::set_noc_link_bandwidth(double link_bandwidth) {
131-
132131
// Iterate over all links and set their bandwidth
133132
for (auto& link : link_storage) {
134133
link.set_bandwidth(link_bandwidth);

vpr/src/noc/noc_storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ class NocStorage {
379379
void add_link(NocRouterId source, NocRouterId sink, double bandwidth, double latency);
380380

381381
/**
382-
* @brief Set the maximum allowable bandwidth for a link
382+
* @brief Set the maximum allowable bandwidth for all links
383383
* within the NoC
384384
*/
385385
void set_noc_link_bandwidth(double link_bandwidth);

vpr/test/test_setup_noc.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ TEST_CASE("test_identify_and_store_noc_router_tile_positions", "[vpr_setup_noc]"
3838
router_tile.height = 2;
3939
router_tile.width = 2;
4040

41-
// name of the router physical tile
42-
//std::string router_tile_name_string("router");
43-
4441
// results from the test function
4542
std::vector<t_noc_router_tile_position> list_of_routers;
4643

@@ -802,7 +799,7 @@ TEST_CASE("test_setup_noc", "[vpr_setup_noc]") {
802799
//assign the noc_info to the arch
803800
arch.noc = &noc_info;
804801

805-
// the architecture file has been setup to include the noc topology and we set the parameters below
802+
// the architecture file has been setup to include the noc topology, and we set the parameters below
806803
noc_info.link_bandwidth = 67.8;
807804
noc_info.link_latency = 56.7;
808805
noc_info.router_latency = 2.3;

0 commit comments

Comments
 (0)