vpr/src/route/router_lookahead_map.cpp
/* Computes the lookahead map to be used by the router. If a map was computed prior to this, a new one will not be computed again.
 * The rr graph must have been built before calling this function. */
Computes the lookahead map to be used by the router. If a map was computed prior to this, a new one will not be computed again.
The rr graph must have been built before calling this function.
Computes the lookahead map to be used by the router . If a map was computed prior to this a new one will not be computed again . The rr graph must have been built before calling this function .
void compute_router_lookahead(int num_segments) {
    vtr::ScopedStartFinishTimer timer("Computing router lookahead map");
    f_cost_map.clear();
    auto& device_ctx = g_vpr_ctx.device();
    free_cost_map();
    alloc_cost_map(num_segments);
    for (int iseg = 0; iseg < num_segments; iseg++) {
        for (e_rr_type chan_type : {CHANX, CHANY}) {
            t_routing_cost_map routing_cost_map({device_ctx.grid.width(), device_ctx.grid.height()});
            for (int ref_inc = 0; ref_inc < 3; ref_inc++) {
                for (int track_offset = 0; track_offset < MAX_TRACK_OFFSET; track_offset += 2) {
                    RRNodeId start_node_ind = get_start_node_ind(REF_X + ref_inc, REF_Y + ref_inc,
                                                            device_ctx.grid.width() - 2, device_ctx.grid.height() - 2, 
                                                            chan_type, iseg, track_offset);
                    if (start_node_ind == RRNodeId::INVALID()) {
                        continue;
                    }
                    run_dijkstra(start_node_ind, REF_X + ref_inc, REF_Y + ref_inc, routing_cost_map);
                }
            }
            set_lookahead_map_costs(iseg, chan_type, routing_cost_map);
            fill_in_missing_lookahead_entries(iseg, chan_type);
        }
    }
    if (false) print_cost_map();
}
void compute_router_lookahead ( int num_segments ) { vtr :: ScopedStartFinishTimer timer ( " " ) ; f_cost_map . clear ( ) ; auto & device_ctx = g_vpr_ctx . device ( ) ; free_cost_map ( ) ; alloc_cost_map ( num_segments ) ; for ( int iseg = 0 ; iseg < num_segments ; iseg ++ ) { for ( e_rr_type chan_type : { CHANX , CHANY } ) { t_routing_cost_map routing_cost_map ( { device_ctx . grid . width ( ) , device_ctx . grid . height ( ) } ) ; for ( int ref_inc = 0 ; ref_inc < 3 ; ref_inc ++ ) { for ( int track_offset = 0 ; track_offset < MAX_TRACK_OFFSET ; track_offset += 2 ) { RRNodeId start_node_ind = get_start_node_ind ( REF_X + ref_inc , REF_Y + ref_inc , device_ctx . grid . width ( ) - 2 , device_ctx . grid . height ( ) - 2 , chan_type , iseg , track_offset ) ; if ( start_node_ind == RRNodeId :: INVALID ( ) ) { continue ; } run_dijkstra ( start_node_ind , REF_X + ref_inc , REF_Y + ref_inc , routing_cost_map ) ; } } set_lookahead_map_costs ( iseg , chan_type , routing_cost_map ) ; fill_in_missing_lookahead_entries ( iseg , chan_type ) ; } } if ( false ) print_cost_map ( ) ; }
Computes the lookahead map to be used by the router.
Computes the lookahead map to be used by the router .
/* free previous delay map and allocate new one */ /* run Dijkstra's algorithm for each segment type & channel type combination */ /* allocate the cost map for this iseg/chan_type */ /* get the rr node index from which to start routing */ //non-corner upper right /* run Dijkstra's algorithm */ /* boil down the cost list in routing_cost_map at each coordinate to a representative cost entry and store it in the lookahead
             * cost map */ /* fill in missing entries in the lookahead cost map by copying the closest cost entries (cost map was computed based on
             * a reference coordinate > (0,0) so some entries that represent a cross-chip distance have not been computed) */