• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/core/techModels/libORION/SIM_router.h

00001 /*-------------------------------------------------------------------------
00002  *                             ORION 2.0 
00003  *
00004  *                                              Copyright 2009 
00005  *      Princeton University, and Regents of the University of California 
00006  *                         All Rights Reserved
00007  *
00008  *                         
00009  *  ORION 2.0 was developed by Bin Li at Princeton University and Kambiz Samadi at
00010  *  University of California, San Diego. ORION 2.0 was built on top of ORION 1.0. 
00011  *  ORION 1.0 was developed by Hangsheng Wang, Xinping Zhu and Xuning Chen at 
00012  *  Princeton University.
00013  *
00014  *  If your use of this software contributes to a published paper, we
00015  *  request that you cite our paper that appears on our website 
00016  *  http://www.princeton.edu/~peh/orion.html
00017  *
00018  *  Permission to use, copy, and modify this software and its documentation is
00019  *  granted only under the following terms and conditions.  Both the
00020  *  above copyright notice and this permission notice must appear in all copies
00021  *  of the software, derivative works or modified versions, and any portions
00022  *  thereof, and both notices must appear in supporting documentation.
00023  *
00024  *  This software may be distributed (but not offered for sale or transferred
00025  *  for compensation) to third parties, provided such third parties agree to
00026  *  abide by the terms and conditions of this notice.
00027  *
00028  *  This software is distributed in the hope that it will be useful to the
00029  *  community, but WITHOUT ANY WARRANTY; without even the implied warranty of
00030  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00031  *
00032  *-----------------------------------------------------------------------*/
00033 
00034 #ifndef _SIM_ROUTER_H
00035 #define _SIM_ROUTER_H
00036 
00037 #include "SIM_parameter.h"
00038 #include "SIM_array.h"
00039 #include "SIM_crossbar.h"
00040 #include "SIM_arbiter.h"
00041 
00042 typedef struct {
00043         double buffer;
00044         double crossbar;
00045         double vc_allocator;
00046         double sw_allocator;
00047 } SIM_router_area_t;
00048 
00049 typedef struct {
00050         SIM_crossbar_t crossbar;
00051         SIM_crossbar_t exp_xb;
00052         SIM_array_t in_buf;
00053         SIM_array_t cache_in_buf;
00054         SIM_array_t mc_in_buf;
00055         SIM_array_t io_in_buf;
00056         SIM_array_t out_buf;
00057         SIM_array_t central_buf;
00058         SIM_crossbar_t in_cbuf_crsbar;
00059         SIM_crossbar_t out_cbuf_crsbar;
00060         SIM_arbiter_t cache_in_arb;
00061         SIM_arbiter_t mc_in_arb;
00062         SIM_arbiter_t io_in_arb;
00063         SIM_arbiter_t vc_in_arb;
00064         SIM_arbiter_t vc_out_arb;
00065         SIM_arbiter_t sw_in_arb;
00066         SIM_arbiter_t sw_out_arb;
00067         SIM_array_t vc_select_buf;
00068         /* FIXME: this should be put in SIM_array_t */
00069         SIM_ff_t cbuf_ff;
00070         double I_static;
00071         double I_buf_static;
00072         double I_crossbar_static;
00073         double I_vc_arbiter_static;
00074         double I_sw_arbiter_static;
00075         double I_clock_static;
00076 } SIM_router_power_t;
00077 
00078 typedef struct {
00079         u_int n_in;
00080         u_int n_cache_in;
00081         u_int n_mc_in;
00082         u_int n_io_in;
00083         u_int n_out;
00084         u_int n_cache_out;
00085         u_int n_mc_out;
00086         u_int n_io_out;
00087         u_int flit_width;
00088         /* virtual channel parameters */
00089         u_int n_v_channel;
00090         u_int n_v_class;
00091         u_int cache_class;
00092         u_int mc_class;
00093         u_int io_class;
00094         int in_share_buf;       /* whether input virtual classes share buffer */
00095         int out_share_buf;      /* whether output virtual classes share buffer */
00096         int in_share_switch;    /* whether input virtual classes share switch */
00097         int out_share_switch;   /* whether output virtual classes share switch */
00098         /* crossbar parameters */
00099         int crossbar_model;
00100         u_int degree;   /* only used by multree crossbar */
00101         int connect_type;
00102         int trans_type; /* only used by transmission gate connection */
00103         u_int xb_in_seg;        /* only used by segmented crossbar */
00104         u_int xb_out_seg;       /* only used by segmented crossbar */
00105         double crossbar_in_len;
00106         double crossbar_out_len;
00107         /* HACK HACK HACK */
00108         int exp_xb_model;
00109         u_int exp_in_seg;       /* only used by segmented crossbar */
00110         u_int exp_out_seg;      /* only used by segmented crossbar */
00111         /* buffer parameters */
00112         int in_buf;
00113         int cache_in_buf;
00114         int mc_in_buf;
00115         int io_in_buf;
00116         int out_buf;
00117         int in_buffer_model;
00118         int out_buffer_model;
00119         /* assume no buffering for local output ports */
00120         int central_buf;
00121         SIM_array_info_t in_buf_info;
00122         SIM_array_info_t cache_in_buf_info;
00123         SIM_array_info_t mc_in_buf_info;
00124         SIM_array_info_t io_in_buf_info;
00125         SIM_array_info_t out_buf_info;
00126         SIM_array_info_t central_buf_info;
00127         u_int pipe_depth;
00128         /* FIXME: this should be put in SIM_array_info_t */
00129         int cbuf_ff_model;
00130         /* switch allocator arbiter parameters */
00131         int sw_in_arb_model;
00132         int sw_out_arb_model;
00133         int sw_in_arb_ff_model;
00134         int sw_out_arb_ff_model;
00135         /* virtual channel allocator arbiter parameters */
00136         int vc_allocator_type;
00137         int vc_in_arb_model;
00138         int vc_out_arb_model;
00139         int vc_in_arb_ff_model;
00140         int vc_out_arb_ff_model;
00141         int vc_select_buf_type;
00142         SIM_array_info_t sw_in_arb_queue_info;
00143         SIM_array_info_t cache_in_arb_queue_info;
00144         SIM_array_info_t mc_in_arb_queue_info;
00145         SIM_array_info_t io_in_arb_queue_info;
00146         SIM_array_info_t sw_out_arb_queue_info;
00147         SIM_array_info_t vc_in_arb_queue_info;
00148         SIM_array_info_t vc_out_arb_queue_info;
00149         SIM_array_info_t vc_select_buf_info;
00150         /* clock related parameters */
00151         int pipelined;  
00152         int H_tree_clock;
00153         int clock_enabled;
00154         double router_diagonal;
00155         /* redundant fields */
00156         u_int n_total_in;
00157         u_int n_total_out;
00158         u_int in_n_switch;
00159         u_int cache_n_switch;
00160         u_int mc_n_switch;
00161         u_int io_n_switch;
00162         u_int n_switch_in;
00163         u_int n_switch_out;
00164 } SIM_router_info_t;
00165 
00166 
00167 /* global variables */
00168 extern GLOBDEF(SIM_router_power_t, router_power);
00169 extern GLOBDEF(SIM_router_info_t, router_info);
00170 extern GLOBDEF(SIM_router_area_t, router_area);
00171 
00172 
00173 extern int SIM_router_init(SIM_router_info_t *info, SIM_router_power_t *router_power, SIM_router_area_t *router_area);
00174 
00175 extern int SIM_buf_power_data_read(SIM_array_info_t *info, SIM_array_t *arr, LIB_Type_max_uint data);
00176 extern int SIM_buf_power_data_write(SIM_array_info_t *info, SIM_array_t *arr, u_char *data_line, u_char *old_data, u_char *new_data);
00177 
00178 extern int SIM_router_power_init(SIM_router_info_t *info, SIM_router_power_t *router);
00179 extern int SIM_router_power_report(SIM_router_info_t *info, SIM_router_power_t *router);
00180 extern double SIM_router_stat_energy(SIM_router_info_t *info, SIM_router_power_t *router, int print_depth, char *path, int max_avg, double e_fin, int plot_flag, double freq);
00181 
00182 extern int SIM_router_area_init(SIM_router_info_t *info, SIM_router_area_t *router_area);
00183 extern double SIM_router_area(SIM_router_area_t *router_area);
00184 
00185 extern int SIM_crossbar_record(SIM_crossbar_t *xb, int io, LIB_Type_max_uint new_data, LIB_Type_max_uint old_data, u_int new_port, u_int old_port);
00186 extern int SIM_arbiter_record(SIM_arbiter_t *arb, LIB_Type_max_uint new_req, LIB_Type_max_uint old_req, u_int new_grant, u_int old_grant);
00187 
00188 //added for SST
00189 extern int SST_SIM_router_init(SIM_router_info_t *info, SIM_router_power_t *router_power, SIM_router_area_t *router_area,
00190                         int SST_in_port,
00191                         int SST_out_port,
00192                         int SST_flit_width,
00193                         int SST_v_channel);
00194 extern double SST_SIM_router_stat_power(SIM_router_info_t *info, SIM_router_power_t *router, int print_depth, char *path, int max_avg, double e_fin, int plot_flag, double freq, double SST_Vdd);
00195 extern double SST_SIM_router_stat_energy(SIM_router_info_t *info, SIM_router_power_t *router, int print_depth, char *path, int max_avg, double e_fin, int plot_flag, double freq, double SST_Vdd);
00196 
00197 
00198 #endif /* _SIM_ROUTER_H */
00199 

Generated on Fri Oct 22 2010 11:02:18 for SST by  doxygen 1.7.1