Commit d1dad464 authored by Nikhil's avatar Nikhil

Create template to ease adding a network

For simplest case, only 2 functions and premable changes should suffice to add a
new network. Update Express Mesh to serve as an example.

Change-Id: I48de25b4c00360201cb23a4a7089ddc08300137d
parent 4ede6937
...@@ -32,6 +32,7 @@ extern void free_tmp(void * ptr); ...@@ -32,6 +32,7 @@ extern void free_tmp(void * ptr);
typedef struct message_list message_list; typedef struct message_list message_list;
struct message_list { struct message_list {
//CHANGE: add message types for new networks here
union { union {
terminal_message dfly_msg; terminal_message dfly_msg;
em_message em_msg; em_message em_msg;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* *
*/ */
//CHANGE: modify to match you header file name
#ifndef EXPRESS_MESH_H #ifndef EXPRESS_MESH_H
#define EXPRESS_MESH_H #define EXPRESS_MESH_H
...@@ -13,76 +14,67 @@ extern "C" { ...@@ -13,76 +14,67 @@ extern "C" {
#include <ross.h> #include <ross.h>
//CHANGE: modify to match the struct
typedef struct net_message net_message;
//CHANGE: modify the struct name - add to message_list union in common-net.h
typedef struct em_message em_message; typedef struct em_message em_message;
struct em_message struct em_message
{ {
/* magic number */ //common entries:
int magic; int magic; /* magic number */
/* flit travel start time*/ short type; /* event type of the flit */
tw_stime travel_start_time;
/* packet ID of the flit */
unsigned long long packet_ID;
/* event type of the flit */
short type;
/* category: comes from codes */
char category[CATEGORY_NAME_MAX];
/* final destination LP ID, this comes from codes can be a server or any other LP type*/
tw_lpid final_dest_gid;
/*sending LP ID from CODES, can be a server or any other LP type */
tw_lpid sender_lp;
tw_lpid sender_mn_lp; // source modelnet id
/* destination terminal ID */
tw_lpid dest_terminal_id;
int dest_terminal;
/* source terminal ID */
tw_lpid src_terminal_id;
short saved_channel;
short my_N_hop;
short hops[8];
/* Intermediate LP ID from which this message is coming */ tw_stime travel_start_time; /* flit travel start time*/
unsigned int intm_lp_id; unsigned long long packet_ID; /* packet ID of the flit */
short saved_vc; char category[CATEGORY_NAME_MAX]; /* category: comes from codes */
short dim_change;
/* last hop of the message, can be a terminal, local router or global router */
int last_hop;
/* For routing */
uint64_t chunk_id;
uint64_t packet_size;
uint64_t message_id;
uint64_t total_size;
int saved_remote_esize; tw_lpid final_dest_gid; /* final destination LP ID, this comes from codes can be a server or any other LP type*/
int remote_event_size_bytes; tw_lpid sender_lp; /*sending LP ID from CODES, can be a server or any other LP type */
int local_event_size_bytes; tw_lpid sender_mn_lp; // source modelnet id (think NIC)
tw_lpid src_terminal_id; /* source terminal ID - mostly same as sender_mn_lp */
tw_lpid dest_terminal_id; /* destination modelnet id */
int dest_terminal; /* logical id of destination modelnet id */
// For buffer message /* packet/message identifier and status */
int vc_index; uint64_t chunk_id; //which chunk of packet I am
int output_chan; uint64_t packet_size; //what is the size of my packet
model_net_event_return event_rc; uint64_t message_id; //seq number at message level - NIC specified
uint64_t total_size; //total size of the message
int remote_event_size_bytes; // data size for target event at destination
int local_event_size_bytes; // data size for event at source
int is_pull; int is_pull;
uint64_t pull_size; uint64_t pull_size;
tw_stime msg_start_time;
/* for reverse computation */ //info for path traversal
short my_N_hop; /* hops traversed so far */
short hops[8]; /* can be used for storing different types of hops */
unsigned int intm_lp_id; /* Intermediate LP ID that sent this packet */
int last_hop; /* last hop of the message, can be a terminal, local router or global router */
int vc_index; /* stores port info */
int output_chan; /* virtual channel within port */
//info for reverse computation
short saved_channel;
short saved_vc;
model_net_event_return event_rc;
tw_stime saved_available_time; tw_stime saved_available_time;
tw_stime saved_avg_time; tw_stime saved_avg_time;
tw_stime saved_rcv_time; tw_stime saved_rcv_time;
tw_stime saved_busy_time; tw_stime saved_busy_time;
tw_stime saved_total_time; tw_stime saved_total_time;
tw_stime saved_hist_start_time; tw_stime saved_hist_start_time;
tw_stime saved_sample_time; tw_stime saved_sample_time;
tw_stime msg_start_time;
int saved_hist_num; //CHANGE: info for specific networks
int saved_occupancy; short dim_change;
}; };
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
/*
* Copyright (C) 2014 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
//CHANGE: modify to match you header file name
#ifndef NET_TEMPLATE_H
#define NET_TEMPLATE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <ross.h>
//CHANGE: modify to match the struct
typedef struct net_message net_message;
//CHANGE: modify the struct name - add to message_list union in common-net.h
struct net_message
{
//common entries:
int magic; /* magic number */
short type; /* event type of the flit */
tw_stime travel_start_time; /* flit travel start time*/
unsigned long long packet_ID; /* packet ID of the flit */
char category[CATEGORY_NAME_MAX]; /* category: comes from codes */
tw_lpid final_dest_gid; /* final destination LP ID, this comes from codes can be a server or any other LP type*/
tw_lpid sender_lp; /*sending LP ID from CODES, can be a server or any other LP type */
tw_lpid sender_mn_lp; // source modelnet id (think NIC)
tw_lpid src_terminal_id; /* source terminal ID - mostly same as sender_mn_lp */
tw_lpid dest_terminal_id; /* destination modelnet id */
int dest_terminal; /* logical id of destination modelnet id */
/* packet/message identifier and status */
uint64_t chunk_id; //which chunk of packet I am
uint64_t packet_size; //what is the size of my packet
uint64_t message_id; //seq number at message level - NIC specified
uint64_t total_size; //total size of the message
int remote_event_size_bytes; // data size for target event at destination
int local_event_size_bytes; // data size for event at source
int is_pull;
uint64_t pull_size;
tw_stime msg_start_time;
//info for path traversal
short my_N_hop; /* hops traversed so far */
short hops[8]; /* can be used for storing different types of hops */
unsigned int intm_lp_id; /* Intermediate LP ID that sent this packet */
int last_hop; /* last hop of the message, can be a terminal, local router or global router */
int vc_index; /* stores port info */
int output_chan; /* virtual channel within port */
//info for reverse computation
short saved_channel;
short saved_vc;
model_net_event_return event_rc;
tw_stime saved_available_time;
tw_stime saved_avg_time;
tw_stime saved_rcv_time;
tw_stime saved_busy_time;
tw_stime saved_total_time;
tw_stime saved_hist_start_time;
tw_stime saved_sample_time;
//CHANGE: add info for specific networks
};
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment