本文整理汇总了C++中Router::getNIInputVec方法的典型用法代码示例。如果您正苦于以下问题:C++ Router::getNIInputVec方法的具体用法?C++ Router::getNIInputVec怎么用?C++ Router::getNIInputVec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Router
的用法示例。
在下文中一共展示了Router::getNIInputVec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: controlCompression
void NIOutputDecompr::controlCompression(Packet* p_pkt, const int decode_lat)
{
int src_router_id = p_pkt->getSrcRouterID();
// network contention delay for packet (not including contention at NI)
int hop_count = g_Topology->getMinHopCount(src_router_id, m_attached_router->id());
const int per_hop_delay = 3;
int pkt_0_load_delay = (hop_count*per_hop_delay - 1) + (p_pkt->m_num_flits - 1);
int net_cont_delay = ((int) (simtime() - p_pkt->m_clk_enter_net)) - pkt_0_load_delay;
assert(net_cont_delay >= 0);
#ifdef _DEBUG_CAM_DYN_CONTROL
int pkt_delay = (int) (simtime() - p_pkt->m_clk_gen);
printf("NIOutDecompr: clk=%0.lf NI-%d %-2d->%-2d pid=%lld cont=%d (mean=%.1lf cnt=%ld) pkt=%d zero=%d\n", simtime(), m_NI_id, p_pkt->getSrcRouterID(), p_pkt->getDestRouterID(), p_pkt->id(),
net_cont_delay,
m_cont_delay_src_tab_vec[src_router_id]->mean(),
m_cont_delay_src_tab_vec[src_router_id]->cnt(),
pkt_delay, pkt_0_load_delay);
#endif
// accounting
m_cont_delay_src_tab_vec[src_router_id]->tabulate((double) net_cont_delay);
// control actions
if (m_cont_delay_src_tab_vec[src_router_id]->mean() > 2.0) {
// enable
Router* srcRouter = g_Router_vec[src_router_id];
for (unsigned int ni=0; ni<srcRouter->getNIInputVec().size(); ni++) {
NIInputCompr* p_NI_comp = (dynamic_cast<NIInputCompr*> (srcRouter->getNIInputVec()[ni]));
if (! p_NI_comp->CAMsts(m_attached_router->id())) { // disable ?
p_NI_comp->enableCAM(m_attached_router->id(), 0);
if (ni==0) {
g_sim.m_num_pkt_spurious++;
g_CamManager->m_pkt_dyn_control++;
}
}
}
} else {
// disable
Router* srcRouter = g_Router_vec[src_router_id];
for (unsigned int ni=0; ni<srcRouter->getNIInputVec().size(); ni++) {
NIInputCompr* p_NI_comp = (dynamic_cast<NIInputCompr*> (srcRouter->getNIInputVec()[ni]));
if (p_NI_comp->CAMsts(m_attached_router->id())) {
p_NI_comp->disableCAM(m_attached_router->id(), 0);
if (ni==0) {
g_sim.m_num_pkt_spurious++;
g_CamManager->m_pkt_dyn_control++;
}
}
}
}
}