@@ -205,8 +205,6 @@ TEST_CASE("test_router_link_list", "[vpr_noc]") {
205
205
NocRouterId source;
206
206
NocRouterId sink;
207
207
208
- NocLinkId link_id;
209
-
210
208
// testing datastructure
211
209
NocStorage test_noc;
212
210
@@ -279,7 +277,7 @@ TEST_CASE("test_remove_link", "[vpr_noc]") {
279
277
std::mt19937 rand_num_gen (device ());
280
278
281
279
// random number generation to determine routers of the link to remove
282
- std::uniform_int_distribution<std::mt19937::result_type> src_router (0 , NUM_OF_ROUTERS);
280
+ std::uniform_int_distribution<std::mt19937::result_type> src_router (0 , NUM_OF_ROUTERS - 1 );
283
281
std::uniform_int_distribution<std::mt19937::result_type> sink_router (1 , NOC_CONNECTIVITY - 1 );
284
282
285
283
// create the NoC
@@ -349,9 +347,9 @@ TEST_CASE("test_remove_link", "[vpr_noc]") {
349
347
350
348
auto & outgoing_links = test_noc.get_noc_router_connections (link_to_remove_src_router);
351
349
// go through all the outgoing links of the source router in the link we removed and check that the link does not exist there as well.
352
- for (auto outgoing_link_id = outgoing_links. begin (); outgoing_link_id != outgoing_links. end (); outgoing_link_id++ ) {
350
+ for (auto outgoing_link : outgoing_links) {
353
351
// get the current outgoing link
354
- const NocLink& curr_outgoing_link = test_noc.get_single_noc_link (*outgoing_link_id );
352
+ const NocLink& curr_outgoing_link = test_noc.get_single_noc_link (outgoing_link );
355
353
356
354
if ((curr_outgoing_link.get_source_router () == link_to_remove_src_router) && (curr_outgoing_link.get_sink_router () == link_to_remove_sink_router)) {
357
355
link_removed_from_outgoing_vector = false ;
@@ -363,9 +361,9 @@ TEST_CASE("test_remove_link", "[vpr_noc]") {
363
361
const auto & links_in_noc = test_noc.get_noc_links ();
364
362
// go through the links and make sure that none of them have the source and sink router of the link
365
363
// that we removed. THe removed link should have the source and sink routers set to invalid values.
366
- for (auto single_link = links_in_noc. begin (); single_link != links_in_noc. end (); single_link++ ) {
364
+ for (auto single_link : links_in_noc) {
367
365
// check whether the source and sink router of the current link matches the routers in the link to remove
368
- if ((single_link-> get_source_router () == link_to_remove_src_router) && (single_link-> get_sink_router () == link_to_remove_sink_router)) {
366
+ if ((single_link. get_source_router () == link_to_remove_src_router) && (single_link. get_sink_router () == link_to_remove_sink_router)) {
369
367
// this indicates that the link was not set to an invalid state and not removed properly
370
368
link_removed_from_outgoing_vector = false ;
371
369
break ;
@@ -412,8 +410,6 @@ TEST_CASE("test_generate_router_key_from_grid_location", "[vpr_noc]") {
412
410
// this will be set to the total number of routers (and should be set before adding routers)
413
411
test_noc.set_device_grid_spec ((int )NUM_OF_ROUTERS, 0 );
414
412
415
- NocRouterId converted_id;
416
-
417
413
// add all the routers to noc_storage and populate the golden router set
418
414
for (int router_number = 0 ; router_number < NUM_OF_ROUTERS; router_number++) {
419
415
// determine the current router parameters
0 commit comments