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

sst/core/techModels/libMcPATbeta06/basic_circuit.h

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 __BASIC_CIRCUIT_H__
00050 #define __BASIC_CIRCUIT_H__
00051 
00052 #include "const.h"
00053 #include "cacti_interface.h"
00054 
00055 using namespace std;
00056 
00057 #define UNI_LEAK_STACK_FACTOR 0.43
00058 
00059 int powers (int base, int n);
00060 bool is_pow2(int64_t val);
00061 uint32_t _log2(uint64_t num);
00062 int factorial(int n, int m = 1);
00063 int combination(int n, int m);
00064 
00065 //#define DBG
00066 #ifdef DBG
00067     #define PRINTDW(a);\
00068     a;
00069 #else
00070     #define PRINTDW(a);\
00071 
00072 #endif
00073 
00074 
00075 enum Wire_placement {
00076     outside_mat,
00077     inside_mat,
00078     local_wires
00079 };
00080 
00081 
00082 
00083 enum Htree_type {
00084     Add_htree,
00085     Data_in_htree,
00086     Data_out_htree,
00087     Search_in_htree,
00088     Search_out_htree,
00089 };
00090 
00091 enum Gate_type {
00092     nmos,
00093     pmos,
00094         inv,
00095     nand,
00096     nor,
00097     tri,
00098     tg
00099 };
00100 
00101 enum Half_net_topology {
00102     parallel,
00103     series
00104 };
00105 
00106 double logtwo (double x);
00107 
00108 double gate_C(
00109     double width,
00110     double wirelength,
00111     bool _is_dram = false,
00112     bool _is_sram = false,
00113     bool _is_wl_tr = false);
00114 
00115 double gate_C_pass(
00116     double width,
00117     double wirelength,
00118     bool   _is_dram = false,
00119     bool   _is_sram = false,
00120     bool   _is_wl_tr = false);
00121 
00122 double drain_C_(
00123     double width,
00124     int nchannel,
00125     int stack,
00126     int next_arg_thresh_folding_width_or_height_cell,
00127     double fold_dimension,
00128     bool _is_dram = false,
00129     bool _is_sram = false,
00130     bool _is_wl_tr = false);
00131 
00132 double tr_R_on(
00133     double width,
00134     int nchannel,
00135     int stack,
00136     bool _is_dram = false,
00137     bool _is_sram = false,
00138     bool _is_wl_tr = false);
00139 
00140 double R_to_w(
00141     double res,
00142     int nchannel,
00143     bool _is_dram = false,
00144     bool _is_sram = false,
00145     bool _is_wl_tr = false);
00146 
00147 double horowitz (
00148     double inputramptime,
00149     double tf,
00150     double vs1,
00151     double vs2,
00152     int rise);
00153 
00154 double pmos_to_nmos_sz_ratio(
00155     bool _is_dram = false,
00156     bool _is_wl_tr = false);
00157 
00158 double simplified_nmos_leakage(
00159     double nwidth,
00160     bool _is_dram = false,
00161     bool _is_cell = false,
00162     bool _is_wl_tr = false);
00163 
00164 double simplified_pmos_leakage(
00165     double pwidth,
00166     bool _is_dram = false,
00167     bool _is_cell = false,
00168     bool _is_wl_tr = false);
00169 
00170 
00171 double cmos_Ileak(
00172     double nWidth,
00173     double pWidth,
00174     bool _is_dram = false,
00175     bool _is_cell = false,
00176     bool _is_wl_tr = false);
00177 
00178 double cmos_Ig_n(
00179     double nWidth,
00180     bool _is_dram = false,
00181     bool _is_cell = false,
00182     bool _is_wl_tr= false);
00183 
00184 double cmos_Ig_p(
00185     double pWidth,
00186     bool _is_dram = false,
00187     bool _is_cell = false,
00188     bool _is_wl_tr= false);
00189 
00190 
00191 double cmos_Isub_leakage(
00192     double nWidth,
00193     double pWidth,
00194     int    fanin,
00195     enum Gate_type g_type,
00196     bool _is_dram = false,
00197     bool _is_cell = false,
00198     bool _is_wl_tr = false,
00199     enum Half_net_topology topo = series);
00200 
00201 double cmos_Ig_leakage(
00202     double nWidth,
00203     double pWidth,
00204     int    fanin,
00205     enum Gate_type g_type,
00206     bool _is_dram = false,
00207     bool _is_cell = false,
00208     bool _is_wl_tr = false,
00209     enum Half_net_topology topo = series);
00210 
00211 double shortcircuit(
00212     double vt,
00213     double velocity_index,
00214     double c_in,
00215     double c_out,
00216     double w_nmos,
00217     double w_pmos,
00218     double i_on_n,
00219     double i_on_p,
00220     double i_on_n_in,
00221     double i_on_p_in,
00222     double vdd);
00223 
00224 double shortcircuit_simple(
00225     double vt,
00226     double velocity_index,
00227     double c_in,
00228     double c_out,
00229     double w_nmos,
00230     double w_pmos,
00231     double i_on_n,
00232     double i_on_p,
00233     double i_on_n_in,
00234     double i_on_p_in,
00235     double vdd);
00236 
00237 inline void set_pppm(
00238         double * pppv,
00239         double a=1,
00240     double b=1,
00241     double c=1,
00242     double d=1
00243     ){
00244                 pppv[0]= a;
00245                 pppv[1]= b;
00246                 pppv[2]= c;
00247                 pppv[3]= d;
00248 
00249 }
00250 
00251 inline void set_sppm(
00252         double * sppv,
00253         double a=1,
00254     double b=1,
00255     double c=1,
00256     double d=1
00257     ){
00258                 sppv[0]= a;
00259                 sppv[1]= b;
00260                 sppv[2]= c;
00261 }
00262 
00263 #endif

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