00001 /*------------------------------------------------------------ 00002 * CACTI 6.5 00003 * Copyright 2008 Hewlett-Packard Development Corporation 00004 * All Rights Reserved 00005 * 00006 * Permission to use, copy, and modify this software and its documentation is 00007 * hereby granted only under the following terms and conditions. Both the 00008 * above copyright notice and this permission notice must appear in all copies 00009 * of the software, derivative works or modified versions, and any portions 00010 * thereof, and both notices must appear in supporting documentation. 00011 * 00012 * Users of this software agree to the terms and conditions set forth herein, and 00013 * hereby grant back to Hewlett-Packard Company and its affiliated companies ("HP") 00014 * a non-exclusive, unrestricted, royalty-free right and license under any changes, 00015 * enhancements or extensions made to the core functions of the software, including 00016 * but not limited to those affording compatibility with other hardware or software 00017 * environments, but excluding applications which incorporate this software. 00018 * Users further agree to use their best efforts to return to HP any such changes, 00019 * enhancements or extensions that they make and inform HP of noteworthy uses of 00020 * this software. Correspondence should be provided to HP at: 00021 * 00022 * Director of Intellectual Property Licensing 00023 * Office of Strategy and Technology 00024 * Hewlett-Packard Company 00025 * 1501 Page Mill Road 00026 * Palo Alto, California 94304 00027 * 00028 * This software may be distributed (but not offered for sale or transferred 00029 * for compensation) to third parties, provided such third parties agree to 00030 * abide by the terms and conditions of this notice. 00031 * 00032 * THE SOFTWARE IS PROVIDED "AS IS" AND HP DISCLAIMS ALL 00033 * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES 00034 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL HP 00035 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 00036 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 00037 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 00038 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 00039 * SOFTWARE. 00040 *------------------------------------------------------------*/ 00041 00042 00043 00044 #ifndef __ROUTER_H__ 00045 #define __ROUTER_H__ 00046 00047 #include <assert.h> 00048 #include <iostream> 00049 #include "basic_circuit.h" 00050 #include "cacti_interface.h" 00051 #include "McPATcomponent.h" 00052 #include "mat.h" 00053 #include "parameter.h" 00054 #include "wire.h" 00055 #include "crossbar.h" 00056 #include "arbiter.h" 00057 00058 00059 00060 class Router : public McPATComponent 00061 { 00062 public: 00063 Router( 00064 double flit_size_, 00065 double vc_buf, /* vc size = vc_buffer_size * flit_size */ 00066 double vc_count, 00067 TechnologyParameter::DeviceType *dt = &(g_tp.peri_global), 00068 double I_ = 5, 00069 double O_ = 5, 00070 double M_ = 0.6); 00071 ~Router(); 00072 00073 /*---SoM SST-----*/ 00074 void SSTleakage_feedback(double temperature); 00075 /*---EoM SST-----*/ 00076 00077 void print_router(); 00078 00079 McPATComponent arbiter, crossbar, buffer; 00080 00081 double cycle_time, max_cyc; 00082 double flit_size; 00083 double vc_count; 00084 double vc_buffer_size; /* vc size = vc_buffer_size * flit_size */ 00085 00086 private: 00087 TechnologyParameter::DeviceType *deviceType; 00088 double FREQUENCY; // move this to config file --TODO 00089 double Cw3(double len); 00090 double gate_cap(double w); 00091 double diff_cap(double w, int type /*0 for n-mos and 1 for p-mos*/, double stack); 00092 enum Wire_type wtype; 00093 enum Wire_placement wire_placement; 00094 //corssbar 00095 double NTtr, PTtr, wt, ht, I, O, NTi, PTi, NTid, PTid, NTod, PTod, TriS1, TriS2; 00096 double M; //network load 00097 double transmission_buf_inpcap(); 00098 double transmission_buf_outcap(); 00099 double transmission_buf_ctrcap(); 00100 double crossbar_inpline(); 00101 double crossbar_outline(); 00102 double crossbar_ctrline(); 00103 double tr_crossbar_power(); 00104 void cb_stats (); 00105 double arb_power(); 00106 void arb_stats (); 00107 double buffer_params(); 00108 void buffer_stats(); 00109 00110 00111 //arbiter 00112 00113 //buffer 00114 00115 //router params 00116 double Vdd; 00117 00118 void calc_router_parameters(); 00119 void get_router_area(); 00120 void get_router_power(); 00121 void get_router_delay(); 00122 00123 double min_w_pmos; 00124 00125 00126 }; 00127 00128 #endif