00001 /***************************************************************************** 00002 * McPAT 00003 * SOFTWARE LICENSE AGREEMENT 00004 * Copyright 2009 Hewlett-Packard Development Company, L.P. 00005 * All Rights Reserved 00006 * 00007 * Permission to use, copy, and modify this software and its documentation is 00008 * hereby granted only under the following terms and conditions. Both the 00009 * above copyright notice and this permission notice must appear in all copies 00010 * of the software, derivative works or modified versions, and any portions 00011 * thereof, and both notices must appear in supporting documentation. 00012 * 00013 * Any User of the software ("User"), by accessing and using it, agrees to the 00014 * terms and conditions set forth herein, and hereby grants back to Hewlett- 00015 * Packard Development Company, L.P. and its affiliated companies ("HP") a 00016 * non-exclusive, unrestricted, royalty-free right and license to copy, 00017 * modify, distribute copies, create derivate works and publicly display and 00018 * use, any changes, modifications, enhancements or extensions made to the 00019 * software by User, including but not limited to those affording 00020 * compatibility with other hardware or software, but excluding pre-existing 00021 * software applications that may incorporate the software. User further 00022 * agrees to use its best efforts to inform HP of any such changes, 00023 * modifications, enhancements or extensions. 00024 * 00025 * Correspondence should be provided to HP at: 00026 * 00027 * Director of Intellectual Property Licensing 00028 * Office of Strategy and Technology 00029 * Hewlett-Packard Company 00030 * 1501 Page Mill Road 00031 * Palo Alto, California 94304 00032 * 00033 * The software may be further distributed by User (but not offered for 00034 * sale or transferred for compensation) to third parties, under the 00035 * condition that such third parties agree to abide by the terms and 00036 * conditions of this license. 00037 * 00038 * THE SOFTWARE IS PROVIDED "AS IS" WITH ANY AND ALL ERRORS AND DEFECTS 00039 * AND USER ACKNOWLEDGES THAT THE SOFTWARE MAY CONTAIN ERRORS AND DEFECTS. 00040 * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THE SOFTWARE, INCLUDING ALL 00041 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL 00042 * HP BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 00043 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 00044 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER ACTION, ARISING 00045 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE SOFTWARE. 00046 * 00047 ***************************************************************************/ 00048 00049 #ifndef __ROUTER_H__ 00050 #define __ROUTER_H__ 00051 00052 #include <assert.h> 00053 #include <iostream> 00054 #include "basic_circuit.h" 00055 #include "cacti_interface.h" 00056 #include "McPATcomponent.h" 00057 #include "mat.h" 00058 #include "parameter.h" 00059 #include "wire.h" 00060 #include "crossbar.h" 00061 #include "arbiter.h" 00062 00063 00064 00065 class Router : public McPATComponent 00066 { 00067 public: 00068 Router( 00069 double flit_size_, 00070 double vc_buf, /* vc size = vc_buffer_size * flit_size */ 00071 double vc_count, 00072 TechnologyParameter::DeviceType *dt = &(g_tp.peri_global), 00073 double I_ = 5, 00074 double O_ = 5); 00075 ~Router(); 00076 00077 00078 void print_router(); 00079 00080 McPATComponent arbiter, crossbar, buffer; 00081 00082 double cycle_time, max_cyc; 00083 double flit_size; 00084 double vc_count; 00085 double vc_buffer_size; /* vc size = vc_buffer_size * flit_size */ 00086 00087 private: 00088 TechnologyParameter::DeviceType *deviceType; 00089 double FREQUENCY; // move this to config file --TODO 00090 double Cw3(double len); 00091 double gate_cap(double w); 00092 double diff_cap(double w, int type /*0 for n-mos and 1 for p-mos*/, double stack); 00093 enum Wire_type wtype; 00094 enum Wire_placement wire_placement; 00095 //corssbar 00096 double NTtr, PTtr, wt, ht, I, O, NTi, PTi, NTid, PTid, NTod, PTod, TriS1, TriS2; 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