Skip to content

Commit 8d69193

Browse files
committed
equivalent: check mutual phy/log type compatibility when swapping
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 0bf4db6 commit 8d69193

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

vpr/src/place/move_utils.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ e_block_move_result record_single_block_swap(t_pl_blocks_to_be_moved& blocks_aff
113113

114114
ClusterBlockId b_to = place_ctx.grid_blocks[to.x][to.y].blocks[to.z];
115115

116+
t_pl_loc curr_from = place_ctx.block_locs[b_from].loc;
117+
116118
e_block_move_result outcome = e_block_move_result::VALID;
117119

118120
// Check whether the to_location is empty
@@ -121,6 +123,13 @@ e_block_move_result record_single_block_swap(t_pl_blocks_to_be_moved& blocks_aff
121123
outcome = record_block_move(blocks_affected, b_from, to);
122124

123125
} else if (b_to != INVALID_BLOCK_ID) {
126+
// Check whether block to is compatible with from location
127+
if (b_to != EMPTY_BLOCK_ID && b_to != INVALID_BLOCK_ID) {
128+
if (!(is_legal_swap_to_location(b_to, curr_from))) {
129+
return e_block_move_result::ABORT;
130+
}
131+
}
132+
124133
// Sets up the blocks moved
125134
outcome = record_block_move(blocks_affected, b_from, to);
126135

@@ -253,10 +262,18 @@ e_block_move_result record_macro_macro_swaps(t_pl_blocks_to_be_moved& blocks_aff
253262
ClusterBlockId b_from = place_ctx.pl_macros[imacro_from].members[imember_from].blk_index;
254263

255264
t_pl_loc curr_to = place_ctx.block_locs[b_from].loc + swap_offset;
265+
t_pl_loc curr_from = place_ctx.block_locs[b_from].loc;
256266

257267
ClusterBlockId b_to = place_ctx.pl_macros[imacro_to].members[imember_to].blk_index;
258268
VTR_ASSERT_SAFE(curr_to == place_ctx.block_locs[b_to].loc);
259269

270+
// Check whether block to is compatible with from location
271+
if (b_to != EMPTY_BLOCK_ID && b_to != INVALID_BLOCK_ID) {
272+
if (!(is_legal_swap_to_location(b_to, curr_from))) {
273+
return e_block_move_result::ABORT;
274+
}
275+
}
276+
260277
if (!is_legal_swap_to_location(b_from, curr_to)) {
261278
log_move_abort("macro_from swap to location illegal");
262279
return e_block_move_result::ABORT;

0 commit comments

Comments
 (0)