Trait caminos_lib::routing::Routing [−][src]
pub trait Routing: Debug {
fn next(
&self,
routing_info: &RoutingInfo,
topology: &dyn Topology,
current_router: usize,
target_server: usize,
num_virtual_channels: usize,
rng: &RefCell<StdRng>
) -> Vec<CandidateEgress>;
fn initialize_routing_info(
&self,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
target_server: usize,
rng: &RefCell<StdRng>
);
fn update_routing_info(
&self,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
current_port: usize,
target_server: usize,
rng: &RefCell<StdRng>
);
fn initialize(
&mut self,
topology: &Box<dyn Topology>,
rng: &RefCell<StdRng>
);
fn performed_request(
&self,
requested: &CandidateEgress,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
target_server: usize,
num_virtual_channels: usize,
rng: &RefCell<StdRng>
);
fn statistics(&self, cycle: usize) -> Option<ConfigurationValue>;
fn reset_statistics(&mut self, next_cycle: usize);
}
Expand description
A routing algorithm to provide candidate routes when the Router
requires.
It may store/use information in the RoutingInfo.
A Routing
does not receive information about the state of buffers or similar. Such a mechanism should be given as a VirtualChannelPolicy
.
Required methods
Compute the list of allowed exits.
fn initialize_routing_info(
&self,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
target_server: usize,
rng: &RefCell<StdRng>
)
fn initialize_routing_info(
&self,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
target_server: usize,
rng: &RefCell<StdRng>
)
Initialize the routing info of the packet. Called when the first phit of the packet leaves the server and enters a router.
fn update_routing_info(
&self,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
current_port: usize,
target_server: usize,
rng: &RefCell<StdRng>
)
fn update_routing_info(
&self,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
current_port: usize,
target_server: usize,
rng: &RefCell<StdRng>
)
Updates the routing info of the packet. Called when the first phit of the packet leaves a router and enters another router. Values are of the router being entered into.
Prepares the routing to be utilized. Perhaps by precomputing routing tables.
fn performed_request(
&self,
requested: &CandidateEgress,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
target_server: usize,
num_virtual_channels: usize,
rng: &RefCell<StdRng>
)
fn performed_request(
&self,
requested: &CandidateEgress,
routing_info: &RefCell<RoutingInfo>,
topology: &dyn Topology,
current_router: usize,
target_server: usize,
num_virtual_channels: usize,
rng: &RefCell<StdRng>
)
To be called by the router when one of the candidates is requested.
fn statistics(&self, cycle: usize) -> Option<ConfigurationValue>
fn statistics(&self, cycle: usize) -> Option<ConfigurationValue>
To optionally write routing statistics into the simulation output.
fn reset_statistics(&mut self, next_cycle: usize)
fn reset_statistics(&mut self, next_cycle: usize)
Clears all collected statistics