[core] fixed a bug where the pin idx of global net on rr graph is not well annotated
This commit is contained in:
parent
a16b3df063
commit
27e29f949c
|
@ -21,7 +21,9 @@ namespace openfpga {
|
|||
*******************************************************************/
|
||||
vtr::vector<RRNodeId, ClusterNetId> annotate_rr_node_global_net(
|
||||
const DeviceContext& device_ctx, const ClusteredNetlist& cluster_nlist,
|
||||
const PlacementContext& placement_ctx, const bool& verbose) {
|
||||
const PlacementContext& placement_ctx,
|
||||
const VprClusteringAnnotation& clustering_annotation,
|
||||
const bool& verbose) {
|
||||
vtr::vector<RRNodeId, ClusterNetId> rr_node_nets;
|
||||
|
||||
size_t counter = 0;
|
||||
|
@ -42,10 +44,36 @@ vtr::vector<RRNodeId, ClusterNetId> annotate_rr_node_global_net(
|
|||
ClusterBlockId block_id = cluster_nlist.pin_block(pin_id);
|
||||
t_block_loc blk_loc = get_block_loc(block_id, false);
|
||||
int phy_pin = placement_ctx.physical_pins[pin_id];
|
||||
t_physical_tile_type_ptr phy_tile = device_ctx.grid.get_physical_type(t_physical_tile_loc(blk_loc.loc.x, blk_loc.loc.y, 0));
|
||||
int node_pin_num = phy_tile->num_pins;
|
||||
/* Note that the phy_pin may not reflect the actual pin index at the top-level physical tile type. It could be one of the random pin to the same pin class. So here, we have to find an exact match of the pin index from the clustering results! */
|
||||
int subtile_idx = blk_loc.loc.sub_tile;
|
||||
auto logical_block = cluster_nlist.block_type(block_id);
|
||||
for (int j = 0; j < logical_block->pb_type->num_pins; j++) {
|
||||
/* Find the net mapped to this pin in clustering results*/
|
||||
ClusterNetId cluster_net_id =
|
||||
cluster_nlist.block_net(block_id, j);
|
||||
/* Get the actual net id because it may be renamed during routing */
|
||||
if (true == clustering_annotation.is_net_renamed(block_id, j)) {
|
||||
cluster_net_id = clustering_annotation.net(block_id, j);
|
||||
}
|
||||
/* Bypass unmatched pins */
|
||||
if (cluster_net_id != net_id) {
|
||||
continue;
|
||||
}
|
||||
int curr_pin_num = get_physical_pin_at_sub_tile_location(phy_tile, logical_block, subtile_idx, j);
|
||||
if (phy_tile->pin_class[curr_pin_num] != phy_tile->pin_class[phy_pin]) {
|
||||
continue;
|
||||
}
|
||||
node_pin_num = curr_pin_num;
|
||||
break;
|
||||
}
|
||||
VTR_ASSERT(node_pin_num < phy_tile->num_pins);
|
||||
std::vector<RRNodeId> curr_rr_nodes =
|
||||
rr_graph.node_lookup().find_nodes_at_all_sides(
|
||||
layer, blk_loc.loc.x, blk_loc.loc.y, IPIN, phy_pin);
|
||||
layer, blk_loc.loc.x, blk_loc.loc.y, IPIN, node_pin_num);
|
||||
for (RRNodeId curr_rr_node : curr_rr_nodes) {
|
||||
VTR_LOGV(verbose, "Annotate global net '%s' on '%s' pin '%d'\n", cluster_nlist.net_name(net_id).c_str(), phy_tile->name, node_pin_num);
|
||||
rr_node_nets[curr_rr_node] = net_id;
|
||||
counter++;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*******************************************************************/
|
||||
#include "openfpga_context.h"
|
||||
#include "vpr_context.h"
|
||||
#include "vpr_clustering_annotation.h"
|
||||
#include "vpr_routing_annotation.h"
|
||||
|
||||
/********************************************************************
|
||||
|
@ -17,7 +18,9 @@ namespace openfpga {
|
|||
|
||||
vtr::vector<RRNodeId, ClusterNetId> annotate_rr_node_global_net(
|
||||
const DeviceContext& device_ctx, const ClusteredNetlist& cluster_nlist,
|
||||
const PlacementContext& placement_ctx, const bool& verbose);
|
||||
const PlacementContext& placement_ctx,
|
||||
const VprClusteringAnnotation& clustering_annotation,
|
||||
const bool& verbose);
|
||||
|
||||
void annotate_vpr_rr_node_nets(const DeviceContext& device_ctx,
|
||||
const ClusteringContext& clustering_ctx,
|
||||
|
|
|
@ -472,6 +472,7 @@ static int route_clock_tree_rr_graph(
|
|||
*******************************************************************/
|
||||
int route_clock_rr_graph(
|
||||
VprRoutingAnnotation& vpr_routing_annotation,
|
||||
const VprClusteringAnnotation& vpr_clustering_annotation,
|
||||
const DeviceContext& vpr_device_ctx, const ClusteredNetlist& cluster_nlist,
|
||||
const PlacementContext& vpr_place_ctx,
|
||||
const RRClockSpatialLookup& clk_rr_lookup, const ClockNetwork& clk_ntwk,
|
||||
|
@ -509,7 +510,7 @@ int route_clock_rr_graph(
|
|||
|
||||
/* Build rr_node-to-net mapping for global nets */
|
||||
vtr::vector<RRNodeId, ClusterNetId> rr_node_gnets =
|
||||
annotate_rr_node_global_net(vpr_device_ctx, cluster_nlist, vpr_place_ctx,
|
||||
annotate_rr_node_global_net(vpr_device_ctx, cluster_nlist, vpr_place_ctx, vpr_clustering_annotation,
|
||||
verbose);
|
||||
|
||||
/* Route spines one by one */
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "rr_clock_spatial_lookup.h"
|
||||
#include "vpr_context.h"
|
||||
#include "vpr_routing_annotation.h"
|
||||
#include "vpr_clustering_annotation.h"
|
||||
|
||||
/********************************************************************
|
||||
* Function declaration
|
||||
|
@ -19,6 +20,7 @@ namespace openfpga {
|
|||
|
||||
int route_clock_rr_graph(
|
||||
VprRoutingAnnotation& vpr_routing_annotation,
|
||||
const VprClusteringAnnotation& vpr_clustering_annotation,
|
||||
const DeviceContext& vpr_device_ctx, const ClusteredNetlist& cluster_nlist,
|
||||
const PlacementContext& vpr_place_ctx,
|
||||
const RRClockSpatialLookup& clk_rr_lookup, const ClockNetwork& clk_ntwk,
|
||||
|
|
|
@ -232,7 +232,9 @@ int route_clock_rr_graph_template(T& openfpga_ctx, const Command& cmd,
|
|||
}
|
||||
|
||||
return route_clock_rr_graph(
|
||||
openfpga_ctx.mutable_vpr_routing_annotation(), g_vpr_ctx.device(),
|
||||
openfpga_ctx.mutable_vpr_routing_annotation(),
|
||||
openfpga_ctx.vpr_clustering_annotation(),
|
||||
g_vpr_ctx.device(),
|
||||
g_vpr_ctx.clustering().clb_nlist, g_vpr_ctx.placement(),
|
||||
openfpga_ctx.clock_rr_lookup(), openfpga_ctx.clock_arch(), pin_constraints,
|
||||
cmd_context.option_enable(cmd, opt_disable_unused_trees),
|
||||
|
|
Loading…
Reference in New Issue