Skip to content

Commit 2c9b49e

Browse files
committed
vpr: vpr_utils: prepacking: add special case for mapping .latch atom blocks into pb_types
Signed-off-by: Pawel Czarnecki <[email protected]>
1 parent 97c5cb0 commit 2c9b49e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

vpr/src/util/vpr_utils.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,20 @@ bool primitive_type_feasible(const AtomBlockId blk_id, const t_pb_type* cur_pb_t
850850

851851
auto& atom_ctx = g_vpr_ctx.atom();
852852
if (cur_pb_type->model != atom_ctx.nlist.block_model(blk_id)) {
853-
//Primitive and atom do not match
854-
return false;
853+
if ((strcmp(atom_ctx.nlist.block_model(blk_id)->name, MODEL_LATCH) == 0) &&
854+
(strcmp(atom_ctx.nlist.block_model(blk_id)->name, cur_pb_type->model->name) == 0)) {
855+
/**
856+
* Special case for .latch: this model exists in 2 variations which are
857+
* defined one after another in linked list, check if the second variant match
858+
*/
859+
if (cur_pb_type->model->next != atom_ctx.nlist.block_model(blk_id)) {
860+
//Next primitive and atom do not match
861+
return false;
862+
}
863+
} else {
864+
//Primitive and atom do not match
865+
return false;
866+
}
855867
}
856868

857869
VTR_ASSERT_MSG(atom_ctx.nlist.is_compressed(), "This function assumes a compressed/non-dirty netlist");

0 commit comments

Comments
 (0)