Skip to content

Commit c85560f

Browse files
acomodivaughnbetz
authored andcommitted
prepack: relax assertion on model port clock input pin_number
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 0eeafcc commit c85560f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

vpr/src/pack/prepack.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,17 +1123,27 @@ static AtomBlockId get_sink_block(const AtomBlockId block_id, const t_model_port
11231123
* pin_number : the pin_number of the pin driven by the net (pin index within the port)
11241124
*/
11251125
static AtomBlockId get_driving_block(const AtomBlockId block_id, const t_model_ports* model_port, const BitIndex pin_number) {
1126-
if (model_port->is_clock) {
1127-
VTR_ASSERT(pin_number == 1); //TODO: support multi-clock primitives
1128-
}
1129-
11301126
auto& atom_ctx = g_vpr_ctx.atom();
11311127

11321128
auto port_id = atom_ctx.nlist.find_atom_port(block_id, model_port);
11331129

11341130
if (port_id) {
11351131
auto net_id = atom_ctx.nlist.port_net(port_id, pin_number);
11361132
if (net_id && atom_ctx.nlist.net_sinks(net_id).size() == 1) { /* Single fanout assumption */
1133+
1134+
auto driver_blk_id = atom_ctx.nlist.net_driver_block(net_id);
1135+
1136+
if (model_port->is_clock) {
1137+
auto driver_blk_type = atom_ctx.nlist.block_type(driver_blk_id);
1138+
1139+
// TODO: support multi-clock primitives.
1140+
// If the driver block is a .input block, this assertion should not
1141+
// be triggered as the sink block might have only one input pin, which
1142+
// would be a clock pin in case the sink block primitive is a clock generator,
1143+
// resulting in a pin_number == 0.
1144+
VTR_ASSERT(pin_number == 1 || (pin_number == 0 && driver_blk_type == AtomBlockType::INPAD));
1145+
}
1146+
11371147
return atom_ctx.nlist.net_driver_block(net_id);
11381148
}
11391149
}

0 commit comments

Comments
 (0)