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

sst/core/techModels/libMcPATbeta/basic_circuit.h

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

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