openfpga/src/repack/build_physical_lb_rr_graph.cpp
/***************************************************************************************
 * Build the edge for a pb_graph_pin for a non-primitive pb_graph node
 * Note: 
 *   - this function is NOT applicable to 
 *     - any input pin of primitive pb_graph_node 
 *     - any output pin of root pb_graph_node!
 ***************************************************************************************/
Build the edge for a pb_graph_pin for a non-primitive pb_graph node
Note:
- this function is NOT applicable to
- any input pin of primitive pb_graph_node
- any output pin of root pb_graph_node!
Build the edge for a pb_graph_pin for a non - primitive pb_graph node Note : - this function is NOT applicable to - any input pin of primitive pb_graph_node - any output pin of root pb_graph_node!
static 
void build_lb_rr_edge_pb_graph_pin(LbRRGraph& lb_rr_graph,
                                   t_pb_graph_pin* pb_pin,
                                   const e_lb_rr_type& pin_rr_type,
                                   t_mode* physical_mode) {
  LbRRNodeId from_node = lb_rr_graph.find_node(pin_rr_type, pb_pin);
  VTR_ASSERT(true == lb_rr_graph.valid_node_id(from_node));
  for (int iedge = 0; iedge < pb_pin->num_output_edges; iedge++) {
    VTR_ASSERT(1 == pb_pin->output_edges[iedge]->num_output_pins);
    if (physical_mode != pb_pin->output_edges[iedge]->interconnect->parent_mode) {
      continue;
    }
    LbRRNodeId to_node = lb_rr_graph.find_node(LB_INTERMEDIATE, pb_pin->output_edges[iedge]->output_pins[0]);
    VTR_ASSERT(true == lb_rr_graph.valid_node_id(to_node));
    LbRREdgeId edge = lb_rr_graph.create_edge(from_node, to_node, physical_mode);
    lb_rr_graph.set_edge_intrinsic_cost(edge, 1.); 
  }
}
static void build_lb_rr_edge_pb_graph_pin ( LbRRGraph & lb_rr_graph , t_pb_graph_pin * pb_pin , const e_lb_rr_type & pin_rr_type , t_mode * physical_mode ) { LbRRNodeId from_node = lb_rr_graph . find_node ( pin_rr_type , pb_pin ) ; VTR_ASSERT ( true == lb_rr_graph . valid_node_id ( from_node ) ) ; for ( int iedge = 0 ; iedge < pb_pin -> num_output_edges ; iedge ++ ) { VTR_ASSERT ( 1 == pb_pin -> output_edges [ iedge ] -> num_output_pins ) ; if ( physical_mode != pb_pin -> output_edges [ iedge ] -> interconnect -> parent_mode ) { continue ; } LbRRNodeId to_node = lb_rr_graph . find_node ( LB_INTERMEDIATE , pb_pin -> output_edges [ iedge ] -> output_pins [ 0 ] ) ; VTR_ASSERT ( true == lb_rr_graph . valid_node_id ( to_node ) ) ; LbRREdgeId edge = lb_rr_graph . create_edge ( from_node , to_node , physical_mode ) ; lb_rr_graph . set_edge_intrinsic_cost ( edge , 1. ) ; } }
Build the edge for a pb_graph_pin for a non-primitive pb_graph node
 Note:
   - this function is NOT applicable to
     - any input pin of primitive pb_graph_node
     - any output pin of root pb_graph_node!
Build the edge for a pb_graph_pin for a non - primitive pb_graph node Note : - this function is NOT applicable to - any input pin of primitive pb_graph_node - any output pin of root pb_graph_node!
/* Find the node that we have already created */ /* Load edges only for physical mode! */ /* Find the node that we have already created */ /* TODO: Double check if this is the case */