55
66namespace {
77
8+ constexpr double DUMMY_LATENCY = 1e-9 ;
9+ constexpr double DUMMY_BANDWIDTH = 1e12 ;
10+
811TEST_CASE (" test_route_flow" , " [vpr_noc_bfs_routing]" ) {
912 /*
1013 * Creating a test FPGA device below. The NoC itself will be
@@ -29,7 +32,7 @@ TEST_CASE("test_route_flow", "[vpr_noc_bfs_routing]") {
2932 // add all the routers
3033 for (int i = 0 ; i < 4 ; i++) {
3134 for (int j = 0 ; j < 4 ; j++) {
32- noc_model.add_router ((i * 4 ) + j, j, i, 0 );
35+ noc_model.add_router ((i * 4 ) + j, j, i, 0 , DUMMY_LATENCY );
3336 }
3437 }
3538
@@ -40,19 +43,19 @@ TEST_CASE("test_route_flow", "[vpr_noc_bfs_routing]") {
4043 for (int j = 0 ; j < 4 ; j++) {
4144 // add a link to the left of the router if there exists another router there
4245 if ((j - 1 ) >= 0 ) {
43- noc_model.add_link ((NocRouterId)((i * 4 ) + j), (NocRouterId)(((i * 4 ) + j) - 1 ));
46+ noc_model.add_link ((NocRouterId)((i * 4 ) + j), (NocRouterId)(((i * 4 ) + j) - 1 ), DUMMY_BANDWIDTH, DUMMY_LATENCY );
4447 }
4548 // add a link to the top of the router if there exists another router there
4649 if ((i + 1 ) <= 3 ) {
47- noc_model.add_link ((NocRouterId)((i * 4 ) + j), (NocRouterId)(((i * 4 ) + j) + 4 ));
50+ noc_model.add_link ((NocRouterId)((i * 4 ) + j), (NocRouterId)(((i * 4 ) + j) + 4 ), DUMMY_BANDWIDTH, DUMMY_LATENCY );
4851 }
4952 // add a link to the right of the router if there exists another router there
5053 if ((j + 1 ) <= 3 ) {
51- noc_model.add_link ((NocRouterId)((i * 4 ) + j), (NocRouterId)(((i * 4 ) + j) + 1 ));
54+ noc_model.add_link ((NocRouterId)((i * 4 ) + j), (NocRouterId)(((i * 4 ) + j) + 1 ), DUMMY_BANDWIDTH, DUMMY_LATENCY );
5255 }
5356 // add a link to the bottom of the router if there exists another router there
5457 if ((i - 1 ) >= 0 ) {
55- noc_model.add_link ((NocRouterId)((i * 4 ) + j), (NocRouterId)(((i * 4 ) + j) - 4 ));
58+ noc_model.add_link ((NocRouterId)((i * 4 ) + j), (NocRouterId)(((i * 4 ) + j) - 4 ), DUMMY_BANDWIDTH, DUMMY_LATENCY );
5659 }
5760 }
5861 }
@@ -97,12 +100,12 @@ TEST_CASE("test_route_flow", "[vpr_noc_bfs_routing]") {
97100 int number_of_links = noc_model.get_noc_links ().size ();
98101
99102 // add the diagonal links and also add them to the golden path
100- noc_model.add_link (NocRouterId (12 ), NocRouterId (9 ));
101- golden_path.push_back ( NocLinkId ( number_of_links++) );
102- noc_model.add_link (NocRouterId (9 ), NocRouterId (6 ));
103- golden_path.push_back ( NocLinkId ( number_of_links++) );
104- noc_model.add_link (NocRouterId (6 ), NocRouterId (3 ));
105- golden_path.push_back ( NocLinkId ( number_of_links++) );
103+ noc_model.add_link (NocRouterId (12 ), NocRouterId (9 ), DUMMY_BANDWIDTH, DUMMY_LATENCY );
104+ golden_path.emplace_back ( number_of_links++);
105+ noc_model.add_link (NocRouterId (9 ), NocRouterId (6 ), DUMMY_BANDWIDTH, DUMMY_LATENCY );
106+ golden_path.emplace_back ( number_of_links++);
107+ noc_model.add_link (NocRouterId (6 ), NocRouterId (3 ), DUMMY_BANDWIDTH, DUMMY_LATENCY );
108+ golden_path.emplace_back ( number_of_links++);
106109
107110 // now run the routinjg algorithm
108111 // make sure that a legal route was found (no error should be thrown)
0 commit comments