00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
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
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
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;
00095 int out_share_buf;
00096 int in_share_switch;
00097 int out_share_switch;
00098
00099 int crossbar_model;
00100 u_int degree;
00101 int connect_type;
00102 int trans_type;
00103 u_int xb_in_seg;
00104 u_int xb_out_seg;
00105 double crossbar_in_len;
00106 double crossbar_out_len;
00107
00108 int exp_xb_model;
00109 u_int exp_in_seg;
00110 u_int exp_out_seg;
00111
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
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
00129 int cbuf_ff_model;
00130
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
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
00151 int pipelined;
00152 int H_tree_clock;
00153 int clock_enabled;
00154 double router_diagonal;
00155
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
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
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
00199