Skip to content

Commit e8feb3e

Browse files
write the correct layer number to noc placement file
1 parent 89dfb32 commit e8feb3e

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

vpr/src/place/noc_place_utils.cpp

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,14 @@ double calculate_noc_cost(const NocCostTerms& cost_terms,
658658
* is computed. Weighting factors determine the contribution of each
659659
* normalized term to the sum.
660660
*/
661-
cost = noc_opts.noc_placement_weighting * (cost_terms.aggregate_bandwidth * norm_factors.aggregate_bandwidth * noc_opts.noc_aggregate_bandwidth_weighting + cost_terms.latency * norm_factors.latency * noc_opts.noc_latency_weighting + cost_terms.latency_overrun * norm_factors.latency_overrun * noc_opts.noc_latency_constraints_weighting + cost_terms.congestion * norm_factors.congestion * noc_opts.noc_congestion_weighting);
661+
cost =
662+
noc_opts.noc_placement_weighting *
663+
(
664+
cost_terms.aggregate_bandwidth * norm_factors.aggregate_bandwidth * noc_opts.noc_aggregate_bandwidth_weighting +
665+
cost_terms.latency * norm_factors.latency * noc_opts.noc_latency_weighting +
666+
cost_terms.latency_overrun * norm_factors.latency_overrun * noc_opts.noc_latency_constraints_weighting +
667+
cost_terms.congestion * norm_factors.congestion * noc_opts.noc_congestion_weighting
668+
);
662669

663670
return cost;
664671
}
@@ -869,39 +876,29 @@ void write_noc_placement_file(const std::string& file_name) {
869876
file_name.c_str());
870877
}
871878

872-
// assume that the FPGA device has a single layer (2-D), so when we write the placement file the layer value will be constant
873-
int layer_number = 0;
874-
875879
// get a reference to the collection of router cluster blocks in the design
876880
const std::vector<ClusterBlockId>& router_clusters = noc_ctx.noc_traffic_flows_storage.get_router_clusters_in_netlist();
877881
//get the noc model to determine the physical routers where clusters are placed
878882
const NocStorage& noc_model = noc_ctx.noc_model;
879883

880-
// get a reference to the clustered netlist
881-
const ClusteredNetlist& cluster_block_netlist = cluster_ctx.clb_nlist;
882-
883-
// get a reference to the clustered block placement locations
884-
const vtr::vector_map<ClusterBlockId, t_block_loc>& clustered_block_placed_locations = placement_ctx.block_locs;
885-
886884
// go through all the cluster blocks and write out their information in the placement file
887-
for (const auto& single_cluster_id : router_clusters) {
885+
for (const ClusterBlockId single_cluster_id : router_clusters) {
888886
// check if the current cluster id is valid
889887
if (single_cluster_id == ClusterBlockId::INVALID()) {
890-
VTR_LOG_ERROR(
891-
"A cluster block id stored as an identifier for a NoC router block was invalid.\n");
888+
VTR_LOG_ERROR("A cluster block id stored as an identifier for a NoC router block was invalid.\n");
892889
}
893890

894891
// get the name of the router cluster block
895-
const std::string& cluster_name = cluster_block_netlist.block_name(single_cluster_id);
892+
const std::string& cluster_name = cluster_ctx.clb_nlist.block_name(single_cluster_id);
896893

897894
//get the placement location of the current router cluster block
898-
const t_block_loc& cluster_location = clustered_block_placed_locations[single_cluster_id];
895+
const t_block_loc& cluster_location = placement_ctx.block_locs[single_cluster_id];
899896

900897
// now get the corresponding physical router block id the cluster is located on
901898
NocRouterId physical_router_cluster_is_placed_on = noc_model.get_router_at_grid_location(cluster_location.loc);
902899

903900
// write the current cluster information to the output file
904-
noc_placement_file << cluster_name << " " << layer_number << " " << (size_t)physical_router_cluster_is_placed_on << "\n";
901+
noc_placement_file << cluster_name << " " << cluster_location.loc.layer << " " << (size_t)physical_router_cluster_is_placed_on << "\n";
905902
}
906903

907904
// finished writing placement information so close the file

0 commit comments

Comments
 (0)