Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ titan_release*.tar.gz
vtr_flow/arch/titan/*.xml
vtr_flow/benchmarks/titan_blif/other_benchmarks
vtr_flow/benchmarks/titan_blif/titan23
vtr_flow/benchmarks/titan_blif/titan_new
vtr_flow/benchmarks/titan_blif/titanium


#
Expand Down
57 changes: 57 additions & 0 deletions vpr/src/route/rr_graph_generation/rr_graph_intra_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
#include "rr_graph_switch_utils.h"
#include "check_rr_graph.h"

/**
* @brief Returns the list of pins (both cluster-level and intra-cluster-level) of the given cluster block.
* @param physical_tile The physical tile type that the cluster block is mapped to.
* @param cluster_blk_id The cluster block ID.
* @param sub_tile_index The sub-tile absolute index (in comparison to relative index which is the index among sub-tiles of the same type) in the physical tile type.
*/
static std::vector<int> get_cluster_block_pins(t_physical_tile_type_ptr physical_tile,
ClusterBlockId cluster_blk_id,
int sub_tile_index);

static void set_clusters_pin_chains(const ClusteredNetlist& clb_nlist,
vtr::vector<ClusterBlockId, t_cluster_pin_chain>& pin_chains,
bool is_flat);
Expand Down Expand Up @@ -179,6 +189,53 @@ static void add_pin_chain(const std::vector<int>& pin_chain,
std::vector<std::vector<t_pin_chain_node>>& all_chains,
bool is_new_chain);

static std::vector<int> get_cluster_block_pins(t_physical_tile_type_ptr physical_tile,
ClusterBlockId cluster_blk_id,
int sub_tile_index) {
// To get the list of pins, we first add the pins on the tile-level, then add the pins on the intra-tile-level.

// A counter to keep track of number of tile-level pins for the sub-tiles before the current sub-tile.
int seen_sub_tiles_num_cluser_pins = 0;
// The number of tile-level pins for the sub-tile instance that the cluster block is mapped to.
int cluster_sub_tile_inst_num_pins;
// A flag to check if the sub-tile instance that the cluster block is mapped to has been found.
bool found_sub_tile = false;

// Iterate over all the sub-tiles to find the sub-tile instance that the cluster block is mapped to.
for (const t_sub_tile& sub_tile: physical_tile->sub_tiles) {
if (sub_tile.capacity.is_in_range(sub_tile_index)) {
// This sub-tile type is the one that the cluster block is mapped to.
found_sub_tile = true;
// The number of tile-level pins for all isntances of the same sub-tile type is the same. Thus,
// we can the the number of tile-level pins for the sub-tile instance by dividing the total number of pins
// for the given sub-tile type by the number of instances.
cluster_sub_tile_inst_num_pins = (sub_tile.num_phy_pins / sub_tile.capacity.total());
int rel_cap = sub_tile_index - sub_tile.capacity.low;
// Add the number of tile-level pins for the instances before the current sub-tile instance to the counter.
seen_sub_tiles_num_cluser_pins += rel_cap * cluster_sub_tile_inst_num_pins;
break;
} else {
// This sub-tile type is not the one that the cluster block is mapped to.
// Add the number of tile-level pins for this sub-tile type to the counter
// and continue to the next sub-tile type.
seen_sub_tiles_num_cluser_pins += sub_tile.num_phy_pins;
}
}

VTR_ASSERT(found_sub_tile);
std::vector<int> pin_num_vec(cluster_sub_tile_inst_num_pins);
// Pin numbers are assigned such that each instance’s tile-level pins
// occupy a continuous range equal to the total number of tile-level pins for that instance.
// Since we know the starting index, we use std::iota to generate that range.
std::iota(pin_num_vec.begin(), pin_num_vec.end(), seen_sub_tiles_num_cluser_pins);

// Add the intra-cluster-level pins to the list.
std::vector<int> internal_pins = get_cluster_internal_pins(cluster_blk_id);
pin_num_vec.insert(pin_num_vec.end(), internal_pins.begin(), internal_pins.end());

return pin_num_vec;
}

static void set_clusters_pin_chains(const ClusteredNetlist& clb_nlist,
vtr::vector<ClusterBlockId, t_cluster_pin_chain>& pin_chains,
bool is_flat) {
Expand Down
17 changes: 0 additions & 17 deletions vpr/src/util/vpr_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,23 +1906,6 @@ std::vector<int> get_cluster_netlist_intra_tile_pins_at_loc(const t_physical_til
return pin_num_vec;
}

std::vector<int> get_cluster_block_pins(t_physical_tile_type_ptr physical_tile,
ClusterBlockId cluster_blk_id,
int abs_cap) {
int max_num_pin = get_tile_total_num_pin(physical_tile) / physical_tile->capacity;
int num_tile_pin_per_inst = physical_tile->num_pins / physical_tile->capacity;
std::vector<int> pin_num_vec(num_tile_pin_per_inst);
std::iota(pin_num_vec.begin(), pin_num_vec.end(), abs_cap * num_tile_pin_per_inst);

pin_num_vec.reserve(max_num_pin);

auto internal_pins = get_cluster_internal_pins(cluster_blk_id);
pin_num_vec.insert(pin_num_vec.end(), internal_pins.begin(), internal_pins.end());

pin_num_vec.shrink_to_fit();
return pin_num_vec;
}

t_arch_switch_inf create_internal_arch_sw(float delay) {
t_arch_switch_inf arch_switch_inf;
arch_switch_inf.set_type(e_switch_type::MUX);
Expand Down
4 changes: 0 additions & 4 deletions vpr/src/util/vpr_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,6 @@ std::vector<int> get_cluster_netlist_intra_tile_pins_at_loc(const t_physical_til
const vtr::vector<ClusterBlockId, std::unordered_set<int>>& pin_chains_num,
t_physical_tile_type_ptr physical_type);

std::vector<int> get_cluster_block_pins(t_physical_tile_type_ptr physical_tile,
ClusterBlockId cluster_blk_id,
int abs_cap);

t_arch_switch_inf create_internal_arch_sw(float delay);

void add_pb_child_to_list(std::list<const t_pb*>& pb_list, const t_pb* parent_pb);
Expand Down