INSEE 05.04.2011
Interconnection Nertworks Simulation and Evaluation Environment
|
Declaration of all global variables & functions. More...
#include "packet.h"
#include "constants.h"
#include "literal.h"
#include "misc.h"
#include "phit.h"
#include "queue.h"
#include "event.h"
#include "router.h"
#include "pkt_mem.h"
#include "batch.h"
#include <math.h>
#include <time.h>
#include <limits.h>
Go to the source code of this file.
Defines | |
#define | packet_size_in_phits pkt_len |
Functions | |
void | run_network_shotmode (void) |
void | run_network_batch (void) |
void | init_injection (void) |
void | data_generation (long i) |
void | data_injection (long i) |
void | datagen_oneshot (bool_t reset) |
void | generate_pkt (long i) |
port_type | select_input_port_shortest (long i, long dest) |
port_type | select_input_port_dor_only (long i, long dest) |
port_type | select_input_port_dor_shortest (long i, long dest) |
port_type | select_input_port_shortest_profitable (long i, long dest) |
port_type | select_input_port_lpath (long i, long dest) |
void | reserve (long i, port_type d_p, port_type s_p) |
void | arbitrate_init (void) |
void | arbitrate_cons_single (long i) |
void | arbitrate_cons_multiple (long i) |
void | arbitrate_direct (long i, port_type d_p) |
void | arbitrate_icube (long i, port_type d_p) |
void | arbitrate_trees (long i, port_type d_p) |
port_type | arbitrate_select_fifo (long i, port_type d_p, port_type first, port_type last) |
port_type | arbitrate_select_longest (long i, port_type d_p, port_type first, port_type last) |
port_type | arbitrate_select_round_robin (long i, port_type d_p, port_type first, port_type last) |
port_type | arbitrate_select_random (long i, port_type d_p, port_type first, port_type last) |
port_type | arbitrate_select_age (long i, port_type d_p, port_type first, port_type last) |
void | request_ports_init (void) |
void | request_port_bubble_oblivious (long i, port_type s_p) |
void | request_port_bubble_adaptive_random (long i, port_type s_p) |
void | request_port_bubble_adaptive_shortest (long i, port_type s_p) |
void | request_port_bubble_adaptive_smart (long i, port_type s_p) |
void | request_port_double_oblivious (long i, port_type s_p) |
void | request_port_double_adaptive (long i, port_type s_p) |
void | request_port_hexa_oblivious (long i, port_type s_p) |
void | request_port_hexa_adaptive (long i, port_type s_p) |
void | request_port_dally_trc (long i, port_type s_p) |
void | request_port_dally_basic (long i, port_type s_p) |
void | request_port_dally_improved (long i, port_type s_p) |
void | request_port_dally_adaptive (long i, port_type s_p) |
void | request_port_bimodal_random (long i, port_type s_p) |
void | request_port_tree (long i, port_type s_p) |
void | request_port_icube (long i, port_type s_p) |
void | request_port_icube_IB (long i, port_type s_p) |
bool_t | check_rr_dim_o_r (packet_t *pkt, dim *d_d, way *d_w) |
bool_t | check_rr_dir_o_r (packet_t *pkt, dim *d_d, way *d_w) |
bool_t | check_rr_fattree (packet_t *pkt, dim *d_d, way *d_w) |
bool_t | check_rr_fattree_adaptive (packet_t *pkt, dim *d, way *w) |
bool_t | check_rr_thintree_adaptive (packet_t *pkt, dim *d, way *w) |
bool_t | check_rr_slimtree_adaptive (packet_t *pkt, dim *d, way *w) |
bool_t | check_rr_icube_adaptive (packet_t *pkt, dim *d, way *w) |
bool_t | check_rr_icube_static_IB (packet_t *pkt, dim *d, way *w) |
bool_t | check_rr_fattree_static (packet_t *pkt, dim *d, way *w) |
bool_t | check_rr_thintree_static (packet_t *pkt, dim *d, way *w) |
bool_t | check_rr_slimtree_static (packet_t *pkt, dim *d, way *w) |
bool_t | check_rr_icube_static (packet_t *pkt, dim *d, way *w) |
void | phit_away (long, port_type, phit) |
void | consume_single (long i) |
void | consume_multiple (long i) |
void | advance (long n, long p) |
void | data_movement_direct (bool_t inject) |
void | data_movement_indirect (bool_t inject) |
void | init_functions (void) |
void | stats (long i) |
void | reset_stats (void) |
void | router_init (void) |
void | init_network (void) |
void | coords (long ad, long *cx, long *cy, long *cz) |
void | coords_icube (long ad, long *cx, long *cy, long *cz) |
long | torus_neighbor (long ad, dim wd, way ww) |
long | midimew_neighbor (long ad, dim wd, way ww) |
long | dtt_neighbor (long ad, dim wd, way ww) |
routing_r | torus_rr (long source, long destination) |
routing_r | torus_rr_unidir (long source, long destination) |
routing_r | mesh_rr (long source, long destination) |
routing_r | midimew_rr (long source, long destination) |
routing_r | dtt_rr (long source, long destination) |
routing_r | dtt_rr_unidir (long source, long destination) |
routing_r | icube_rr (long source, long destination) |
routing_r | icube_4mesh_rr (long source, long destination) |
routing_r | icube_1mesh_rr (long source, long destination) |
routing_r | fattree_rr_adapt (long source, long destination) |
routing_r | thintree_rr_adapt (long source, long destination) |
routing_r | slimtree_rr_adapt (long source, long destination) |
void | create_fattree () |
void | create_slimtree () |
void | create_thintree () |
void | create_icube () |
void | get_conf (long, char **) |
void | print_headers (void) |
void | print_partials (void) |
void | print_results (time_t, time_t) |
void | results_partial (void) |
void | save_batch_results () |
void | print_batch_results (batch_t *b) |
void | print_batch_results_vast (batch_t *b) |
void | init_queue (queue *q) |
void | pkt_init () |
void | free_pkt (unsigned long n) |
unsigned long | get_pkt () |
void | read_trace () |
void | run_network_trc () |
void | init_event (event_q *q) |
void | ins_event (event_q *q, event i) |
void | do_event (event_q *q, event *i) |
event | head_event (event_q *q) |
void | rem_head_event (event_q *q) |
bool_t | event_empty (event_q *q) |
void | init_occur (event_l *l) |
void | ins_occur (event_l *l, event i) |
bool_t | occurred (event_l *l, event i) |
void | init_exd (long, long, long, long, long) |
void | run_network_exd (void) |
Variables | |
long | radix |
Radix of each router. | |
long | ndim |
long | nstages |
Number of stages for indirect topologies. | |
long | stDown |
Number of links down in a slim/thin tree. It also refeers to the number of nodes attached to a switching element in fattree and indirect cube . | |
long | stUp |
Number of links up in a slim tree. | |
long | NUMNODES |
Total number of nodes. | |
long | nprocs |
Total number nodes that are able to inject. | |
long | n_ports |
Total number of ports in each router. | |
long | r_seed |
Random Seed. | |
long | nodes_x |
Nodes in dimension X. | |
long | nodes_y |
Nodes in dimension Y. | |
long | nodes_z |
Nodes in dimension Z. | |
long | binj_cap |
Injection buffer capacity (in packets). | |
long | ninj |
Number of injectors in each router. | |
router * | network |
An array of routers containing the system. | |
long ** | destinations |
Matrix containing map of source/destination pairs at consumption (destination). | |
long ** | sources |
Matrix containing map of source/destination pairs at injection (source). | |
long * | con_dst |
Histograms of distance at consumption (source). | |
long * | inj_dst |
Histograms of distance at injection (source). | |
long | max_dst |
Size of distance histograms. | |
long * | source_ports |
Array that contains the source ports for the monitored node. | |
long * | dest_ports |
Array that contains the destination ports for the monitored node. | |
long * | port_utilization |
Array that contains the port utilization of the monitored node. | |
double | sent_count |
Number of packets sent. (stats) | |
double | injected_count |
Number of packets injected. (stats) | |
double | rcvd_count |
Number of packets received. (stats) | |
double | last_rcvd_count |
Number of packets received before the start of the present batch. (stats) | |
double | dropped_count |
Number of packets dropped. (stats) | |
double | transit_dropped_count |
Number of in-transit packets dropped. (stats) | |
double | last_tran_drop_count |
Number of in-transit packets dropped before the start of the present batch. (stats) | |
long | pnodes_x |
Nodes in dimension X of the submesh for icube placement. | |
long | pnodes_y |
Nodes in dimension Y of the submesh for icube placement. | |
long | pnodes_z |
Nodes in dimension Z of the submesh for icube placement. | |
long | faults |
Number of broken links. | |
double | msg_sent_count [3] |
Number of Message sent of each type. (bimodal stats) | |
double | msg_injected_count [3] |
Number of Message injected of each type. (bimodal stats) | |
double | msg_rcvd_count [3] |
Number of Message received of each type. (bimodal stats) | |
double | msg_acum_delay [3] |
Accumulative delay of each message type. (bimodal stats) | |
double | msg_acum_inj_delay [3] |
Accumulative injection delay of each message type. (bimodal stats) | |
long | msg_max_delay [3] |
Maximum delay of each message type. (bimodal stats) | |
long | msg_max_inj_delay [3] |
Maximum injection delay of each message type. (bimodal stats) | |
double | msg_acum_sq_delay [3] |
Accumulative square delay of each message type. (bimodal stats) | |
double | msg_acum_sq_inj_delay [3] |
Accumulative square injection delay of each message type. (bimodal stats) | |
long | msglength |
The length of the long messages (in packets) for bimodal traffic. | |
double | lm_prob |
Probability of inject a long message in bimodal traffic(in packets). | |
double | lm_percent |
Probability of inject a long message in bimodal traffic(in messages). | |
long | sim_clock |
Simulation clock. | |
long | last_reset_time |
Time in which the last reset has been performed. | |
long | bub_adap [2] |
Bubble to adaptive channels. | |
long | bub_x |
Bubble to X Dimension Escape Channels. Usually equal to Y,Z. | |
long | bub_y |
Bubble to Y Dimension Escape Channels. Usually equal to X,Z. | |
long | bub_z |
Bubble to Z Dimension Escape Channels. Usually equal to X,Y. | |
topo_t | topo |
long | plevel |
long | pheaders |
long | bheaders |
long | pinterval |
Interval to print information about the system state. | |
long | extract |
Extract packets from head of the injection queue when they cannot be injected. | |
long | monitored |
Monitored node. | |
double | intransit_pr |
Priority given to in-transit traffic. | |
double | inj_phit_count |
Number of phits sent. (stats) | |
double | sent_phit_count |
Number of phits injected. (stats) | |
double | rcvd_phit_count |
Number of phits received. (stats) | |
double | dropped_phit_count |
Number of phits dropped. (stats) | |
long(* | neighbor )(long ad, dim wd, way ww) |
routing_r(* | calc_rr )(long source, long destination) |
void(* | request_port )(long i, port_type s_p) |
void(* | arbitrate_cons )(long i) |
port_type(* | arbitrate_select )(long i, port_type d_p, port_type first, port_type last) |
void(* | consume )(long i) |
bool_t(* | check_rr )(packet_t *pkt, dim *d_d, way *d_w) |
port_type(* | select_input_port )(long i, long dest) |
void(* | data_movement )(bool_t inject) |
void(* | arbitrate )(long i, port_type d_p) |
double | load |
The provided injected load. | |
double | trigger_rate |
Probability to trigger new packets when a packet is received. | |
long | aload |
Provided load multiplied by RAND_MAX used in injection. | |
long | lm_load |
Actual long message load multiplied by RAND_MAX used in bimodal injection. | |
long | trigger |
Provided trigger_rate multiplied by RAND_MAX used in reactive traffic. | |
long | trigger_max |
Maximum of packets triggered. | |
long | trigger_min |
Minimum of packets triggered. | |
long | trigger_dif |
Random interval == 1 + trigger_max - trigger_min. | |
double | global_q_u |
double | global_q_u_current |
vc_management_t | vc_management |
routing_t | routing |
traffic_pattern_t | pattern |
cons_mode_t | cons_mode |
arb_mode_t | arb_mode |
req_mode_t | req_mode |
inj_mode_t | inj_mode |
placement_t | placement |
long | shift |
Number of places for shift placement. | |
long | trace_nodes |
Number of tasks in the trace. | |
long | trace_instances |
Number of instances of the trace to simulate. | |
char | placefile [128] |
bool_t | drop_packets |
Drop packets that have no room in the injection queue. | |
bool_t | parallel_injection |
Allows/Disallows the parallel injection (inject some packets in the same cycle & router). | |
bool_t | shotmode |
Are the system running in shotmode. | |
long | shotsize |
Size of each shot (in packets per node) | |
double | global_cc |
Global congestion control. Percent of the system recurses used. | |
long | timeout_upper_limit |
Timeout limit to enter in congested mode. | |
long | timeout_lower_limit |
Timeout limit to leave congested mode. | |
long | update_period |
Period taken to calculate the global ocupation. | |
long | total_shot_size |
Number of packets in each shot. | |
batch_t * | batch |
Array to save all the batchs' stats. | |
long | samples |
Number of samples (batchs or shots) to take from the current Simulation. | |
long | batch_time |
Sampling period. | |
double | threshold |
Threshold to accept convergency. | |
long | warm_up_period |
Number of 'oblivious' cycles until start convergency asurement simulation. | |
long | warmed_up |
The cycle in wich warming are really finished. | |
long | conv_period |
Convergency estimation sampling period. | |
long | max_conv_time |
Maximum time for Convergency estimation. | |
long | min_batch_size |
Minimum number of reception in a batch to save stats. | |
double | acum_delay |
Accumulative delay. (stats) | |
double | acum_inj_delay |
Accumulative injection delay. (stats) | |
long | max_delay |
Maximum delay. (stats) | |
long | max_inj_delay |
Maximum injection delay. (stats) | |
double | acum_sq_delay |
Accumulative square delay. (stats) | |
double | acum_sq_inj_delay |
Accumulative square injection delay. (stats) | |
double | acum_hops |
Accumulative number of hops. (stats) | |
long | nodes_per_switch |
The number of nodes attached to each switch. | |
long | links_per_direction |
The number of parallel links in each direction. | |
long | pkt_len |
Length of FSIN packets in phits. | |
long | phit_size |
Size, in bytes, of a phit. Used in application-driven simulation for splitting mpi messages into packets. | |
long | buffer_cap |
Transit buffer capacity (in packets). | |
long | tr_ql |
long | inj_ql |
dim * | port_coord_dim |
An array containig the dimension for each port. | |
way * | port_coord_way |
An array containig the direction (way) for each port. | |
channel * | port_coord_channel |
An array containig the number of virtual channel for each port. | |
packet_t * | pkt_space |
long | pkt_max |
char | trcfile [128] |
bool_t | go_on |
While this is TRUE the simulation will go on! | |
long | reseted |
Number of resets. | |
FILE * | fp |
A pointer to a file. Used for several purposes. | |
char | file [128] |
port_type | last_port_arb_con |
void(* | run_network )(void) |
long | nchan |
Number of Virtual Channels. | |
long | nways |
Number of ways. (unidir. / bidir.) | |
port_type | p_con |
The number of the consumption port. | |
port_type | p_drop |
The number of the dropping port, for dropping in-transit traffic. | |
port_type | p_inj_first |
The number of the first injection port. | |
port_type | p_inj_last |
The number of the last injection port. | |
literal_t | vc_l [] |
literal_t | routing_l [] |
literal_t | rmode_l [] |
literal_t | atype_l [] |
literal_t | ctype_l [] |
literal_t | pattern_l [] |
literal_t | topology_l [] |
literal_t | injmode_l [] |
literal_t | placement_l [] |
long | sk_xy |
Skew from X to Y. | |
long | sk_xz |
Skew from X to Z. | |
long | sk_yx |
Skew from Y to X. | |
long | sk_yz |
Skew from Y to Z. | |
long | sk_zx |
Skew from Z to X. | |
long | sk_zy |
Skew from Z to Y. | |
long | fsin_cycle_relation |
long | simics_cycle_relation |
long | serv_addr |
long | num_periodos_espera |
long | num_executions |
Number of executions, appended to the output filename. |
Declaration of all global variables & functions.
FSIN Functional Simulator of Interconnection Networks Copyright (2003-2011) J. Miguel-Alonso, J. Navaridas
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
void advance | ( | long | n, |
long | p | ||
) |
Advance packets.
Move a phit from an output port to the corresponding input port in the neighbour
n | The number of the node. |
p | The physichal port id to advance. |
void arbitrate_cons_multiple | ( | long | i | ) |
Performs consumption of all phits that have arrived to a node.
For "multiple" consumption, all input ports can access to the consumption port.
i | The node in which the consumption is performed. |
void arbitrate_cons_single | ( | long | i | ) |
Performs consumption of a single phit.
For "single" consumption, the consumption port (just one) is arbitrated just like any other one.
i | The node in which the consumption is performed. |
void arbitrate_direct | ( | long | i, |
port_type | d_p | ||
) |
Main arbitration function for direct topologies. Implements the virtual function arbitrate.
An output port can be assigned to an input port in a range [first, last) If IPR allows it, all input ports (transit + injection) are in the range [0, p_con). If not, we check the range of transit ports [0, p_inj_first) and, later, if not assignment has been done, we check the range of injection ports [p_inj_first, <p_con). NOTE that the last port in the range is NOT included in the arbitration. Actual selection is done by arbitrate_select(), which make take different values: arbitrate_select_fifo(), etc.
i | The node in which the arbitration is performed. |
d_p | The destination port for wich the arbitration is performed. |
void arbitrate_icube | ( | long | i, |
port_type | d_p | ||
) |
Main arbitration function for the indirect cube . Implements the virtual function arbitrate.
This functions will only check those ports that make sense: the NIC when arbitrating a consumption port, the injection ports when arbitrating a NIC, all the transit ports when arbitrating a switch. NOTE that the transit ports can be affected by the Intransit Priority Restriction. In that case, ports that are connected to the NICS are checked in a second round.
i | The node in which the arbitration is performed. |
d_p | The destination port for wich the arbitration is performed. |
void arbitrate_init | ( | void | ) |
Initialization of the structures needed to perform arbitration.
Select the port containing the first injected packet.
Given a range of input-injection ports, select the one with the oldest packet, measured since it was injected.
i | The node in which the arbitration is performed. |
d_p | The destination port for wich the arbitration is performed. |
first | The first port for looking to. |
last | The next port from the last to looking to. This port is not included. |
Select the port that requested the port first of all the given ports.
Given a range of input-injection ports, select the one that requested the output port first Time of request is stored in network[i].p[d_p].req[s_p].
i | The node in which the arbitration is performed. |
d_p | The destination port for wich the arbitration is performed. |
first | The first port for looking to. |
last | The next port from the last to looking to. This port is not included. |
Select the port with the biggest queue length.
Given a range of input-injection ports, select the one whose queue occupation is longer. We take a look to the queues in a round-robin fashion, starting with the last lucky input port (network[i].p[d_p].ri), if several ports have the same occupation, the first visited will be the selected one.
i | The node in which the arbitration is performed. |
d_p | The destination port for wich the arbitration is performed. |
first | The first port for looking to. |
last | The next port from the last to looking to. This port is not included. |
Random selection of a port.
Given a range of input-injection ports, select one of them randomly.
i | The node in which the arbitration is performed. |
d_p | The destination port for wich the arbitration is performed. |
first | The first port for looking to. |
last | The next port from the last to looking to. This port is not included. |
Select the next occupied port using round-robin.
Given a range of input-injection ports, select one in a round-robin fashion. The last used is stored in network[i].p[d_p].ri
i | The node in which the arbitration is performed. |
d_p | The destination port for wich the arbitration is performed. |
first | The first port for looking to. |
last | The next port from the last to looking to. This port is not included. |
void arbitrate_trees | ( | long | i, |
port_type | d_p | ||
) |
Main arbitration function for the trees. Implements the virtual function arbitrate.
This functions will only check those ports that make sense: the NIC when arbitrating a consumption port, the injection ports when arbitrating a NIC, all the transit ports when arbitrating a switch.
i | The node in which the arbitration is performed. |
d_p | The destination port for wich the arbitration is performed. |
Routes using Dimesion order routing.
Checks a routing record and indicates the direction/way of choice, following the dimension order routing algorithm. (order: x+ x- y+ y- z+ z-)
pkt | The packet to route. |
d | The desired dimesion is returned here. |
w | The elected direction (way) is returned here. |
Routes using Direction order routing.
Checks a routing record and indicates the direction/way of choice, following the direction order routing algorithm. (order: x+ y+ z+ x- y- z-)
pkt | The packet to route. |
d | The selected dimesion is returned here. |
w | The chosen direction (way) is returned here. |
Routes in a fattree.
Adaptive routing in fattrees.
pkt | The packet to route. |
d | The desired port is returned here. |
w | The elected direction (way) is returned here (always UP). |
Routes in a fattree.
Static routing in fattrees. Upward path depends on the source. Downward path depends on the destination(as always).
pkt | The packet to route. |
d | The desired port is returned here. |
w | The elected direction (way) is returned here (always UP). |
Fully adaptive routing in a icube using Virtual channels.
Each physical has an ESCAPE (Bubble) subchannel plus 'nchan-1' adaptive VC. Adaptive routing selects between all the profitable VC in all physical links. Checks a routing record and indicates the direction/way of choice, following the less congested channel, but using minimal paths. It chooses the profitable channel with more credits.
pkt | The packet to route. |
d | The desired dimesion is returned here. |
w | The elected direction (way) is returned here. |
Routes using dimesion order routing in a icube (adaptive between parallel links).
Checks a routing record and indicates the direction/way of choice, following the dimension order routing algorithm. (order: x+ x- y+ y- z+ z-). It also chooses the physichal channel with more credits. Bubble is used to avoid deadlock.
pkt | The packet to route. |
d | The desired dimesion is returned here. |
w | The elected direction (way) is returned here. |
Routes using dimesion order routing in an indirect cube split into independent meshes (for IB-based simul.)
Checks a routing record and indicates the direction/way of choice, following the dimension order routing algorithm. (order: x+ x- y+ y- z+ z-). Mesh + DOR is used to avoid deadlock.
pkt | The packet to route. |
d | The desired dimesion is returned here. |
w | The elected direction (way) is returned here. |
Routes in a slimtree.
Adaptive routing in slimtrees.
pkt | The packet to route. |
d | The desired port is returned here. |
w | The elected direction (way) is returned here (always UP). |
Routes in a slimtree.
Static routing in slimtrees. Not implemented yet
pkt | The packet to route. |
d | The desired port is returned here. |
w | The elected direction (way) is returned here (always UP). |
Routes in a thintree.
Adaptive routing in thintrees.
pkt | The packet to route. |
d | The desired port is returned here. |
w | The elected direction (way) is returned here (always UP). |
Routes in a thintree.
Static routing in thintrees. Upward path depends on the source. Downward path depends on the destination(as always).
pkt | The packet to route. |
d | The desired port is returned here. |
w | The elected direction (way) is returned here (always UP). |
void consume_multiple | ( | long | i | ) |
Consume one/many phits.
This is the "multiple" version, meaning that in a cycle it is possible to consume phits from all VCs.
i | The number of the node in which the consumption is performed. |
void consume_single | ( | long | i | ) |
Consume a single phit.
This "Single" version is used when there is a single consumption port, shared among all the VCs. Arbitration is required.
i | The number of the node in which the consumption is performed. |
void coords | ( | long | ad, |
long * | cx, | ||
long * | cy, | ||
long * | cz | ||
) |
Calculates the coordinates of a node (X, Y, Z)
Each node have stored their own coordinates because they are used often.
ad | Address of the node. |
cx | Coordinate X is returned here. |
cy | Coordinate Y is returned here. |
cz | Coordinate Z is returned here. |
void coords_icube | ( | long | ad, |
long * | cx, | ||
long * | cy, | ||
long * | cz | ||
) |
Calculates the coordinates of a node (X, Y, Z) in a icube.
Each node have stored their own coordinates because they are used often.
ad | Address of the node. |
cx | Coordinate X is returned here. |
cy | Coordinate Y is returned here. |
cz | Coordinate Z is returned here. |
void create_fattree | ( | ) |
Creates a fat tree topology.
This function defines all the links between the elements in the network.
void create_icube | ( | ) |
Creates an indirect cube topology.
This function links all the elements within the network.
void create_slimtree | ( | ) |
Creates a slim tree topology.
This function defines all the links between the elements in the network.
void create_thintree | ( | ) |
Creates a thin tree topology.
This function defines all the links between the elements in the network.
void data_generation | ( | long | i | ) |
Generates data when allowed.
Injection may be stopped by the global congestion control, by the parameter mpackets in fsin.conf, or by the shot mode when a burst is finished.
i | The node in which the data must be generated. |
void data_injection | ( | long | i | ) |
Moves data from an injection buffer to an injection queue.
Performs data movement from an injection buffer, which is used for data transmision between the router and its node processor(s), to the injection port which takes part in the router logic.
i | The node in which the injection is performed. |
void data_movement_direct | ( | bool_t | inject | ) |
Performs the movement of the data in a direct topology.
inject | If TRUE new data generation is performed. |
void data_movement_indirect | ( | bool_t | inject | ) |
Performs the movement of the data in an indirect topology.
inject | If TRUE new data generation is performed. |
void datagen_oneshot | ( | bool_t | reset | ) |
Performs the data generation when running in shotmode.
reset | When TRUE, starts a new shot. |
void do_event | ( | event_q * | q, |
event * | i | ||
) |
Uses the first event in the queue.
Takes an event an increases its packet count. When it reaches the length of the event, this is erased from the queue.
q | A pointer to a queue. |
i | A pointer to the event to do. |
Gets a neighbor in a given direction.
ad | A node address. |
wd | A dimension (X,Y or Z). |
ww | A way (UP or DOWN). |
routing_r dtt_rr | ( | long | source, |
long | destination | ||
) |
Generates the routing record for a twisted torus.
This function considers three cases according to the different options of the target dimension of the skews. Z dimension will act as default in case no skew (torus) is considered.
source | The source node of the packet. |
destination | The destination node of the packet. |
routing_r dtt_rr_unidir | ( | long | source, |
long | destination | ||
) |
Generates the routing record for an unidirectional twisted torus.
source | The source node of the packet. |
destination | The destination node of the packet. |
bool_t event_empty | ( | event_q * | q | ) |
Is a queue empty?.
q | A pointer to the queue. |
routing_r fattree_rr_adapt | ( | long | source, |
long | destination | ||
) |
Generates the routing record for a k-ary n-tree.
This function allows adaptive routing because no route is defined here.
source | The source node of the packet. |
destination | The destination node of the packet. |
void free_pkt | ( | unsigned long | n | ) |
Frees a packet.
Add the packet id. to the free packets
n | The id of the packet to free. |
void generate_pkt | ( | long | i | ) |
Generate a packet to inject.
If there is no packet saved then generates a packet using the defined pattern. Then try to inject the generated packet & if it cannot be injected and packet dropped is not allowed, save the packet and try to use it later.
i | The node in which the injection is performed. |
void get_conf | ( | long | argn, |
char ** | args | ||
) |
Get the configuration for the simulation.
First take default values for the simulation. Second take the values from the file 'fsin.conf'. Finally take the command line arguments.
argn | The number of arguments. |
args | The arguments taken from the command line. |
unsigned long get_pkt | ( | ) |
Get a free packet.
event head_event | ( | event_q * | q | ) |
Looks at the first event in a queue.
q | A pointer to the queue. |
routing_r icube_1mesh_rr | ( | long | source, |
long | destination | ||
) |
Generates the routing record for an indirect cube using static routing (no Bubble). Deadlock is avoided by considering a collection of isolated meshes and using DOR in each of them. All the meshes have their origin in node (0,0).
source | The source node of the packet. |
destination | The destination node of the packet. |
routing_r icube_4mesh_rr | ( | long | source, |
long | destination | ||
) |
Generates the routing record for an indirect cube using static routing (no Bubble). Deadlock is avoided by considering four isolated meshes and using DOR in each of them. Origins are in nodes (0,0) (X/2, 0) (0, Y/2) and (X/2, Y/2) repectively for each of the meshes. Routing selects the mesh with shorter distance.
source | The source node of the packet. |
destination | The destination node of the packet. |
routing_r icube_rr | ( | long | source, |
long | destination | ||
) |
Generates the routing record for an indirect cube using adaptive routing.
source | The source node of the packet. |
destination | The destination node of the packet. |
void init_event | ( | event_q * | q | ) |
Initializes an event queue.
q | a pointer to the queue to be initialized. |
void init_exd | ( | long | fsin_cycles, |
long | simics_cycles, | ||
long | packet_size, | ||
long | simics_hosts_port, | ||
long | periodos | ||
) |
Funcion de inicializacion para la Simulacion conducida por la ejecucion Parametros: long fsin_cycle_relation: relacion de ciclos entre Simics y FSIN, los ciclos que correra FSIN, por defecto es 10 long simics_cycle_relation: relacion de ciclos entre Simics y FSIN, los ciclos que correra Simics, por defecto es 1000 long packet_size_in_phits: tamao en phits del paquete, un phit son 4 bytes (configurable), por defecto es 32, es pkt_len long serv_addr: puerto de escucha de nuevas conexiones de SIMICS hosts, por defecto es 8082 long num_periodos_espera: retardo de interconexion que se introducira en el hosts destino. Medido en ciclos SIMICS, por defecto es 0
void init_functions | ( | void | ) |
Initialization of functions.
Instances the virtual functions to the ones required for the simulation
void init_injection | ( | void | ) |
Initializes Injection.
Calculates all needed variables for injection & prepares all structures.
void init_network | ( | void | ) |
Initializes the network.
Gives the initial values to the simulation depending on the topology.
void init_occur | ( | event_l * | l | ) |
Initializes all ocurred events lists.
There is only one list in each router.
l | A pointer to the list to be initialized. |
void init_queue | ( | queue * | q | ) |
Initializes a queue.
Making it empty.
q | The queue to initialize. |
void ins_event | ( | event_q * | q, |
event | i | ||
) |
Adds an event to a queue.
q | a pointer to a queue. |
i | the event to be added to q. |
void ins_occur | ( | event_l * | l, |
event | i | ||
) |
Inserts an event's occurrence in an event list.
If the event is in the list, then its count is increased. Otherwise a new event is created in the occurred event list.
l | A pointer to a list. |
i | The event to be added. |
routing_r mesh_rr | ( | long | source, |
long | destination | ||
) |
Generates the routing record for a mesh.
source | The source node of the packet. |
destination | The destination node of the packet. |
Obtains a neighbor node in midimew topology (only 2D).
ad | A node address. |
wd | A dimension (X or Y). |
ww | A way (UP or DOWN). |
routing_r midimew_rr | ( | long | source, |
long | destination | ||
) |
Generates the routing record for a midimew.
source | The source node of the packet. |
destination | The destination node of the packet. |
bool_t occurred | ( | event_l * | l, |
event | i | ||
) |
Has an event completely occurred?.
If it has totally occurred, this is, the event is in the list and its count is equal to its length, then it is deleted from the list.
l | a pointer to a list. |
i | the event we are seeking for. |
A phit has arrived to destination & is consumed.
Gets all kind of statistics, and print the corresponding traces. "old" version, simpler: does not interact with TrGen, just collects statistics.
i | The node in which the consumption is performed. |
s_p | The input port in wich the phit is. |
ph | The arrived phit. |
void pkt_init | ( | ) |
Initiates the memory allocation & the free packets structure.
In pkt_space we allocate all the space needed for packet contain. This way our Memory needs are always the same and we must not alloc and free memory each time we use a packet.
void print_batch_results | ( | batch_t * | b | ) |
Print the results of a batch in a Comma Separated Value format (dense).
Print all batch's stats in CSV format. The stats shown are: cycles taken, average distance, injected load, Accepted load, packet sent count, received packet count, dropped packet count, average delay, delay standard deviation, maximun delay, average injection delay, injection delay standard deviation, maximun injection delay.
b | a pointer to the batch to print |
void print_batch_results_vast | ( | batch_t * | b | ) |
Print the results of a batch in an Human Readable Style (not very dense).
Print all batch's stats in HR style. The stats shown are: cycles taken, average distance, injected load, Accepted load, packet sent count, received packet count, dropped packet count, average delay, delay standard deviation, maximun delay, average injection delay, injection delay standard deviation, maximun injection delay.
Not actually in use, but may be useful.
b | a pointer to the batch to print |
void print_headers | ( | void | ) |
Print headers at simulation start.
void print_partials | ( | void | ) |
void print_results | ( | time_t | start_time, |
time_t | end_time | ||
) |
void read_trace | ( | ) |
The trace reader dispatcher selects the format type and calls to the correct trace read.
The selection reads the first character in the file. This could be: '#' for dimemas, 'c', 's' or 'r' for fsin trc, and '-' for alog (in complete trace the header is "-1", or in filtered trace could be "-101" / "-102"). This is a very naive decision, so we probably have to change this, but for the moment it works.
void rem_head_event | ( | event_q * | q | ) |
Deletes the first event in a queue.
q | A pointer to the queue. |
void request_port_bimodal_random | ( | long | i, |
port_type | s_p | ||
) |
Request port for bimodal traffic.
Bubble adaptive random for short messages. Escape channel for long messages.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_bubble_adaptive_random | ( | long | i, |
port_type | s_p | ||
) |
Random Adaptive port request.
It tries to continue in the same dim/way in an adaptive VC. If not possible, then jump to another random adaptive VCs. If no adaptive, profitable dim is found, go to ESCAPE VC.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_bubble_adaptive_shortest | ( | long | i, |
port_type | s_p | ||
) |
Shortest Adaptive port request.
If packet cannot continue in the same virtual channel, it tries to go to the adaptive VC with most space in its queue. If no adaptive, profitable dim is found due to a congestion control mechanism, then go to ESCAPE VC.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_bubble_adaptive_smart | ( | long | i, |
port_type | s_p | ||
) |
Smart Adaptive port request.
At injection time, the packet is injected to a random channel. It tries to continue in the same dim/way in an adaptive VC. If not possible, then jump to another, profitable dim, still using adaptive VCs. If no adaptive, profitable dim is found, go to ESCAPE VC.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_bubble_oblivious | ( | long | i, |
port_type | s_p | ||
) |
Requests an output port using oblivious (DOR) routing.
It is possible to have several oblivious channels in parallel. A static selection of channel is done at injection time. After that, the same VC is used all the time.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_dally_adaptive | ( | long | i, |
port_type | s_p | ||
) |
Request a port using the dally algorithm + some VCs.
Adaptive port request. Channels 0 and 1 are the Escape channels, following the Dally algorithm request_port_dally_improved
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_dally_basic | ( | long | i, |
port_type | s_p | ||
) |
Request a port using oblivious dally algorithm.
Oblivious port request, using virtual channels 0 and 1.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_dally_improved | ( | long | i, |
port_type | s_p | ||
) |
Request a port using an improved dally algorithm.
Oblivious port request, using virtual channels 0 and 1. Implements an optimization described in Duato's book to better use both VCs
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_dally_trc | ( | long | i, |
port_type | s_p | ||
) |
Request a port using dally trc mechanism.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_double_adaptive | ( | long | i, |
port_type | s_p | ||
) |
Requests an output port using bubble double adaptive routing.
Routes equal to bubble double but we are able to change our channel when the bubble restriction allows us.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_double_oblivious | ( | long | i, |
port_type | s_p | ||
) |
Requests an output port using bubble double oblivious routing.
We have ndim escape channels. Each one using DOR routing in different order of dimensions. For example for ndim=2 XY & YX. We decide de channel when we inject & we cannot change it.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_hexa_adaptive | ( | long | i, |
port_type | s_p | ||
) |
Requests an output port using bubble hexa??? adaptive routing.
Equal to bubble hexa oblivious routing but packets can move to another channel when matchs bubble restriction.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_hexa_oblivious | ( | long | i, |
port_type | s_p | ||
) |
Requests an output port using bubble hexa??? oblivious routing.
Equal to bubble double routing but with all the possible dimension orders XY XZ YX YZ ZX ZY. The packets aren't allowed to move to another channel.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_icube | ( | long | i, |
port_type | s_p | ||
) |
Requests an output port in an indirect cube .
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_icube_IB | ( | long | i, |
port_type | s_p | ||
) |
Requests an output port in an indirect cube (for IB-based simul.)
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_port_tree | ( | long | i, |
port_type | s_p | ||
) |
Requests an output port in a tree (fattree, thintree and slimtree).
When going upward: adapts. When going downward: obeys the routing record (except slimtree that can adapt).
i | The switch in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void request_ports_init | ( | void | ) |
Prepare arrays mt and candidates.
mt[ dim * nways | way ] stores a list of boolean values, indicating all profitable directions for a given input. When bidirectional links this means that the array is like the next: [ X+ X- Y+ Y- .... ] in mesh-like topologies. [ 0^ 0v 1^ 1v .... ] in tree-like topologies.
candidates extends that list, and contains all profitable output ports for a given input.
Tries to reserve an output port.
An output port has selected the input port (s_p) that will be connected to an output port (d_p) at node i.
i | The node in which the reservation is performed. |
d_p | The reserved destination port. |
s_p | The source port which is reserving. |
void reset_stats | ( | void | ) |
Resets the stats of the simulation.
Histograms, maps & long messages stats are only cleared when the convergency phase are finished.
void results_partial | ( | void | ) |
Print partial results.
void router_init | ( | void | ) |
Initializes all the routers in the network.
Prepares all structures needed for the simulation (routers & all their stuff for requesting, arbitring & stating). Event queues & occurred list are initilized here if compiled with the TRACE_SUPPORT != 0 .
void run_network_batch | ( | void | ) |
Run the simulation taking stats for some batches.
The simulation are split in three phases: Warm-up, Convergency assurement & Stationary state.
void run_network_exd | ( | void | ) |
Run the simulation in Execution driven mode.
Main function for execution driven simulation using SIMICS.
void run_network_shotmode | ( | void | ) |
Run the simulation in shotmode.
The simulation runs for samples shots and takes stats for each one.
void run_network_trc | ( | ) |
Runs simulation using a trace file as workload.
In this mode, simulation are running until all the events in the nodes queues are done. It prints partial results each pinterval simulation cycles & calculates global queues states for global congestion control.
void save_batch_results | ( | ) |
Save the current batch's stats.
Save the current stats in the reseted position of the batch array. The stats saved are: cycles taken, average distance, injected load, Accepted load, packet sent count, received packet count, dropped packet count, average delay, delay standard deviation, maximun delay, average injection delay, injection delay standard deviation, maximun injection delay.
port_type select_input_port_dor_only | ( | long | i, |
long | dest | ||
) |
Select an injection queue using strict DOR prerouting.
When using DIMENSION_ORDER_ROUTING most packets are injectec in X+ or X-
i | The node in which the injection is performed. |
dest | The destination node. |
port_type select_input_port_dor_shortest | ( | long | i, |
long | dest | ||
) |
Select an injection queue using DOR prerouting and if not possible in the shortest port.
It uses select_input_port_dor but, if the corresponding injector is full, it tries to inject in the port with shortest injection+buffer utilization.
i | The node in which the injection is performed. |
dest | The destination node. |
port_type select_input_port_lpath | ( | long | i, |
long | dest | ||
) |
Select an injection queue using the packet's routing record.
Select the injector for the direction in which the packet has the highest number of hops.
i | The node in which the injection is performed. |
dest | The destination node. |
port_type select_input_port_shortest | ( | long | i, |
long | dest | ||
) |
Select the shortest injection queue.
Selects the port with SHORTEST injection + buffer utilization.
i | The node in which the injection is performed. |
dest | The destination node. Actually not used in this function. |
port_type select_input_port_shortest_profitable | ( | long | i, |
long | dest | ||
) |
Select an injection queue using the packet's routing record.
Taking into consideration all the possible profitable dim/way options, it injects in that with shortest injection+buffer utilization
i | The node in which the injection is performed. |
dest | The destination node. |
routing_r slimtree_rr_adapt | ( | long | source, |
long | destination | ||
) |
Generates the routing record for a slimtree.
This function allows adaptive routing because no route is defined here.
source | The source node of the packet. |
destination | The destination node of the packet. |
void stats | ( | long | i | ) |
Collects queue occupancy histogram stats.
i | The node to collect from. |
routing_r thintree_rr_adapt | ( | long | source, |
long | destination | ||
) |
Generates the routing record for a thin tree.
This function allows adaptive routing because no route is defined here.
source | The source node of the packet. |
destination | The destination node of the packet. |
Obtains a neighbor node in torus & mesh topologies.
Given a node address "ad", a direction "wd" (X,Y or Z) and a way "ww" (UP or DOWN) returns the address of the neighbor in that direction and way; only valid for torus but usable also for mesh.
ad | A node address. |
wd | A dimension (X,Y or Z). |
ww | A way (UP or DOWN). |
routing_r torus_rr | ( | long | source, |
long | destination | ||
) |
Generates the routing record for a torus.
source | The source node of the packet. |
destination | The destination node of the packet. |
routing_r torus_rr_unidir | ( | long | source, |
long | destination | ||
) |
Generates the routing record for an unidirectional torus.
source | The source node of the packet. |
destination | The destination node of the packet. |
Id of the router arbitration mechanism.
'Virtual' Function that performs the arbitration of the output ports.
inject | It is TRUE if the injection has to be performed. |
void(* arbitrate_cons)(long i) |
'Virtual' Function that arbritates the consumption of the arriven packets.
i | The node in which the consumption is performed. |
'Virtual' Function that arbitrates the selection of an input port for an output port.
i | The node in which the consumption is performed. |
d_p | The destination port to arbitrate for. |
first | The first input port that can use this output. |
last | The next of the last input port that can use this input. |
long bheaders |
Batch headers. A Bitmap to know what batch stats are printed in final summary. 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 + 2048 + 4096 BatchTime AvDistance InjLoad AccLoad PacketSent PacketRcvd PacketDrop AvgDelay StDevDelay MaxDelay InjAvgDel InjStDvDel InjMaxDel
'Virtual' Function that calculates packet routing record.
source | The source node of the packet. |
destination | The destination node of the packet. |
'Virtual' Function that routes a packet.
pkt | The packet to route. |
d_d | The destination dimension is returned here. |
d_w | The destination way is returned here. |
Id of the consumption mode.
void(* consume)(long i) |
'Virtual' Function that performs consumption.
i | The node in which the consumption is performed. |
void(* data_movement)(bool_t inject) |
'Virtual' Function that performs the traffic movement in the network.
inject | It is TRUE if the injection has to be performed. |
char file[128] |
The output file name.
It will be appended one extension for each out: .mon for monitored node. .map for channel mapping. .hst for queue occupation histograms.
double global_q_u |
The global queue occupation.
This is the value shown to the nodes and is updated every update_period cycles with the value of global_q_u_current.
double global_q_u_current |
The global queue occupation.
This value is calculated each cycle.
Id of the injection mode.
long inj_ql |
Last port to check when arbitrating the consumption port.
'Virtual' Function that performs the search of a neighbor node. Only used by direct topologies.
ad | A node address. |
wd | A dimension (X,Y or Z). |
ww | A way (UP or DOWN). |
The traffic pattern Id.
long pheaders |
Partial headers. A Bitmap to know what system stats are shown. 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 clock inj_load cons_load av_delay delay_dev max_delay inj_delay i_d_dev i_dev_max netw. ocup queue_ocup
long pkt_max |
The maximum number of packets allowed.
Normally is the number of nodes multiplied by the maximun capacity of each router.
Structure in wich all the packets are stored.
It is created and allocated when stating simulation, and it must be not modify later. It is used in heap mode, so we try to use the last free packet to favor spatial locality.
Id of the placement strategy.
All the placement strategies are specified here.
long plevel |
Print level - bitmap. 0 = Just final summary 1 = Source/destination Map 2 = port utilization Map 4 = Distance Histogram 8 = Histogram of port utilization 16 = Packet-level traces 32 = Phit-level traces 64 = Monitored node
Id of the request port mechanism.
void(* request_port)(long i, port_type s_p) |
'Virtual' Function that prepares the request of an output port.
i | The node in which the request is performed. |
s_p | The source (input) port which is requesting the output port. |
void(* run_network)(void) |
'Virtual' Function that runs the simulation.
port_type(* select_input_port)(long i, long dest) |
'Virtual' Function that performs the selection of the injection ports.
i | The node in wich the injection is performed. |
dest | The destination of the packet. |
The topology Id.
All the topologies allowed are specified here.
long tr_ql |
Transit queue length (in phits).
Equal to buffer_cap multiplied by pkt_len.
char trcfile[128] |
The name of a file containing a trace for trace driven.
If the file is in .alog format & only will be considered message sending an reception (events -101 & -102). If the file is a dimemas trace only point to point operations and cpu intervals are considered. The FSIN trace format is also allowed.
Id of the Virtual Channel management mechanism.