Find if driver of edge is in the same pattern, if yes, add to pattern Convention: Connections are made on backward expansion only (to make future multi-fanout support easier) so this function must update both source and destination blocks
578 int iport, ipin, iedge;
584 found = expansion_edge->infer_pattern;
585 for (i = 0; !found && i < expansion_edge->num_pack_patterns; i++) {
586 if (expansion_edge->pack_pattern_indices[i] == curr_pattern_index) {
595 for (i = 0; i < expansion_edge->num_input_pins; i++) {
596 if (expansion_edge->input_pins[i]->parent_node->pb_type->num_modes
599 assert(found ==
FALSE);
607 if (source_block == NULL
610 source_block->
block_id = *L_num_blocks;
612 list_of_packing_patterns[curr_pattern_index].base_cost +=
618 if (list_of_packing_patterns[curr_pattern_index].root_block
620 list_of_packing_patterns[curr_pattern_index].root_block =
635 list_of_packing_patterns,
637 &source_pb_graph_node->
input_pins[iport][ipin],
638 source_block, L_num_blocks);
653 list_of_packing_patterns,
654 curr_pattern_index, L_num_blocks,
FALSE);
669 list_of_packing_patterns,
671 &source_pb_graph_node->
clock_pins[iport][ipin],
672 source_block, L_num_blocks);
677 if (destination_pin != NULL) {
684 pack_pattern_connection->
from_block = source_block;
686 expansion_edge->input_pins[i];
687 pack_pattern_connection->
to_block = destination_block;
688 pack_pattern_connection->
to_pin = destination_pin;
690 source_block->
connections = pack_pattern_connection;
694 pack_pattern_connection->
from_block = source_block;
696 expansion_edge->input_pins[i];
697 pack_pattern_connection->
to_block = destination_block;
698 pack_pattern_connection->
to_pin = destination_pin;
699 pack_pattern_connection->
next = destination_block->connections;
700 destination_block->connections = pack_pattern_connection;
702 if (source_block == destination_block) {
703 vpr_printf(TIO_MESSAGE_ERROR,
"Invalid packing pattern defined. Source and destination block are the same (%s).\n",
708 if(expansion_edge->input_pins[i]->num_input_edges == 0) {
709 if(expansion_edge->input_pins[i]->parent_node->pb_type->parent_mode == NULL) {
711 list_of_packing_patterns[curr_pattern_index].is_chain =
TRUE;
714 list_of_packing_patterns,
715 curr_pattern_index, L_num_blocks,
TRUE);
718 for (j = 0; j < expansion_edge->input_pins[i]->num_input_edges;
720 if (expansion_edge->input_pins[i]->input_edges[j]->infer_pattern
723 expansion_edge->input_pins[i]->input_edges[j],
724 list_of_packing_patterns, curr_pattern_index,
725 destination_pin, destination_block, L_num_blocks);
729 < expansion_edge->input_pins[i]->input_edges[j]->num_pack_patterns;
731 if (expansion_edge->input_pins[i]->input_edges[j]->pack_pattern_indices[k]
732 == curr_pattern_index) {
733 assert(found ==
FALSE);
737 expansion_edge->input_pins[i]->input_edges[j],
738 list_of_packing_patterns,
739 curr_pattern_index, destination_pin,
740 destination_block, L_num_blocks);
t_pb_graph_pin ** clock_pins
const t_pb_type * pb_type
t_pack_pattern_block * from_block
struct s_pb_graph_edge ** output_edges
void * my_calloc(size_t nelem, size_t size)
t_pb_graph_pin ** output_pins
t_pack_pattern_block * to_block
struct s_pb_graph_edge ** input_edges
float compute_primitive_base_cost(INP t_pb_graph_node *primitive)
t_pb_graph_pin * from_pin
struct s_pb_graph_node * parent_node
struct s_pack_pattern_connections * next
struct s_pack_pattern_connections * connections
static void forward_expand_pack_pattern_from_edge(INP t_pb_graph_edge *expansion_edge, INOUTP t_pack_patterns *list_of_packing_patterns, INP int curr_pattern_index, INP int *L_num_blocks, INP boolean make_root_of_chain)
struct s_pb_type * pb_type
static void backward_expand_pack_pattern_from_edge(INP t_pb_graph_edge *expansion_edge, INOUTP t_pack_patterns *list_of_packing_patterns, INP int curr_pattern_index, INP t_pb_graph_pin *destination_pin, INP t_pack_pattern_block *destination_block, INP int *L_num_blocks)
t_pb_graph_pin ** input_pins