#include <genericRouter4Stg.h>
Public Member Functions | |
GenericRouter4Stg () | |
~GenericRouter4Stg () | |
void | init (uint ports, uint vcs, uint credits, uint buffer_size) |
void | set_no_nodes (uint nodes) |
These functions are mainly for DOR routing and are seperated so as to not force DOR modelling in all designs. | |
void | set_grid_x_location (uint a, uint b, uint c) |
void | set_grid_y_location (uint a, uint b, uint c) |
void | send_credit_back (uint i) |
void | process_event (IrisEvent *e) |
string | toString () const |
string | print_stats () |
void | set_edge_links () |
void | dump_buffer_state () |
Public Attributes | |
vector< vector< uint > > | downstream_credits |
uint | packets |
uint | flits |
double | total_packet_latency |
double | last_flit_out_cycle |
unsigned long long int | stat_sim_total_time |
vector< vector< uint > > | stat_packet_out |
vector< vector< uint > > | stat_flit_out |
bool | is_mc_router |
Private Member Functions | |
void | handle_link_arrival_event (IrisEvent *e) |
Event handle for the LINK_ARRIVAL_EVENT event. Entry from DES kernel. | |
void | handle_tick_event (IrisEvent *e) |
Event handle for the TICK_EVENT. Entry from DES kernel. | |
void | handle_detect_deadlock_event (IrisEvent *) |
void | do_switch_traversal () |
void | do_switch_allocation () |
Private Attributes | |
vector< GenericBuffer > | in_buffers |
vector< GenericRC > | decoders |
vector< InputBufferState > | input_buffer_state |
GenericVcAllocator | vca |
PToPSwitchArbiterVcs | swa |
GenericCrossbar | xbar |
vector< uint > | available_ports |
vector< uint > | available_vcs |
vector< vector< uint > > | cr_time |
bool | ticking |
Model Description in cycles: --------------------------- BW and RC stages happen in the same cycle ( BW pushes the flits into the input buffer and the RC unit. ) VCA: Head flits request for an output virtual channel and max(pxv) requesting input ports/vcs. On winning the grant the packet requests for SA. The winner is cleared when the tail exits. SA: Pick one output port from n requesting input ports (0<n<p) for the pxp crossbar ST: Move the flits across the crossbar and push it out on the link LT: This is not modelled within the router and is part of the link component. =====================================================================================
Definition at line 67 of file genericRouter4Stg.h.
GenericRouter4Stg::GenericRouter4Stg | ( | ) |
GenericRouter4Stg::~GenericRouter4Stg | ( | ) |
constructor
Definition at line 30 of file genericRouter4Stg.cc.
void GenericRouter4Stg::do_switch_allocation | ( | ) | [private] |
Definition at line 546 of file genericRouter4Stg.cc.
References SA_unit::ch, PToPSwitchArbiterVcs::clear_requestor(), GenericCrossbar::configure_crossbar(), Router::credits, downstream_credits, in_buffers, input_buffer_state, PToPSwitchArbiterVcs::is_empty(), istat, NetworkComponent::node_ip, PToPSwitchArbiterVcs::pick_winner(), SA_unit::port, Router::ports, GenericCrossbar::push(), IrisStats::stat_router, SW_TRAVERSAL, swa, SWA_REQUESTED, ticking, VCA_COMPLETE, Router::vcs, and xbar.
Referenced by handle_tick_event().
void GenericRouter4Stg::do_switch_traversal | ( | ) | [private] |
The do_two_stage_router flag is used here to model variable router pipeline delay depending on system clock and router complexity.
Send a credit back and update buffer state for the downstream router buffer
Definition at line 427 of file genericRouter4Stg.cc.
References _DBG, NetworkComponent::address, TailFlit::avg_network_latency, HeadFlit::avg_network_latency, PToPSwitchArbiterVcs::clear_requestor(), GenericVcAllocator::clear_winner(), cr_time, data, do_two_stage_router, downstream_credits, EMPTY, FLIT_ID, HEAD, TailFlit::hop_count, HeadFlit::hop_count, in_buffers, input_buffer_state, GenericCrossbar::is_empty(), is_mc_router, Flit::is_single_flit_pkt, istat, last_flit_out_cycle, LINK_ARRIVAL_EVENT, NetworkComponent::node_ip, Simulator::Now(), Router::output_connections, Router::ports, NetworkComponent::process_event(), LinkArrivalData::ptr, GenericCrossbar::pull(), PToPSwitchArbiterVcs::request(), Simulator::Schedule(), send_credit_back(), stat_flit_out, stat_packet_out, IrisStats::stat_router, SW_TRAVERSAL, swa, SWA_REQUESTED, TAIL, total_packet_latency, Flit::type, LinkArrivalData::type, LinkArrivalData::vc, Flit::vc, vca, VCA_COMPLETE, Router::vcs, and xbar.
Referenced by handle_tick_event().
void GenericRouter4Stg::dump_buffer_state | ( | ) |
Definition at line 177 of file genericRouter4Stg.cc.
References EMPTY, input_buffer_state, INVALID, NetworkComponent::node_ip, Router::ports, and Router::vcs.
void GenericRouter4Stg::handle_detect_deadlock_event | ( | IrisEvent * | e | ) | [private] |
Definition at line 148 of file genericRouter4Stg.cc.
References _DBG_NOARG, cr_time, DETECT_DEADLOCK_EVENT, input_buffer_state, Simulator::Now(), Router::ports, NetworkComponent::process_event(), Simulator::Schedule(), IrisEvent::type, and Router::vcs.
Referenced by process_event().
void GenericRouter4Stg::handle_link_arrival_event | ( | IrisEvent * | e | ) | [private] |
Event handle for the LINK_ARRIVAL_EVENT event. Entry from DES kernel.
Definition at line 268 of file genericRouter4Stg.cc.
References _DBG, HeadFlit::addr, cr_time, CREDIT_ID, data, decoders, downstream_credits, HeadFlit::dst_address, IrisEvent::event_data, FLIT_ID, flits, FULL, HEAD, in_buffers, HeadFlit::inport, input_buffer_state, Router::input_connections, is_mc_router, Flit::is_single_flit_pkt, istat, HeadFlit::length, HeadFlit::msg_class, NetworkComponent::node_ip, Simulator::Now(), Router::output_connections, packets, Router::ports, NetworkComponent::process_event(), LinkArrivalData::ptr, Simulator::Schedule(), HeadFlit::src_address, IrisEvent::src_id, IrisStats::stat_router, TAIL, TICK_EVENT, ticking, Flit::type, LinkArrivalData::type, IrisEvent::vc, LinkArrivalData::vc, and Router::vcs.
Referenced by process_event().
void GenericRouter4Stg::handle_tick_event | ( | IrisEvent * | e | ) | [private] |
Event handle for the TICK_EVENT. Entry from DES kernel.
Body and tail flits get written in link arrival and since the message state may already been pushed to ST because of the header we want to ensure that all flits go thru an IB and ST stage. Hence ST is done on the flits_in_ib information and not buffer occupancy. for( uint i=0; i<(ports*vcs); i++) { uint ip = input_buffer_state[i].input_port; uint ic = input_buffer_state[i].input_channel;
if ((input_buffer_state[i].pipe_stage == SW_TRAVERSAL || input_buffer_state[i].pipe_stage == IB ) && (input_buffer_state[i].flits_in_ib < in_buffers[ip].get_occupancy(ivc))) { input_buffer_state[i].flits_in_ib++; ticking = true; } }
Definition at line 606 of file genericRouter4Stg.cc.
References Router::credits, GenericVcAllocator::current_winners, do_switch_allocation(), do_switch_traversal(), downstream_credits, FULL, IB, in_buffers, input_buffer_state, GenericVcAllocator::is_empty(), GenericVcAllocator::is_requested(), istat, NetworkComponent::node_ip, Simulator::Now(), GenericVcAllocator::pick_winner(), Router::ports, NetworkComponent::process_event(), GenericVcAllocator::request(), PToPSwitchArbiterVcs::request(), Simulator::Schedule(), GenericVcAllocator::squash_requests(), IrisStats::stat_router, SW_TRAVERSAL, swa, SWA_REQUESTED, TICK_EVENT, ticking, IrisEvent::vc, vca, VCA_COMPLETE, VCA_REQUESTED, and Router::vcs.
Referenced by process_event().
destructor
Implements Router.
Definition at line 35 of file genericRouter4Stg.cc.
References GenericVcAllocator::address, PToPSwitchArbiterVcs::address, NetworkComponent::address, Router::buffer_size, cr_time, Router::credits, decoders, DETECT_DEADLOCK_EVENT, downstream_credits, flits, in_buffers, input_buffer_state, Component::myId(), GenericVcAllocator::node_ip, PToPSwitchArbiterVcs::node_ip, NetworkComponent::node_ip, Simulator::Now(), packets, Router::ports, NetworkComponent::process_event(), PToPSwitchArbiterVcs::resize(), Simulator::Schedule(), GenericCrossbar::setup(), GenericVcAllocator::setup(), stat_flit_out, stat_packet_out, swa, total_packet_latency, vca, Router::vcs, and xbar.
string GenericRouter4Stg::print_stats | ( | void | ) | [virtual] |
Implements Router.
Definition at line 190 of file genericRouter4Stg.cc.
References flits, last_flit_out_cycle, NetworkComponent::name, NetworkComponent::node_ip, packets, Router::ports, stat_flit_out, stat_packet_out, stat_print_level, and total_packet_latency.
void GenericRouter4Stg::process_event | ( | IrisEvent * | e | ) | [virtual] |
Implements NetworkComponent.
Definition at line 127 of file genericRouter4Stg.cc.
References _DBG, DETECT_DEADLOCK_EVENT, handle_detect_deadlock_event(), handle_link_arrival_event(), handle_tick_event(), LINK_ARRIVAL_EVENT, TICK_EVENT, and IrisEvent::type.
void GenericRouter4Stg::send_credit_back | ( | uint | i | ) |
Definition at line 805 of file genericRouter4Stg.cc.
References NetworkComponent::address, CREDIT_ID, data, do_two_stage_router, input_buffer_state, Router::input_connections, LINK_ARRIVAL_EVENT, Simulator::Now(), NetworkComponent::process_event(), Simulator::Schedule(), LinkArrivalData::type, and LinkArrivalData::vc.
Referenced by do_switch_traversal().
void GenericRouter4Stg::set_edge_links | ( | ) |
For DOR the no of nodes in the network and the grid sizes are to be set and passed to RC.
Implements Router.
Definition at line 113 of file genericRouter4Stg.cc.
References decoders.
void GenericRouter4Stg::set_no_nodes | ( | uint | nodes | ) | [virtual] |
These functions are mainly for DOR routing and are seperated so as to not force DOR modelling in all designs.
Initialise the router for ports, vcs and credits. TODO buffer size not used right now. Just make sure its larger than credits.
Implements Router.
Definition at line 103 of file genericRouter4Stg.cc.
References decoders.
string GenericRouter4Stg::toString | ( | ) | const [virtual] |
Reimplemented from Router.
Definition at line 782 of file genericRouter4Stg.cc.
References NetworkComponent::address, decoders, in_buffers, NetworkComponent::node_ip, swa, GenericCrossbar::toString(), PToPSwitchArbiterVcs::toString(), and xbar.
vector<uint> GenericRouter4Stg::available_ports [private] |
Definition at line 111 of file genericRouter4Stg.h.
vector<uint> GenericRouter4Stg::available_vcs [private] |
Definition at line 112 of file genericRouter4Stg.h.
vector< vector<uint> > GenericRouter4Stg::cr_time [private] |
Definition at line 113 of file genericRouter4Stg.h.
Referenced by do_switch_traversal(), handle_detect_deadlock_event(), handle_link_arrival_event(), and init().
vector<GenericRC> GenericRouter4Stg::decoders [private] |
Definition at line 106 of file genericRouter4Stg.h.
Referenced by handle_link_arrival_event(), init(), set_grid_x_location(), set_grid_y_location(), set_no_nodes(), and toString().
vector< vector<uint> > GenericRouter4Stg::downstream_credits |
Definition at line 89 of file genericRouter4Stg.h.
Referenced by do_switch_allocation(), do_switch_traversal(), handle_link_arrival_event(), handle_tick_event(), and init().
Definition at line 94 of file genericRouter4Stg.h.
Referenced by handle_link_arrival_event(), init(), and print_stats().
vector<GenericBuffer> GenericRouter4Stg::in_buffers [private] |
Definition at line 105 of file genericRouter4Stg.h.
Referenced by do_switch_allocation(), do_switch_traversal(), handle_link_arrival_event(), handle_tick_event(), init(), and toString().
vector<InputBufferState> GenericRouter4Stg::input_buffer_state [private] |
Definition at line 107 of file genericRouter4Stg.h.
Referenced by do_switch_allocation(), do_switch_traversal(), dump_buffer_state(), handle_detect_deadlock_event(), handle_link_arrival_event(), handle_tick_event(), init(), and send_credit_back().
Definition at line 100 of file genericRouter4Stg.h.
Referenced by do_switch_traversal(), and handle_link_arrival_event().
Definition at line 96 of file genericRouter4Stg.h.
Referenced by do_switch_traversal(), and print_stats().
These are the statistics variables
Definition at line 93 of file genericRouter4Stg.h.
Referenced by handle_link_arrival_event(), init(), and print_stats().
vector< vector<uint> > GenericRouter4Stg::stat_flit_out |
Definition at line 99 of file genericRouter4Stg.h.
Referenced by do_switch_traversal(), init(), and print_stats().
vector< vector<uint> > GenericRouter4Stg::stat_packet_out |
Definition at line 98 of file genericRouter4Stg.h.
Referenced by do_switch_traversal(), init(), and print_stats().
unsigned long long int GenericRouter4Stg::stat_sim_total_time |
Definition at line 97 of file genericRouter4Stg.h.
PToPSwitchArbiterVcs GenericRouter4Stg::swa [private] |
Definition at line 109 of file genericRouter4Stg.h.
Referenced by do_switch_allocation(), do_switch_traversal(), handle_tick_event(), init(), and toString().
bool GenericRouter4Stg::ticking [private] |
Definition at line 115 of file genericRouter4Stg.h.
Referenced by do_switch_allocation(), GenericRouter4Stg(), handle_link_arrival_event(), and handle_tick_event().
Definition at line 95 of file genericRouter4Stg.h.
Referenced by do_switch_traversal(), init(), and print_stats().
GenericVcAllocator GenericRouter4Stg::vca [private] |
Definition at line 108 of file genericRouter4Stg.h.
Referenced by do_switch_traversal(), handle_tick_event(), and init().
GenericCrossbar GenericRouter4Stg::xbar [private] |
Definition at line 110 of file genericRouter4Stg.h.
Referenced by do_switch_allocation(), do_switch_traversal(), init(), and toString().