@@ -658,7 +658,14 @@ double calculate_noc_cost(const NocCostTerms& cost_terms,
658
658
* is computed. Weighting factors determine the contribution of each
659
659
* normalized term to the sum.
660
660
*/
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
+ );
662
669
663
670
return cost;
664
671
}
@@ -869,39 +876,29 @@ void write_noc_placement_file(const std::string& file_name) {
869
876
file_name.c_str ());
870
877
}
871
878
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
-
875
879
// get a reference to the collection of router cluster blocks in the design
876
880
const std::vector<ClusterBlockId>& router_clusters = noc_ctx.noc_traffic_flows_storage .get_router_clusters_in_netlist ();
877
881
// get the noc model to determine the physical routers where clusters are placed
878
882
const NocStorage& noc_model = noc_ctx.noc_model ;
879
883
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
-
886
884
// 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) {
888
886
// check if the current cluster id is valid
889
887
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 " );
892
889
}
893
890
894
891
// 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);
896
893
897
894
// 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];
899
896
900
897
// now get the corresponding physical router block id the cluster is located on
901
898
NocRouterId physical_router_cluster_is_placed_on = noc_model.get_router_at_grid_location (cluster_location.loc );
902
899
903
900
// 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 " ;
905
902
}
906
903
907
904
// finished writing placement information so close the file
0 commit comments