@@ -107,7 +107,9 @@ void reinitialize_noc_routing(const t_noc_opts& noc_opts, t_placer_costs& costs)
107
107
* NoC latency cost caused by a placer move is stored
108
108
* here.
109
109
*/
110
- void find_affected_noc_routers_and_update_noc_costs (const t_pl_blocks_to_be_moved& blocks_affected, NocCostTerms& delta_c, const t_noc_opts& noc_opts);
110
+ void find_affected_noc_routers_and_update_noc_costs (const t_pl_blocks_to_be_moved& blocks_affected,
111
+ NocCostTerms& delta_c,
112
+ const t_noc_opts& noc_opts);
111
113
112
114
/* *
113
115
* @brief Updates static datastructures found in 'noc_place_utils.cpp'
@@ -154,7 +156,10 @@ void commit_noc_costs();
154
156
* flows within the NoC.
155
157
* @return std::vector<NocLinkId>& The found route for the traffic flow.
156
158
*/
157
- std::vector<NocLinkId>& route_traffic_flow (NocTrafficFlowId traffic_flow_id, const NocStorage& noc_model, NocTrafficFlows& noc_traffic_flows_storage, NocRouting& noc_flows_router);
159
+ std::vector<NocLinkId>& route_traffic_flow (NocTrafficFlowId traffic_flow_id,
160
+ const NocStorage& noc_model,
161
+ NocTrafficFlows& noc_traffic_flows_storage,
162
+ NocRouting& noc_flows_router);
158
163
159
164
/* *
160
165
* @brief Updates the bandwidth usages of links found in a routed traffic flow.
@@ -202,7 +207,10 @@ void update_traffic_flow_link_usage(const std::vector<NocLinkId>& traffic_flow_r
202
207
* @param updated_traffic_flows Keeps track of traffic flows that have been
203
208
* re-routed. Used to prevent re-routing the same traffic flow multiple times.
204
209
*/
205
- void re_route_associated_traffic_flows (ClusterBlockId moved_router_block_id, NocTrafficFlows& noc_traffic_flows_storage, NocStorage& noc_model, NocRouting& noc_flows_router, std::unordered_set<NocTrafficFlowId>& updated_traffic_flows);
210
+ void re_route_associated_traffic_flows (ClusterBlockId moved_router_block_id,
211
+ NocTrafficFlows& noc_traffic_flows_storage,
212
+ NocStorage& noc_model, NocRouting& noc_flows_router,
213
+ std::unordered_set<NocTrafficFlowId>& updated_traffic_flows);
206
214
207
215
/* *
208
216
* @brief Used to re-route all the traffic flows associated to logical
@@ -233,7 +241,10 @@ void revert_noc_traffic_flow_routes(const t_pl_blocks_to_be_moved& blocks_affect
233
241
* @param noc_flows_router The packet routing algorithm used to route traffic
234
242
* flows within the NoC.
235
243
*/
236
- void re_route_traffic_flow (NocTrafficFlowId traffic_flow_id, NocTrafficFlows& noc_traffic_flows_storage, NocStorage& noc_model, NocRouting& noc_flows_router);
244
+ void re_route_traffic_flow (NocTrafficFlowId traffic_flow_id,
245
+ NocTrafficFlows& noc_traffic_flows_storage,
246
+ NocStorage& noc_model,
247
+ NocRouting& noc_flows_router);
237
248
238
249
/* *
239
250
* @brief Recompute the NoC costs (aggregate bandwidth and latency) by
@@ -369,13 +380,44 @@ double calculate_traffic_flow_aggregate_bandwidth_cost(const std::vector<NocLink
369
380
* @param traffic_flow_info Contains the traffic flow priority.
370
381
* @param noc_opts Contains the user provided weightings of the traffic flow
371
382
* latency and its constraint parameters for the cost calculation.
372
- * @return THe computed latency for the provided traffic flow
383
+ * @return The computed latency for the provided traffic flow
373
384
*/
374
- double calculate_traffic_flow_latency_cost (const std::vector<NocLinkId>& traffic_flow_route, const NocStorage& noc_model, const t_noc_traffic_flow& traffic_flow_info, const t_noc_opts& noc_opts);
385
+ double calculate_traffic_flow_latency_cost (const std::vector<NocLinkId>& traffic_flow_route,
386
+ const NocStorage& noc_model,
387
+ const t_noc_traffic_flow& traffic_flow_info,
388
+ const t_noc_opts& noc_opts);
375
389
390
+ /* *
391
+ * @brief Determines the congestion cost a NoC link. The cost
392
+ * is calculating by measuring how much the current bandwidth
393
+ * going through the link exceeds the link's bandwidth capacity.
394
+ *
395
+ * @param link The NoC link for which the congestion cost is
396
+ * to be computed
397
+ * @param noc_opts Contains the user provided weighting factor to
398
+ * specify the importance of congestion costs compared to other
399
+ * NoC-related cost terms.
400
+ * @return The computed congestion cost for the given NoC link.
401
+ */
376
402
double calculate_link_congestion_cost (const NocLink& link, const t_noc_opts& noc_opts);
377
403
378
- double calculate_noc_cost (const NocCostTerms& cost_terms, const t_placer_costs& norm_factors, const t_noc_opts& noc_opts);
404
+ /* *
405
+ * @brief Computes a weighted average of NoC cost term to determine
406
+ * NoC's contribution to the total placement cost.
407
+ *
408
+ * @param cost_terms Different NoC-related cost terms.
409
+ * @param norm_factors Normalization factors used to scale
410
+ * different NoC-related cost term so that they have similar
411
+ * ranges.
412
+ * @param noc_opts Contains noc_placement_weighting factor
413
+ * to specify the contribution of NoC-related cost to the
414
+ * total placement cost.
415
+ * @return The computed total NoC-related contribution to the
416
+ * total placement cost.
417
+ */
418
+ double calculate_noc_cost (const NocCostTerms& cost_terms,
419
+ const t_placer_costs& norm_factors,
420
+ const t_noc_opts& noc_opts);
379
421
380
422
/* *
381
423
* @brief Goes through all the traffic flows and determines whether the
@@ -385,12 +427,37 @@ double calculate_noc_cost(const NocCostTerms& cost_terms, const t_placer_costs&
385
427
*/
386
428
int get_number_of_traffic_flows_with_latency_cons_met (void );
387
429
430
+ /* *
431
+ * @brief Goes through all NoC links and counts the congested ones.
432
+ *
433
+ * @return The total number of congested NoC links.
434
+ */
388
435
int get_number_of_congested_noc_links (void );
389
436
437
+ /* *
438
+ * @brief Goes through all NoC links and determines whether they
439
+ * are congested or not. Then adds up the congestion ratio of all
440
+ * congested links.
441
+ *
442
+ * @return The total congestion ratio
443
+ */
390
444
double get_total_congestion_bandwidth_ratio (void );
391
445
446
+ /* *
447
+ * @brief Goes through all NoC links and determines whether they
448
+ * are congested or not. Then finds n links that are most congested.
449
+ *
450
+ * @return n links with highest congestion ratio
451
+ */
392
452
std::vector<NocLink> get_top_n_congested_links (int n);
393
453
454
+
455
+ /* *
456
+ * @brief Goes through all NoC links and determines whether they
457
+ * are congested or not. Then finds n links that are most congested.
458
+ *
459
+ * @return n highest congestion ratios
460
+ */
394
461
std::vector<double > get_top_n_congestion_ratios (int n);
395
462
396
463
/* *
0 commit comments