00001 /* 00002 * circuit_analyzer.h - circuits and transistor capacitance, leakage 00003 * analysis functions. 00004 * Some estimation functions are obtained from CACTI. 00005 * 00006 * This file is a part of the PowerAnalyzer tool suite written by 00007 * Nam Sung Kim as a part of the PowerAnalyzer Project. 00008 * 00009 * The tool suite is currently maintained by Nam Sung Kim. 00010 * 00011 * Copyright (C) 2001 by Nam Sung Kim 00012 * 00013 * This source file is distributed "as is" in the hope that it will be 00014 * useful. The tool set comes with no warranty, and no author or 00015 * distributor accepts any responsibility for the consequences of its 00016 * use. 00017 * 00018 * Everyone is granted permission to copy, modify and redistribute 00019 * this tool set under the following conditions: 00020 * 00021 * This source code is distributed for non-commercial use only. 00022 * Please contact the maintainer for restrictions applying to 00023 * commercial use. 00024 * 00025 * Permission is granted to anyone to make or distribute copies 00026 * of this source code, either as received or modified, in any 00027 * medium, provided that all copyright notices, permission and 00028 * nonwarranty notices are preserved, and that the distributor 00029 * grants the recipient permission for further redistribution as 00030 * permitted by this document. 00031 * 00032 * Permission is granted to distribute this file in compiled 00033 * or executable form under the same conditions that apply for 00034 * source code, provided that either: 00035 * 00036 * A. it is accompanied by the corresponding machine-readable 00037 * source code, 00038 * B. it is accompanied by a written offer, with no time limit, 00039 * to give anyone a machine-readable copy of the corresponding 00040 * source code in return for reimbursement of the cost of 00041 * distribution. This written offer must permit verbatim 00042 * duplication by anyone, or 00043 * C. it is distributed by someone who received only the 00044 * executable form, and is accompanied by a copy of the 00045 * written offer of source code that they received concurrently. 00046 * 00047 * In other words, you are welcome to use, share and improve this 00048 * source file. You are forbidden to forbid anyone else to use, share 00049 * and improve what you give them. 00050 */ 00051 00052 #ifndef CIRCUIT_ANALYZER_H 00053 #define CIRCUIT_ANALYZER_H 00054 00055 /* estimate leakage current 00056 * return in A */ 00057 /* i: current */ 00058 double 00059 estimate_ilekage( 00060 double weff /* in um */); 00061 00062 /* estimate effective leakage capacitance 00063 * return in F */ 00064 double 00065 estimate_lCeff( 00066 double weff, /* in um */ 00067 double opfreq, /* in Hz */ 00068 double opvolt /* in V */); 00069 00070 /* estimate optimal transistor stage ratio for cascade inverter buffer */ 00071 /* b: buffer */ 00072 double 00073 estimate_btr_opt( 00074 unsigned nbstages_opt, /* optimial number of buffer stages */ 00075 double sCeff); 00076 00077 double 00078 estimate_ibufchainiCeff( 00079 double btr_opt, /* optimial buffer stages ratio */ 00080 double sCeff); 00081 00082 /* estimate leakage effective capacitance of the cascaded inverter buffers 00083 * return in F */ 00084 double 00085 estimate_ibufchainlCeff( 00086 unsigned nbstages_opt,/* optimial number of buffer stages */ 00087 double btr_opt, /* optimal buffer transistor stage ratio */ 00088 double opfreq, 00089 double opvolt); 00090 00091 00092 /* Used to communicate with the horowitz model */ 00093 #define RISE 1 00094 #define FALL 0 00095 #define NCH 1 00096 #define PCH 0 00097 00098 /* returns gate capacitance in Farads */ 00099 double gatecap( 00100 double weff, /* gate Weff in um (length is Leff) */ 00101 double wirelength /* poly wire length going to gate in lambda */); 00102 00103 /* returns gate capacitance in Farads */ 00104 double gatecappass( 00105 double weff, /* gate Weff in um (length is Leff) */ 00106 double wirelength /* poly wire length going to gate in lambda */); 00107 00108 /* returns drain cap in Farads */ 00109 double draincap( 00110 double weff, /* um */ 00111 int nchannel, /* whether n or p-channel (boolean) */ 00112 int stack /* number of transistors in series that are on */); 00113 00114 /* returns resistance in ohms */ 00115 double transresswitch( 00116 double weff, /* um */ 00117 int nchannel, /* whether n or p-channel (boolean) */ 00118 int stack /* number of transistors in series */); 00119 00120 /* returns resistance in ohms */ 00121 double transreson( 00122 double weff, /* um */ 00123 int nchannel, /* whether n or p-channel (boolean) */ 00124 int stack /* number of transistors in series */); 00125 00126 /* returns weff in um */ 00127 double restowidth( 00128 double res, /* resistance in ohms */ 00129 int nchannel /* whether N-channel or P-channel */); 00130 00131 double horowitz( 00132 double inputramptime, /* input rise time */ 00133 double tf, /* time constant of gate */ 00134 double vs1, 00135 double vs2, /* threshold voltages */ 00136 int rise /* whether INPUT rise or fall (boolean) */); 00137 #endif /* CIRCUIT_ANALYZER_H */