Skip to content

Commit 36386d7

Browse files
committed
[vpr][place] fix typos
1 parent a379afb commit 36386d7

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

vpr/src/place/net_cost_handler.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@ static void alloc_and_load_for_fast_vertical_cost_update(float place_cost_exp, v
240240
const auto& rr_graph = device_ctx.rr_graph;
241241
vtr::NdMatrix<float, 2> tile_num_inter_die_conn({device_ctx.grid.width(),
242242
device_ctx.grid.height()}, 0);
243+
244+
const int grid_height = device_ctx.grid.height();
245+
const int grid_width = device_ctx.grid.width();
246+
247+
248+
chanz_place_cost_fac = vtr::NdOffsetMatrix<float, 4>({{{0, grid_width-1},
249+
{0, grid_height-1},
250+
{0, grid_width-1},
251+
{0, grid_height-1}}}
252+
);
243253

244254
for (const auto& src_rr_node : rr_graph.nodes()) {
245255
for (const auto& rr_edge_idx : rr_graph.configurable_edges(src_rr_node)) {
@@ -265,10 +275,10 @@ static void alloc_and_load_for_fast_vertical_cost_update(float place_cost_exp, v
265275
}
266276
}
267277

268-
for (int x_high = 1; x_high < (int)device_ctx.grid.width(); x_high++) {
269-
for (int y_high = 1; y_high < (int)device_ctx.grid.height(); y_high++) {
270-
for (int x_low = 0; x_low < x_high; x_low++) {
271-
for (int y_low = 0; y_low < y_high; y_low++) {
278+
for (int x_high = 0; x_high < (int)device_ctx.grid.width(); x_high++) {
279+
for (int y_high = 0; y_high < (int)device_ctx.grid.height(); y_high++) {
280+
for (int x_low = 0; x_low <= x_high; x_low++) {
281+
for (int y_low = 0; y_low <= y_high; y_low++) {
272282
int num_inter_die_conn = 0;
273283
for (int x = x_low; x <= x_high; x++) {
274284
for (int y = y_low; y <= y_high; y++) {

vpr/src/place/net_cost_handler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class NetCostHandler {
195195
*/
196196
vtr::NdOffsetMatrix<float, 2> chanx_place_cost_fac_; // [-1...device_ctx.grid.width()-1]
197197
vtr::NdOffsetMatrix<float, 2> chany_place_cost_fac_; // [-1...device_ctx.grid.height()-1]
198-
vtr::NdOffsetMatrix<float, 4> chanz_place_cost_fac_; // [-1...device_ctx.grid.get_num_layers()-1]
198+
vtr::NdOffsetMatrix<float, 4> chanz_place_cost_fac_; // [0...device_ctx.grid.width()-1][0...device_ctx.grid.height()-1][0...device_ctx.grid.width()-1][0...device_ctx.grid.height()-1]
199199

200200

201201
private:

0 commit comments

Comments
 (0)