Skip to content

Commit 3fa4fa8

Browse files
check latency equality for routers and links
1 parent 63e7cfc commit 3fa4fa8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

vpr/src/noc/sat_routing.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,33 @@ static int comp_max_number_of_traversed_links(NocTrafficFlowId traffic_flow_id)
501501

502502
const auto& traffic_flow = traffic_flow_storage.get_single_noc_traffic_flow(traffic_flow_id);
503503

504+
const auto& noc_links = noc_model.get_noc_links();
505+
const auto& noc_routers = noc_model.get_noc_routers();
504506
const double noc_link_latency = noc_model.get_noc_link_latency();
505507
const double noc_router_latency = noc_model.get_noc_router_latency();
508+
509+
auto router_it = std::find_if(noc_routers.begin(), noc_routers.end(), [noc_router_latency](const NocRouter& r) {
510+
return (noc_router_latency != r.get_latency());
511+
});
512+
513+
if (router_it != noc_routers.end()) {
514+
VTR_LOG_ERROR(
515+
"SAT router assumes all NoC routers have the same latency. "
516+
"NoC router with the user if %d has a different latency (%g) than the NoC-wide router latency (%g).\n",
517+
router_it->get_router_user_id(), router_it->get_latency());
518+
}
519+
520+
auto link_it = std::find_if(noc_links.begin(), noc_links.end(), [noc_link_latency](const NocLink& l) {
521+
return (noc_link_latency != l.get_latency());
522+
});
523+
524+
if (link_it != noc_links.end()) {
525+
VTR_LOG_ERROR(
526+
"SAT router assumes all NoC links have the same latency. "
527+
"NoC link %d has a different latency (%g) than the NoC-wide link latency (%g).\n",
528+
(size_t)link_it->get_link_id(), link_it->get_latency());
529+
}
530+
506531
const double traffic_flow_latency_constraint = traffic_flow.max_traffic_flow_latency;
507532

508533
VTR_ASSERT(traffic_flow_latency_constraint < 0.1);

0 commit comments

Comments
 (0)