Skip to content

Commit ccd3a66

Browse files
update unit tests to be compatible with DeviceGrid constructors
1 parent b28100a commit ccd3a66

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

vpr/test/test_compressed_grid.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ TEST_CASE("test_compressed_grid", "[vpr_compressed_grid]") {
162162
}
163163

164164
auto& grid = g_vpr_ctx.mutable_device().grid;
165-
grid = DeviceGrid("test_device_grid", test_grid);
165+
std::vector<std::vector<int>> dummy_cuts0, dummy_cuts1;
166+
grid = DeviceGrid("test_device_grid", test_grid, std::move(dummy_cuts0), std::move(dummy_cuts1));
166167

167168
std::vector<t_compressed_block_grid> compressed_grids = create_compressed_block_grids();
168169

vpr/test/test_setup_noc.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ TEST_CASE("test_identify_and_store_noc_router_tile_positions", "[vpr_setup_noc]"
129129
}
130130

131131
// create a new device grid
132-
DeviceGrid test_device = DeviceGrid(device_grid_name, test_grid);
132+
std::vector<std::vector<int>> dummy_cuts0, dummy_cuts1;
133+
DeviceGrid test_device = DeviceGrid(device_grid_name, test_grid, std::move(dummy_cuts0), std::move(dummy_cuts1));
133134

134135
// call the test function
135136
list_of_routers = identify_and_store_noc_router_tile_positions(test_device, router_tile_name);
@@ -246,7 +247,8 @@ TEST_CASE("test_identify_and_store_noc_router_tile_positions", "[vpr_setup_noc]"
246247
}
247248

248249
// create a new device grid
249-
DeviceGrid test_device = DeviceGrid(device_grid_name, test_grid);
250+
std::vector<std::vector<int>> dummy_cuts0, dummy_cuts1;
251+
DeviceGrid test_device = DeviceGrid(device_grid_name, test_grid, std::move(dummy_cuts0), std::move(dummy_cuts1));
250252

251253
// call the test function
252254
list_of_routers = identify_and_store_noc_router_tile_positions(test_device, router_tile_name);
@@ -363,7 +365,8 @@ TEST_CASE("test_identify_and_store_noc_router_tile_positions", "[vpr_setup_noc]"
363365
}
364366

365367
// create a new device grid
366-
DeviceGrid test_device = DeviceGrid(device_grid_name, test_grid);
368+
std::vector<std::vector<int>> dummy_cuts0, dummy_cuts1;
369+
DeviceGrid test_device = DeviceGrid(device_grid_name, test_grid, std::move(dummy_cuts0), std::move(dummy_cuts1));
367370

368371
// call the test function
369372
list_of_routers = identify_and_store_noc_router_tile_positions(test_device, router_tile_name);
@@ -404,7 +407,7 @@ TEST_CASE("test_create_noc_routers", "[vpr_setup_noc]") {
404407
/*
405408
* Setup:
406409
* - The router will take over a 2x3 grid area
407-
* - The NoC will be a 3x3 Mesh topology and located at
410+
* - The NoC will be a 3x3 Mesh topology and located at
408411
* the following positions:
409412
* - router 1: (0,0)
410413
* - router 2: (4,0)
@@ -590,7 +593,7 @@ TEST_CASE("test_create_noc_links", "[vpr_setup_noc]") {
590593
/*
591594
* Setup:
592595
* - The router will take over a 2x3 grid area
593-
* - The NoC will be a 3x3 Mesh topology and located at
596+
* - The NoC will be a 3x3 Mesh topology and located at
594597
* the following positions:
595598
* - router 1: (0,0)
596599
* - router 2: (4,0)
@@ -738,7 +741,7 @@ TEST_CASE("test_setup_noc", "[vpr_setup_noc]") {
738741
/*
739742
* Setup:
740743
* - The router will take over a 2x3 grid area
741-
* - The NoC will be a 3x3 Mesh topology and located at
744+
* - The NoC will be a 3x3 Mesh topology and located at
742745
* the following positions:
743746
* - router 1: (0,0)
744747
* - router 2: (4,0)
@@ -929,7 +932,8 @@ TEST_CASE("test_setup_noc", "[vpr_setup_noc]") {
929932
}
930933
}
931934

932-
device_ctx.grid = DeviceGrid(device_grid_name, test_grid);
935+
std::vector<std::vector<int>> dummy_cuts0, dummy_cuts1;
936+
device_ctx.grid = DeviceGrid(device_grid_name, test_grid, std::move(dummy_cuts0), std::move(dummy_cuts1));
933937

934938
REQUIRE_THROWS_WITH(setup_noc(arch), "The Provided NoC topology information in the architecture file has more number of routers than what is available in the FPGA device.");
935939
}
@@ -980,7 +984,8 @@ TEST_CASE("test_setup_noc", "[vpr_setup_noc]") {
980984

981985
noc_info.router_list.clear();
982986

983-
device_ctx.grid = DeviceGrid(device_grid_name, test_grid);
987+
std::vector<std::vector<int>> dummy_cuts0, dummy_cuts1;
988+
device_ctx.grid = DeviceGrid(device_grid_name, test_grid, std::move(dummy_cuts0), std::move(dummy_cuts1));
984989

985990
REQUIRE_THROWS_WITH(setup_noc(arch), "No physical NoC routers were found on the FPGA device. Either the provided name for the physical router tile was incorrect or the FPGA device has no routers.");
986991
}
@@ -1215,7 +1220,8 @@ TEST_CASE("test_setup_noc", "[vpr_setup_noc]") {
12151220
noc_info.link_bandwidth_overrides.insert({{noc_router_user_id, neighbor_router_user_id}, LINK_BANDWIDTH_OVERRIDE});
12161221
}
12171222

1218-
device_ctx.grid = DeviceGrid(device_grid_name, test_grid);
1223+
std::vector<std::vector<int>> dummy_cuts0, dummy_cuts1;
1224+
device_ctx.grid = DeviceGrid(device_grid_name, test_grid, std::move(dummy_cuts0), std::move(dummy_cuts1));
12191225

12201226
REQUIRE_NOTHROW(setup_noc(arch));
12211227

0 commit comments

Comments
 (0)