src/mem/ruby/network/simple/SimpleNetwork.cc
// From a switch to a switch
From a switch to a switch
From a switch to a switch
void
SimpleNetwork::makeInternalLink(SwitchID src, SwitchID dest, BasicLink* link,
                                std::vector<NetDest>& routing_table_entry,
                                PortDirection src_outport,
                                PortDirection dst_inport)
{
    std::vector<MessageBuffer*> queues(m_virtual_networks);
    for (int i = 0; i < m_virtual_networks; i++) {
        assert(m_num_connected_buffers < m_int_link_buffers.size());
        MessageBuffer* buffer_ptr = m_int_link_buffers[m_num_connected_buffers];
        m_num_connected_buffers++;
        queues[i] = buffer_ptr;
    }
    SimpleIntLink *simple_link = safe_cast<SimpleIntLink*>(link);
    m_switches[dest]->addInPort(queues);
    m_switches[src]->addOutPort(queues, routing_table_entry[0],
                                simple_link->m_latency,
                                simple_link->m_bw_multiplier);
}
void SimpleNetwork :: makeInternalLink ( SwitchID src , SwitchID dest , BasicLink * link , std :: vector < NetDest > & routing_table_entry , PortDirection src_outport , PortDirection dst_inport ) { std :: vector < MessageBuffer * > queues ( m_virtual_networks ) ; for ( int i = 0 ; i < m_virtual_networks ; i ++ ) { assert ( m_num_connected_buffers < m_int_link_buffers . size ( ) ) ; MessageBuffer * buffer_ptr = m_int_link_buffers [ m_num_connected_buffers ] ; m_num_connected_buffers ++ ; queues [ i ] = buffer_ptr ; } SimpleIntLink * simple_link = safe_cast < SimpleIntLink * > ( link ) ; m_switches [ dest ] -> addInPort ( queues ) ; m_switches [ src ] -> addOutPort ( queues , routing_table_entry [ 0 ] , simple_link -> m_latency , simple_link -> m_bw_multiplier ) ; }
From a switch to a switch
From a switch to a switch
// Create a set of new MessageBuffers // allocate a buffer // Connect it to the two switches