models/network/iris/components/CrossBarSwitch.cc
void CrossBarSwitch::handle_inf_arrival( int inputid, LinkData* data)
{
    switch ( data->type ) {
        case FLIT:
            {
                if (data->f->type == HEAD)
                {
                    //generate the order record for out queue to guarantee the network follow FIFO principal
                    order_record[static_cast<HeadFlit*>(data->f)->dst_id].push_back(inputid);
                    //generate the record when header flit coming
                    stat_packets_in++;
                }
                
                stat_flits_in++;
                in_buffer[inputid].push_back(data->f);
                break;
            }

        case CREDIT:
            {
                //add credit back when credit coming
                downstream_credits[inputid]++;
                assert(downstream_credits[inputid] <= (uint)credits);
                break;
            }

        default:	
            assert(0);
            break;
    }	
    // delete ld.. if ld contains a flit it is not deleted. see destructor
    delete data;
}
//! response for putting flits into buffer and add the downstream credit
//! @param \c port  The port # where the data come from
//! @param \c data  The link data come from interface which can be two types: credit and flit
response for putting flits into buffer and add the downstream credit
response for putting flits into buffer and add the downstream credit
void CrossBarSwitch::handle_inf_arrival( int inputid, LinkData* data)
{
    switch ( data->type ) {
        case FLIT:
            {
                if (data->f->type == HEAD)
                {
                    order_record[static_cast<HeadFlit*>(data->f)->dst_id].push_back(inputid);
                    stat_packets_in++;
                }
                stat_flits_in++;
                in_buffer[inputid].push_back(data->f);
                break;
            }
        case CREDIT:
            {
                downstream_credits[inputid]++;
                assert(downstream_credits[inputid] <= (uint)credits);
                break;
            }
        default:	
            assert(0);
            break;
    }	
    delete data;
}
void CrossBarSwitch :: handle_inf_arrival ( int inputid , LinkData * data ) { switch ( data -> type ) { case FLIT : { if ( data -> f -> type == HEAD ) { order_record [ static_cast < HeadFlit * > ( data -> f ) -> dst_id ] . push_back ( inputid ) ; stat_packets_in ++ ; } stat_flits_in ++ ; in_buffer [ inputid ] . push_back ( data -> f ) ; break ; } case CREDIT : { downstream_credits [ inputid ] ++ ; assert ( downstream_credits [ inputid ] <= ( uint ) credits ) ; break ; } default : assert ( 0 ) ; break ; } delete data ; }
response for putting flits into buffer and add the downstream credit
response for putting flits into buffer and add the downstream credit
//generate the order record for out queue to guarantee the network follow FIFO principal //generate the record when header flit coming //add credit back when credit coming // delete ld.. if ld contains a flit it is not deleted. see destructor