Cadence SPICE™ Reference Manual Product Version 4.4.2 December 1998 1990-2000 Cadence Design Systems, Inc. All rights reserved. Printed in the United States of America. Cadence Design Systems, Inc., 555 River Oaks Parkway, San Jose, CA 95134, USA Trademarks: Trademarks and service marks of Cadence Design Systems, Inc. (Cadence) contained in this document are attributed to Cadence with the appropriate symbol. For queries regarding Cadence’s trademarks, contact the corporate legal department at the address shown above or call 1-800-862-4522. All other trademarks are the property of their respective holders. Restricted Print Permission: This publication is protected by copyright and any unauthorized use of this publication may violate copyright, trademark, and other laws. Except as specified in this permission statement, this publication may not be copied, reproduced, modified, published, uploaded, posted, transmitted, or distributed in any way, without prior written permission from Cadence. This statement grants you permission to print one (1) hard copy of this publication subject to the following conditions: 1. The publication may be used solely for personal, informational, and noncommercial purposes; 2. The publication may not be modified in any way; 3. Any copy of the publication or portion thereof must include all original copyright, trademark, and other proprietary notices and this permission statement; and 4. Cadence reserves the right to revoke this authorization at any time, and any such use shall be discontinued immediately upon written notice from Cadence. Disclaimer: Information in this publication is subject to change without notice and does not represent a commitment on the part of Cadence. The information contained herein is the proprietary and confidential information of Cadence or its licensors, and is supplied subject to, and may be used only by Cadence’s customer in accordance with, a written agreement between Cadence and its customer. Except as may be explicitly set forth in such agreement, Cadence does not make, and expressly disclaims, any representations or warranties as to the completeness, accuracy or usefulness of the information contained in this document. Cadence does not warrant that use of such information will not infringe any third party rights, nor does Cadence assume any liability for damages or costs of any kind that may result from use of such information. Restricted Rights: Use, duplication, or disclosure by the Government is subject to restrictions as set forth in FAR52.227-14 and DFAR252.227-7013 et seq. or its successor. Cadence SPICE Reference Manual Contents Before You Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 About This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Finding Information in This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Reader’s Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Learning the Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Sources of Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Product Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Related Manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Syntax Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 13 14 15 15 15 15 16 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Cadence SPICE and the Analog Simulation Environment . . . . . . . . . . . . . . . . . . . . . . . . Cadence SPICE Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interrupting the Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File Name Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command Line Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 19 19 20 21 21 22 2 Built-In Variables and Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Built-In Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Built-In Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 December 1998 2 Product Version 4.4.2 Cadence SPICE Reference Manual 3 Expressions and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Numeric Suffixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 39 40 48 4 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . altqual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . c ................................................................. call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . e ................................................................. endloop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . if . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . l .................................................................. loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . usem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Input/Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . December 1998 3 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 76 77 Product Version 4.4.2 Cadence SPICE Reference Manual bread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 bwrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 datime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 datime [.n] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 hlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Circuit Simulation and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 contif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 continue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 continue/trstore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 convrg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 disto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 four . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 keep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 nodset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 sens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 sim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 trans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 trstore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Accessing/Displaying Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 delvar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 equate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 getdis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 getvar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 printvs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 December 1998 4 Product Version 4.4.2 Cadence SPICE Reference Manual probe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . recall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . senstr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . tstore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . hcopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . histo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . oplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . plot3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . spec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . view3d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . werase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . whisto . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . wplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . wscat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . wtext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Plotting in a Tektronix Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 132 134 135 136 137 137 138 139 140 141 142 143 145 146 147 148 149 150 151 153 154 154 5 Circuit Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 DC Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AC Small-Signal Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Noise Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transient Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DC Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fixing Circuit File Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the convrg Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the store and restore Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . December 1998 5 158 158 158 159 159 160 160 161 161 Product Version 4.4.2 Cadence SPICE Reference Manual Forcing Node Voltages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transient Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initial Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using NRAMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transient Analysis Timestep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Local Truncation Error Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Iteration Timestep Control Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulation Control Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables that Affect Transient Internal Timestep . . . . . . . . . . . . . . . . . . . . . . . . . . . Variables that Affect Tolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Readin-Bypass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 164 164 166 167 167 169 170 171 174 174 6 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Circuit Description Format .............................................. Circuit Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resistor Element .................................................. Inductor Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Capacitor Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transformer (Mutual Inductor) Element (Air Core) . . . . . . . . . . . . . . . . . . . . . . . . . . Transmission Line (Lossless) Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resistive (Ideal) Switch Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Voltage and Current Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Independent Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DC Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Piecewise Linear Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Piecewise Linear Voltage Source File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Pulse Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exponential Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sinusoidal Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Single Frequency FM Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DC Current Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Piecewise Linear Current Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Piecewise Linear Current Source File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . December 1998 6 177 178 179 180 182 183 185 186 188 189 190 191 192 194 196 198 200 202 204 205 207 Product Version 4.4.2 Cadence SPICE Reference Manual Pulse Current Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exponential Current Source .......................................... Sinusoidal Current Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Single Frequency FM Current Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multidimensional Polynomial-Dependent Sources . . . . . . . . . . . . . . . . . . . . . . . . . . Voltage-Controlled Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Current-Controlled Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Current-Controlled Current Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Voltage-Controlled Current Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Semiconductor Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Diode Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bipolar Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Silicon-Controlled Rectifier (SCR) Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MOSFET Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BSIM Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GaAs MESFET Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Silicon-on-Insulator (SOI) MOSFET Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . JFET Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Operating Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 211 213 215 217 219 221 223 225 226 228 229 231 233 235 237 239 241 242 7 Command and Model Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243 Command Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sample Command File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Model Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Model File Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example Model File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Temperature Files .................................................... Example Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initialization and Update Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initialization File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Update File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using init.s and update.s Files for Statistical Analysis . . . . . . . . . . . . . . . . . . . . . . . December 1998 7 243 244 246 246 247 248 249 249 250 250 251 251 Product Version 4.4.2 Cadence SPICE Reference Manual 8 Device Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260 Diode Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 Diode Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Diode Model Operating Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Model Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Bipolar Junction Transistor (BJT) Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Modified Gummel-Poon BJT Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 Modified Gummel-Poon BJT Model Operating Point Parameters . . . . . . . . . . . . . . . . . 279 Model Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 DC Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 AC Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 Junction Field-Effect Transistor (JFET) Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 JFET Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 JFET Model Operating Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 Model Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 Level 1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 Level 2 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 Level 3 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 AC Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 Noise Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 Metal-Oxide-Semiconductor Field-Effect Transistor Model (Level 1) . . . . . . . . . . . . . . . 304 MOSFET Model Parameters (Level 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 MOSFET Model Operating Point Parameters (Level 1) . . . . . . . . . . . . . . . . . . . . . . . 308 Model Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 DC Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 Noise Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 Metal-Oxide-Semiconductor Field-Effect Transistor Model (Levels 2 (MOS2) and 3 (MOS3)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 MOSFET Model Parameters (Levels 2 and 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 MOSFET Model Operating Point Parameters (Levels 2 and 3) . . . . . . . . . . . . . . . . . . . 320 MOSFET Model Operating Point Parameters (Charge Conserving Capacitance Option Level 3 Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 Model Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 Parameters and Models Common to Levels 2 and 3 . . . . . . . . . . . . . . . . . . . . . . . . 321 December 1998 8 Product Version 4.4.2 Cadence SPICE Reference Manual DC Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Extrinsic AC Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parameters and Models Unique to Level 2 (MOS2) . . . . . . . . . . . . . . . . . . . . . . . . . Parameters and Models Unique to Level 3 (MOS3) . . . . . . . . . . . . . . . . . . . . . . . . . Temperature Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Breakdown Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modified Level 3 (Berkeley MOS3) MOSFET Model . . . . . . . . . . . . . . . . . . . . . . . . . . . Additional Model Parameters To Enable Level3+ / MOS3+ Equations . . . . . . . . . . . Equation Modifications (Level-3+ / MOS3+) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Berkeley Short-Channel IGFET Model (BSIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BSIM Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BSIM Model Operating Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Model Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Length/Width Sensitivity Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DC Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AC Model Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Temperature Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GaAs MESFET Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GaAs MESFET Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . GaAs MESFET Model Operating Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . Model Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Silicon Controlled Rectifier (SCR) Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SCR Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SCR Model Operating Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Model Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Silicon-on-Insulator (SOI) MOSFET Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SOI MOSFET Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SOI MOSFET Model Operating Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Model Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . December 1998 9 322 325 328 333 336 337 337 338 339 341 342 345 346 346 347 351 356 356 358 360 362 370 372 375 377 379 381 383 386 Product Version 4.4.2 Cadence SPICE Reference Manual References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 9 Subcircuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 Data File Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 Sample Subcircuit File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 10 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 Resistor and Capacitor Sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Resistor Sweep ................................................... Capacitor Sweep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Differential Pair ...................................................... Simple Op Amp Macromodel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File: BJTOP.S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . December 1998 10 405 406 407 408 411 413 Product Version 4.4.2 Cadence SPICE Reference Manual Nonlinear Capacitor Macromodel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 Nonlinear Inductor Macromodel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 A Monte Carlo Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 B STATF: Correlated Random Number Generator . . . . . . . . . . . . . 425 C Fourier Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428 D Cadence SPICE Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 E Node Referencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Restrictions and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 432 433 435 F User-Defined Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 Customizing the Cadence SPICE Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 Using Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440 G User-Defined FORTRAN Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 December 1998 11 Product Version 4.4.2 Cadence SPICE Reference Manual Using FORTRAN Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 H User-Defined Controlled Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 Using Controlled Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450 I Mixed-Signal Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Starting the Control Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Primitive Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .A2D/.D2A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459 459 461 461 463 464 J Quick Command Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 Index.............................................................................................................................. 473 December 1998 12 Product Version 4.4.2 Cadence SPICE Reference Manual Before You Start ■ About This Manual ❑ Finding Information in This Manual ❑ Reader’s Input ■ Learning the Basics ■ Other Sources of Information ■ ❑ Product Installation ❑ Related Manuals Syntax Conventions About This Manual This manual is for developers and designers of integrated circuits. It contains reference information about the Cadence SPICE™ interactive circuit simulator. You can use Cadence SPICE as a standalone application or within the Analog Simulation Environment of the Analog Artist™ Electrical Design System. Finding Information in This Manual The following table summarizes the topics covered in this manual. For information about . . . Read . . . Getting started with SPICE Chapter 1, “Introduction” The built-in variables and arrays in Cadence SPICE Chapter 2, “Built-in Variables and Arrays” Using expressions and built-in functions in Cadence SPICE Chapter 3, “Expressions and Functions” December 1998 13 Product Version 4.4.2 Cadence SPICE Reference Manual Before You Start For information about . . . Read . . . Specific commands Chapter 4, “Commands” AC, DC, transient, and noise analysis Chapter 5, “Circuit Analysis” Achieving convergence Chapter 5, “Circuit Analysis” Component models (source, element, device) and their properties and netlist format Chapter 6, “Components” Setting variables, defining functions, and assigning values to model parameters Chapter 7, “Command and Model Files” Temperature models Chapter 7, “Command and Model Files” Device parameters and associated equations Chapter 8, “Device Models” Creating and accessing subcircuits Chapter 9, “Subcircuits” Examples of Cadence SPICE input and output files Chapter 10, “Examples” Monte Carlo Analysis Appendix A STATF (a correlated random number generator) Appendix B Fourier Analysis Appendix C Cadence SPICE Limits Appendix D Node Referencing Appendix E User-Defined Subroutines Appendix F FORTRAN Functions Appendix G Controlled Sources Appendix H Mixed-Signal Simulation Appendix I Quick Command Reference Appendix J Reader’s Input Please fill out the Reader’s Profile . It is important for us to know about your background and the job you do. If you want to report errors or suggest improvements to us, please fill out the Reader’s Critique . December 1998 14 Product Version 4.4.2 Cadence SPICE Reference Manual Before You Start Learning the Basics Before you begin using Cadence SPICE, you should be familiar with the Design Framework II™ environment. The Design Framework II Help shows you how to ■ Start the Cadence software ■ Get around in the Cadence software ■ Get help on a command ■ Use the mouse ■ Use menus ■ Use standard and options forms ■ Start a design session Other Sources of Information For more information about Cadence SPICE and other related products, you can consult the sources listed below. Product Installation The Cadence Installation Guide tells you how to install the product. Related Manuals If you run Cadence SPICE within the Analog Artist Simulation Environment, you might want to consult the following: ■ Analog Artist Simulation Help ■ Analog Artist Mixed-Signal Simulation Help ■ Analog Artist Design Example: Mixed-Signal Simulation December 1998 15 Product Version 4.4.2 Cadence SPICE Reference Manual Before You Start Syntax Conventions The following are the syntax conventions for Cadence SPICE commands. literal Bold words are keywords that you must enter literally. These keywords represent command (function, routine) or option names. <argument> Angle brackets surround command modifiers or arguments that you supply. They also surround optional input variables for the Cadence SPICE input netlists. argument Words in plain typewriter font are arguments you define. You must substitute names or values for the arguments. | Vertical bars (OR-bars) separate possible choices for a single argument. They take precedence over any other character. [ ] Brackets denote optional arguments. When used with OR-bars, they enclose a list of choices from which you can choose one. { } Braces are used with OR-bars and enclose a list of choices from which you must choose one. ... Three dots indicate that you can repeat the previous argument. If they are used with brackets, you can specify zero or more arguments. If they are used without brackets, you need to specify at least one argument, but you can specify more. argument... specify at least one, but more are possible [argument]...you can specify zero or more ,... A comma and three dots together indicate that if you specify more than one argument, you must separate those arguments by commas. ⇒ A right arrow precedes the possible values that can be returned by a SKILL function. This character is created with a special symbol font in the publishing tool. It is represented in ASCII with an equal sign and a greater than sign (=>). December 1998 16 Product Version 4.4.2 Cadence SPICE Reference Manual Before You Start A slash separates the possible values that can be returned by a SKILL function. / Important Any characters not included in the list above are required by the language and must be entered literally. December 1998 17 Product Version 4.4.2 Cadence SPICE Reference Manual 1 Introduction ■ Cadence SPICE and the Analog Simulation Environment ■ Cadence SPICE Basics ❑ Before You Begin ❑ Starting the Program ❑ Interrupting the Program ❑ File Name Conventions ❑ Command Line Conventions Cadence SPICE and the Analog Simulation Environment The Cadence SPICE circuit simulator is an interactive circuit simulator based on the University of California, Berkeley, SPICE2 program. It has a modified architecture for interactive operation, plus enhancements that automatically improve convergence with problem circuits. You can use the Cadence SPICE program within the Analog Simulation Environment of the Analog Artist Electrical Design System or as a standalone simulator. This manual contains information to help you simulate an integrated circuit using the Cadence SPICE interactive simulator. December 1998 18 Product Version 4.4.2 Cadence SPICE Reference Manual Introduction The following figure shows the relationship of the Cadence SPICE program to other analog design tools. All tools are integrated through the Cadence Design Framework II™ architecture, which uses a common database to store and recall design data. Analog Artist Design Flow Overlay Design Entry Analog Libraries Library Development Optimization Statistics Mixed-Signal, Interactive Simulation Environment Cadence SPICE Waveform Display System MixedSignal P&R WATSCAD Symbolic Layout and Compactio Spectre Verilog ThirdParty Parasitic Backannotation Switched Capacitor Filter Synthesis Analog Microwave Interactive Physical Design Verification Tools PCB Interface Cadence Design Framework II Cadence SPICE Basics Before You Begin You can, if you wish, set the following variables in the UNIX® environment before you start the Cadence SPICE software. CDSSPICE_DIR – Directory from which .cdsSpicerc is read. Defaults to the home directory. CDS_TMP_DIR – Directory in which Cadence SPICE software puts its temporary (tmp.SLXXXX) files. Defaults to /tmp. You can create a file in your home directory called .cdsSpicerc, which contains Cadence SPICE commands. Every time you start Cadence SPICE, the program automatically reads this file once. This file can contain information that you want to use each time you run Cadence SPICE, such as a variable that you want set every time. You can also add a print December 1998 19 Product Version 4.4.2 Cadence SPICE Reference Manual Introduction statement to your .cdsSpicerc file as a reminder that you have a particular variable set, in case you later change to a design that no longer requires that variable. For example: set morbkp=.01 print "value of morpkp has been changed in my .cdsSpicerc to" morbkp Readin-Bypass Capability The /tmp/tmp.SLM6XXXXX file contains the “SPICE deck” that is sent to the simulator. The simulator updates this file when the netlist or analysischanges. XXXXX is the one to five-digit UNIX process ID. In the interests of speed and efficiency, however, Cadence SPICE has a “readin-bypass” capability that lets the simulator skip the potentially lengthy netlist read in, error check, and matrix setup if only a parameter, element/device/model value, or option card parameter changes. With readin-bypass turned on, the simulator does not update the file; it just places the new parameters in the proper locations in the simulator and begins the analysis. To display the values of the parameters and option card parameters, use the display param * or display uparam * commands (refer to the “Commands” chapter). To turn off readin-bypass, set go2off=1. (If you turn off readin-bypass, you increase simulation time.) Starting the Program The name cdsSpice is often used in the software and refers to the Cadence SPICE program. To start the Cadence SPICE program on a UNIX Workstation, type the following command: cdsSpice [-s###] [-S###] [<inname] [>outname] -s### December 1998 Invokes a memory manager of size ### (default is 200). This memory manager stores functions, arrays, variables, macros, and (if you use KEEP ALL) node names and all data points from the computed nodes/currents. The program multiplies the size by 1000, which means that a size of 200 gives 200,000 double precision words. If you set the size too large, your machine might not have enough memory to run the program, resulting in an error message. Increase the value if you see either of these error messages: 20 Product Version 4.4.2 Cadence SPICE Reference Manual Introduction ERROR - THERE IS NOT ENOUGH FREE SPACE TO EXTEND ARRAY XXX IN THE MEMORY MANAGER. TRY USING THE -S OPTION WHEN INVOKING THE PROGRAM IF MORE MEMORY IS NEEDED ERROR - THE MEMORY MANAGER THAT READS IN THE DATA TO PLOT HAS RUN OUT OF MEMORY. RESTART CDSSPICE WITH THE -s OPTION. -S### Invokes a SPICE memory manager with a size of ### (default is 600). The program multiplies the size by 1000. This memory manager contains all of the SPICE data. Increase the size of this memory manager if you see this error message: ERROR: MEMORY NEEDS EXCEED XXX ICORE = YYY ALL AVAILABLE SPICE MEMORY HAS BEEN USED inname If you use this variable, the system reads and executes all Cadence SPICE commands from the inname file. The Cadence SPICE session terminates after all commands execute. outname If you use this variable, the system directs output to the outname file. Otherwise, output is directed to the terminal. The simulation environment stores the commands sent to Cadence SPICE in the /tmp/ artist.log file for the Analog Artist Electrical Design System version 2.x and the /tmp/ cdsSpiceX file for version 4.x., where the X in the log file name is the window number at the top of the Simulation Window. Interrupting the Program Type Control-c to do a soft interrupt of the simulation and return to the Cadence SPICE command mode. File Name Conventions For file maintenance, the following conventions are used for naming files. A dot (.) and a letter are appended to these file names: file.c Circuit description file (also known as netlist file) file.s Command file (for commands such as setting variables) These .s files are also used for subcircuit files. December 1998 21 Product Version 4.4.2 Cadence SPICE Reference Manual Introduction file.m Device model file (A .m file can contain as many .MODEL statements as you need.) file.f Function file used during sim (contains functions) Note: The recommended configuration for the cdsSpice files is that the language commands reside in a separate .s file, the circuit description in a .c file, the model files in the .m file, and the subcircuits in a .s file. However, you can put the circuit description, the model files, and the subcircuits together in a single .c file. When you use one of these names in a command, specify only the file part, without the extension. Use the entire name at the system level. You can use uppercase and lowercase file names. The system looks first for a file name in which the extension (.c, .s, .m or .f ) has the same case as the first letter of the file name. If not found, the system looks for a file name in which the extension does not have the same case as the first letter of the file name. Command Line Conventions The following rules govern the syntax of Cadence SPICE commands: ■ All input commands are free format. ■ The only valid delimiter between arguments on a command line is one or more blanks. ■ Commas (,) are not valid delimiters (see above), and you cannot embed them in a number. For example, 10,000 is not valid, but 10000 and 10k are valid. ■ Embedded blanks are allowed only where indicated in the command syntax. ■ Do not use a delimiter between a parameter and its value. For example, PARAMETER=0.0 is correct; PARAMETER = 0.0 is not. ■ Do not use tabs in any of the Cadence SPICE files. ■ You can continue command lines onto the next line by placing an ampersand (&) as the last character on the command line. ■ A command line that contains an asterisk (*) in column one is a comment line and is ignored. A pound sign (#) also indicates a comment, but you can use it anywhere on the line, not just in column one. Anything after a # is ignored, unless the # is prefaced by a backslash (\). ■ A backslash (\) indicates that the special meaning is removed from the character following the backslash. December 1998 22 Product Version 4.4.2 Cadence SPICE Reference Manual 2 Built-In Variables and Arrays ■ Built-In Variables ❑ ■ Built-In Arrays Example Built-In Variables The Cadence SPICE variables defined in this chapter have specific meanings and should be used only as defined. Do not alter values for variables marked by an asterisk (*). You can set unmarked variables with the set command. (Refer to the “Commands” chapter.) The variables are divided into three groups: ■ Variables particular to the cdsSpice SPICE simulator, indicated in the table below by an “S” ■ Variables particular to the cdsSpice language, indicated in the table below by a “C” ■ Graphic variables, indicated in the table below by a “G” When you start the Cadence SPICE software, the program assigns the initial values provided in the variable list that follows (except those indicated as “not set”). Built-In Variables Variable name ABSTOL December 1998 Description Initial value Group The absolute current error tolerance for the simulation. 1E-12 S 23 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group ARTSTR The default store/restore file format (ARTSTR=0) 0 prints the node voltages and the voltage source currents. This file format is useful if the netlist does not change, as, for example, between Monte Carlo runs. The alternate format (ARTSTR=1) prints the node-voltage pair, and is useful when renetlisting in the Analog simulation environment or when you make minor topological changes to the circuit. S AVSTEP Used in the timestep calculation. .33 S 1.0 If equal to 1, the plot axes are drawn for the wplot and oplot commands. If equal to 0, the axes are not drawn. This allows for faster plots when there is more than one[209z curve. If YMIN=0, YMAX=0, XMIN=0, XMAX=0, the axes are drawn, regardless of the value of AXES. G The maximum time step is based on a combination of the minimum time constant and the average of all time constants. AVSTEP specifies what fraction of the average is used. AVSTEP=0 is equivalent to SPICE2G, which uses only the minimum time constant. Although this setting might be the most accurate, it can cause increased simulation time and occasionally internal timestep size problems. AVSTEP=.33, the default, is compatible with older versions of cdsSpice. If only a very small part of the circuit is active, this default can cause some inaccuracies if the average of the latent nodes swamps the primary time constant of the active portion of the circuit. In such cases, use a smaller value such as AVSTEP=.01. The maximum allowable AVSTEP value of 1 only uses the average of all time constants to determine the timestep. This is the most inaccurate setting, Use it only with caution. AXES December 1998 24 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group BEGSIM The sim file is read from the screen rather than from a file. When the file is complete you must enter ENDSIM, which resets BEGSIM to 0. 0 C *BOLTZ Boltzmann’s constant. 1.38053E-23 C BREAK If set, interrupts a transient analysis at the specified value. Not set S CHARGE Coulomb charge on an electron. 1.602E-19 C CHGTOL Charge tolerance of the simulation. 1.0E-14 S CNVREV Selects the DC convergence algorithm. Values 2.4 of 2.4 or greater select the default algorithm. Values of 2.3 or less select a different algorithm. Changing the value of this variable is discouraged. When you query this variable with the display param * command, the value returned is the current Cadence SPICE version number. S * DATE Gives the date in the format: MMDDYY.0 C DCOPPT If equal to 0, suppresses the DC operating point 1.0 solution when initial conditions are specified. S DCSAT The system provides saturation/linear 0 information only when it reaches this DC value in a DC transfer-curve analysis. For example, if DCSAT=0 (default), and you issue SWEEP VIN FROM 5 to -5 by -1, the system tells you whether a device is in the saturation/linear region only after the DC value is less than or equal to 0. (In this example, the system provides no information from 5V to 1V for DCSAT=0.) S DELMAX 0 If not equal to zero, the Cadence SPICE software uses the specified value as the maximum internal transient analysis timestep. If equal to 0, uses an internal timestep of TSTOP/ 50.0, where TSTOP is the final sweep time point. S December 1998 25 Date when user signed in Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group DIVDIF If set to 1, Cadence SPICE invokes the timestep 0 determination method used in SPICE2G.6. S DOACCT Prints the run-time statistics for some simulators 0 in the SPICE socket. The default (0) is not to print the statistics. C ECHO If equal to 0, the terminal does not echo 0 commands. If equal to 1, the terminal echoes command lines as they are read. If equal to 2, the terminal echoes only those lines evaluated during a go. If equal to 4, the Cadence SPICE prompt is turned off. C ENGNOTE If not equal to zero, prints plot variables in 0 engineering notation exponent is a power of 3). If 0, prints plot variables in ordinary exponential (G field) notation. G * EPPO Permittivity of free space. 8.854E-12 F/C C FREQ Frequency variable for AC analysis. Not set C FFTFLOOR Plots an FFT phase component as 0.0 if the -1 corresponding FFT magnitude is less than the value of FFTFLOOR. Setting FFTFLOOR to the typical value of 5e-7 eliminates most of the random FFT phases of 180 degrees that occur for very small magnitude components. Setting FFTFLOOR to a negative value turns off this automatic phase zeroing. C GMIN The minimum conductance used by the 1.0E-12 Cadence SPICE software. Note: When simulating circuits with small operating currents (<1E-12), decrease GMIN to ~1E-15 to prevent relatively large leakage currents and corresponding accuracy loss. In BSIM model (“Device Models” chapter), use LEAK parameter to decrease effect of GMIN S December 1998 26 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group GMINON A possible convergence aid to make the circuit 2 more inear. GMINON=0 adds resistances from every node to ground that is less than GMIN. GMINON=1 adds resistances from every node to ground. GMINON=2 adds resistances from every node to ground and in parallel to each semiconductor junction. GMINON=3 adds resistances in parallel to each semiconductor junction. S GO2OFF If not equal to zero, the Cadence SPICE program 0 is executed with normal READIN and SETUP phases. If equal to zero, the READIN and SETUP phases are bypassed if appropriate. If you use this variable, set it before you enter the first go command. Use of this variable is not recommended because it slows the simulation process. S GRTEXT Specifies the graphics text displayed on plots. 0-No text 1-All text 2-Title only 3-Time stamp only 1 G GSAVE For use with Monte Carlo analysis. If not equal to 0 zero, resets the 20 Gaussian seeds to their original values before the next go. If equal to zero, updates the seeds for each go. Note: Following a simulation with GSAVE=1, reset GSAVE to 0 to update the seeds again. C * INDEX Internal pass counter for loop, oplot, plot, and Not set wplot commands. Only valid for innermost loop. See the examples of INDEX used with the loop and plot commands in the “Commands” chapter. C INTTIM If set to 1, invokes the algorithm used to solve the problem indicated by the error message “INTERNAL TIMESTEP TOO SMALL.” 0 S ITL1 Sets the DC iteration limit. 100 S December 1998 27 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group ITL2 Sets the DC transfer curve iteration limit. 100 S ITL3 Sets the lower transient analysis limit. Used if LVLTIM=1. 4 S ITL4 Sets the transient analysis timepoint iteration limit. Used if LVLTIM=1. 25 S ITL5 Sets the transient analysis timepoint iteration limit. 999999 S LGFILE If not equal to zero, echoes all commands to your log file. If equal to zero, does not generate log file. 0 C Note: When inside a loop and LGFILE=1, echoes the commands inside the loop before executing them. LVLTIM If equal to 1, uses iteration timestep control. If equal to 2, uses truncation error timestep control. 2 S MAXORD When METHOD=2, sets MAXORD to the maximum integration order to be used.Valid values range from 2 through 6. 2 S METHOD If not equal to 2, uses trapezoidal integration. If equal to 2, uses variable order Gear integration. 1 S MFNOIS If set to 0, the program uses the default Cadence 0 SPICE MOSFET noise model for flicker noise. If set to 1, L*W in the model equation denominator is replaced by L2. If set to 2, the program uses a different flicker noise model. Refer to the “Device Models” chapter for more information. S December 1998 28 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group MKS Allows input of MOS device and model variables 1 in units compatible with SPICE2G.6. When MKS is set to 1, the Cadence SPICE program follows the SPICE2G format for device and model variable units. When MKS is set to 0, the Cadence SPICE program follows the SPICE2D format (CGS). S MONTE 0 If not equal to zero, invokes Monte Carlo analysis when using GAUSS, TRACK, and STATF functions. If 0, Monte Carlo method is not invoked, and GAUSS, TRACK, and STATF output the mean values. C MORBKP Increases accuracy during a transient analysis 0.1 by potentially adding more breakpoints to the breakpoint table. SPICE adds a breakpoint to the table if it is within MORBKP*TSTEP of another breakpoint. For example, if you set MORBKP to 0.001, the system might add more breakpoints to the table, which increases accuracy but can slow the program. S NBINS 5 Number of bins used for plotting histograms (histo and whisto commands). The maximum for whisto is 101. There is no limit for histo. G NIDENT Number of plot identifiers (rectangles, triangles) 5 per waveform for the oplot and wplot commands. A negative value plots the waveform before the axis. G *NKEEPI Number of element currents on the keep list. 0 C *NKEEPV Number of node voltages on the keep list. 0 C *NNODES Number of circuit nodes. Not set C December 1998 29 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group NODCHR If NODCHR=0, node numbers can be character 0 strings and node mapping is used. If NODCHR=1, nodes can only be integers and node mapping is not used. If you set NODCHR, you must set it before you use the SIM command. Once you set NODCHR, it must remain set until the next SIM. C NOGO If the Cadence SPICE program encounters an 0 error during simulation that causes it to abort, NOGO sets to 1. It resets to 0 on the next go. Useful for checking for successful completion of a simulation. C NOGO=2 indicates the analysis stopped due to a transient continue or contif command. Data is available for plotting or printing. NOGO=3 indicates a Cadence SPICE error occurred, but there is still data to plot or print. NOGO=4 indicates the analysis stopped due to the “NO CONVERGENCE IN DC ANALYSIS” error. NOGO=5 indicates the analysis stopped due to the “INTERNAL TIMESTEP TOO SMALL” error. Data up to this point can be printed or plotted. NOWARN Suppresses some of the SPICE warning messages. You should set NOWARN to 0 for all initial designs, so that you do not miss any important messages. Some messages do not print when you set NOWARN to 1 (off). 0 S NRAMP If not set to zero, transient pre-analysis mode is 0 enabled, and NRAMP is the ratio of total sweep time to rise time. NRAMP is further discussed in the “Circuit Analysis” chapter. S NSETN Number of nodes initialized. C December 1998 0 30 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group NSIG Number of significant figures printed when using 4 printvs and plot commands G *NSWEEP Number of uninterpolated (raw data) points. Not set C *NUSUBS Number of user-defined subroutines linked by sload. Does not include user-defined functions. Not set C *PI The constant pi. 3.1415926 C PRNOTE Specifies notation used by the PRINT command: 1 1 – Normal Cadence SPICE notation 2 – Scientific notation 3 – Engineering notation G PSFFLG Controls creation of the PSF data files. 0 S 80.0 G 0 – No PSF files are created. Use this value when you run the program standalone or under Analog Artist 2.X. 1 – PSF files are created. Analog Artist 4.X versions set PSFFLG=1 automatically. The data is not automatically read into the cdsSpice Memory Manager (-s command line flag). Use get to read the data back into memory to do postprocessing. 2 – PSF files are created. To use Cadence SPICE and Analog Artist 4.3.2 postprocessing capabilities, enter the cdsspice command in the Simulation Window. PWIDTH Paper width. QADLIN Type of interpolation that printvs applies to data 0 points. This variable does not affect the output of plot QADLIN=0 Linear interpolation QADLIN=1 Quadratic interpolation In the Artist environment, and whenever you use vpfuncs.s, Vm() and Vp() are always linear. C RELTOL Relative error tolerance for the simulation. S December 1998 31 1.0E-03 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group *REV Current revision of the Cadence SPICE software. 4.n C RON The resistor value used in the nodset command 1.0 ohm to realize the Norton equivalent of a voltage source. RON can also be used as a convergence aid. See the “Forcing Node Voltages” section of the “Circuit Analysis” chapter. S SAM Determines the statistical analysis model (SAM) 0 mode of operation when using Cadence SPICE software customized with SAM geometrydependent device models. Five modes are available: SAM=0Mean parameters SAM=1 Deterministic parameters SAM=2 Correlated random parameters SAM=3 Deterministic with mismatch SAM=4 Correlated random with mismatch C SAMPRB Used with SAM options 1 and 3. If less than 0.0, -1.0 does not calculate probability of finding a deterministic set of correlated model parameters more extreme than presently given. If 0.0 or greater, calculates probability and prints to screen. C SCALE Scales the geometry-dependent properties of 1.D0 the MOSFET device. When SCALE equals 1.D0 (default), it has no effect. SCALE applies only to MOSFETs, and scales the following MOSFET device properties: L=L*SCALE W=W*SCALE AS=AS*SCALE*SCALE PD=PD*SCALE PS=PS*SCALE LD=LD*SCALE LS=LS*SCALE S December 1998 32 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group SCALEM Scales the geometry-dependent model 1.D0 parameters of the MOSFET model. When SCALEM equals 1.D0, (default), it has no effect. SCALEM applies only to MOSFETs, and scales the following MOSFET model parameters: LDD=LDD*SCALE LDS=LDS*SCALE LD=LD*SCALE SEEDUP Used for Monte Carlo analysis. If not equal to zero, the 20 Monte Carlo seeds will not be updated after a go command. SINWAV Limits the transient timestep to improve accuracy 1.E6 of circuits with only SIN input sources. If not set, and the circuit contains no energy-storage elements and no input sources other than SIN, the system sets SINWAV to the smallest (1/freq)/ 8 value of all the input source sine waves. Otherwise, SINWAV is 1.E6 and does not affect the timestep. If you require greater accuracy, set SINWAV to a small value such as (1/freq)/n, where n is less than 8. When you set SINWAV in this way, its effect is similar to that of DELMAX. S SPICE2G SPICE2G.G has several modeling bugs, some of 0 which have been fixed in Cadence SPICE. To run without the bugs, set SPICE2G to 0 (default). To use the original SPICE2G equations, set SPICE2G to 1. S SPMESS If not set to zero, prints the following messages 0 to the screen when appropriate: “SPICE2 EXECUTION,” “SPICE2 FINISHED,” “RESTORE BEING DONE FROM file name,” and “STORING NODE VOLTAGES IN FILE file name.” If set to zero, does not print the messages. C December 1998 33 0 S C Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group SPTEMP When set to 1, the program uses SPICE2G 1 temperature analysis. When SPTEMP is set to 0, you must supply your own temperature equations to do temperature analysis. S SPTIME If not equal to zero, sends (prints) information at 0 each AC or DC sweep point. For transient analysis, the value of the variable specifies the time interval at which the information is printed. If the keep all command is not used, the voltages of the first two nodes (or the first two currents) on the keep list are also printed for a transient, DC, or AC analysis. If SPTIME is set to -5, prints every fifth iteration in the Newton loop. S SSAVE If not equal to zero, the STATF seed is reset to its 0 original value before the next go. If equal to zero, the seed is updated as usual. (See the “STATF: Correlated Random Number Generator” appendix). This variable also controls the seed used to find correlated random numbers (SAM options 2 and 4). S *STARTIME Elapsed CPU time in seconds from login to when Not set you invoke the Cadence SPICE program C TEMPDC 25.0 The temperature (in degrees C) at which the circuit is simulated. Setting TEMPDC creates a .TEMP T1 card in the “SPICE deck,” where T1 is the value of TEMPDC. S TIME Time variable for transient analysis. 0.0 C TIMSAT The system provides saturation/linear 0.0 information only when it reaches this timepoint in a transient analysis. For example, if TIMSAT=20N, and the device saturates at 5N, you receive information only after 20N. S December 1998 34 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group TINIT Initial timestep for transient analysis. If you do Not set not set it, the Cadence SPICE program sets it to TSTEP/10 where TSTEP is the increment specified in the sweep command. S TNOM Nominal temperature (in degrees C). S TRLIM If set to 1, helps increase accuracy in a transient 0.0 analysis. In some cases, helps to avoid “INTERNAL TIMESTEP TOO SMALL.” S TRTOL 7.0 Transient error tolerance. This variable is an estimate of the factor by which Cadence SPICE overestimates the actual truncation error. Only used when LVLTIM=2 (default). S TSAVE If not equal to zero, the TRACK seed is reset to its original value prior to the next go. If equal to zero, the seed is updated as usual. C TTYPE This parameter specifies what type of terminal Not set you are using. TTYPE must be set in order to use some of the graphics commands. If TTYPE is not set when the command is initiated, you are prompted to enter the terminal type. The TTYPE values and terminal types they represent are as follows: 1 = Tektronix 4010 2 = Tektronix 4027 3 = HP 7220 4 = HP 2648A 5 = VT125 6 = VT240 7 = RAM 6000 8 = dumb terminal, 80 columns 9 = dumb terminal, 132 columns 10 = Tektronix 4662 11 = MCX (Masscomp) 12 = Tekwindow 13 = pic December 1998 35 25.0 0.0 G Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group TWOPI The constant 2*pi. 6.2831853 C UIC If set to 1, the initial conditions specified on the device or element cards are used. 0.0 S VBCSAT BJT saturation variable. If the internal VBC is greater than VBCSAT and VBE is greater than VBESAT, the BJT is considered saturated. The SAT flag displayed in the output of the probe op Q* command indicates the saturation condition. Refer to the probe op command description. 0.15 S VBESAT See VBCSAT description. 0.6 S VCESAT BJT Internal Collector to Emitter voltage flag 0.0 which overrides the VBESAT/VBCSAT flag information in Probe Op output (SAT). In this case, the SAT flag indicates that the internal Vbe sand Vbc are greater than zero and the internal Vce is less than the VCESAT value that has been set (NON-ZERO). S VNTOL The absolute voltage error tolerance for the simulation. 1.0E-6 S *VT The constant BOLTZ*298/CHARGE. Not a function of temperature. 2.568E-02 C WRFLAG If not equal to zero, Cadence SPICE execution 0 information is echoed to the screen (or output file specified when invoking the Cadence SPICE program). If equal to zero, this information is not echoed.Useful for locating circuit file errors. XMAX The maximum X-plot limit, used for all plot commands except plot. If XMIN and XMAX are both 0.0, the program generates its own limits. 0/0 G XMIN The minimum X-plot limit, used for all plot commands except plot. If XMIN and XMAX are both 0.0, the program generates its own limits. 0.0 G December 1998 36 S Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Variables, continued Variable name Description Initial value Group YLIM If not equal to zero, forces all Y-variables to the same plot limits (used only if Y-variables are all log or are all non-log). If equal to 0.0, each Yvariable has its own Y-axis plot. 1.0 G YMAX The maximum Y-plot limit. If YMIN and YMAX are both 0.0, the program generates its own limits. 0.0 G YMIN The minimum Y-plot limit. If YMIN and YMAX are 0.0 both 0.0, the program generates its own limits. G Built-In Arrays The arrays described below are built into the Cadence SPICE program. Do not use these array names in any other context than as described. The Cadence SPICE program uses arrays marked with an asterisk (*) internally; if you redefine them, your program might abort. Built-In Arrays Array Name Description *keeplist(n) Contains the n nodes kept with the keep command. seed(22) Contains 22 odd integers used as seeds for the GAUSS, TRACK, and STATF functions. The first 20 elements are used for both GAUSS and TRACK, and for SAM options 3 and 4 for mismatch. The 21st element is used for TRACK; and the 22nd element is used for STATF, and for SAM options 2 and 4. (See the “Monte Carlo Analysis” and the “STATF: Correlated Random Number Generator” appendices.) *sweepvar(NSWEEP) Contains uninterpolated (raw) sweep values. There are NSWEEP values in sweepvar. December 1998 37 Product Version 4.4.2 Cadence SPICE Reference Manual Built-In Variables and Arrays Built-In Arrays, continued Array Name Description *valueary(NSWEEP,VALUARYP) Contains the kept node voltage values as a function of sweepvar. The values in valueary are uninterpolated (raw) data from the Cadence SPICE program. There are NSWEEP points in valueary. Example Circuit file ckt.c has node 3 that increases in value as time is swept. sim ckt keep 3 sweep time from 0 to 10 by 1 go Find time when node 3 is greater than a value (vthres) you specify. set vthres=2 loop x from 1 to nsweep set nvalue = valueary(x,find(3,keeplist(1),nkeepv)) if nvalue > = vthres then break endloop print "time=" sweepvar(x) December 1998 38 Product Version 4.4.2 Cadence SPICE Reference Manual 3 Expressions and Functions ■ Introduction ■ Expressions ■ Functions ■ Numeric Suffixes Introduction You can define component properties as user variables or as expressions. Expressions can consist of any mix of constants, user variables, inherited properties, or some predefined functions (see the “Functions” section). You can also define your own functions. Expressions An expression can be a single variable or a combination of variables. For example, you can define the value of a resistor r by a variable r1. Or, you can define it by an equation such as (r1*r2)/(r1+r2). In each case, r1 and r2 are user-defined variables. The following conventions apply: ■ Expressions follow the FORTRAN rules for operator precedence and parentheses (innermost parentheses solved first). Valid operators are listed in order of decreasing precedence (highest precedence is 1). Precedence Operator Meaning Arithmetic Operators 1 ** Exponentiation 2 * Multiplication December 1998 39 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions Precedence Operator Meaning 2 / Division 3 + Addition 3 - Subtraction Relational Operators 4 <= Less Than or Equal To 4 <> Not Equal To 4 < Less Than 4 >= Greater Than or Equal To 4 > Greater Than 4 = Equal To 5 !- Logical Not 5 !* Logical And 5 !+ Logical Or ■ Relational operators return a value of 0 for false and 1 for true. You can then use these relational operators in any other arithmetic or logic operation. set c=(a>=b)*10+(a<b)*20 ■ Any nonzero value is true, while 0 is false. However, the logical operators still produce 1 and 0 for true and false. Thus !-2.0 is 0 and 1.0!*2.0 is 1. ■ Variable (or parameter) names must begin with a letter and contain a maximum of seven additional alphanumeric characters. ■ The program considers all variables to be real floating-point variables; the FORTRAN IJ-K-L-M-N convention for integer variables or functions is not used. ■ Embedded blanks are not allowed in expressions or on either side of the equals sign (=). Functions Within an expression you can assign FORTRAN-like functions. Functions are either user defined or built in. You can write user-defined functions into a file to include with the netlist at netlist time. This is one of the netlisting options. December 1998 40 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions You define your own function in the init.s file by declaring it with the keyword FUNCTION, as shown in the following example: FUNCTION func(var1)=var1**2 Refer to the “Command and Model Files” chapter for additional examples of user-defined functions. The following pages list the built-in functions in alphabetical order. Use functions marked with an asterisk (*) only if you kept the node voltage or voltage source current for display. Function Definition ABS(x) Returns the absolute value of x. ACOS(x) Returns the arccosine of x. ARGCNT(dummy) Returns the number of arguments passed to the current use level. You must pass a dummy argument, although the function does not use it. ASIN(x) Returns the arcsine of x. ATAN(x) Returns the arctangent of x. ATABLE(xxx,x(i),y(j),npoint) Defines a piecewise-linear relationship of the elements of arbitrary arrays y( ) versus x( ), starting at the jth and ith elements (usually 1), in that order. The independent variable, xxx, is the x-value at which an interpolated yvalue is returned. If the point that you request is not in the table, the program obtains the result by linear extrapolation. The number of points in the description is npoint. Warning:npoint ≤ (nelx-i+1) npoint ≤ (nely-j+1) where the dimensions of the x( ) and y( ) arrays are nely and nelx. For example: set a=atable (5,x(1),y(1),24) December 1998 41 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions Function Definition ATABLE2(xxx,yyy,x(i),y(j), z(1,1),npointx,npointy) Defines a three-dimensional interpolative relationship of the elements of the arrays z( ) versus x( ) and y( ), starting at ith and jth elements. Returns the z-value for the independent variables xxx and yyy. The number of points in the x and y arrays are npointx and npointy, which also must be the exact dimensions of the z array. If the point that you request is not in the table, the program obtains the result by linear extrapolation. CORR(x(i),y(j),n) Returns correlation coefficient between the next n elements of arrays x and y, starting with element i in array x and element j in array y. COS(x) Returns the cosine of x. DB(x) Returns 20*LOG10(x). (decibels) EGAUSS(mn,std,L,H,A,B) Returns lower and upper bounds, and “exclusion regions” where no Gaussian random numbers are returned that are: less than L greater than H between A and B This function lets you generate a truncated and “discrete parts binned” distribution in which higher quality lowtolerance center parts are picked out, and parts lying outside the L to H range are rejected through testing. An example of EGAUSS function distribution appears at the end of this table. ERF(x) Returns Erf(x), the error function as used in device physics. ERFC(x) Returns 1-Erf1(x). ERF1(x) Returns Erf1(x). EXP(x) Returns ex. EXQTIM(dummy) Returns number of seconds of CPU time used. A dummy argument must be passed, but it is not used. FIND(x,keeplist(1),nkeepv) Returns the valueary pointer for the kept node x. Always use keeplist(1). December 1998 42 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions Function Definition GAUSS(mn,std,n) Generates a Gaussian random number with a mean value mn, and a standard deviation std. The n specifies which element of the seed array to use to generate the Gaussian random number, and n must be between 1 and 20, inclusive. You must set the MONTE parameter to 1 or a call to GAUSS returns the mean value. *I(name) or I(name,port) Returns the current through the element name or the current through the device name and specified port after a sweep and a go. (Port is c, b, e, or s for BJT; d, g, s, or gb for JFET; d, g, s, or b for MOSFET, BSIM and GaAs; a, ag, cg, or s for SCR; d, gf, s, gb, or b for SOI.) * II(name) or II(name,port) Returns the imaginary part of the AC complex current through element name or the current through device name and specified port. (Port is c, b, e, or s for BJT; d, g, s, or gb for JFET; d, g, s, or b for MOSFET, BSIM and GaAs; a, ag, cg, or s for SCR; d, gf, s, gb, or b for SOI.) IM(name) or IM(name,port) Returns the AC magnitude of the current through element name or the current through device name and specified port. (Port is c, b, e, or s for BJT; d, g, s, or gb for JFET; d, g, s, or b for MOSFET, BSIM and GaAs; a, ag, cg, or s for SCR; d, gf, s, gb, or b for SOI.) INT(x) Returns the integer part of x. * IP(name) or IP(name,port) Returns the AC phase of the current through element name and specified port. (Port is c, b, e, or s for BJT; d, g, s, or gb for JFET; d, g, s, or b for MOSFET, BSIM and GaAs; a, ag, cg, or s for SCR; d, gf, s, gb, or b for SOI.) * IR(name); or IR(name,port) Returns the real part of the AC complex current through element name and specified port. (Port is c, b, e, or s for BJT; d, g, s, or gb for JFET; d, g, s, or b for MOSFET, BSIM and GaAs; a, ag, cg, or s for SCR; d, gf, s, gb, or b for SOI.) LOG(x) Returns log(x) (the natural log). LOG10(x) Returns log10(x). MAX(x1,x2,...) Returns the maximum of x1, x2, . . . December 1998 43 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions Function Definition MEAN(x(i),n) Returns the mean value of the next n elements of array x, starting with element i. For example, MEAN(x(1),10) returns the mean of elements 1 through 10 in array x. MEAN(x(6),10) returns the mean of the elements 6 through 10 in array x. MIN(x1,x2,...) Returns the minimum of x1, x2.... MOD(x,y) Returns remainder of x/y. PERTAB(x1,y1,x2,y2,... xn,yn) Defines a periodic piecewise-linear table that repeats with period xn-x1. Returns the y value for the independent variable x. RADCLK(dummy) Returns a random number between 0 and 1 generated from the clock. Useful for generating seeds for Monte Carlo analysis. You must pass a dummy argument, but it is not used. RANDOM(x) Returns a random number between 0 and 1 using seed x, (0<x<1). Cannot be used during Cadence SPICE execution. SIGN(x) Returns 1 if x>=0 and -1 if x<0. SIN(x) Returns the sine of x. STATF(mn(1),std(1),corr(1), rand(1),n) Generates a set of generally correlated random variables. Arrays mn, std, and corr should contain the means, standard deviations, and correlation coefficients of the n Gaussian distributions from which the random variables are generated. Returns the random numbers in array rand. You can generate a maximum of 10 random variables. For additional information, see the “STATF: Correlated Random Number Generator” appendix. STDEV(x(i),n) Returns the standard deviation of the first n elements of array x, starting with element i. TABLE(x,x1,y1x2,y2,... xn,yn) Returns the linearly interpolated y value that corresponds to argument x, based on the piecewise-linear table of (xi,yi) pairs. If x<=x1, y1 is returned and if y>=xn, yn is returned. Any number of (x,y) pairs can be passed. TAN(x) Returns the tangent of x. TANH(x) Returns the hyperbolic tangent of x. December 1998 44 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions Function Definition TRACK(x,std,n,c) Generates a correlated random number with a mean value x and a standard deviation std. The element of the SEED array that generates the Gaussian random number is n. The n you specify here is the same n you specify in the GAUSS function you are tracking. The tracking coefficient c must be a real number between -1 and 1, inclusive. The value of c determines how closely correlated the track number is to the corresponding Gaussian number. If you use both GAUSS and TRACK functions, GAUSS must be first. Parameter MONTE must be set to 1, otherwise a call to TRACK returns the mean value. UNIFORM(mn,tol,n) Generates uniform random numbers with a mean of mn over the range from (mn-tol*mn) to (mn+tol*mn). Array element seed(n) is the running seed passed to the RANDOM( ) function; you must initialize it to an odd integer, as explained in the “Built-In Variables and Arrays” chapter. Thus, UNIFORM(1k,0.1,1) generates a uniform distribution with mean 1k and plus or minus 10% tolerance. Set MONTE variable to 1, otherwise a call to UNIFORM( ) returns the mean value. UUARAY fcn Number Function 1 out(1) = Number of crossings of in2(1) by in1 out(2:out(1)+1) = Piecewise linear interpolation of crossings 2 out = in1 + in2 elementwise 3 out = in1 - in2 elementwise 4 out = in1 * in2 elementwise 5 out = in1/ in2 elementwise 6 out = in1 ** in2 elementwise 7 out(1) = Inner product of in1 and in2 8 out(i) = Sum of in1(1:i) for i = 1 to n 9 out(i) = in1(i+1)-in1(i) for i = 1: n-1 December 1998 45 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions UUARAY fcn Number Function 10 out = in1 + in2(1) 11 out = -in1 +in2(1) 12 out = in1 * in2(1) 13 out = in2(1) / in1 14 out = in1 ** in2(1) 15 out = in2(1) ** in1 16 out = |in1| 17 out = exp(in1) 18 out = ln(in1) 19 out(1) = Piecewise linear (in1, in2(1)) 20 out(1) = mean (in1) out(2) = Std dev(in1) n-1 out(3) = Variance(in1) out(4) = Min(in1) out(5) = Max(in1) For all in1(I) within in2(1) *out(2) of mean out(6) = Good n out(7) = Good mean out(8) = Good std dev n-1 out(9) = Good variance out(10) = Good min out(11) = Good max * V(x) Returns the node voltage x after executing sweep, go, and get. * VDC(x) Returns the DC node voltage at node x. If you performed a transient analysis, VDC(x) returns the initial transient point, unless you used GET DC, in which case VDC(x) returns the DC solution. * VI(x) Returns the imaginary part of the AC complex node voltage at node x. * VM(x) Returns the magnitude of the AC node voltage at node x. December 1998 46 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions UUARAY fcn Number Function * VMD(x1,x2) Returns the AC magnitude and phase difference between the nodes x1 and x2 after an AC analysis. * VP(x) Returns the phase of the AC node voltage at node x. * VPD(x1,x2) Returns the difference between the AC phases of nodes x1 and x2 after an AC analysis. * VPD180(p,n) Returns the difference between the AC phases of the positive (p) and negative (n) nodes between +180 and -180 degrees. * VPD360(p,n) Returns the difference between the AC phases of the positive (p) and negative (n) nodes between 0 and -360 degrees. * VPIIO180(ip,in,o) Returns the phase across a single-output/differential-input amplifier, between +180 and -180 degrees. I, in, and o are the positive and negative input, and the output nodes. * VPIIO360(ip,in,o) Returns the phase across a single-output/differential-input amplifier, between 0 and -360 degrees. ip, in, and o are the positive and negative input, and the output nodes. * VR(x) Returns the real part of the AC complex node voltage at node x. Figure 3-1 Example of EGAUSS Function Distribution L A B H The following additional calculator functions are available: December 1998 47 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions argmaxargmaxFargmaxT argminargminFargminT emaxemaxFemaxT emineminFeminT nthcrossnthcrosTfindroot risetimerisetimTrms averagederivativeintegral To use these functions, if you are using Cadence SPICE on a standalone basis, you must first type the following at the Cadence SPICE prompt: altqual .../cds/etc/analog/dotS use efuncs It is not necessary to enter the above command if you are using Cadence SPICE through the Analog Artist Electrical Design System, 2X. Numeric Suffixes There are several conventions for defining numeric values for component characteristics. For example, 1000 = 1000Hz = 1e3 = 1.0E+3 = 1k = 1kHz 1E-12 = 1p = 1e-18MEG = 1e-3n = 1PICOAMP These examples show that you can use engineering notation and key scale- factor letters. Cadence SPICE ignores alphanumeric characters that are not scale factors (that is, in 1k = 1kHz, Cadence SPICE ignores the “Hz”). Cadence SPICE supports the following scale-factor letter conventions: (Note: For Cadence SPICE scale factors, case is insignificant.) A=1e-18MI=25.4e-4 F=1e-15M=1e-3 P=1e-12K=1e+3 N=1e-9ME=1e+6 U=1e-6T=1e+12 December 1998 48 Product Version 4.4.2 Cadence SPICE Reference Manual Expressions and Functions UM=1e-4 (MKS=0) UM=1e-6 (MKS=1) Note: (for Analog Artist Electrical Design System users) The SKILL™ language supports other case-significant suffixes that are not compatible with Cadence SPICE. The SKILL numeric suffixes are listed below. f=1e-15%=1e-2 p=1e-12K=1e+3 n=1e-9M=1e+6 u=1e-6G=1e+9 m=1e-3T=1e+12 Note the following differences between the scale factors used by Cadence SPICE and those used by the SKILL language: ■ The SKILL language does not use the “k” suffix but does use “K.” ■ The % and M used in SKILL are not used in Cadence SPICE suffixes. ■ Cadence SPICE uses “ME” for mega and “M” for milli; the SKILL language uses “M” for mega and “m” for milli. To avoid confusion, use exponential notation for mega (1e6). Use uppercase for other suffixes greater than one and lowercase for suffixes less than one. December 1998 49 Product Version 4.4.2 Cadence SPICE Reference Manual 4 Commands ■ Introduction ■ Declarations ■ ❑ array ❑ function ❑ macro Language ❑ altqual ❑ break ❑ c ❑ call ❑ e ❑ endloop ❑ exit ❑ help ❑ if ❑ l ❑ loop ❑ next ❑ quit ❑ set ❑ system December 1998 50 Product Version 4.4.2 Cadence SPICE Reference Manual Commands ■ ■ ❑ use ❑ usem Input/Output ❑ append ❑ bread ❑ bwrite ❑ close ❑ datime ❑ datime [.n] ❑ hlist ❑ list ❑ open ❑ print ❑ read Circuit Simulation and Analysis ❑ contif ❑ continue ❑ continue/trstore ❑ convrg ❑ disto ❑ four ❑ go ❑ keep ❑ nodset ❑ noise ❑ reset ❑ restore December 1998 51 Product Version 4.4.2 Cadence SPICE Reference Manual Commands ■ ■ ❑ sens ❑ sim ❑ sweep ❑ trans ❑ trstore Accessing/Displaying Simulation Results ❑ delvar ❑ display ❑ equate ❑ get ❑ getdis ❑ getvar ❑ printvs ❑ probe ❑ recall ❑ save ❑ senstr ❑ store ❑ tstore Graphics ❑ delay ❑ erase ❑ hcopy ❑ histo ❑ oplot ❑ plot ❑ plot3d December 1998 52 Product Version 4.4.2 Cadence SPICE Reference Manual Commands ■ ❑ spec ❑ view3d ❑ werase ❑ whisto ❑ window ❑ wplot ❑ wscat ❑ wtext Plotting in a Tektronix Window Introduction This chapter is a programmer’s reference and not a user guide. You are discouraged from using the simulator in its interactive mode with the Analog Artist Electrical Design System. Cadence does not support the product at this interface level. The Cadence SPICE commands are arranged in the following categories: ■ declarations array function macro ■ language altqual break c call e ■ endloop set exit loop system help next use if quit usem input/output append close list print bread datime open read bwrite hlist ■ circuit simulation and analysis contif continue December 1998 four go noise reset sim sweep 53 Product Version 4.4.2 Cadence SPICE Reference Manual Commands continue/trstore keep restore trans convrg nodset sens trstore disto ■ accessing/displaying numeric results delvar getdis probe senstr display getvar recall store equate printvs save trstore get ■ graphics delay erase hcopy histo oplot plot plot3d spec view3d wplot werase wscat whisto wtext window You can type these commands into the Cadence SPICE program using the described syntax. If you are using the Analog Artist Electrical Design System, you do not need to type them because the simulator interface calls them directly, based on your menu selections. To see which commands were called by Analog Artist, you can look in the /tmp/artist.log file for Analog Artist version 2.x and the /tmp/cdsSpiceX file for Analog Artist version 4.x. Declarations Table 4-1 Command Summary Command Brief description Page array Declares one or more user arrays array function Defines one or more user functions function macro Defines a user macro macro December 1998 54 Product Version 4.4.2 Cadence SPICE Reference Manual Commands array array aname1(dim1,dim2,...)[=number] [[aname2(dim1,dim2)...]=number] Declares a user array. An array is a set of numbers stored sequentially in memory. Aname is the array name. Dim defines the dimensions of the array, which may be previously defined variables or integers. Number is the value to which all array locations will be initialized. You can access a number in the array by means of the index, which points to the location of the number in memory. An error occurs if you declare an aname that has not been defined. Usage Rules ■ Array names must be distinct from both built-in and user-defined function names. ■ Arrays can be initialized at declaration time by assigning a value to the array. Examples array xdata(10) ydata(3,4) array ydata(9,10)=0.0 xdata(10)=1.2 December 1998 55 Product Version 4.4.2 Cadence SPICE Reference Manual Commands function function fname1(arg1,arg2,...)=expr1 [fname2(arg1,...)=expr2] off Defines a user function. Fname is the function name. Arg1, arg2, and so forth are variables used in the expression (expr). The expression can contain parameters that have not yet been defined. A function must have at least one argument. Functions may be redefined. The off option removes all user-generated functions from Cadence SPICE. You can, as an option, use function (.f) files to create a database of functions that everyone in a group can use. Usage Rules ■ Function names must be distinct from array names and built-in functions. ■ A function file (file.f) should contain only functions and comments. These files are only accessed during a sim command. ■ A function file (file.f) can contain only one function command. To store more than one function in a file, use a continuation (&). ■ Subsequently defined functions must have all their embedded functions previously defined. Example function f(a,b,c)=a**2+log(b)*abs(c) g(d)=sqrt(d) & h(e)=e*f(1,2,3)-g(e) December 1998 56 Product Version 4.4.2 Cadence SPICE Reference Manual Commands macro macro macnam macro-definition off Defines a user macro. Macnam is the macro name. Macro-definition replaces macnam when macnam arg1 arg2. is typed. You can use $N for argument substitution (see examples below). A macro replaces an entire command with a single word. To use a defined macro, enter the following: macnam The off option removes all macro definitions from Cadence SPICE. Examples macro p1 plot V(1) V(2) V(3) p1 (produces a plot of V(1) V(2) V(3)) macro p2 plot V($1) V($2) p2 20 30(produces a plot of V(20) V(30)) Clarification of “&” versus “$” args for macro definitions in use file: FILE: setup.s macro p plot V($1) vs times from 0 to &1 by &2 When you execute: use setup 200n 10n or setup 200n 10n a macro p is defined as: plot V($1) vs time from 0 to 200n by 10n So if you type: p 5 the following command is executed: plot V(5) vs time from 0 to 200n by 10n December 1998 57 Product Version 4.4.2 Cadence SPICE Reference Manual Commands Language Table 4-2 Command Summary Command Brief description Page altqual Allows access to files on alternate directory paths altqual break Breaks control out of a loop break c Changes a string in previous command c call Calls a FORTRAN subroutine call e Executes previous command e endloop Indicates end of commands to be looped endloop exit Exits current use file exit help Displays help information help if Allows conditional testing if l Lists previous command l loop Allows repeated execution of commands loop next Begins execution at next loop index next quit Leaves Cadence SPICE program quit set Assigns a value to a variable name set system Puts you in job control system use Executes commands stored in a .s file use usem Executes commands stored in a .m file usem December 1998 58 Product Version 4.4.2 Cadence SPICE Reference Manual Commands altqual altqual qual1 [qual2...] off Allows access to files on alternate directory paths or directories, provided they are “public read.” Qual1 is a string up to 250 characters long. Twenty alternate qualifiers are allowed at one time. New qualifiers are added to the previous list. All commands that access files now search for the file on your default qualifier and then the other alternate qualifiers in the order given. Altqual off deletes all previous altquals. Examples altqual ~cdsSpice/test altqual /usr/mnt3/design1/circuit altqual off December 1998 59 Product Version 4.4.2 Cadence SPICE Reference Manual Commands break break Used inside a loop. It breaks control out of the loop currently executing, and starts executing the next command after the endloop. Example loop i from 1 to 20 print i if (i=12) then break endloop In this example, the print statement is executed 12 times, for values of i from 1 to 12. December 1998 60 Product Version 4.4.2 Cadence SPICE Reference Manual Commands c c/old/new/ Changes a string in the previous command from old string to new string. There is no space after the c. The changed line is then echoed back. December 1998 61 Product Version 4.4.2 Cadence SPICE Reference Manual Commands call call subname(arg1,arg2,...arg10) This command is not part of standard Cadence SPICE. Contact your local Cadence field office for information on availability. Calls subname subroutine so that you can use your own subroutines. To use the call command, do the following: 1. Put the subroutine that you call in a file with the same name. 2. Create a file containing a list of user-defined subroutines (one per line) and the subroutines they call. 3. Prepare a customized version of Cadence SPICE using the cdsload macro. 4. Type UcdsSpice Use the cdsload macro to create a version of Cadence SPICE that links to the user-defined subroutines you will use at run time. The syntax of the macro is: cdsload -s <SUBLIST> where <SUBLIST> is the name of the file containing the names of the defined subroutines and the subroutines they call. These names can have qualifiers or paths before them. Refer to the “User-Defined Subroutines” appendix for additional information on cdsload. Usage Rules ■ User-defined subroutines must not have more than ten parameters, and all the arguments must be real. If you need integer arguments, do the conversion in a subroutine using the INT function. If a subroutine is a standard subroutine that should not be altered, and you need an integer argument, write a small subroutine that converts the double precision arguments into integers (INT function) and then calls the subroutine that you want. ■ When using call, if any of the arguments are arrays, pass the first element in the array. Example call GAUSS1(x(1),y(1),size) December 1998 62 Product Version 4.4.2 Cadence SPICE Reference Manual Commands e e/old/new/ Executes previous command. Changes a string in the previous command from old string to new string, and executes the altered line. There is no space after the e. The changed line is echoed back. December 1998 63 Product Version 4.4.2 Cadence SPICE Reference Manual Commands endloop endloop Indicates the end of the sequence of commands for the last loop command. Examples In this example, the set and print commands execute 10 times, for values of i from 1 to 10. loop i from 1 to 10 set x(i)=i**2 print i x(i) endloop This example shows how to use the INDEX variable with the loop command. Input: loop x from 1e-5 to 1e-2 dec 1 print x INDEX endloop Output: 1.000E-5 1.000E-4 1.000E-3 1.000E-2 December 1998 1.000 2.000 3.000 4.000 64 Product Version 4.4.2 Cadence SPICE Reference Manual Commands exit exit Used inside a use file. It transfers control out of the current level of use. Note: This command is not valid inside a loop embedded in a use, only in the immediate text of use itself. Example File: test.s open 1 w1 print.1 "THIS IS A TEST" exit print.1 "SHOULD NOT GET HERE" After entering use test the w1 file contains: THIS IS A TEST The second print statement is not executed. December 1998 65 Product Version 4.4.2 Cadence SPICE Reference Manual Commands help help command * Gives information and/or syntax for a specified Cadence SPICE command; help * gives information and/or syntax for all the commands. To use this command, set the directory where Cadence SPICE looks for help files by adding the following to your .cdsSpicerc file: set helpdir="/usr/local/myDirectory" The directory in quotes is that in which you place the HELPSD and HELPSL help files, which are shipped in . . ./cds/etc/analog/dotS. You can place these files in any directory. December 1998 66 Product Version 4.4.2 Cadence SPICE Reference Manual Commands if if expression then command [else command] or if expression then commands [else commands] endif The if command is conditional. Command(s) following then are executed if the expression is true or greater than zero, and command(s) following else are executed if the expression is false or less than or equal to zero. In either case the else command is optional. If no else is present and the expression is false or less than or equal to zero, execution is passed to the next command. Expression can be Boolean or arithmetic. Expression Examples a=b a=b**2+c a<b*c a<>b a+b*c+pi**2 a You can use any valid Cadence SPICE command with then or else commands. Loop and endloop must both be after then or both after else. When using an e, l, or c command after an if-then-else, the changes are made on the command in the clause that was executed and not the whole if-then-else command. Usage Rules ■ Nested if-then-elses are allowed. ■ The loop and endloop must be in the same level of nesting. ■ Only 15 levels of nesting are allowed. ■ Blocked if-then-else is similar to FORTRAN if-then-else. Unblocked if-then-else Examples set a=10 b=10 c=2 d=100 e=3 if a**e=b*d then print "EQUAL" December 1998 67 Product Version 4.4.2 Cadence SPICE Reference Manual Commands Result: EQUAL is printed if a-b then set f=1 else set f=0 Result: f is set to zero if a*c<b*e then use file1 else use file2 Result: file1 is used if -a then set g=1 set h=2 Result: h is set to 2, g is not set Blocked if-then-else Examples set a=10 b=10 c=2 d=100 e=3 array x(5) set a=1 b=2 c=3 d=4 if a=1 then read n print c use file else read m print d use file2 endif Result: waits to receive input for n, then prints c and uses file1. if a=2 then if b=2 then print c endif else loop i from 1 to 5 set x(i)=i print x(i) endloop endif Result: loop is executed. December 1998 68 Product Version 4.4.2 Cadence SPICE Reference Manual Commands l l Lists the previous command if the command word was valid. l does not list the commands l, c, or e. December 1998 69 Product Version 4.4.2 Cadence SPICE Reference Manual Commands loop Causes Cadence SPICE to read in the next sequence of commands and stores them until an endloop command is encountered. Then all commands between the loop command and endloop command are executed in a loop the specified number of times. Param sweeps from startexp to stopexp, incremented by increxp in one of the following ways: by Increments param by adding increment to it. times Increments param by multiplying it by increment. oct Increments param by multiplying it by an internally computed multiplier to achieve increment values of param per octave. dec Identical to oct except increments are per decade instead of octave. (by, times, oct, dec) increxp is optional. If omitted, by 1 is assumed. Usage Rules ■ There is a maximum of 15 levels of loop per level of use. ■ Increment in loop can be negative only if using the by increment option. December 1998 70 Product Version 4.4.2 Cadence SPICE Reference Manual Commands next next Used inside a loop. It transfers control to the endloop, and starts executing the next index of the loop unless the loop bounds have already been satisfied. Note: This command is not valid in a use file embedded in a loop, only in the immediate text of the loop itself. Example loop i from 1 to 20 if (i=7) then next print i endloop In this example, the print statement is executed 19 times, for values of i from 1 to 20, excluding 7. December 1998 71 Product Version 4.4.2 Cadence SPICE Reference Manual Commands quit quit Leaves Cadence SPICE. (You lose all unsaved data.) December 1998 72 Product Version 4.4.2 Cadence SPICE Reference Manual Commands set set param=expr [aryname(expr1,expr2,...)=expr] Assigns value of expr (expression) to variable param or array aryname. Expressions can contain any functions, arrays, or other parameters that have already been set. No embedded blanks in expressions are permitted. You can reset parameters by using another set command. You can specify values in the Cadence SPICE circuit description for most element values, model parameters, times, voltages, and so forth as variables in a circuit file. You can then set and reset these variables in Cadence SPICE. Example set a=(10*2)/3 b=sqrt(A) December 1998 73 Product Version 4.4.2 Cadence SPICE Reference Manual Commands system system Transfers control to UNIX csh, which lets you edit, run programs, and so forth. To get back into Cadence SPICE do any of the following: ■ Successfully execute a program ■ Type: exit ■ ABORT When you return to Cadence SPICE, all variables, functions, and arrays are still defined and contain their original values. You can add a csh (for Cshell) command on the line after the system command. You cannot continue the csh command on another line. The csh command is executed immediately upon entering csh. After execution of the csh command, the system returns you to Cadence SPICE. December 1998 74 Product Version 4.4.2 Cadence SPICE Reference Manual Commands use use[.n] filename [arg1 arg2 ...] Causes execution of the filename.s file with possible argument substitutions on its line. Filenames can contain any Cadence SPICE command. (Refer to the “Command and Model Files” chapter for additional information on .s command files.) The &1 in filename.s is substituted by arg1, which is the first argument passed to the file, and so forth. If &5 is in filename.s but only four arguments are passed to the use command, a zero length string is substituted for &5, that is, &5 is squeezed out. Separate the arguments on the use command by one or more blanks. If you want a blank in the middle of an argument, surround the entire argument by double quotes. The filename.s (the full path name) can have a maximum length of 250 characters. Use.n redirects output from the use file to logical unit number n (an integer from 1 through 9). You must have already assigned the logical unit number in an open or append command. Usage Rules ■ You can nest use only twenty levels deep, and pass up to 100 arguments. ■ Quotes are allowed in a string, but they must be preceded by a backslash (\). In this case the quote (") is interpreted as an ordinary character. ■ Concatenation is allowed immediately after ampersand variables. The exclamation point (!) is the concatenation character. ■ You can place variables containing valid argument numbers after the ampersand instead of just the number. For example, set b=1 a=&b sets a to arg1. Examples use file1 use myplot "TITLE STRING" arg2 or myplot "TITLE STRING" arg2 In the following example, 10k replaces &1 in the test1.s file, 3 replaces &2, 14u replaces &3, and 6 replaces &4. use test1 10k 3 14u 6 December 1998 75 Product Version 4.4.2 Cadence SPICE Reference Manual Commands usem usem[.n] filename [arg1 arg2 . . .] Identical to the use command, except that the filename.m file instead of filename.s is executed, and only one level of usem is allowed. This file should contain only device model statements, and you should call it only from the circuit (.c) file. (Refer to the “Command and Model Files” chapter for additional information on .m model files.) Usem.n redirects output from the usem file to logical unit number n (an integer from 1 through 9). The logical unit number is previously assigned in an open or append command. Input/Output Table 4-3 Command Summary Command Brief description Page append Opens a file and points to end append bread Reads input from binary file bread bwrite Writes output to binary file bwrite close Closes a logical unit number close datime Prints current date and time datime hlist Lists a file to HP® printer hlist list Lists a file list open Opens a file for input or output open print Writes output to file or screen print read Reads input from file or screen read December 1998 76 Product Version 4.4.2 Cadence SPICE Reference Manual Commands append append logunt filename Opens (assigns) logical unit number logunt to filename file and then advances to the end of the file so you can add on to it. Logunt must be an integer from 1 through 9. Filename is a filename, a physical device number, or another logical unit number. Usage Rule For the append command to function, the file that it references must exist. Examples append 1 circuit.out append 3 output December 1998 77 Product Version 4.4.2 Cadence SPICE Reference Manual Commands bread bread.logunt array(expr1) expr2... parameter Reads real numbers into an array (or parameter) from a binary file (logunt). logunt Logical unit number from 1 through 9. You must have previously opened this file with the open command. array (or parameter) A dimensioned array or defined parameter into which the numbers are to be read. expr1, expr2 Any valid expression whose value is the number of items to be read into an array (or parameter). Logunt, array (or parameter), and expr2 must be present. There is no limit to the groups of array-expressions allowed. Usage Rule ■ A bwrite must precede this command. Examples array x(100) open 2 w2 bread.2 x(1) 100 Bread reads in 100 binary numbers stored in w2, converts the numbers to real, and places them into array x starting at x(1). array a(75) b(75) c(50) open 3 w3 bread.2 x(1) 25 b(1) 25 c(1) 50 Bread reads the first 25 numbers from w3 into a, the second 25 numbers into b, and the next 50 numbers into c. array x(200) set a=2 b=25 c=4 n=1 set r=0 t=0 s=0 open 4 w4hold (1) bread.4 x(n) b*c*a close 4 December 1998 78 Product Version 4.4.2 Cadence SPICE Reference Manual Commands open 4 w4hold (2) bread.4 r 1 t 1 s 1 In (1), 200 numbers are read into x. In (2), the first number is read into r, the second into t, and the third into s. You must have defined r, t, and s previously. Note: If there are two breads from the same file, you must close and then reopen the file. December 1998 79 Product Version 4.4.2 Cadence SPICE Reference Manual Commands bwrite bwrite.logunt array(expr1) expr2... parameter Writes real numbers into a binary file from an array (or parameter). logunt Logical unit number from 1 through 9. You must have previously opened this file with the open command. array (or parameter) A dimensioned array or defined parameter from which the numbers are to be written. expr1, expr2 Any valid expression whose value is the number of items in the array to be written into the binary file. Logunt, array (or parameter), and expr2 must be present. There is no limit to the groups of array-expressions allowed. Usage Rules ■ You can follow this command with bread to convert the number back into a real (not binary) number. ■ You cannot append information to a file after you do a bwrite. You must use the bwrite command to write out all binary information. Examples array x(100)=1.2 • • • open 2 w2 bwrite.2 x(1) 100 Bwrite writes the 100 numbers in x starting at x(1), converted to binary, into w2. array a(25)=1 b(25)=2 set t=5 s=10 n=1 open 3 w3 bwrite.3 a(1) 25 b(n) 25 t 1 s 1 December 1998 80 Product Version 4.4.2 Cadence SPICE Reference Manual Commands Bwrite writes the 25 numbers in a followed by the 25 numbers in b followed by t and then s, into w3. array x(300)=3 set a=3 b=50 c=2 open 4 w4hold (1) bwrite.4 x(1) a*b*c close 4 open 4 w4hold (2) bwrite.4 a 1 b 1 c 1 In (1), bwrite writes 300 numbers from x into w4hold. In (2), bwrite writes the value of a, then b, then c into w4hold. The values of a, b, and c will overwrite the first three numbers in w4hold because they are on separate bwrite lines. December 1998 81 Product Version 4.4.2 Cadence SPICE Reference Manual Commands close close logunt Closes logical unit number logunt. Logunt must be an integer from 1 through 9. Examples close 1 close 6 You only need to use the close command if you are opening the same logical unit number to different files in the same session. A quit command closes all files automatically. December 1998 82 Product Version 4.4.2 Cadence SPICE Reference Manual Commands datime Prints out the date and time on one line in the following format: day month year hour: minute: second. (See next page.) December 1998 83 Product Version 4.4.2 Cadence SPICE Reference Manual Commands datime [.n] datime [.n] Prints out the date and time on one line in the following format: day month year hour: minute: second. This command can be used to stamp output files by doing the following: open n filename datime.n where n is a logical unit number, an integer from 1 through 9. Filename is the name of the file to be used. December 1998 84 Product Version 4.4.2 Cadence SPICE Reference Manual Commands hlist hlist fname [startline [numlines]] Lists fname file to an HP printer. If you specify startline, the listing starts with that line. Numlines specifies how many lines are listed. Startline and numlines must be whole numbers, not variables. If you specify neither argument, the whole file is listed. December 1998 85 Product Version 4.4.2 Cadence SPICE Reference Manual Commands list list fname [startline [numlines]] Lists fname file. If you specify startline, the listing starts with that line. Numlines specifies how many lines are listed. Startline and numlines must be whole numbers, not variables. If you specify neither argument, the whole file is listed. December 1998 86 Product Version 4.4.2 Cadence SPICE Reference Manual Commands open open logunt filename Opens (assigns) logical unit number logunt to the filename file for reading or writing. Input or output starts at the beginning of the filename file. Logunt must be an integer from 1 through 9. Filename is the name of a file, a physical device number, or another logical unit number. You can redirect the input/output of any command from/to a file or physical device by appending a .logunt to the Cadence SPICE command. Note: If filename does not exist, the file is created and a message is printed to the screen. Examples open 1 OUTPUT open 2 circuit.out print.2 "This goes in file circuit.out" December 1998 87 Product Version 4.4.2 Cadence SPICE Reference Manual Commands print print[.n] ["string1"] [expr1] ["string2"] [expr2]... Prints a string of characters and/or the value of an expression. The value of the expression is printed in 1PG12.5 format. There cannot be embedded blanks in the expression. Strings can be continued to the next line with an ampersand (&). The command print alone prints a blank line. Usage Rules ■ If a double quote ("), pound sign (#), or backslash (\) is used as an ordinary character in the print string, that character must be preceded by a backslash. These three characters have special meaning in Cadence SPICE. (See the “Cadence SPICE Basics” section of the “Introduction” chapter.) ■ Each individual string has a maximum length of 999 characters. ■ Two character strings cannot be printed sequentially. For example, instead of print "MY" "FILENAME" use print "MY FILENAME" ■ Print.n will print the desired information to the file opened to unit n, where n is a number from 1 through 9. Examples print "x=" x "y=" y print "VALUE IS:" cos(x+y)*cos(x-y) print "\# I"(prints: # I) print.1 "hello" December 1998 88 Product Version 4.4.2 Cadence SPICE Reference Manual Commands read read[.n] [param] [[numitem:]arrayname(expr1,expr2,...)]... Reads one item into param and/or numitem items into arrayname, beginning at arrayname(expr1,expr2,...). If numitem is omitted, one number is assumed read. Numitem can be an expression. All numbers read by one read command must come from one terminal line or file line. No continuation of lines is allowed. Each read command starts reading on a new line. To skip over heading or blank lines, use a dummy read, which is a read with no arguments. The format for reading from a file is as follows: read.n where n is the logical unit number from any previous open command. Examples read a b array y(10) read 10:y(1) read.2 a 4:y(6) read a+b*2:y(1) read.2 Note: The third example reads in a value for parameter a and then four values for array y starting at the sixth location (y(6)) from the file assigned to logical unit number 2. The fifth example is a dummy read that just skips over a line in the file to logical unit number 2. Circuit Simulation and Analysis Table 4-4 Command Summary Command Brief description Page contif Causes transient analysis interruption contif continue Continues an interrupted or completed transient analysis continue continue/trstore Continues a transient analysis already started in a previous Cadence SPICE session December 1998 89 continue/ trstore Product Version 4.4.2 Cadence SPICE Reference Manual Commands Table 4-4 Command Summary Command Brief description Page convrg Aids in circuit convergence convrg disto Computes distortion disto four Computes Fourier analysis four go Initiates Cadence SPICE execution go keep Saves specified node voltages and/or currents keep nodset Constrains a node voltage to a value nodset noise Invokes noise analysis noise reset Resets Monte Carlo seeds to original values reset restore Initializes DC node voltages restore sens Invokes sensitivity analysis sens sim Circuit file sim sweep Sweeps voltage, current, frequency, or time sweep trans Computes DC small-signal value trans trstore Initializes transient node voltages trstore December 1998 90 Product Version 4.4.2 Cadence SPICE Reference Manual Commands contif contif number operator expression contif off Interrupts a transient analysis if a specified condition is not met. NOGO is set to 2 if the analysis is interrupted. SPTIME must be set to use contif. number Either 1 or 2: 1 the voltage (or current) of the first node (or current) on the KEEPLIST. 2 the voltage (or current) of the second node (or current) on the KEEPLIST. operator Greater than (>) or less than (<). expression Any valid Cadence SPICE expression. Examples sim test keep 5 i(r1) sweep time from 0 to 100n by 5n set SPTIME=5n contif 1 < .7 In this example, the transient analysis continues if the voltage of the first node (or current) on the KEEPLIST (in this case V(5)) is less than 0.7. If the voltage becomes greater than 0.7 the analysis is interrupted and NOGO is set to 2. sim test set a=2 b=10 c=25 keep 5 i(r1) 6 sweep time from 0 to 100 by 5 set SPTIME=5 contif 2 > a*b/c go In this example, the transient analysis continues if the voltage of the second node (or current) on the KEEPLIST (in this case i(r1)) is greater than 0.8 (a*b/c=.8). If the current becomes less than 0.8 the analysis will be interrupted and NOGO will be set to 2. contif off December 1998 91 Product Version 4.4.2 Cadence SPICE Reference Manual Commands This example turns off the contif command. Also, a sim or keep off turns off this command. Note that contif cannot be used with keep all. December 1998 92 Product Version 4.4.2 Cadence SPICE Reference Manual Commands continue continue to expression by expression off Continues a transient analysis after it has been either interrupted or completed. A transient analysis sweep command must always precede this command, and a go must follow it. Formats continue Causes the analysis to continue to the same stop value with the same by value specified in the original sweep command. You can use continue only if the transient analysis was interrupted at a time point prior to tstop. continue to a by b Causes the analysis to continue to the new a stop value by the new b timestep. continue off Turns off the continue command. Therefore, if you issue another go, the analysis executed from the last sweep command is executed, and you lose all information from continue. Interrupts Control-c A soft interrupt interrupts a transient analysis and a transient continue. It is useful to set SPTIME to see where the analysis is in time. set break=a Before executing the go command, you can set the parameter break to interrupt the analysis at time a. All information obtained up to the point when a transient analysis or transient continue is interrupted can be plotted or printed. If you execute any other DC, AC, or transient analysis, the information from the original transient analysis is lost and the continue command cannot be used with the other information. You can use as many continue or continue to a by b commands as you need. The go after the continue command does not serve the same purpose as a second go in READIN-BYPASS. All READIN-BYPASS and initialization code is skipped over during the transient continue command. Once a continue command is executed, the code is set up to December 1998 93 Product Version 4.4.2 Cadence SPICE Reference Manual Commands continue from the last computed point to TSTOP. Therefore, a READIN-BYPASS go cannot be executed. You can set DELMAX and TINIT to obtain results more closely resembling results from an analysis containing a sweep command. (DELMAX can be set to TSTOP/50, where TSTOP is last point in the sweep; TINIT can be set to TSTEP/10, where TSTEP is the time step in the sweep.) The default timestep for printing or plotting results of a transient continue is the last specified timestep (from the last continue to a by b). If there is no continue to a by b command, the timestep in the sweep command is used. Variables The following variables can be modified and used with a transient continue as of cdsSpice 4.2.2. ABSTOL RELTOL CHGTOL VNTOL GMIN ITL3 ITL4 DELMAX Note: Normally if DELMAX=0, the cdsSpice default of TSTOP/50 is used internally. If you set DELMAX to some non-zero value during a transient continue , the value you enter is used. If you then set DELMAX back to zero, the previous value you entered is still used. The value is not set back to TSTOP/50. If you want the DELMAX value to return to the initial TSTOP/50 default value, you must explicitly set it. Example sim test keep 1 2 set break=5.0 SPTIME=.2 set DELMAX=(14/50) sweep time from 0 to 9.0 by .2 go The analysis is interrupted at 5.0. December 1998 94 Product Version 4.4.2 Cadence SPICE Reference Manual Commands A possible sequence follows: printvs v(1) Prints the value from time 0 to 5.0 by 0.2 continue Continues from 5.0 to 9.0 by .2 go ^c Type [CTRL] [C] at time 7.0 printvs v(1) Prints the values from 0 to 7.0 by 0.2 continue to 11.5 by .3Continues from 7.0 to 11.5 by 0.3 go continue to 14.0 by .25Continues from 11.5 to 14.0 by 0.25 printvs v(1) Prints values from 0 to 14.0 by 0.25 December 1998 95 Product Version 4.4.2 Cadence SPICE Reference Manual Commands continue/trstore trstore filename continue to a by b (instead of a sweep command) Continues a transient analysis started in a previous Cadence SPICE session. In the original analysis a tstore command stores the information needed to start the analysis at a later time. The trstore/continue commands allow you to continue the analysis later. Usage Rules ■ The analysis starts where it previously stopped and continues to the new stop value a by the new timestep b. ■ Any number of continue commands or continue to a by b commands can follow. ■ When plotting or printing, only information calculated from the current session’s starting point (the last session’s stopping point) to the new stop value is used. ■ DELMAX and TINIT can be set to obtain results more closely resembling results from an analysis containing only a sweep command. Examples In this example, the following commands are stored in a file named TEST.S. sim test keep 1 2 sweep time from 0 to 5.0 by .2 go tstore te1 At some time TEST.S was executed. In a later Cadence SPICE session, these commands stored in file TEST2.S are executed. sim test trstore te1 keep 1 2 continue to 10.0 by .2 go This example calculates values from time 5.0 to 10.0 by 0.2 and only these values can be plotted or printed. You can now interrupt and continue this analysis as needed. December 1998 96 Product Version 4.4.2 Cadence SPICE Reference Manual Commands convrg convrg [gminon [intval lstval]] off on Used to aid in circuit convergence using a continuation method. gminon Determines how the continuation method will be used (default=2). See “Built-In Variables and Arrays” chapter. intval Initial value (default=1E-3). lstval Last value (default=1E-12). off Turns off the automatic call to the GMIN stepping routine when there is a convergence problem. (Refer to the “Built-In Variables and Arrays” chapter for a description of GMIN.) It remains turned off throughout the rest of the Cadence SPICE session. 1 Turns on the automatic call to the GMIN stepping routine when there is a convergence problem. The default is to call the routine, so use this option only if you used convrg off during the Cadence SPICE session. You can specify three, one, or no parameters. If parameters are not specified, the defaults are used. Examples sim test convrg (all defaults are used) go sim test convrg 2 (defaults for intval, lstval are used) go sim test convrg 1 1e-4 1e-11 go Note: convrg must precede the go command. The convrg command is automatically shut off after an initial DC operating point is (or is not) found. December 1998 97 Product Version 4.4.2 Cadence SPICE Reference Manual Commands disto disto rload[inter[skw2[refpwr[spw2]]]] off Computes the distortion characteristics of the circuit as part of the AC small-signal analysis. The analysis assumes that one or two signal frequencies are imposed at the input. The two frequencies are F1 (the nominal analysis frequency) and F2. rload Output load resistor into which all distortion power products are computed. inter Interval at which the summary of all the nonlinear devices that contribute to the total distortion is printed. (If you omit or set this to zero, no summary printout is made. skw2 Ratio of F2 to F1. If omitted, uses a value of 0.9 (that is, F2 = 0.9 * F1). refpwr Reference power level used in computing the distortion products. If omitted, uses 1 mW. spw2 Amplitude of F2. If omitted, assumes a value of 1.0. off Turns off the disto command. Examples disto rl 2.95 1.0e-3.75 disto rx 3 December 1998 98 Product Version 4.4.2 Cadence SPICE Reference Manual Commands four four freq off Computes a Fourier analysis as part of the transient analysis. freq Fundamental frequency at which the Fourier analysis is performed. off Turns off the four command. Note: Fourier analysis is performed on keep nodes and currents. Fourier analysis cannot be performed with keep all. Example four 8e+6 December 1998 99 Product Version 4.4.2 Cadence SPICE Reference Manual Commands go go [create] [simulator] [filename] Initiates execution of Cadence SPICE. Evaluates all expressions in the circuit file. Any parameter to be used must be set before the go command is executed. create Create an input file without running the simulator. simulator Specify a simulator other than Cadence SPICE. Available simulators: HSPICE, SPECTRE, or any third-party simulator integrated into Cadence SPICE. filename Specify a filename for the Cadence SPICE input deck. Examples go Creates a temporary file, runs Cadence SPICE, and removes the temporary file upon exiting Cadence SPICE. go filename Executes a simulation, using the file filename created in an earlier session, without performing the sim phase. go create filename Creates a Cadence SPICE input deck in file filename. go create tospice filename Generates a generic SPICE deck from Analog Artist input. This netlist is SPICE2G.6 compatible and does not contain any Cadence SPICE special characters. go create spectre filename Creates an input deck for the SPECTRE simulator. You can create a filename in one session and, with save/recall, run the file in another session. Session 1 sim ckt keep all sweep time from 0 to 100n by 2n go go create ckt1 save srckt1 Session 2 December 1998 100 Product Version 4.4.2 Cadence SPICE Reference Manual Commands recall srckt1 go ckt1 printvs v(1) . . . If you don’t want to use the save/recall commands, you can do the following instead: Session 1: set nodchr=1(turn off node/char string mapping) sim ckt keep all sweep time from 0 to 100n by 2n go create ckt1file . . . Session 2: set nodchr=1 (use the same keep/sweep) go ckt1file . . . Go Spectre The Spectre™ direct-method circuit simulator is similar to the SPICE simulator, but is not a descendant of SPICE. Spectre, which is written in C, uses the same basic algorithms as SPICE, including implicit integration methods, Newton-Raphson iteration, and direct matrix solution; but every algorithm is newly implemented. You can use the following Cadence SPICE commands with go spectre: ■ All declaration commands (array, function, macro) ■ All language commands (such as set, if, loop use, and usem) ■ All input/output commands (such as open and close) ■ Most simulation commands (sim, keep, sweep, nodset, noise, go) ■ Most commands for accessing/displaying numeric results (save, recall, get, probe (nv), display (param, uparam, altqual, open, keep, nodset, nodnam, macro, sweep, array, function), printvs, equate(op)) ■ All graphics commands (such as plot, wplot, and erase) December 1998 101 Product Version 4.4.2 Cadence SPICE Reference Manual Commands You can run all Cadence SPICE analyses (transient, DC, AC, and noise) with the go spectre command. You can also plot or print all the information from these sweeps. You can use Monte Carlo Analysis parametric plotting and optimization with the go spectre command. While sweeping, Spectre prints a status line that lets you monitor progress and estimate when the sweep will be complete. The status line counts down from 9 to 0, where 0 is the end of the sweep. Note: If any information is not available in Spectre, such as sat in probe op, Spectre prints the value “8.8E-78.” Go HSPICE You can use the HSPICE™ simulator from Meta-Software, Inc., to simulate electrical circuits in the DC, transient, RF, and microwave regions. The following Cadence SPICE commands are available with go hspice: ■ All declaration commands (array, function, macro) ■ All language commands (such as set, if, loop use, and usem) ■ All input/output commands (such as open and close) ■ Most simulation commands (sim, keep, sweep (not noise), nodset, go) ■ Most commands for accessing/displaying numeric results (save, recall, get, probe (nv), display (param, uparam, altqual, open, keep, nodset, nodnam, macro, sweep, array, function), printvs) ■ All graphics commands (such as plot, wplot, and erase) You can run three types of Cadence SPICE analyses (transient, DC, and AC) with the go hspice command. You can also plot or print all the information from these sweeps in Cadence SPICE. You can use Monte Carlo Analysis parametric plotting and optimization with the go hspice command. Note: If any information is not available in HSPICE, such as sat in probe op, Spectre prints the value “8.8E-78.” December 1998 102 Product Version 4.4.2 Cadence SPICE Reference Manual Commands keep keep node1 [node2 node3 ...] I(name) I(name,port) all alliv off keep node1 saves the voltages for node1 when you run a simulation. Keep the current through an element or device by specifying I(name) or I(name,port), where name is the name of an element or device. (Port is c, b, e, or s for BJT; d, g, s, or gb for JFET; d, g, s, or b for MOSFET, BSIM, and GaAs; a, ag, cg, or s for SCR; and d, gf, s, gb, or b for SOI.) Keep all keeps all the nodes in the circuit. To cancel a keep request, type keep off Use keep alliv to keep all top-level currents. (This option is not available when you run Cadence SPICE outside the Analog Artist Simulation Environment.) Usage Rules ■ A maximum of 200 keep nodes and 200 keep currents is allowed. ■ keep remains in effect after typing go and returning from Cadence SPICE (that is, it need not be repeated after changing a parameter value). If you place the keep command in a use file or loop, be sure to precede it with keep off. ■ The keep command is cumulative. A second keep does not cancel the first keep and the node voltage is kept twice. ■ Subcircuits are allowed on a keep command. Syntax is keep SUBCIRCUIT^...SUBCIRCUIT^ NODENAME ■ Noise analysis cannot be performed with keep all. ■ Fourier analysis cannot be performed with keep all. ■ keep all does not cancel previous keeps. ■ keep all does not keep currents. Examples keep 10 21 32 inp2 inp3 keep i(r1) i(q1,c) December 1998 103 Product Version 4.4.2 Cadence SPICE Reference Manual Commands keep keep keep keep keep keep i(vds) i(JFET1,d) i(mos,b) i(m1,g) x2^3 i(x1^x2^mos,b) all xa^xb^inp1 December 1998 104 Product Version 4.4.2 Cadence SPICE Reference Manual Commands nodset nodset nodnum1 volt1 [nodnum2 volt2...] off Constrains a nodnum1 node voltage to a prescribed volt1 value in a DC circuit simulation. You can then store (tstore) and restore (trstore) this solution for later solutions. Cadence SPICE places a current source (=volt/RON) from ground to the node in parallel with a resistance RON=1ohm. Thus, if the total resistance seen at the set node is 1ohm, the final value of the constrained node will be half the prescribed value. RON is therefore a settable parameter, and can be changed as needed. The off option removes the current sources and RON resistances. (Setting RON>10G also effectively removes the forcing voltage.) In either case the stored (tstored) files may be restored (trstored). This command is useful in aiding DC convergence and initializing transient steady-state solutions. (See the “Forced Nodes and Nodset Nodes” section of the “Circuit Analysis” chapter.) nodset off cancels the nodset request. Note: The nodset command overrides any previous nodset command. Only one level of nesting in subcircuits is allowed with the nodset command. Examples nodset 6.5 nodset 10 5.5 input 0.0 December 1998 105 Product Version 4.4.2 Cadence SPICE Reference Manual Commands noise noise nodenum sourcename [list every num] off Invokes noise analysis. Noise contributions are summed at output node nodenum. Sourcename is an independent source for equivalent input noise calculations. A value for num of n lists noise contributions from every noise source every nth frequency point during an AC analysis. (A sweep freq . . . must be given for noise analysis.) Omitting list every num produces noise output at only the first SWEEP frequency. The output node voltage of node nodenum at swept frequencies is available by means of v(nodenum) after executing get noise. The noise off command turns off the noise command. Usage Rules ■ Noise analysis can be done only with an AC analysis. ■ Subcircuits are allowed on the noise command. ■ You cannot use keep all with noise analysis. Examples noise 10 vin noise 21 V11 list every 2 noise ainp vin December 1998 106 Product Version 4.4.2 Cadence SPICE Reference Manual Commands reset reset Resets all 22 elements of the Monte Carlo seed array seed to their original values, as defined when you first entered Cadence SPICE. Refer to the “Monte Carlo Analysis” appendix for further details. Also consult the “Built-In Variables and Arrays” chapter for descriptions of GSAVE, TSAVE, and SSAVE, used in conjunction with reset. December 1998 107 Product Version 4.4.2 Cadence SPICE Reference Manual Commands restore restore filename off Initializes node voltages for the DC analysis with those in filename file (generated by a store command). If the file does not exist, or the wrong number of node voltages is stored in the file, the restore is not done. Restore off cancels the previous restore command. December 1998 108 Product Version 4.4.2 Cadence SPICE Reference Manual Commands sens sens node1 [node2] ac node1 [node2] off Performs a DC sensitivity analysis with respect to the circuit elements and devices (resistors, capacitors, inductors, voltage-controlled current sources and independent current sources, BJT, JFET, and MOS) for the output variable specified. You can access this output with a probe sens wrt . . . command. The sens ac node1 [node2] performs an AC sensitivity analysis with respect to the circuit elements and devices for the output variable specified. You can access the output via a probe acsen at . . . command. node1 is a node number. If you specify node2, the sens command takes the difference between the two. The sens off command cancels a sens request. Note: Subcircuits are allowed on the sens command. Examples sens sens sens sens sens sens output 21 30 ac 2 ac 2 5 x1^15 ac x1^x2^3 December 1998 109 Product Version 4.4.2 Cadence SPICE Reference Manual Commands sim sim fname [old] Preprocesses the circuit fname.c file and is required before the first go. If you specify old, the previous keep, sweep, noise, sens, restore, trstore and nodset are used. If you do not specify old, all these commands are turned off. The sim command scans fname.c for FORTRAN-like expressions that are stored for later evaluation during the go command. Circuit File Conventions The fname.c circuit file contains the circuit description in a format similar to SPICE2, with the following exceptions: ■ The first line in the circuit file must be a title line, which is ignored when the file is processed. ■ The only delimiter allowed is the blank character. ■ Placing an ampersand (&) at the end of the line indicates that the line is continued. ■ The circuit file must not contain an .END statement, and you must specify subcircuit names explicitly on the .ENDS <subname> line. Example * INVERTER CIRCUIT ******* devices ******* M1 2 3 0 0 MOSN W=1000U L=700U AD=20N AS=0.2N PD=1500U & PS=1500U M2 2 3 1 1 MOSP W=5000U L=700U AD=20N AS=0.2N PD=1800U & PS=1800U RIN 4 3 10 CL5 2 0 CL ******* power supply and signal ******* VCC 1 0 DC 5 VIN 4 0 PULSE 0 5 1N 2N 2N 5N 14N ******* analysis request ******* * N and P-CHANNEL MOSFET MODEL FILES .MODEL MOSN NMOS LEVEL=2 VTO=.8 GAMMA=.46 & LAMBDA=.02 KP=67E-6 PHI=.6 IS=1.5E-15 PB=.61 & CJ=2.3E-8 CGSO=2.3E-12 CGDO=2.3-12 & CGBO=6.1E-12 TOX=3E-6 December 1998 110 Product Version 4.4.2 Cadence SPICE Reference Manual Commands .MODEL MOSP PMOS LEVEL=2 VTO=-.8 GAMMA=.63 LAMBDA=.02 & KP=27E-6 PHI=.6 IS=1.5E-15 PB=.71 CJ=4.2E-8 & CGSO=3.4E-12 CGDO=3.4E-12 CGBO=5.6E-12 TOX=3E-6 Usage Rules ■ FORTRAN-like expressions can occur on element and/or model lines. Initial conditions (IC=...), device area factors, and controlled source coefficients can be expressions if preceded by an equal sign. ■ All expressions terminate with a blank. ■ Parameters in the circuit file that were not set must be set with the set command before the go command. With multiple runs, you can use the set command to redefine element values or model parameters. ■ On model and device lines, expressions are scanned following each equal sign. On element lines, expressions are allowed after node definitions. ■ Only circuit file lines beginning with non-Cadence SPICE commands are allowed. These Cadence SPICE lines cannot have an inductor named loop, a transistor named quit, a resistor named read, a controlled source named go, and so forth. ■ You can place use and/or usem commands in circuit files to bring in functions, subcircuits, or even other parts of the circuit. ■ Subcircuits and circuits can contain duplicate node numbers. When you do a probe nv *, subcircuit nodes are identified by the full subcircuit names. When using display or probe on subcircuits, element names begin with the letter x. ■ Do not use the following names as arrays or parameters: DC EXP V VI IR AC PWL VM I PULSE EXTERN VP IM SIN VR IP ■ You can use expressions for any arguments on a voltage or current source element line. Arguments to source built-in functions (such as PULSE) must not be put in parentheses. Some valid voltage source lines are: V1 V1 V1 V1 V1 3 3 3 3 3 4 4 4 4 4 V1 3 4 December 1998 (automatically DC 0.0) DC 0.0 AC 0.0 AC VIAC*FACTOR*TC(TEMPDC) 0.0 PWL 0NS 0V 10NS AC MAG PHASE 1V & 20NS 1V 30NS 0V PWL 0NS 0V TDELAY 0V TRISE VM & 111 Product Version 4.4.2 Cadence SPICE Reference Manual Commands V1 ■ 3 4 TRISE+TWIDTH VMAX2*TRISE+TWIDTH 0V DC VIDC*(1+TC*(TEMPDC+25)) AC 1 Cadence SPICE allows expressions in transistor lines. For example: M1 2 7 0 12 NMOS1 L=LE*KR W=WE*ABS(KR) IC=10 1 0 Note: In device files, commas are not allowed in the IC= initial condition statement. ■ An asterisk (*) in column one is considered a comment. ■ For temperature variation, explicitly define model and element parameter functions as functions of the variable TEMPDC. The internal thermal voltage (kT/q) is the only temperature-dependent factor in Cadence SPICE. Note: The built-in VT Cadence SPICE parameter is a constant; resetting TEMPDC does not change the value of VT. k ⋅ ( 298K ) VT = ------------------------q Note: For SPTEMP =1, the SPICE2.6 temperature equations are used. Node Naming Conventions Nodes are considered character strings rather than numbers. Therefore, node names of up to six characters are allowed. A valid node name consists of the letters A-Z, the numbers 09, and the “at” sign (@). In Cadence SPICE, node names are assigned a number and that number is sent to Cadence SPICE (rather than the name). Type display nodnam* to display the number assigned to each name. Set NODCHR=1 to turn off node mapping. Example R1 OUTPUT INPUT 10 R2 1 OUT1 3 Notes: ■ A tmp.SLM6xxxxx file, where xxxxx is the processor ID number, has the assigned node number rather than the user node name, if NODCHR=0 (see “Built-In Variables and Arrays” chapter). Type display nodnam* to view the node map. ■ Ground node (0) must not be renamed; it must stay 0. ■ If you change the circuit file and execute a sim old command, all commands containing nodes (such as keep, nodset, sens) must be turned off and reinvoked to ensure correct node mapping. December 1998 112 Product Version 4.4.2 Cadence SPICE Reference Manual Commands ■ Numbers are also considered character strings and are substituted for mapped node numbers. December 1998 113 Product Version 4.4.2 Cadence SPICE Reference Manual Commands sweep Sweeps the Cadence SPICE simulation over one of the following variables: vname Element name of any voltage source iname Element name of any current source freq Frequency for AC analysis time Time for transient analysis from startexp to stopexp using the specified increment increxp, incremented in one of the following ways: by Increments param by adding increment to it. oct Increments param by multiplying it by an internally computed multiplier to achieve increment values of param per octave. dec Identical to oct except increments are per decade instead of octave. (by, oct, dec) increxp is optional; if omitted, by 1 is assumed. sweep off (dc, freq, time) turns off specific sweeps only. A sweep vname or iname indicates a DC transfer curve analysis, sweep freq indicates an AC analysis, and sweep time indicates a transient analysis. Only the by keyword is allowed for source and time sweeps. Freq sweeps can be by, oct, or dec. Sweep commands remain in effect after typing go and returning from Cadence SPICE (that is, sweeps need not be repeated after changing a parameter value). sweep is reset after a sim command. December 1998 114 Product Version 4.4.2 Cadence SPICE Reference Manual Commands To cancel all sweep requests, type sweep off. To cancel specific sweeps only, type sweep off dc, off freq, or off time. Because a single Cadence SPICE run can contain a DC sweep, an AC analysis, and a transient analysis, you can give all three sweep commands before initiating Cadence SPICE execution with a go command. All keep variables are kept in all analysis modes. Use the get command to obtain output from each analysis. Usage Rules ■ Subcircuits are allowed on the sweep command. Note: You can set SPTIME to print a message for each AC or DC sweep point or at a specified transient time interval. Refer to the “Built-In Variables and Arrays” chapter for details on setting this variable. Examples sweep freq from 1me to 100me by 1me sweep time from 0 to 100ns by 5ns sweep x2^v2 from 1v to 10v by 1v Note: You can do an AC analysis after a transient analysis, omitting the DC operating point analysis. In this case, the AC analysis begins at the final transient operating point. sim ckt sweep time from.... (any keep or other commands) go tstore filename(store initial values for the AC analysis) restore filename(restore the initial values) sweep off(turn off the transient sweep, if same session) set DCOOPT=0(turn off DC analysis) sweep freq... go December 1998 115 Product Version 4.4.2 Cadence SPICE Reference Manual Commands trans trans outvar insrc off Computes the DC small-signal value of the transfer function (output/input), input resistance, and output resistance. outvar Small-signal output variable. insrc Small-signal input source. off Turns off the trans command. Example trans 9 is1 In this example, the trans command computes the ratio of 9 (the small-signal output resistance at 9) to is1 (the small-signal input resistance at is1). December 1998 116 Product Version 4.4.2 Cadence SPICE Reference Manual Commands trstore trstore filename off Initializes the node voltages for the transient analysis with those in filename file (generated using a tstore command). If the file does not exist, or the wrong number of node voltages is stored in the file, the trstore is not done. This command inhibits the initial DC analysis in the following transient analysis; therefore the voltages in the file do not need to represent a steady-state solution. Trstore off cancels the previous trstore command. Accessing/Displaying Simulation Results Table 4-5 Command Summary Command Brief description Page delvar Takes differences of sensitivities stored in two files delvar display Displays Cadence SPICE stored information display equate Sets a variable to a probe or display value equate get Loads Cadence SPICE output into memory get getdis Gets the disto information getdis getvar Generates tables of sensitivities output getvar printvs Prints out plot data values in columns printvs probe Displays Cadence SPICE output information probe recall Recalls information saved in a previous Cadence SPICE session recall save Saves information from current Cadence SPICE session for later Cadence SPICE session save senstr Stores sensitivity output in a file senstr store Stores DC node voltages in a file store tstore Stores transient node voltages in a file tstore December 1998 117 Product Version 4.4.2 Cadence SPICE Reference Manual Commands delvar delvar filename1 filename2 filename3 Takes the differences of the corresponding sensitivities from filename1 and filename2. Stores them in filename3, which you can access by a getvar command. Files filename1 and filename2 must exist and must correspond in the number of sensitivities they contain or an error results. December 1998 118 Product Version 4.4.2 Cadence SPICE Reference Manual Commands display Displays stored information from Cadence SPICE. altqual Displays alternate qualifiers. open Displays all files that are currently opened or appended. keep Displays keep list. December 1998 119 Product Version 4.4.2 Cadence SPICE Reference Manual Commands stat Displays statistics on Cadence SPICE run time, CPU time, time taken in each analysis, and number of Newton iterations. macro Displays macros that have been defined. node Displays node table. element and device Displays element and device connections. model Displays model parameters. The MOSFET model level that this command displays is the internal level. For example, for MKS=1 (default), if you set the LEVEL model parameter to 3 or 5, this command prints that the level is 5. If you set LEVEL to 2 or 6, the command prints that the level is 6. Refer to the “Device Models” chapter for additional information. sweep Displays sweeps (dc, ac, and tran) that have been set up. If a transient continue was executed, it is also displayed. param Displays all built-in parameters. uparam Displays all user parameters. array Displays names and lengths of all user arrays. fortfunc Displays all user-defined FORTRAN functions. Field 1 is the function name, field 2 is the number of arguments, and field 3 is the file in which the function is defined. nodset Displays all user-set nodes and their values. noise Displays last noise command. restore Displays file name from which the last restore was done. trstore Displays filename from which the last trstore was done. nodnam Displays what node number was assigned to each user node name. Note: Subcircuits are allowed on display node, element, device, and model commands. December 1998 120 Product Version 4.4.2 Cadence SPICE Reference Manual Commands Examples display display display display display node 10 20 25 model * element v* node X1^X2^3 element X1^X2^vcc input Wild Card Characters You can use wild card characters (.) and (*) in the following display commands: param, uparam, open, macro, node, element, device, model, array, function. A period (.) designates any single character. An asterisk (*) designates any string of characters. More than one (.) is allowed at a time, but only one (*) is allowed. For example, R.1.2 is valid, but R*1*2 is not valid. Examples R. Q.2 .3. V* *1 RB*2 = = = = = = R1, R2, RB,... Q12, QA2, QM2,... R3, Q3, V3, 23,... V1, V, V123, VA2,... Q1, 1, MMOD1,... RB12, RB452, RB63B2,... December 1998 121 Product Version 4.4.2 Cadence SPICE Reference Manual Commands equate Sets variable param1 to the user-specified probe op, display element, display model, probe sens, or probe acsen value. You cannot do these assignments using the set command. op Sets param1 to the specified probe op or display element value. model Sets param1 to the specified display model value. sens Sets param1 to the specified (normalized) DC sensitivity value. acsenm Sets param1 to the specified AC sensitivity magnitude at the specified frequency freq. (If freq is not exactly equal to one of the swept frequencies, the closest frequency is chosen.) acsenp Sets param1 to the specified AC sensitivity phase at the specified frequency freq. trans Sets param1 to the DC small-signal value of the transfer function (out/in), the input resistance (inr), or the output resistance (outr). Note: In the above syntax, named refers to the device name, namee refers to the element name, namem refers to the model name, and namep refers to the parameter name. The parameter values available through this command are all those listed by the corresponding probe and display commands. op, model, sens, acsenm, and acsenp are not Cadence SPICE functions and can only be used in conjunction with the equate command. December 1998 122 Product Version 4.4.2 Cadence SPICE Reference Manual Commands Usage Rules ■ The following do not follow probe op and display element naming conventions: ACPHS=AC phase ACVAL=AC value DCVAL=DC value I=current P=power V=voltage VAL=value ■ Subcircuits are allowed on the equate command. Examples equate equate equate equate equate equate equate A=op(R1,VAL) B=model(M10,VTO) C=op(R3,I) D=op(ID,DCVAL) E=model(JTEST,BETA) F=sens(R1) G=sens(Q1,BF) H=acsenm(Q2,CMU,10K) I=acsenm(X1^X2^Q2,CMU,5K) J=trans(out/in) K=trans(outr) L=trans(inr) December 1998 123 Product Version 4.4.2 Cadence SPICE Reference Manual Commands get Loads Cadence SPICE output from the appropriate analysis into memory so that it can be accessed with any of the following functions: V(node) Node voltage for any get command. VM(node) Magnitude of the ac node voltage. VP(node) Phase of the ac node voltage. VR(node) Real part of the ac node voltage. VI(node) Imaginary part of the ac node voltage. I(name) Transient and dc sweep branch current through element name. IM(name) Magnitude of the ac branch current through element name. Implemented only for voltage sources. IP(name) Phase of the ac branch current through element name. Implemented only for voltage sources. IR(name) Real part of the ac branch current through the element name. Implemented only for voltage sources. II(name) Imaginary part of the ac branch current through element name. Implemented only for voltage sources. I(name,port) Transient and ac sweep branch current through device name and port. IM(name,port) Magnitude of the ac branch current through device name and port. Implemented only for voltage sources. December 1998 124 Product Version 4.4.2 Cadence SPICE Reference Manual Commands IP(name,port) Phase of the ac branch current through device name and port. Implemented only for voltage sources. IR(name,port) Real part of the ac branch current through device name and port. Implemented only for voltage sources. II(name,port) Imaginary part of the ac branch current through device name and port. Implemented only for voltage sources. You do not need to issue the get command for the display and probe commands. Usage Rules ■ After a successful get command, you can issue the printvs, plot, oplot, tplot, and wplot commands without the vs . . . arguments such as plot VM(3) VM(5). The vs from and to parameters are identical to those in the original sweep command. ■ The DC node voltages calculated by Cadence SPICE prior to a DC, AC, or transient analysis are available after a successful get command via VDC (nodenam). For example: print VDC(210), plot (C(23)-VDC(23)). ■ You can access the value of node voltages during a transient sweep by setting the Cadence SPICE parameter time. For example: set time=1, print V(23), set vdelta=V(24)V(23). ■ After each go command and successful Cadence SPICE execution, an automatic get is performed on the first analysis swept after the sim command. However, if PSFFLG=1, no automatic get occurs. Example sim test sweep time from 0 to 100ns by 5ns sweep FREQ from 1me to 100me by 1me keep 1 go get ac plot VM(21) If there are no Cadence SPICE errors, an automatic get tran is done as soon as the program has finished simulating. If you want ac information you must type get ac. December 1998 125 Product Version 4.4.2 Cadence SPICE Reference Manual Commands getdis getdis numpts output1[(x)] array1 [output2[(x)] arrayz . . . Gets the disto information from the binary files and stores it in arrays for future use. numpts Number of points stored, always starts at first frequency. output One of the following: freq Frequency hd2 Magnitude of the frequency component 2*f1, assuming f2 is not present. hd3 Magnitude of the frequency component 3*f1, assuming f2 is not present. sim2 Magnitude of the frequency component f1 + f2. dim2 Magnitude of the frequency component f1 - f2. dim3 Magnitude of the frequency component 2*f1-f2. f1 is the nominal analysis frequency and f2=skw2*f1 (see the disto command). xOne of the following: r Real i Imaginary m Magnitude p Phase db 20 * LOG10 arrayDimensioned Cadence SPICE array into which the data is stored. Examples array srel(6) simg(6) getdis 6 sim2(r) srel(1) sim2(I) simg(1) This example gets six points from sim2(r), the real part of the magnitude of the frequency component f1 + f2, and stores that data in the array srel; and six points from sim2(i), and stores that data in the array simg. array ahd(10) asim(10) adim(10) getdis 10hd2(M)ahd(1) sim2(p)asim(1) dim3(r) adim(1) December 1998 126 Product Version 4.4.2 Cadence SPICE Reference Manual Commands getvar getvar filename [percent permat] mag at freqval [percent permat] phs at freqval [percent permat] Takes the sensitivity analysis output stored in filename file and generates a table containing those sensitivities that are larger than percent times the maximum sensitivity. If not specified, percent defaults to 0.01, and permat defaults to 0.02. For AC analysis you must specify mag or phs (sensitivity magnitude or phase), plus the frequency freqval. If the requested frequency value is not exact, the closest frequency to the one desired is used. The original table then divides into two tables, the paired and unpaired. For two sensitivities to be paired, the parameter values must be the same, and their sensitivities must be opposite in sign with magnitudes within permat of each other. A getvar command is valid only on a file resulting from a senstr command or a delvar command. Example After simulation with sensitivity analysis, senstr W1 set VIN=15 TIN=25N go senstr W2 delvar W1 W2 W3 getvar W3. 5 .1 December 1998 127 Product Version 4.4.2 Cadence SPICE Reference Manual Commands printvs Prints the data as columns of numbers with headings. You can print up to six expressions versus the sweep parameters. The vs portion of the command is optional following an appropriate get command. Use the all parameter to print all the raw data points without interpolation. If you omit this option, data points are interpolated linearly or quadratically depending on the value of the variable QADLIN. Set QADLIN to 0 for linear interpolation (the default) or to 1 for quadratic interpolation. The param parameter sweeps from startexp to stopexp, incremented by increxp in one of the following ways: by Increments param by adding increxp to it. times Increments param by multiplying it by increxp. oct Increments param by multiplying it by an internally computed multiplier to achieve increxp values of param per octave. dec Same as oct except increments are per decade instead of octave. (by, times, oct, dec) increxp is optional. If omitted, by 1 is assumed. Examples printvs x(i) ye vs i from 1 to 10 get ac printvs VM(21) December 1998 128 Product Version 4.4.2 Cadence SPICE Reference Manual Commands probe Displays information returned from the circuit simulation. nv Displays the dc node voltages. nvl Displays the dc node voltages with maximum precision. tnv Displays the final timepoint node voltages. Note: If the simulation ends on a breakpoint of one of the time variable sources in the circuit, the time accessed by probe tnv does not correspond to the final sweep time. Time advances to the next breakpoint. To get around this problem, set time= final sweep point and access the December 1998 129 Product Version 4.4.2 Cadence SPICE Reference Manual Commands node voltages directly, that is, print v(3) for node 3. You can use probe nv * ^ to probe toplevel node voltages. tnvl Displays the final timepoint node voltages with maximum precision. op, opl, ops op displays the device operating point information. opl gives maximum precision. ops is the short version, which includes only the three most important values at the operating point. sat and bkdwn are displayed for op and opl. probe op displays saturation/linear/breakdown information. For a BJT, the saturation region is flagged by sat. For all FETs the linear region is flagged by lin. All devices are flagged for breakdown by bkdwn. If sat, lin, or bkdwn equals 9.456E-35, the device did not saturate, enter linear region, or enter breakdown region. Otherwise, sat/lin indicates the time (if transient) or voltage (if DC) after TIMSAT (or DCSAT), in which the device saturated or entered linear region. For a BJT, sat indicates the previous timepoint (if transient) or voltage (if DC) after TIMSAT (or DCSAT), at which the transistor saturated. (Internal VBC is calculated from previous timepoints.) Bkdwn indicates the time or voltage at which the device entered the breakdown region. tp, tpl, tps tp displays final device time point information. tpl gives maximum precision. tps is the short version, which includes only the three most important values at the timepoint. noise at Displays the noise at the specified frequency (if a noise analysis has been run). sens wrt Displays the dc sensitivities of elements and devices specified. acsen at Displays the ac sensitivities of the requested elements and devices at the specified frequency (if an ac analysis has been run). For the devices, small-signal sensitivities are available. disto at Displays the distortion at a specified frequency (if an ac analysis has been run). December 1998 130 Product Version 4.4.2 Cadence SPICE Reference Manual Commands four at Displays the Fourier analysis for a given keep variable. trans Displays the output for the dc small-signal value of the transfer function analysis. Note: Subcircuits are allowed on all of the above commands. You can probe node voltages in the same subcircuit by separating them with a comma: probe nvl X1^X2^1,3 Examples probe probe probe probe probe probe probe ops * op Q1 X1^Q2 sens wrt R1 R10 R15 nv * nv X1^X2^* acsen * wrt G1 G7 G10 acsen at * wrt * Wild Card Characters You can use the wild card characters (.) and (*) in the following probe commands: nv, nvl, tnv, tnvl, op, tp, sens wrt, acsen at, ops, opl, tps, tpl. A period (.) designates any single character. An asterisk (*) designates any string of characters. More than one (.) is allowed at a time, but only one (*) is valid. For example, R.1.2 is valid, but R*1*2 is not valid. Examples R. Q.2 .3 V* *1 RB*2 = = = = = = R1, R2, RB, etc. Q12, QA2, QM2, etc. R3, Q3, V3, 23, etc. V1, V, V123, VA2, etc. Q1, 1, MMOD1, etc. RB12, RB452, RB63B2, etc. December 1998 131 Product Version 4.4.2 Cadence SPICE Reference Manual Commands recall recall filename Recalls information saved in a previous Cadence SPICE session. Filename is the name of the file containing the saved information. Actually, several files must exist to execute the recall command: filename filename1 filename2 filename3 filename4 These files were all generated by the save command. The recall command allows access to the following: ■ All print or plot node voltages or currents specified by previous keep statements . ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ keeps sweeps nodset restore trstore functions arrays macros noise simulator used ■ ■ ■ ■ ■ ■ ■ ■ ■ user parameters parameters display nodnam display stat probe nv probe op display model probe noise aw/waves (mixed-signal) You can display and use all of the above information. You can use the sim file.c old command without retyping the keeps, sweep, and so forth. An automatic get will be performed on the first sweep type. If you want other sweep information, execute the appropriate get (ac, dc, ran, noise) command. Notes: ■ A save command must precede the recall command. December 1998 132 Product Version 4.4.2 Cadence SPICE Reference Manual Commands ■ You cannot use the recall command in an earlier Cadence SPICE version to recall a file you save using the save command in a later Cadence SPICE version. For example: If you save a file in version 2.2, you can recall the file in versions 2.2, 2.3, and so forth. If you save a file in version 2.3, you cannot recall the file in version 2.2. ■ You should eliminate files when you no longer need them. December 1998 133 Product Version 4.4.2 Cadence SPICE Reference Manual Commands save save filename Saves information from a current Cadence SPICE session for use in a later session. Filename is the name of the file in which information is saved. If the filename does not exist it is created. Several files are created: filename filename1 filename2 filename3 filename4 All these files are necessary to use the information at a later date. These files might be large and should be eliminated when no longer needed. The save command saves ■ All print or plot node voltages or currents specified by previous keep statements. ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ keeps sweeps nodset restore trstore functions arrays macros noise simulator used ■ ■ ■ ■ ■ ■ ■ ■ ■ user parameters parameters display nodnam display stat probe nv probe op display model probe noise aw/waves (mixed-signal) Note: You can do multiple saves as needed. Use the recall command to retrieve the data. December 1998 134 Product Version 4.4.2 Cadence SPICE Reference Manual Commands senstr senstr filename Stores sensitivities in filename. You can then access them later with a delvar command or a getvar command. You can use this command only after a sensitivity analysis. If filename file does not already exist, it is generated. December 1998 135 Product Version 4.4.2 Cadence SPICE Reference Manual Commands store store filename Stores the node voltages from the DC analysis in filename. You can use this file for initializing future analyses. If filename does not exist, it is generated. You can use this command only after the go command. To later use these node voltages to initialize an analysis, use the restore command. There are two store formats. The first (when the ARTSTR variable equals 0, which is the default) prints the node voltages and the voltage source currents. This file is useful when you run several simulations without modifying the circuit topology. (You can modify circuit parameters and variables, however.) This method is quicker and less flexible than the second. The second store format (when the ARTSTR variable equals 1), prints the node-voltage pairs, and lets you renetlist or change the circuit topology. You can use this file only if the expected operating point of the new circuit is close to the operating point of the circuit from which the stored file was generated. If not, this stored file can be the source of convergence problems. December 1998 136 Product Version 4.4.2 Cadence SPICE Reference Manual Commands tstore tstore filename Stores the node voltages from the transient analysis in the filename specified for initializing future analyses. If filename does not exist, it is generated. You can use this command only after the go command. To later use these node voltages to initialize an analysis, use the trstore command. Graphics Table 4-6 Command Summary Command Brief description Page delay Delays execution for specified number of seconds delay erase Erases graphics from terminal erase hcopy Copies terminal screen to attached hard copy unit hcopy histo Plots a line-printer format histogram (bar plot) histo oplot Plots y1, y2, . . .yn-1 versus yn in current window oplot plot Plots y=f (x) in line-printer format plot plot3d Plots z=f(x,y) in current window plot3d spec Does a modified plot of the Fourier analysis data spec view3d Sets view angle and axis labels for plot3d view3d werase Erases text and/or graphics from specified window werase whisto Plots histogram (bar plot) in current window whisto window Sets screen window for window plots window wplot Plots y=f (x) in current window wplot wscat Plots a scatter plot of y1 versus y2 in current window wscat wtext Puts text string in the current graphics window wtext December 1998 137 Product Version 4.4.2 Cadence SPICE Reference Manual Commands delay delay expression Delays execution for the length of time specified by expression (in seconds). For example, delay might be used after a printer command to allow enough time to print out the information before the next command is executed. expression is any valid Cadence SPICE expression. There cannot be embedded blank spaces within the expression. Examples delay 10 (the delay is 10 seconds) delay y(1)*b*a December 1998 138 Product Version 4.4.2 Cadence SPICE Reference Manual Commands erase erase Clears the screen of any graphical output, such as from a wplot or whisto command. It also clears the screen of previous commands and alphanumeric output. December 1998 139 Product Version 4.4.2 Cadence SPICE Reference Manual Commands hcopy hcopy Makes a hard copy of the screen to a local printer or hard copy unit. This command works with the following terminal/printer configurations: ■ VT125 or VT240 with an LA50, LA100, or LN03 printer ■ HP2648 with a 2631G printer ■ Tektronix® 4010/4012 with a 4631 hard copy unit December 1998 140 Product Version 4.4.2 Cadence SPICE Reference Manual Commands histo histo param numpoint [forcemin forcemax] arrayname(expr1,expr2,...) Creates a line-printer type histogram of numpoint values starting at entry param of arrayname. numpoint, forcemin, and forcemax can be expressions. If you omit forced minimum and maximum, they are computed from the data. You can control the number of histogram bins by setting built-in parameter NBINS. The default for NBINS is 5, the maximum is 101 bins. Examples histo ydata(1) 100 0 1000 histo ans(1,2) 50 December 1998 141 Product Version 4.4.2 Cadence SPICE Reference Manual Commands oplot Identical to the wplot command, except that the last expression before the vs becomes the x variation of each of the other y-expressions. param sweeps from startexp to stopexp in one of the following ways: by Linear x-axis. Increments param by adding increxp to it. times Log x-axis. Increments param by multiplying it by increxp. oct Log x-axis, where increxp is the number of points per octave, or power of 2. dec Log x-axis, where increxp is the number of points per decade. vs param from startexp to stopexp is optional only if a successful simulation has been run. Then, if startexp/stopexp values are not specified, the start/stop increment of the specified sweep is used. The (by, times, oct, dec) increxp statement is optional. If it is omitted, the program uses by 1. For each expression you plot, you can place :L immediately after the expression to plot the log of the expression with a log axis. Examples oplot sin(theta) cos(theta) vs theta from 0 to TWOPI Draws a circle. oplot sin(theta) sin(2*theta) cos(theta) vs theta from 0 to TWOPI Draws a circle around a horizontal figure eight. December 1998 142 Product Version 4.4.2 Cadence SPICE Reference Manual Commands plot Generates a line-printer type vertical plot of the expression(s), (expr1,...), versus the param parameter swept from startexp to stopexp, in one of the following ways: by Linear x-axis. Increments param by adding increxp to it. times Log x-axis. Increments param by multiplying it by increxp. oct Log x-axis, where increxp is the number of points per octave, or power of 2. dec Log x-axis, where increxp is the number of points per decade. The (by, times, oct, dec) increxp statement is optional. If it is omitted, the program uses by 1. For each expression you plot, you can specify the following options immediately after the expression: :L Plot the log of the expression with a log axis. :P Print the values of the expression beside the plot. :LP Do both of the above. Usage Rules ■ You can plot up to nine expressions on one graph. ■ You can use the built-in YMIN and YMAX parameters to force plot limits, but XMIN and XMAX are ignored. ■ The portion of the command beginning with vs is optional following an appropriate get command, but if you use vs, then you must use from startexp to stopexp. December 1998 143 Product Version 4.4.2 Cadence SPICE Reference Manual Commands Examples plot x vs x from 1 to 100 dec 4 Plots x versus x on a linear log scale where the x-axis ranges from 1 to 100, calculating 4 points per decade. plot a**x:L vs x from 1 to 10 by .2 Plots the function a**x versus x on a log linear scale, calculating y for each x over the specified range, as follows: a**1.0, a**1.2, a**1.4, ..., a**10.0 get ac plot VM(21):P Plots the ac magnitude of node voltage 21 and prints the values of the voltages vertically along the x-axis. plot yarray(INDEX) vs x from 1e-5 to 1e-2 dec 1 This example shows how to use the INDEX variable with plot. It plots the first four points from yarray array (read in or generated in a loop). December 1998 144 Product Version 4.4.2 Cadence SPICE Reference Manual Commands plot3d plot3d expr1... vs param1 vs param2 from startexp1 from startexp2 to stopexp1 to stopexp2 [by increxp1] [by increxp2] Generates a three-dimensional plot of expr1 . . . , versus the two sweep parameters param1 and param2, which sweep from startexp1 and startexp2, to stopexp1 and stopexp2. param1 and param2 increment by increxp1 and increxp2. The plot is placed in the current window. The increxp statement is optional. If it is omitted, the program uses by 1. Note: The built-in parameters XMIN, XMAX, YMIN, and YMAX are not used by plot3d. Examples plot3d sin(i)*cos(j) vs i from -.4 to.4 by.1 vs j from -.6 to.6 by .1 plot3d z(i,j) vs i from 1 to 20 vs j from 1 to 20 December 1998 145 Product Version 4.4.2 Cadence SPICE Reference Manual Commands spec spec outvariable mag phs spec does a modified plot of the Fourier analysis data. outvariable Kept node or current mag Magnitude phs Phase Examples spec 2 mag spec x1^2 phs December 1998 146 Product Version 4.4.2 Cadence SPICE Reference Manual Commands view3d view3d [xlabel ylabel zlabel n] Assigns axis labels xlabel, ylabel, and zlabel, and assigns a viewing angle n for plot3d. The default axis labels are x-axis, y-axis, z-axis and the default view angle is 1, where the origin is in the lower left corner. All rotations are above the vertical z-axis. Usage Rules ■ The maximum length of a single axis label is 20 characters. You cannot embed a blank in a label. ■ The viewing angle n must be 1, 2, 3, or 4, which refer to one of the following rotations about the Z-axis: n=1 for view from lower-left corner n=2 for view from lower-right corner n=3 for view from upper-right corner n=4 for view from upper-left corner ■ view3d with no arguments restores the default axis labels and view angle. Example view3d x-axis.label y-axis.label z=f(x,y)=sin(x)*cos(y) 3 December 1998 147 Product Version 4.4.2 Cadence SPICE Reference Manual Commands werase werase [xorigin yorigin xdelta ydelta] Erases only the rectangular region of the screen within a specified window. When no coordinates are specified, the area set by the last window command is erased. If the parameters are specified, the rectangular region with lower left corner at (xorigin, yorigin) and upper right corner at (xorigin + xdelta, yorigin + ydelta) is erased. The default values are 0 0 1 1, and all four parameters must be between 0 and 1, inclusive. On terminals with separate text and graphics planes, only the graphic output is erased. Examples werase 0 0 1 1 werase werase 0 .5 1 .5 December 1998 (erases entire screen) (erases area of screen specified by last window) (erases upper half of screen) 148 Product Version 4.4.2 Cadence SPICE Reference Manual Commands whisto whisto arrayname (expr1,expr2 . . .)numpoints [forcemin forcemax] Creates a histogram of numpoints values starting at the indexed entry of arrayname. The histogram is put in the window previously specified by the window command. Numpoints, forcemin, and forcemax can be expressions. If you do not specify forcemin and forcemax, they are computed from the data. You can control the number of bins by setting parameter NBINS. The default number of bins is 5; the maximum is 101. Examples whisto xdata(1) 50 0 100 whisto ydata(1) 20 set NBINS=10 whisto info(1) December 1998 100 149 Product Version 4.4.2 Cadence SPICE Reference Manual Commands window window xorigin yorigin xdelta ydelta Defines the location of plots (wplots) on the screen. xorigin and yorigin are the coordinates of the lower left corner of a rectangular window of size xdelta by ydelta, into which graphics output is written. The default values are 0 0 1 1, which locate plots with the origin in the lower left corner and generate the largest rectangle that can fit on the screen. Examples window 0 0 1 1 window .5 .5 .5 .5 December 1998 (full screen) (upper right quadrant of screen) 150 Product Version 4.4.2 Cadence SPICE Reference Manual Commands wplot Generates a plot of yexpr1, and so forth, versus param parameter in the screen window specified by the window command. param sweeps from startexp to stopexp in one of the following ways: by Linear x-axis. Increments param by adding increxp to it. times Log x-axis. Increments param by multiplying it by increxp. oct Log x-axis, where increxp is the number of points per octave, or power of 2. dec Log x-axis, where increxp is the number of points per decade. vs param from startexp to stopexp is optional only if a successful simulation has been run. Then, if startexp/stopexp values are not specified, the start/stop increment of the specified sweep is used. The (by, times, oct, dec) increxp statement is optional. If it is omitted, the program uses by 1. The first time you issue this command, you are prompted for terminal type (if TTYPE is not already set). For each expression you plot, you can place :L immediately after the expression to plot the log of the expression with a log axis. Usage Rules ■ The built-in parameters YMIN, YMAX, XMIN, and XMAX set limits when plotting. ■ You can plot up to nine expressions on one graph. Examples wplot sin(x) cos(x) vs x from 0 to TWOPI by TWOPI/50 December 1998 151 Product Version 4.4.2 Cadence SPICE Reference Manual Commands wplot v(2) I(R1) December 1998 displays a node/voltage current (after a successful simulation) 152 Product Version 4.4.2 Cadence SPICE Reference Manual Commands wscat wscat arrayy(indexy1,indexy2,...) vs arrayx(indexx1,indexx2,...) for numpoints Generates a scatter plot of arrayy versus arrayx for numpoints, starting at positions in arrays specified by arguments indexy1, indexx1, and so forth. The plot is placed in the window previously specified by the window command. If TTYPE is not set, then the first time this or any window command is issued, you are prompted for the terminal type. Usage Rule The built-in parameters YMIN, YMAX, XMIN, and XMAX set limits for plotting. Example wscat x(1) vs y(1) for 20 December 1998 153 Product Version 4.4.2 Cadence SPICE Reference Manual Commands wtext wtext “text string” x-pos y-pos [color] [size] Puts a text string in the current graphics window at location (x-pos, y-pos). You can also specify the color and size of the text. Usage Rules Text string is a string of characters enclosed by double quotes. ■ The text positions (x-pos, y-pos) are numbers between 0 and 1, inclusive. ■ Color is a number that corresponds to the plot colors, beginning with 0. ■ Size is a value from 0 through 9. Examples wtext “hello world” .4 .5 0 0 wtext “Title” .45 .95 -1 1 Notes: Due to terminal text orientation, certain values of x-pos and y-pos can cause the text to be outside the current window. Values of -1 for color and size cause the default values to be used. Color and size can be meaningless on certain terminals. Plotting in a Tektronix Window You can obtain Tektronix plots while running Cadence SPICE as a standalone simulator on most UNIX systems by using TTYPE values of 8 for “dumb terminal” or 12 for “Tektronix plots.” To open a Tektronix window in UNIX running XWindows™ and then redirect the Cadence SPICE plots to the new window: 1. Create a new xterm window. 2. With the cursor in the new xterm window, press the control key and the middle mouse button at the same time. 3. From the menu that appears, select: December 1998 154 Product Version 4.4.2 Cadence SPICE Reference Manual Commands Show Tektronix Window (tekshow is the selection in OpenWindows) 4. In your new window, press the control key and the middle mouse button at the same time. Choose the following from the menu that appears: Hide VT Window (in your new window) (vthide is the selection in OpenWindows) 5. Move the mouse into the new Tektronix window and type “tty”. (The window provides a TTY number in the format: “ttypn”, where n is the number provided by the window.) 6. To bring up Cadence SPICE, move the mouse to the window where you want to see the text appear during your simulation, and type /bin/sh cdsSpice 2>/dev/ttypn 3>/dev/ttypn where the n is the number provided by the Tektronix window. (See the following note) 7. To test your Tektronix window in cdsSpice, type wplot x vs x from 1 to 5 by 1 8. When you are prompted for the terminal type, enter 12. To avoid the prompt, type the following command set ttype=12 before requesting any plots. (You can also use the erase command to erase the window between plots.) Note: There are two other methods that you can use to bring up cdsSpice rather than typing the Bourne Shell (/bin/sh) command above. 9. You can create in your bin directory several files called cds1 cds2 cds3 cds4 cds5 . . . which contain the following: cds1: cdsSpice 2>/dev/ttyp1 3>/dev/ttyp1 cds2: cdsSpice 2>/dev/ttyp2 3>/dev/ttyp2 cds3: cdsSpice 2>/dev/ttyp3 3>/dev/ttyp3 After you have found the tty number of your Tektronix window (1, for example), you can type: December 1998 155 Product Version 4.4.2 Cadence SPICE Reference Manual Commands cds1 This will bring up cdsSpice and redirect the graphics to the Tektronix window. When you leave cdsSpice, you will be returned to the csh environment. 10. Alternatively, you can add the following line to your .cshrc file: alias cds sh -c ‘”cdsSpice 2>/dev/ttyp’’\!*’’ 3>/dev/ttyp’’\!*’’ “‘ Then if your Tektronix window was /dev/ttyp5, type the following in the UNIX window where you want to start up cdsSpice: cds 5 December 1998 156 Product Version 4.4.2 Cadence SPICE Reference Manual 5 Circuit Analysis ■ DC Analysis ■ AC Small-Signal Analysis ❑ Noise Analysis ■ Transient Analysis ■ Convergence ■ DC Convergence ■ ■ ■ ■ ❑ Fixing Circuit File Errors ❑ Using the convrg Command ❑ Using the store and restore Commands ❑ Forcing Node Voltages Transient Convergence ❑ Initial Conditions ❑ Using NRAMP Transient Analysis Timestep ❑ Local Truncation Error Method ❑ Iteration Timestep Control Method Simulation Control Variables ❑ Variables that Affect Transient Internal Timestep ❑ Variables that Affect Tolerance Readin-Bypass December 1998 157 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis DC Analysis DC analysis determines the DC operating point of the circuit with inductors shorted and capacitors opened. The Cadence SPICE program performs DC analysis automatically prior to ■ Transient analysis to determine the transient initial conditions ■ AC small-signal analysis to determine the linearized, small-signal models for nonlinear devices You can also initialize by using the restore or trstore command. (See the “Commands” chapter.) You can use DC analysis to generate DC transfer curves. The program steps a specified independent voltage or current source over the specified range of values and stores the DC output variables for each sequential source value. You can also determine the DC smallsignal sensitivities of specified output variables with respect to circuit parameters. AC Small-Signal Analysis AC small-signal analysis computes the AC output variables as a function of frequency. The program performs the following steps: ■ Computes the DC operating point of the circuit and determines linearized, small-signal models for all of the nonlinear devices in the circuit. ■ Analyzes the resultant linear circuit over the range of frequencies that you specify. The desired output of an AC small-signal analysis is usually a transfer function such as voltage gain or transimpedance. If the circuit has only one AC input, it is convenient to set that input to unity and zero phase, so that output variables have the same value as the transfer function of the output variable with respect to the input. Noise Analysis You can also simulate the generation of white noise by resistors and semiconductor devices with the AC small-signal analysis. Equivalent noise source values are determined automatically from the small-signal operating point of the circuit, and the contribution of each noise source is added at a given summing point. The total output noise level and the equivalent input noise level are determined at each frequency point. The output and input noise levels are normalized with respect to the square root of the noise bandwidth and are expressed in V/Hz1/2 or A/Hz1/2. You can print or plot the output noise and equivalent input December 1998 158 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis noise in the same way as other output variables. No additional input data is necessary for this analysis. You can simulate flicker noise sources in the noise analysis by including values for the KF and AF parameters in the appropriate device models. (Refer to the “Device Models” chapter.) You can simulate the distortion characteristics of a circuit in the small-signal mode as a part of the AC small-signal analysis. The program performs the analysis by assuming that one or two signal frequencies are imposed at the input. Specify the frequency range for noise and distortion analysis parameters with a sweep freq command. Transient Analysis The transient analysis portion of the Cadence SPICE program computes the transient output variables as a function of time over the time interval that you specify. A DC analysis automatically determines the initial conditions, or you can force the conditions with the nodset and trstore commands. The program sets all sources that are not time-dependent (such as power supplies) to their DC values. Specify the transient time interval and the Fourier analysis options with a sweep time command. Convergence The program obtains both DC and transient solutions by an iterative process that terminates when both of the following conditions are met: ■ The nonlinear branch currents converge to within a tolerance of 0.1 (RELTOL) percent or 10N (ABSTOL), whichever is larger. ■ The node voltages converge to within a tolerance of 0.1 (RELTOL) percent or 1 microvolt (VNTOL), whichever is larger. You can change the above default values for RELTOL, ABSTOL, and VNTOL (defined in the “Built-In Variables and Arrays” chapter) with the set command. Although the algorithm used in the Cadence SPICE program is very reliable, it can fail to converge to a solution. When failure occurs, the program automatically executes the convrg command (refer to the “Commands” chapter). If the circuit still does not converge, the program prints the node voltages at the last iteration and stops the simulation. The following commands provide information on nodes that did not converge: December 1998 159 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis probe nv Prints an asterisk (*) next to every node that did not converge. probe op Prints an asterisk next to every device that did not converge. In such cases, the printed node voltages are not necessarily correct or even close to the correct solution. Failure to converge in the DC analysis is usually due to an error in specifying circuit conventions, element values, or model parameter values. DC Convergence “NO CONVERGENCE IN DC ANALYSIS” is a common error message. The Cadence SPICE DC analysis determines the DC operating point of the circuit with inductors shorted and capacitors opened. An initial DC solution is required prior to a transient analysis to determine initial transient conditions and prior to a small-signal AC analysis to compute the linearized small-signal models for nonlinear devices. Therefore, DC convergence is necessary prior to a transient or AC analysis. The program contains several aids for solving DC convergence problems. Fixing Circuit File Errors A primary cause of nonconvergence is circuit file errors. Incorrectly connected devices and elements the same node used twice in the circuit are common errors. The following commands can help you discover such hookup errors (also described in the “Commands” chapter): Display node * Prints each node followed by the list of elements or devices to which the node is connected. Display element* Shows the element or device name followed by the Device *connecting nodes. The value of the element and the area and model name of the device are also given. Display model * Outputs the model name, type, and associated variables. Useful for checking for improperly assigned model variables. After confirming that the message is not due to a circuit file error, you can use one of the methods in the following sections for solving the convergence problem. December 1998 160 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Using the convrg Command You can use the convrg command either by itself or with any of its arguments (see the “Commands” chapter). The convrg routine, which is highly reliable for achieving DC convergence for troublesome circuits, uses a continuation method and does the following: 1. Internally adds a resistance from each node in the circuit to ground and across each semiconductor junction. The initial resistance value is rather large, 1E-3 ohms. 2. Runs a DC simulation. Under this condition, with the added resistance across each node and junction, the circuit tends to behave in a more linear manner, thus more readily enabling convergence. 3. Internally decreases the resistance. 4. Runs another DC simulation, using the results of the previous simulation for initial values. 5. Continues this procedure until it achieves a resistance default of 1E-12 ohms, or until several internal adjustments have not achieved convergence. The program displays the results so that you can witness the sequence of events. This method is generally successful, since convrg incrementally tracks the DC circuit operation from an almost linear state to its desired nonlinear state. Using the store and restore Commands Once you obtain a DC solution, you can store the results using the store and restore commands (refer to the “Commands” chapter). store Saves the node voltages from the DC analysis into a userspecifiable file. restore Retrieves the saved values in a later Cadence SPICE session, so that you obtain convergence easily. The restore file can also be an excellent starting point for obtaining a DC solution after you make minor changes, such as component values or temperature, to a circuit. December 1998 161 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Forcing Node Voltages A very powerful continuation method (convrg) is automatically called to achieve DC convergence on troublesome circuits. If convergence is still not achieved and the circuit has no connectivity problems, use nodset commands to initialize node voltages. Refer to the “Commands” chapter. Nodset lets you specify a “good” initial starting point for any node voltage. This feature is particularly useful for circuits that contain cross-coupled devices such as latches or flip-flops. After a circuit has failed to converge, you can execute a probe nv * command. Along with the node voltages, an asterisk (*) is printed beside each node that did not converge. Once you identify the problem nodes (such as high impedance nodes), use nodset to set these node voltages to appropriate initial values that you can usually determine from hand calculations and approximation methods. The circuit is more likely to converge if you set the problem nodes to expected values. The nodset command creates a current source (=volt/RON) from ground to the specified node in parallel with a resistance (RON). The default for RON is 1 ohm. Because the current source and resistor are new elements in the circuit, the node is hard set and never released for the duration of the analysis. This applies to the duration of the DC operating point and any other analyses, such as transient, that follow. The node is held until you turn it off with nodset off (or, if you are working in the Analog Artist Simulation Environment, the Remove command in the Force Node Voltages section of the Set Variables and State menu). The advantage of forced node voltages is that you force a node to your desired solution, which forces the rest of the circuit to find an acceptable solution. Because the extra elements are based on the RON Cadence SPICE variable, you can use this technique to aid convergence. You can loop RON (similar to parametric plotting loops) to slowly release the effects of RON. Sequence of Cadence SPICE commands: sim test nodset 1 1. 2.2 go store gtest nodset off restore gtest go if converged: store gtest if did not converge: nodset 1 1.3 2 2.2 set ron=10k (you might need to start RON at a smaller value, such as 10) go store gtest restore gtest set ron=10k go December 1998 162 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis • • • ron=10g (value at which nodset is effectively off The disadvantage is that the solution is not really a “true solution” because the simulator did not solve for, but was forced to accept, this value. You can eliminate this disadvantage by using the store/restore capabilities in Cadence SPICE, as described below for nodset nodes. The Force Node Voltages section of the Analog Artist Set Variables and State menu is equivalent to the nodset node voltage command in Cadence SPICE. Nodset Nodes The Node Set section of the Set Variables and State menu in the Analog Simulation Environment is equivalent to the following sequence of Cadence SPICE commands: nodset node value hard set nodset, as described above go run the simulation store files store the DC node voltages nodset off turn off the nodset restore file restore the node voltages go run the simulation The nodes set with nodset are first forced to the specified values by placing a current source in parallel with a resistance, as described in the section on forced nodes. The analysis is then run. Then nodset is turned off, which removes the current and resistor source. The analysis (DC operating point) is rerun using restored voltages. In this sequence, the set values are used as an initial guess for the Newton-Raphson iteration loop. Because a solution was found with this “initial guess” in the first run with the nodset command, the new solution will probably be very close to this initial guess, and will usually be found in less than four iterations. This is a more accurate solution because the simulator was able to solve it. Choosing nodset and a transient analysis is equivalent to the following: sweep off turn off the transient analysis (for example) nodset node value hard set nodset, as described above December 1998 163 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis go run the simulation store file save the DC node voltages nodset off turn off the nodset set dcoppt=0 turn off the DC operating point analysis trstore file trstore the node voltages for the transient sweep ... put back the transient sweep go run the simulation In this and the previous cases, the DC operating point is first computed using the nodset command, which introduces the current source in parallel with a resistor. The simulator finds a solution and turns off nodset, that is, removes the current source and the resistor. Then to do a transient analysis, Cadence SPICE turns off the DC operating point, restores the node voltages, and runs the transient analysis. Cadence SPICE does not need to recompute DC, and so turns off DC to ■ Save time. The simulator does use the DC operating point. ■ Avoid confusion. The simulator uses a trstore file. If the Cadence SPICE does not turn off the DC operating point, you might get different values for the DC operating point (back annotation of node voltages) and the time=0 values for those nodes. All commands sent to Cadence SPICE when you select an Analog Simulation Environment menu command are in the /tmp/artist.log file. Transient Convergence Initial Conditions The initial conditions (ICs) specified on devices and elements, such as the IC= for a capacitor, initialize the devices and elements for transient analysis. The ICs do not have an effect during DC. In addition, the IC values are used as an initial guess to the Newton-Raphson iteration at TIME=0. Therefore, although the TIME=0 solution might start at a specified IC value, the final converged solution at TIME=0 might not be that specified IC value. The simulator must obey December 1998 164 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Kirchhoff’s current and voltage laws when computing the final solution at TIME=0. If a solution is found using your IC within the iteration, the final solution at TIME=0 is the IC value. To hard set nodes so that the ICs are kept for the time=0 solution, you can use a technique similar to the forced nodes described above. In this case, the nodes are hard set in DC, with the current source in parallel with the resistor. A solution for the entire circuit is found with these select nodes hard-wired. The rest of the circuit is forced to adjust, given that the other nodes are forced. This solution is stored and trstored for transient. As in the case of IC=, the voltages are an initial guess, not a final solution. The difference is that in the case of the trstore file, the entire circuit has been solved with the nodsets in place. Therefore, it should only take a few iterations to converge, and because the initial guess is a converged solution, the final solution of the Newton-Raphson iteration will probably equal the initial guess. Specifying Initial Conditions An option similar to the nodset command is specifying initial conditions on a device line in the circuit file. Rather than defining initial conditions for nodes, the IC variables specify initial conditions for voltages on particular devices. Generally the IC option is used if a device is not operating in the normal mode, such as a transistor operating in the inverse active region or a diode used as a Zener. For example, setting IC=0.65 for a transdiode used in the forward direction on an NPN device should work well. In general, circuits that contain both bipolar and FET devices should have all initial conditions set on the FET devices, which are not as numerically stable as the bipolar devices. There are several aids for setting initial conditions: ■ The probe op * command, which displays the operating point information for a device, can help you determine which initial conditions to set. ■ You can add the off property to all devices that should be in the off state at the beginning of the analysis. Off is particularly useful for convergence in regenerative switching circuits or circuits with positive feedback. ■ For very high impedance points in the circuit, you can add large-valued resistors (100ME to 100G) off the gates of FETs to ground. Ideal current sources, often used in the early design phases, also require this type of parallel resistor. Example Q1 Q3 J1 1 1 1 2 2 2 3 3 3 December 1998 NPNMOD IC=VBE VCE NPNMOD OFF JMOD IC=VDS VGC 165 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Using NRAMP If your circuit still does not converge, you can use NRAMP. (Refer to the “Built-In Variables and Arrays” chapter.) NRAMP essentially turns off the initial DC simulation, because a solution cannot be found, and instead uses a transient simulation to obtain a DC solution. NRAMP ramps all the DC voltage supplies from zero to their final values. This method is useful for circuits with inherent DC stability problems, such as triggers and oscillators. Turn on the NRAMP variable by setting it to a nonzero value, and specify a range for the transient analysis. The transient simulation should cover enough time to ensure that the circuit reaches a steady state. You can check this by plotting waveforms with the wplot command after the simulation completes. Thus NRAMP, by ramping on DC power supplies, gives the circuit enough time to settle to a stable solution. Once the simulation completes, you can use probe tnv * to determine if the final transient node voltages are correct. If the results are satisfactory, you should store the final transient voltages using the tstore command. Then you can reset NRAMP to 0 and restore the results. All subsequent transient or AC analyses will use these final transient NRAMP voltages as the DC starting solution. The following shows a typical command sequence: sim test set nramp=1 sweep time from 0 to 10m by 1m # should be enough time for most circuits to reach # steady state # keep node1 as output node go probe tnv * # to check the final transient node voltages tstore gtest # to save the final transient node voltages wplot v (Node1) # to check if indeed the steady state was reached set nramp=0 # turn nramp off restore gtest # restore the saved transient voltages-as a DC sweep off # to turn the previous transient sweep off go December 1998 166 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Transient Analysis Timestep “INTERNAL TIMESTEP TOO SMALL IN TRANSIENT ANALYSIS” is the most common transient analysis error. A transient analysis simulates the circuit over time by solving a system of nonlinear equations at discrete time points.You use the sweep command and specify a starting point (usually zero), a stopping point, and a timestep (sweep TIME from 0 to TSTOP by TSTEP). Unlike DC transfer curves and AC analyses, the step used internally by the program is not the same as that specified in the sweep command. The program uses the specified timestep for saving data for printing and plotting. The internal program timestep is determined by calculations dependent on the current performance of the circuit. Local Truncation Error Method You can use the local truncation error (LTE) to determine the timestep. Trapezoidal Integration During a transient analysis a solution must be found at every discrete point in time. To find this solution, the program uses the trapezoidal integration method. (The Gear integration method can also be used and is discussed later.) The error associated with numerical integration methods is called the local truncation error. The program uses LTE at each time point to determine the amount by which to increase the timestep. In general, a smaller timestep will be chosen if the LTE is large. Additional factors, such as the DELMAX and TINIT variables as well as the sweep timestep and the tolerance variables also help determine the next timestep. (These variables are discussed in further detail below.) These factors determine the next timestep if a solution is found at a particular time point. If the program does not find a solution, it divides the timestep by 8 and attempts another solution. If no solution is found, it divides the timestep by 8 again. This continuous dividing by 8 eventually leads to the timestep error message. Circuit File Errors The primary cause for timestep problems is circuit file errors, particularly unusually large or small element values (such as a 10H inductor or 0.01pF capacitor). The following commands (also described in the “Commands” chapter) can help you trace these errors: probe op * December 1998 Displays the operating point information for all the devices. 167 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis display element * Prints the element values. You can also use the display model command, as described in the “DC Convergence” section. After confirming that the message is not due to a circuit file error, there are several techniques available for solving the timestep problem. Varying Transient Sources A first technique is to slightly vary transient sources (such as pulse and PWL). Increasing the rise and fall times may allow the circuit sufficient time to settle into a more stable state. Check that the rise time on the pulse or PWL is not smaller than the timestep specified on the sweep command. If so, the first timestep may jump over the rise time completely, with the likelihood of nonconvergence at that time point. Altering Variables After the circuit is adjusted you can alter the following variables: DELMAX Maximum allowed timestep. Defaults to TSTOP/50. TINIT Used at time equal to zero and at each breakpoint (point of discontinuity) in the circuit. Defaults to TSTEP/10. (TSTEP and TSTOP are variables on the sweep command.) You can also use the timestep on the sweep command as a limit in determining the next timestep. Although a larger TINIT might aid convergence, generally all three of these variables should be decreased slightly, reducing the timestep at each time point. If there is a smaller distance between the previous and current point, and the circuit converged at the previous point, it is more likely to converge at the current point as well. Theoretically, if the timestep is small enough at each point, the circuit will always converge, though at the expense of a dramatic slowdown in the simulation. You can also increase the ABSTOL, RELTOL, VNTOL, and CHGTOL tolerance variables (described in the “Built-In Variables and Arrays” chapter) to solve this problem. Because the tolerances are loosened, the circuit is more likely to converge at each timepoint, though accuracy might be affected. The tolerance variable that might have the greatest effect on the timestep and the least effect on the rest of the simulation is TRTOL. You can change the other variables, but there is greater potential for compromise in accuracy. December 1998 168 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Gear Integration Method Another possible solution to the timestep problem is switching the integration method from trapezoidal to Gear by setting the METHOD variable equal to 2. The Gear 2 through Gear 6 methods are chosen by setting MAXORD to a number from 2 to 6. We recommend Gear 2 (the default Gear method) because it is much more stable than the other Gear methods. The primary reason for switching methods is that certain types of circuits that do not converge with trapezoidal integration might converge with Gear. If the circuit does converge, the timestep is increased rather than decreased, thus avoiding the “TIMESTEP TOO SMALL” error. Iteration Timestep Control Method You can also use the iteration timestep control method to determine the timestep. Setting LVLTIM to 1 If the problem persists, you can turn off the LTE calculation for determining the timestep by setting the LVLTIM variable to 1. In this case, the iteration timestep control method is invoked, which determines the next timestep based on the number of iterations required for convergence at a current time point, rather than on error criteria. Associated with this method are the following variables: ITL3 Lower iteration limit, which defaults to 4 and can remain at this value. ITL4 Upper iteration limit, which you should set to 10. DELMAX Maximum allowable timestep, which should be set to a value smaller than the default value to maintain accuracy. In this method, if the number of iterations required to find a solution at a time point is ■ less than ITL3, then the timestep is doubled ■ greater than ITL4, then the timestep is divided by 8 ■ between ITL3 and ITL4, then the timestep remains the same This method can work where the default LTE method might not, and should produce accurate results if you specify DELMAX and ITL4 appropriately. December 1998 169 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Setting LVTIM to 0 Setting LVLTIM to (0) zero is another iteration control method. LVLTIM set to 0 differs from the previous algorithm in that it does not use ITL3. In this routine, if the number of iterations is ■ greater than ITL4 (default=25), then the timestep is divided by 8 ■ less than ITL4, then the timestep is increased by the minimum of twice the previous timestep or DELMAX To maintain accuracy, set DELMAX to some smaller value (slightly smaller than the width of any expected peaks or valleys in the waveforms). As in the previous iteration control method, this algorithm should produce accurate results once you specify DELMAX properly. Because of the simplicity of this algorithm, there is more control over the choice of the next timestep than in the previous methods. Setting INTTIM to 1 A final option is to set INTTIM to 1, which invokes a routine designed to avoid the timestep problem. The method is used once dividing by 8 begins, rather than throughout the entire simulation. Based on the severity of the problem, the algorithm will invoke several routines. Among these is switching from LTE to an iteration timestep control. If problems persist, the timestep at which the circuit will not converge is “skipped over.” At this point there are two possibilities: ■ The circuit problems were due to round-off errors caused by too small of a timestep. If so, skipping over (increasing) the timestep will help obtain convergence at the new timepoint. ■ A spike exists in the circuit at the point of nonconvergence. In this case, the skipping over will cause the spike to be lost. You can set DELMAX to a value smaller than the default value to help alleviate this problem and to ensure the accuracy of the results. Simulation Control Variables Simulation control variables can affect the transient internal timestep and the tolerance in interrelated ways. For additional information on these variables, refer to the “Built-In Variables and Arrays” chapter. December 1998 170 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Variables that Affect Transient Internal Timestep The following variables and other considerations can change the internal timestep in a transient analysis: ■ DELMAX DELMAX significantly effectsthe internal timestep. If you do not set DELMAX , it is set internally to TSTOP/50 where TSTOP is the final transient sweep value. If there are no energy storage elements, then DELMAX=MIN(DELMAX, TSTEP). The first step is DELTA where DELTA=MIN (DELMAX, TSTEP). DELMAX also helps to determine the next timestep. If you set DELMAX to a smaller value you may prevent the error message: Internal Timestep Too Small ■ TSTOP (sweep command variable) TSTOP might have an effect on the timestep because the default for DELMAX is TSTOP/ 50. If you set DELMAX, TSTOP has no effect, except near the end of the simulation (because TSTOP is one of the breakpoints). A problem you might encounter is that you obtain different results from a full sweep under the following conditions: sweep time from 0 to 100n by 1n (Here, DELMAX=100N/50) and a continued sweep under the following conditions: sweep time from 0 to 50n by 1n (Here DELMAX=50N/50) continue to 100n by 1n To obtain the same results for both cases, set DELMAX to 100n/50. ■ TSTEP (sweep command variable) TSTEP usually does not have much effect in determining the next timestep. If there are no energy storage elements, then DELMAX= MIN(DELMAX,TSTEP). The first step is DELTA, where DELTA= MIN(DELMAX,TSTEP). TSTEP is used to find the next timestep after a breakpoint and is used to build the breakpoint table initially. When the breakpoint table is built, if one breakpoint is too close to another breakpoint, it is discarded. “Too close” is defined as MORBKP*TSTEP or 0.1*TSTEP. Possible problems related to setting TSTEP that you may encounter are: December 1998 171 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis ■ ❑ If there are no energy storage elements, you might not know that the TSTEP = DELMAX. ❑ If there are no breakpoints in the circuit, that is, no pulse, PWL, or other factors that slow the circuit down, the timestep can increase by a factor of two each step, with the first step potentially being TSTEP. ❑ If TSTEP is too large, then many breakpoints could potentially be discarded, leading to inaccurate solutions. (MORBKP can be set to help eliminate this problem.) TINIT TINIT has a relatively small effect on timestep control. It is used to find the next timestep after a breakpoint. The default setting is TSTEP/10. Setting TINIT might help avoid some of the slight inaccuracies around the breakpoints. As in the transient continue with TSTOP, you might need to set TINIT if the TSTEP value changes on the continue command to obtain the same results. ■ SINWAV The SINWAV variable helps add breakpoints under certain conditions. The default for SINWAV is 1E+6, which means that this variable has no effect. However, it is automatically used and set to (smallest (1/freq)/8) if: ❑ There are no energy storage elements. ❑ There are no breakpoints. ❑ You did not set SINWAV to a different value. Sinusoidal sources do not generate any breakpoints; therefore, there is nothing to slow down the timestep. In some cases, the timestep might increase so much that it overshoots the transitions, missing them entirely, resulting in erroneous data. ■ DELTA The previous timestep is set to DELTA internally by the program. DELTA is used to choose the next timestep after a breakpoint. The timestep can increase by a factor of two over the previous time step. ■ Breakpoint table The breakpoint table slows the timestep at a transition point such as PULSE or PWL. It forces the timestep to land on the breakpoint. ■ MORBKP December 1998 172 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis If a breakpoint is “too close” to another breakpoint, it is discarded. “Too close” is defined as MORBKP*TSTEP. Therefore, changing the value of MORBKP can change the number of breakpoints in the breakpoint table. This parameter helps in gaining more accuracy on fast rising or falling edges, such as those on a pulse or PWL device. ■ Local Truncation Error Local truncation error (LTE) has a significant effect on the next timestep. It is invoked by setting LVLTIM=2 (the default value). It calculates the LTE based on all the capacitances and inductances in the circuit. ■ Iteration Control Iteration control is used if LVLTIM=1. It uses the number of iterations that it took for the previous solution to converge as a means of determining the next timestep. Iteration control might be faster and less accurate than LVLTIM=2. December 1998 173 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis Variables that Affect Tolerance ■ RELTOL This has the most overall effect of all the tolerances. Slight changes can have a big impact on the circuit speed and accuracy. You can tighten RELTOL to 1E-4 or 1E-5 for increased accuracy at the expense of a much slower simulation. RELTOL is also useful in correcting transient timestep inaccuracies. ■ ABSTOL This has a large effect on MOS and MESFET circuits. For many of these circuits, it might be advisable to set ABSTOL=1E-10, for example. Especially in MESFET circuits, 1E-12 is in many cases “too small” for the currents in these circuits. ■ VNTOL This has the greatest effect on circuits containing controlled sources, especially the nonlinear controlled sources. If you are experiencing problems you might want to set this to 1E-5, for example. ■ CHGTOL This variable can have an effect on charge-sensitive circuits such as switched-capacitor circuits. With small geometry devices, this tolerance might have to be several orders of magnitude smaller than the default. ABSTOL might also have to be reduced proportionally. ■ TRTOL Cadence discourages changing this tolerance, which is associated with the LTE error. Readin-Bypass The readin-bypass feature allows circuit resimulation without the time-consuming READIN, ERRCHK (error checking), and matrix SETUP phases following changes in circuit parameter values. Invoke readin-bypass only when the changes made since the previous simulation are to the parameter values. When you assign an expression to a parameter value, cdsSpice writes a “#” instead of an “E” for exponentiation to the /tmp/tmp.SLM6XXXXX file. Therefore all the numbers in the /tmp/ tmp.SLM6XXXXX file that contain a “#” are evaluated expressions. The readin-bypass code in SPICE can then accept another value later for any number containing a “#” sign. If a parameter does change value, the change is NOT reflected in the /tmp/tmp.SLM6XXXXX file. This file is not rewritten and reread into SPICE; instead the values are passed directly to the simulator to save time. December 1998 174 Product Version 4.4.2 Cadence SPICE Reference Manual Circuit Analysis After the simulation, you can use the following commands to check whether your values are set correctly: display element * display device * display model * Any of the following situations turns readin-bypass off automatically: ■ changes in sweep, nodset, and/or other conditions ■ changes in topology To turn readin-bypass off permanently, use the set command to set go2off equal to 1. December 1998 175 Product Version 4.4.2 Cadence SPICE Reference Manual 6 Components ■ Introduction ■ Circuit Description Format ■ Circuit Elements ■ ❑ Resistor Element ❑ Inductor Element ❑ Capacitor Element ❑ Transformer (Mutual Inductor) Element (Air Core) ❑ Transmission Line (Lossless) Element ❑ Resistive (Ideal) Switch Element Voltage and Current Sources ❑ Independent Sources ❑ DC Voltage Source ❑ Piecewise Linear Voltage Source ❑ Piecewise Linear Voltage Source File ❑ Pulse Voltage Source ❑ Exponential Voltage Source ❑ Sinusoidal Voltage Source ❑ Single Frequency FM Voltage Source ❑ DC Current Source ❑ Piecewise Linear Current Source ❑ Piecewise Linear Current Source File December 1998 176 Product Version 4.4.2 Cadence SPICE Reference Manual Components ■ ■ ❑ Pulse Current Source ❑ Exponential Current Source ❑ Sinusoidal Current Source ❑ Single Frequency FM Current Source ❑ Multidimensional Polynomial-Dependent Sources ❑ Voltage-Controlled Voltage Source ❑ Current-Controlled Voltage Source ❑ Current-Controlled Current Source ❑ Voltage-Controlled Current Source Semiconductor Devices ❑ Diode Device ❑ Bipolar Device ❑ Silicon-Controlled Rectifier (SCR) Device ❑ MOSFET Device ❑ BSIM Device ❑ GaAs MESFET Device ❑ Silicon-on-Insulator (SOI) MOSFET Device ❑ JFET Device Operating Point Parameters Introduction Cadence SPICE recognizes the complete range of element, source, and semiconductor device models described in this chapter, which also lists the properties and the netlisting format for each component. This chapter also defines the circuit (.c) file syntax that describes the circuit structure. The network description is similar to the SPICE2 input format, with minor exceptions. December 1998 177 Product Version 4.4.2 Cadence SPICE Reference Manual Components Circuit Description Format Circuit (.c) File Format ■ The first card in the input deck must be a title card, and the order of the remaining lines is arbitrary. ■ Each element in the circuit is specified by an element card that contains: ■ ❑ The element name ❑ The circuit nodes to which the element is connected ❑ The values of the parameters that determine the electrical characteristics of the element The first letter of the element name specifies the element type. The format for the element types is the following: The strings *XXXXX*, *YYYYY*, and *ZZZZZ* denote arbitrary alphanumeric strings. For example, a resistor name must begin with the letter R and can contain from one to six characters. Hence, R, R1, RSE, ROUT, and R3AC2 are valid resistor names. Node Conventions ■ Data fields enclosed in square brackets ([ ]) are optional. All indicated punctuation (such as the equal sign) is required. ■ Nodes can be nonnegative integers or alphanumeric characters and are limited to a maximum of six characters. ■ The datum (ground) node number must be zero. ■ The circuit cannot contain a loop of voltage sources and/or inductors or a cutset of current sources and/or capacitors. ■ Each node in the circuit must have a DC path to ground. ■ Every node must have at least two connections, except for transmission line nodes (to permit unterminated transmission lines). Cadence SPICE uniformly uses the associated reference convention indicated in the next figure for branch voltages and currents. December 1998 178 Product Version 4.4.2 Cadence SPICE Reference Manual Components Current and Voltage Conventions Circuit Elements Cadence SPICE can simulate the circuit elements described in this section. These circuit elements have properties associated with them. You can assign numeric values, variables, or expressions (which may contain variables and/or functions) to the properties. (Refer to the “Expressions and Functions” and “Built-In Variables and Arrays” chapters.) You do not need to assign values to the variables until you are ready to run a simulation. When you change only the values of variables between simulations, you do not need to renetlist. December 1998 179 Product Version 4.4.2 Cadence SPICE Reference Manual Components Resistor Element Analog Artist Symbol Name: res n1 n2 General Form RXXXXX n1 n2 rt tc=tc1 =tc2 Name Description Default Unit Element nodes – – r Resistance with no temperature effects – ohm tc1 Linear temperature coefficient (defined below) 0 °C-1 tc2 Parabolic temperature coefficient (defined below) 0 °C-2 Nodes n1, n2 Properties The Analog Artist user interface calculates the value of rt from the r, tc1, and tc2 properties by solving the equation below. rt = r ⋅ ( 1 + tcl ⋅ ( TEMPDC – TNOM ) + tc2 ⋅ ( TEMPDC – TNOM ) 2 ) Optional properties tc1 and tc2 default to zero and result in temperature- independent resistance if neither is specified. In this case the value of property r appears in the netlist. If you specify nonzero tc1 and/or tc2, the netlist contains the above equation for rt. Property r has no default value and if not specified, results in an error. Example 1 Resistor with constant value r=1K. The resistor netlists as follows: December 1998 180 Product Version 4.4.2 Cadence SPICE Reference Manual Components RC1 12 17 1K Example 2 Simple 50-ohm resistor at temperature TEMPDC, with r=50, tc1=1E-3, and tc2=1E-6. The resistor netlists as follows: RC1 12 17 50*(1+1.E-3*(TEMPDC-TNOM)+1.E-6*(TEMPDC-TNOM)**2) The system calculates rt = 50 ⋅ ( 1 + 10 – 3 ⋅ ( TEMPDC – TNOM ) + 10 – 6 ⋅ ( TEMPDC – TNOM ) 2 ) and sends the result to the cdsSpice SPICE program. Example 3 Geometric resistor with W=100 width and L=3 length at temperature TEMPDC: Define r=rpgeo(100,3), tc1=1E-3, and tc2=1E-6, and provide the following function where RHOP is the poly sheet resistance: FUNCTION rpgeo(w,l)=w/l*RHOP The resistor netlists as follows: RC1 12 17 rpgeo(100,3)*(1+1.E-3*(TEMPDC-TNOM)+1.E-6& *(TEMPDC-TNOM)**2) The system calculates 100 rt = --------- ⋅ RHOP ⋅ ( 1 + 10 – 3 ⋅ ( TEMPDC – TNOM ) + 10 – 6 ⋅ ( TEMPDC – TNOM ) 2 ) 3 and sends the result to the cdsSpice SPICE program. December 1998 181 Product Version 4.4.2 Cadence SPICE Reference Manual Components Inductor Element Analog Artist Symbol Name: ind n+ n- General Form LXXXXX n+ n- l [ic=incond] Name Description Default Unit Positive, negative element nodes – – l Inductor value expression 1uH H ic Initial current at time 0 0 A Nodes n+, nProperties Initial conditions (if any) apply if you specify the trstore option or set variable UIC to one. Examples LLINK 42 69 IUH LSHUNT 23 51 10U IC=15.7A You can program more complicated functions for computing inductor values from the number of turns, and you can also include temperature effects, as shown in the example below. The example uses an inductor with 10 turns at temperature TEMPDC. Define the l property as l=lnt(10) and provide the simulator function. The numerical values are coefficients. FUNCTION lnt(nt)=nt*95E-6*(1+1.E-3*(TEMPDC-TNOM)& +1.E-6*(TEMPDC-TNOM)**2) December 1998 182 Product Version 4.4.2 Cadence SPICE Reference Manual Components Capacitor Element Analog Artist Symbol Name: cap n+ n- General Form CXXXXX n+ n- c [ic=incond] Name Description Default Unit Positive, negative element nodes – – c Capacitor value expression 1pF F ic Initial voltage at time 0 0 V Nodes n+, nProperties Initial conditions (if any) apply if you specify the trstore option or set the variable UIC to one. Examples CBYP COSC 13 17 17 23 CX*2*PI IOU IC=3V You can program more complicated functions to model geometric and temperature effects, as shown in the following example. This example uses a capacitor with width=100µ, length=50µ, at temperature TEMPDC, with capacitance of 0.1pF/µ2, and 1E-3 and 1E-6 temperature coefficients. The following command defines the function: FUNCTION cwl(w,l)=w*l*0.1pf*(1+1E-3*(TEMPDC-TNOM) & +1E-6*(TEMPDC-TNOM)**2) To use this function as a capacitor value, create a device such as this: December 1998 183 Product Version 4.4.2 Cadence SPICE Reference Manual Components C1 1 5 CWL(100u,50u) You can also parameterize the dimensions of the capacitor: C1 1 5 CWL(W,L) Before you run the simulation, set the values of W and L. For example: Set W=100u L=50u December 1998 184 Product Version 4.4.2 Cadence SPICE Reference Manual Components Transformer (Mutual Inductor) Element (Air Core) Analog Artist Symbol Name: xfmr n+ n+ n- n- LYY LZZ General Form KXXXXX LYYYYY LZZZZZ k Name Description Default Unit k Coupling coefficient exp (0<k<=1) 0 – pi Value of primary inductor LYYYYY – – si Value of secondary inductor LZZZZZ – – Properties KXXXXX LYYYYY LZZZZZ k LYYYYY N1 N2 pi LZZZZZ N3 N4 si Usage Rules ■ You can enter the coupled inductors in either order, and they must be constant. ■ In terms of the DOT convention, this coupling puts a dot by the first node of each of the coupled inductors. Examples K43 LAA LBB 0.999 KXFRMR L1 L2 0.87 December 1998 185 Product Version 4.4.2 Cadence SPICE Reference Manual Components Transmission Line (Lossless) Element Analog Artist Symbol Name: tline n1 i1 n2 i2 nr1 nr2 General Form TXXXXX n1 nr1 n2 nr2 z0=value [td=value] [freq=value [nl=nrmlen]] [ic=v1 =i1 =v2 =i2] Name Description Default Unit n1, nr1 Nodes at port 1 – – n2, nr2 Nodes at port 2 – – z0 Characteristic impedance 50 ohm td Transmission delay – s freq Transmission line frequency – Hz nl Normalized electrical length with respect to wavelength at F 0.25 - v1, i1 Initial voltages and currents v2, i2 at each port – – Nodes Properties Example T1 1 0 2 0 Z0=50 TD=10NS Note: You can express the length of the line in either of two forms (you must specify one of the forms, although the general form shows both as optional): December 1998 186 Product Version 4.4.2 Cadence SPICE Reference Manual Components ■ Specify td directly. ■ Specify freq and nl. If you specify freq but not nl, 0.25 is assumed (that is, the frequency is assumed to be the quarter-wave frequency). This element models only one propagating mode. If all four nodes are distinct in the actual circuit, then two modes may be excited. To simulate this situation, you need two transmissionline elements. Initial conditions (if any) apply if you specify the trstore option or set variable UIC to 1. December 1998 187 Product Version 4.4.2 Cadence SPICE Reference Manual Components Resistive (Ideal) Switch Element Analog Artist Symbol Name: switch n+ nc+ n- nc- General Form WXXXXX n+ n- nc+ nc- V Vsw Td Ts [Ro [Rc]] Name Description Default Unit n+, n- Positive, negative switch nodes – – nc+, nc- Positive, negative controlling nodes – – (Vc=Vnc+-Vnc-) – – Vsw When (Vc<=Vsw) switch open, otherwise switch closed – V Td Delay before switch changes state - s Ts Time interval for switching – s Ro Open-switch resistance 1.0E12 ohm Rc Closed-switch resistance 1.0 ohm Nodes Properties Only supported for DC and transient analysis. V in the netlist line, generated automatically by the Analog Artist netlister, refers to voltage switch. December 1998 188 Product Version 4.4.2 Cadence SPICE Reference Manual Components Examples In the following example, a switch connected between nodes 1 and 2 opens when the voltage between nodes 3 and 4 ≤ 1 V and closes when the voltage > 1 V. The time delay is 1 ns, so the switch begins to change states 1 ns after the controlling voltage passes 1 V in either direction. The minimum switching time is 1 ns so the switch actually closes or opens 1 ns (plus the 1 ns delay) after reaching the associated voltage. W12 1 2 3 4 V 1 1N 1N The following example shows that you can use expressions for the properties if you precede them by an equal sign (=). W1 1 2 3 0 V =VC*2 =TD =TR 1E+10 =RCLOSE You should set tdelay and tswitch to a value greater than zero. If either one is zero, set DELMAX to a smaller value (TSTOP/150) to avoid a small overshoot of the solution at a point of discontinuity. Voltage and Current Sources The voltage and current sources described in this section are recognized for simulation by Cadence SPICE. These sources have properties associated with them. You can assign numeric values, variables, or expressions (which may contain variables and/or functions) to the properties. (Refer to the “Expressions and Functions” and “Built-In Variables and Arrays” chapters.) You do not need to assign values to the variables until you are ready to run a simulation. When you change only the values of variables between simulations, you do not need to renetlist. December 1998 189 Product Version 4.4.2 Cadence SPICE Reference Manual Components Independent Sources General Form VXXXXX n+ n- [[DC] expr1] [AC [expr2 [expr3]]] IYYYYY n+ n- [[DC] expr1] [AC [expr2 [expr3]]] Name Description n+, n- Positive, negative nodes expr1 DC and transient analysis value of the source, which you can omit if the source value is 0 for both analyses. If the source value is time invariant (such as a power supply), you can precede it by the value DC. expr2, expr3 AC magnitude and phase for AC analysis. If you omit expr2 following the keyword AC, Cadence SPICE assumes value 1. If you omit expr3, it assumes value 0. If the source is not an AC small-signal input, omit the AC keyword, expr2, and expr3. Usage Rules ■ You do not need to ground voltage sources. ■ Current flows from the positive node through the source to the negative node. ■ You can assign any source a time-dependent value for transient analysis. In this case the DC analysis uses the time-zero value. ■ If you omit or set to zero parameters other than source values, Cadence SPICE uses the default values. ■ There are five independent source functions: piecewise linear (PWL), pulse (PULSE), exponential (EXP), sinusoidal (SIN), and single- frequency FM (SFFM). The following sections describe each type of source in detail. December 1998 190 Product Version 4.4.2 Cadence SPICE Reference Manual Components DC Voltage Source Analog Artist Symbol Name: vdc n+ n- General Form VXXXXX n+ n- [DC] vdc [AC acm [acp]] Name Description Default Unit Positive, negative nodes – – vdc Steady state (DC) value 0 V acm AC magnitude none V acp AC phase none degrees Nodes n+, nProperties Refer to the beginning of the “Independent Sources” section for general information. Examples VCC Vin 10 11 December 1998 0 0 DC DC 6 5 AC 1 0 191 Product Version 4.4.2 Cadence SPICE Reference Manual Components Piecewise Linear Voltage Source Analog Artist Symbol Name: vpwl n+ n- General Form VXXXXX n+ n- PWL Name t1 v1 [t2 v2 t3 v3 t4 v4....] [AC acm[acp]] Description Default Unit Positive, negative nodes – – t1 First time breakpoint 0 s v1 First voltage breakpoint 0 V acm AC magnitude none V acp AC phase none degrees Nodes n+, nProperties . . t50 v50 The value of the source at intermediate values of time is determined through linear interpolation on the input values. Refer to the beginning of the “Independent Sources” section for general information. Example VPWL 1 0 December 1998 PWL 0 0 40N 5 100N 5 120N 192 2 180N 0 Product Version 4.4.2 Cadence SPICE Reference Manual Components Voltage Versus Time December 1998 193 Product Version 4.4.2 Cadence SPICE Reference Manual Components Piecewise Linear Voltage Source File Analog Artist Symbol Name: vpwl n+ n- General Form VXXXXX n+ n- PWLF filename [AC acm[acp]] Name Description Default Unit Positive, negative nodes – – filename Name of file containing time-voltage information – – acm AC magnitude none V acp AC phase none degrees Nodes n+, nProperties Usage Rules ■ The file filename must exist and contain at least two columns. The first column must be the time, and the second must be the voltage. ■ A line with a pound sign (#) as the first character is a comment. A line that is otherwise blank must also begin with a (#) to avoid error. ■ Any characters beyond two columns are ignored, so you can add comments in data lines without using a (#). ■ The file cannot contain any expressions, and the number cannot contain any suffixes. For example, 2.7e-8 is correct; 27n is incorrect. December 1998 194 Product Version 4.4.2 Cadence SPICE Reference Manual Components ■ You can generate the file of time-voltage pairs with the printvs command, described in the “Commands” chapter. Sample File # # # TIME v(1) # # # 0.000E+00 2.000E-01 4.000E-01 6.000E-01 8.000E-01 1.000E-00 1.200E-00 1.400E-00 1.600E-00 1.800E-00 2.000E-00 5.000E-01 5.000E-01 5.000E-01 5.167E-01 5.500E-01 5.833E-01 6.167E-01 6.500E-01 6.833E-01 7.167E-01 7.500E-01 0.000E+00 2.000E-01 4.000E-01 1.200E-00 1.400E-00 1.600E-00 1.800E-00 2.000E-00 5.000E-01 5.000E-01 5.000E-01 6.167E-01 6.500E-01 6.833E-01 7.167E-01 7.500E-01 7.8000E-01 7.9000E-01 8.0000E-01 9.0000E-01 7.7000E-01 # this sentence is a comment # another comment # another comment Results: The value of the source at intermediate values of time is determined through linear interpolation of the input values. Refer to the beginning of the “Independent Sources” section for general information. Example VPWLF 1 0 December 1998 PWLF volt.in 195 Product Version 4.4.2 Cadence SPICE Reference Manual Components Pulse Voltage Source Analog Artist Symbol Name: vpulse n+ n- General Form VXXXXX n+ n- PULSE v1 v2 [td [tr [tf [pw [per]]]]] [AC acm[acp]] Description Default* Unit Positive, negative nodes – – v1 Initial voltage source value 0 V v2 Pulsed source value 0 V td Delay from 0 for pulse start 0 s tr Rise time tstep s tf Fall time tstep s pw Pulse width tstop s per Period of pulse tstop s acm AC magnitude none V acp AC phase none degree Name Nodes n+, nProperties *If you set a property value to zero, the system uses the default value. Refer to the beginning of the “Independent Sources” section for general information. December 1998 196 Product Version 4.4.2 Cadence SPICE Reference Manual Components Example VPULSE 1 0 PULSE -1.0 1.0 25N 10N 10N 50N 100N Voltage Versus Time December 1998 197 Product Version 4.4.2 Cadence SPICE Reference Manual Components Exponential Voltage Source Analog Artist Symbol Name: vexp n+ n- General Form VXXXXX n+ n- EXP v1 v2 [td1 [tau1[td2 [tau2]]]] [AC acm[acp]] Description Default* Unit Positive, negative nodes – – v1 Initial voltage source value 0 V v2 Pulsed voltage source value 0 V td1 Delay time before rise 0 s tau1 Rise time constant tstep s td2 Beginning time of fall tstep+td1 s tau2 Fall time constant tstep s acm AC magnitude none V acp AC phase none degree Name Nodes n+, nProperties * If you set a property value to zero, the system uses the default value. Refer to the beginning of the “Independent Sources” section for general information. Example VEXP 1 0 December 1998 EXP 0 5 30N 30N 60N 40N 198 Product Version 4.4.2 Cadence SPICE Reference Manual Components Voltage Versus Time December 1998 199 Product Version 4.4.2 Cadence SPICE Reference Manual Components Sinusoidal Voltage Source Analog Artist Symbol Name: vsin n+ n- General Form VXXXXX n+ n- SIN vo va [freq [td [theta]]] [AC acm[acp]] Description Default* Unit Positive, negative nodes – – vo DC offset 0 V va Amplitude 0 V freq Frequency 1/tstop Hz td Delay from time 0 0 s theta Damping factor 0 1/sec acm AC magnitude none V acp AC phase none degree Name Nodes n+, nProperties * If you set a property value to zero, the system uses the default value. Refer to the beginning of the “Independent Sources” section for general information. Examples VSIN VSINE 1 1 0 0 December 1998 SIN AC 1.0 1 1.0 0 100ME SIN 50N 2.0 20ME 1.5 200 150MEG 10N 10E7 Product Version 4.4.2 Cadence SPICE Reference Manual Components Voltage Versus Time December 1998 201 Product Version 4.4.2 Cadence SPICE Reference Manual Components Single Frequency FM Voltage Source General Form VXXXXX n+ n- SFFM vo va [fc [mdi [fs]]] [AC acm [acp]] Description Default* Unit Positive, negative nodes – – vo DC offset 0 V va Amplitude 0 V fc Frequency 1/tstop Hz mdi Modulation index 0 s fs Signal frequency 1/tstop Hz acm AC magnitude none V acp AC phase none degree Name Nodes n+, nProperties * If you set a property value to zero, the system uses the default value. Refer to the beginning of the “Independent Sources” section for general information. Equation v ( t ) = vo + va ⋅ sin ( ( 2 ⋅ π ⋅ fc ⋅ t ) + mdi ⋅ sin ( 2 ⋅ π ⋅ fs ⋅ t ) ) Example VSFFM 12 December 1998 0 SFFM (0 1M 20K 5 1K) 202 Product Version 4.4.2 Cadence SPICE Reference Manual Components Voltage Versus Time December 1998 203 Product Version 4.4.2 Cadence SPICE Reference Manual Components DC Current Source Analog Artist Symbol Name: idc n+ n- General Form IXXXXX n+ n- [DC] idc [AC acm [acp]] Name Description Default Unit Positive, negative nodes – – idc Steady state (DC) value 0 A acm AC magnitude none A acp AC phase none degree Nodes n+, nProperties Examples IDC I2 3 5 0 0 December 1998 DC DC 1M AC 1E-3 1 0 204 Product Version 4.4.2 Cadence SPICE Reference Manual Components Piecewise Linear Current Source Analog Artist Symbol Name: ipwl n+ n- General Form IXXXXX n+ n- PWL t1 i1 [t2 i2 t3 i3 t4 i4....] [AC acm[acp]] Name Description Default Unit Positive, negative nodes – – t1 First time breakpoint 0 s i1 First current breakpoint 0 A acm AC magnitude none A acp AC phase none degree Nodes n+, nProperties t50 i50 The value of the source at intermediate values of time is determined through linear interpolation on the input values. Example IPWL 0.3 6 0 400N December 1998 PWL 0.4 0 500N 0.1 0.5 200N 0.2 300N AC 1 0 205 Product Version 4.4.2 Cadence SPICE Reference Manual Components Current Versus Time December 1998 206 Product Version 4.4.2 Cadence SPICE Reference Manual Components Piecewise Linear Current Source File Analog Artist Symbol Name: ipwlf n+ n- General Form IXXXXX n+ n- PWLF fileName [AC acm[acp]] Name Description Default Unit Positive, negative nodes – – fileName Name of file containing time-current information – – acm AC magnitude none A acp AC phase none degree Nodes n+, nProperties Usage Rules ■ The file filename must exist and contain at least two columns. The first column must be the time, and the second must be the current. ■ A line with a pound sign (#) as the first character is a comment. A line that is otherwise blank must also begin with a (#) to avoid error. ■ Any characters beyond two columns are ignored, so you can add comments in data lines without using a (#). ■ You can generate the file of time-current pairs with the printvs command, described in the “Commands” chapter. December 1998 207 Product Version 4.4.2 Cadence SPICE Reference Manual Components Sample File # # # TIME I(R1) # # # 0.000E+00 2.000E-01 4.000E-01 6.000E-01 8.000E-01 1.000E-00 1.200E-00 1.400E-00 1.600E-00 1.800E-00 2.000E-00 5.000E-017.8000E-01 5.000E-017.9000E-01 5.000E-018.0000E-01 5.167E-019.0000E-01 5.500E-01 5.833E-01 6.167E-017.7000E-01 6.500E-01 6.833E-01 7.167E-01 7.500E-01 0.000E+00 2.000E-01 4.000E-01 1.200E-00 1.400E-00 1.600E-00 1.800E-00 2.000E-00 5.000E-01 5.000E-01 5.000E-01 6.167E-01 6.500E-01 6.833E-01 7.167E-01 7.500E-01 # this sentence is a comment # another comment # another comment Results: The value of the source at intermediate values of time is determined through linear interpolation on the input values. Refer to the beginning of the “Independent Sources” section for general information. Example IPWLF 1 0 December 1998 PWLF cur.in 208 Product Version 4.4.2 Cadence SPICE Reference Manual Components Pulse Current Source Analog Artist Symbol Name: ipulse n+ n- General Form IXXXXX n+ n- PULSE i1 i2 [td [tr [tf [pw [per]]]]] [AC acm[acp]] Description Default* Unit Positive, negative nodes – – i1 Initial current source value 0 A i2 Pulsed source value 0 A td Delay from 0 for pulse start 0 s tr Rise time tstep s tf Fall time tstep s pw Pulse width tstop s per Period of pulse tstop s acm AC magnitude none A acp AC phase none degree Name Nodes n+, nProperties * If you set a property value to zero, the system uses the default value. Example IPULS 6 0 PULSE 0 0.2 3N December 1998 5N 5N 20N 30N 209 AC 1 0 Product Version 4.4.2 Cadence SPICE Reference Manual Components Current Versus Time December 1998 210 Product Version 4.4.2 Cadence SPICE Reference Manual Components Exponential Current Source Analog Artist Symbol Name: iexp n+ n- General Form IXXXXX n+ n- EXP i1 i2 [td1 [tau1 [td2 [tau2]]]] [AC acm[acp]] Description Default* Unit Positive, negative nodes – – i1 Initial current source value 0 A i2 Pulsed current source value 0 A td1 Delay time before rise 0 s tau1 Rise time constant tstep s td2 Beginning time of fall tstep+td1 s tau2 Fall time constant tstep s acm AC magnitude none A acp AC phase none degree Name Nodes n+, nProperties * If you set a property value to zero, the system uses the default value. Example IEXP 5 0 December 1998 EXP 0.1 2 5N 20N 50N 10N 211 Product Version 4.4.2 Cadence SPICE Reference Manual Components Current Versus Time December 1998 212 Product Version 4.4.2 Cadence SPICE Reference Manual Components Sinusoidal Current Source Analog Artist Symbol Name: isin n+ n- General Form IXXXXX n+ n- SIN io ia [freq [td [theta]]] [AC acm[acp]] Description Default* Unit Positive, negative nodes – – io DC offset 0 A ia Amplitude 0 A freq Frequency 1/tstop Hz td Delay from time 0 0 s theta Damping factor 0 1/sec acm AC magnitude none A acp AC phase none degree Name Nodes n+, nProperties * If you set a property value to zero, the system uses the default value. Example ISIN 1 0 December 1998 SIN 1.5 0.4 10K 50U 5E4 213 Product Version 4.4.2 Cadence SPICE Reference Manual Components Current Versus Time December 1998 214 Product Version 4.4.2 Cadence SPICE Reference Manual Components Single Frequency FM Current Source General Form IXXXXX n+ n- SFFM io ia [fc [mdi [fs]]] [AC acm [acp]] Description Default* Unit Positive, negative nodes – – io DC offset 0 A ia Amplitude 0 A fc Frequency 1/tstop Hz mdi Modulation index 0 s fs Signal frequency 1/tstop Hz acm AC magnitude none A acp AC phase none degrees Name Nodes n+, nProperties * If you set a property value to zero, the system uses the default value. Refer to the “Independent Sources” section for general information. Equation i ( t ) = io + ia ⋅ sin [ ( 2 ⋅ π ⋅ fc ⋅ t ) + mdi ⋅ sin ( 2 ⋅ π ⋅ fs ⋅ t ) ] Example ISFFM 12 December 1998 0 SFFM (0 1U 15K 5 0.5K) 215 Product Version 4.4.2 Cadence SPICE Reference Manual Components Current Versus Time December 1998 216 Product Version 4.4.2 Cadence SPICE Reference Manual Components Multidimensional Polynomial-Dependent Sources Cadence SPICE allows circuits to contain dependent sources characterized by any of the equations: I=F(V) V=F(V) I=F(I) V=F(I) where the functions must be polynomials (or user-defined nonlinear controlled sources) and the arguments can be multidimensional. Specify the polynomial functions by a set of coefficients P0, P1, ..., PN. Both the number of dimensions (ND) and the number of coefficients are arbitrary. The meaning of the coefficients depends upon the dimension of the polynomial, as shown in the following examples. Example of One-Dimensional Function Suppose that the function is one-dimensional (that is, a function of one argument). Then the function value FV is determined by the following expression in FA (the function argument): ... FV = PO + ( P1 ⋅ FA ) + ( P2 ⋅ FA 2 ) + ( P3 ⋅ FA 3 ) + ( P4 ⋅ FA 4 ) + ( P5 ⋅ FA 5 ) + Example of Two-Dimensional Function Suppose now that the function is two-dimensional, with arguments FA and FB. Then the function value FV is determined by the following expression: FV = PO + ( P1 ⋅ FA ) × ( P2 ⋅ FB ) + ( P3 ⋅ FA 2 ) + ( P4 ⋅ FA ⋅ FB ) + ( P5 ⋅ FB 2 ) + ( P6 ⋅ FA 3 ) + ( P3 ⋅ FA 3 ) + ( P7 ⋅ FA 2 ⋅ FB ) + ( P8 ⋅ FA ⋅ FB 2 ) + ( P9 ⋅ FB 3 ) + ... Example of Three-Dimensional Function Consider now the case of a three-dimensional polynomial function with arguments FA, FB, and FC. Then the function value FV is determined by the following expression: FV = PO + ( P1 ⋅ FA ) + ( P2 ⋅ FB ) + ( P3 ⋅ FC ) + ( P4 ⋅ FA 2 ) + ( P5 ⋅ FA ⋅ FB ) + + + ( P6 ⋅ FA ⋅ FC ) + ( P7 ⋅ FB 2 ) + ( P8 ⋅ FB ⋅ FC ) + ( P9 ⋅ FC 2 ) + ( P10 ⋅ FA 3 ) ( P11 ⋅ FA 2 ⋅ FB ) + ( P12 ⋅ FA 2 ⋅ FC ) + ( P13 ⋅ FA ⋅ FB 2 ) + ( P14 ⋅ FA ⋅ FB ⋅ FC ) ( P15 ⋅ FA ⋅ FC 2 ) + ( P16 ⋅ FB 3 ) + ( P17 ⋅ FB 2 ⋅ FC ) + ( P18 ⋅ FB ⋅ FC 2 ) + ( P19 ⋅ FC 3 ) + ( P20 ⋅ FA 4 ) + December 1998 ... 217 Product Version 4.4.2 Cadence SPICE Reference Manual Components If the polynomial is one-dimensional and exactly one coefficient is specified, then Cadence SPICE assumes it to be P1 (and P0 = 0.0) to input linear controlled sources. In this case the P1 name is changed to a more meaningful name, as described for these dependent sources in the following sections. Two netlisting formats are provided, one for the linear onedimensional case and another for all others. Only the linear one-dimensional case is supported through the graphic interface. Symbols for nonlinear multidimensional sources are not provided, and you must enter them by means of the netlist. For all four of the dependent sources described in the following sections, the initial condition parameter is described as optional. If not specified, Cadence SPICE assumes 0.0. The initial condition for dependent sources is an initial guess for the value of the controlling variable. The program uses this initial condition to obtain the DC operating point of the circuit. After convergence has been obtained, the program continues iterating to obtain the exact value for the controlling variable. Therefore, to reduce the computational effort for the DC operating point (or if the polynomial specifies a strong nonlinearity), specify a value fairly close to the actual controlling variable for the initial condition. December 1998 218 Product Version 4.4.2 Cadence SPICE Reference Manual Components Voltage-Controlled Voltage Source Analog Artist Symbol Name: vcvs n+ nc1+ nc1- n- General Form Linear: EXXXXX n+ n- nc1+ nc1- egain [ic=...] Nonlinear:EXXXXX n+ n- [poly nd] nc1+ nc1- ...p0 [p1...] [ic=...] Name Description Default Unit n+, n- Positive, negative nodes – – nc1+, nc1- Positive, negative controlling nodes – – (vn1-vn2)=egain*(vnc1-vnc2) 0 – ic Time 0 estimate of controlling voltages 0 V poly nd Polynomial of nd dimensions (specify only – if nd greater than default 1) – p0, p1... Polynomial coefficients – Nodes Properties egain Voltage gain: 0 Usage Rules For the nonlinear source: ■ Specify one pair of nodes for each dimension. ■ The polynomial specifies the source voltage as a function of the controlling voltage(s). December 1998 219 Product Version 4.4.2 Cadence SPICE Reference Manual Components Examples E1 E1 EX 2 3 14 1 2.0 3 4 21 17 10.5 2.1 1.75 17 0 POLY 3 13 0 15 0 17 2.0 =17.35*1.521 0 0 1 1 1 IC=1.5 The last example describes a voltage source (ideal voltage summer) with the value: V = V ( 13, 0 ) + V ( 15, 0 ) + V ( 17, 0 ) December 1998 220 Product Version 4.4.2 Cadence SPICE Reference Manual Components Current-Controlled Voltage Source Analog Artist Symbol Name: ccvs n+ n- General Form Linear: HXXXXX n+ n- vref hgain [ic=...] Nonlinear: HXXXXX n+ n- [poly nd] vref1 [vref2 ...] p0 [p1...] [ic=...] Name Description Default Unit Positive, negative nodes – – (vn1-vn2)=hgain*i(vref) 0 ohms vref, vref1... Names of voltage sources through which controlling current flows (specify one name for each dimension) – – ic Time 0 estimate of controlling currents 0 A poly nd Polynomial of nd dimensions (specify only if nd – greater than default 1) – p0, p1... Polynomial coefficients – Nodes n+, nProperties hgain Transresistance: 0 Usage Rules ■ The positive controlling current flows from the positive node, through the source, to the negative node of each voltage source (vrefn). ■ The polynomial specifies the source voltage as a function of the controlling current(s). December 1998 221 Product Version 4.4.2 Cadence SPICE Reference Manual Components Examples HX 5 17 VZ 0.5K HXY 13 20 POLY 2 VIN1 VIN2 HR 4 17 VX 0 0 1 0 0 0 0 1 IC=0.5 =1.3/.99 The second example describes a voltage source with the value: V = I ( vref 2 ) 2 December 1998 222 Product Version 4.4.2 Cadence SPICE Reference Manual Components Current-Controlled Current Source Analog Artist Symbol Name: cccs n+ n- General Form Linear: FXXXXX n+ n- vref fgain [ic=...] Nonlinear: FXXXXX n+ n- [poly nd] vref1 [vref2 ...] p0 [p1...] [ic=...] Name Description Default Unit Positive, negative nodes – – fgain Current gain: i=fgain*i(vref) 0 – vref, vref1 . . . Names of voltage sources through which controlling current flows (specify one name for each dimension) - - ic Time 0 estimate of controlling currents 0 A poly nd Polynomial of nd dimensions (specify only if nd greater than default 1) – – p0, p1 . . . Polynomial coefficients 0 – Nodes n+, nProperties Usage Rules ■ Current and controlling current flow from the positive node, through the source, to the negative node of appropriate voltage source (vrefn). ■ The polynomial specifies the source current as a function of the controlling current(s). December 1998 223 Product Version 4.4.2 Cadence SPICE Reference Manual Components Examples F1 13 5 VSENS 5 F1 12 10 VCC 1MA FXFER 13 20 VSENS 1.3M 0 1 The second example describes a current source with the value: I = 1 – 3 + 1.3 – 3 ⋅ I ( VCC ) December 1998 224 Product Version 4.4.2 Cadence SPICE Reference Manual Components Voltage-Controlled Current Source Analog Artist Symbol Name: vccs n+ nc1+ nc1- n- General Form Linear: GXXXXX n+ n- nc1+ nc1- ggain [ic=...] Nonlinear: GXXXXX n+ n- [poly nd] nc1+ nc1- ...p0 [ic=...] Name [p1...] Description Default Unit n+, n- Positive, negative nodes – – nc1+, nc1- Positive, negative controlling nodes – – i=ggain*(V(nc1+)-V(nc1-)) 0 mho ic Time 0 estimate of controlling voltages 0 A poly nd Polynomial of nd dimensions (specify only if – nd greater than default 1) – p0, p1... Polynomial coefficients – Nodes Properties ggain Current gain: – Usage Rules ■ Current flows from the positive node, through the source, to the negative node. ■ Specify one pair of nodes for each dimension. December 1998 225 Product Version 4.4.2 Cadence SPICE Reference Manual Components Examples G1 1 0 5 3 GR 17 3 17 GMLT 23 17 G2 1 0 2 4 0 0.1MMHO 3 0 1M 1.5M IC=2V POLY 2 3 5 1 2 0 1M 17M 3.5U IC=2.5 1.3 =L/W =(4.2/VADD)+.1 The third example describes a current source with the value: I = 1 – 3 ⋅ V ( 17, 3 ) + 1.5 – 3 ⋅ V ( 17, 3 ) 2 Since the source nodes are the same as the controlling nodes, this source actually models a nonlinear resistor. The fourth example shows that expressions can be used if preceded with an equal sign (=). Semiconductor Devices The elements described in the “Elements” and “Sources” sections require only a few parameters (properties) to completely specify their electrical characteristics. However, the models for the semiconductor devices require many parameters. Moreover, many devices in a circuit often are defined by the same set of device model parameters. You can define a set of device model parameters in a separate model (.m) file and assign it a unique model name. The device property list then references the model file, eliminating the need to specify all of the model parameters on each device instance. Refer to the “Command and Model Files” and “Device Models” chapters for additional information on model files and model parameters. The two optional properties you can specify for most devices are an area factor and an initial condition. Area Determines the number of equivalent parallel devices of a specified model. The affected parameters are marked with an asterisk (*) in the model parameter description (defaults to 1). Initial Conditions You can set two different forms of initial conditions in the property lists: off December 1998 Use for improving the DC convergence for circuits that contain more than one stable state. If you specify off, the DC operating point is determined with the terminal voltages for that device set to zero. After it converges, the program continues to iterate to obtain the exact value for the terminal voltages. If a circuit has 226 Product Version 4.4.2 Cadence SPICE Reference Manual Components more than one DC stable state, you can use the off option to force the solution to correspond to a desired state. If you specify off when the device is actually conducting, the program will still obtain the correct solution (assuming the solutions converge). However, more iterations will be required since the program must independently converge to two separate solutions. ic= Bypasses the DC operating point calculation normally made before the start of transient analysis. Initializes the DC or transient node voltages. Invoke this using the trstore command. If you want to specify initial conditions (ic=) on specific nodes, set the parameter UIC to one. Cadence SPICE models temperature using SPICE2Gcompatible built-in equations. To use these equations, set SPTEMP to 1 (refer to the “Built-in Variables and Arrays” chapter). Note: If you are using Cadence SPICE version 2.x, you can use your own equations. The etc/analog/examples/temperature directory in version 2.x includes command and model files describing temperature dependencies for diode, BJT, MOS, and JFET devices. You can customize these files to create your own device temperature models. Refer to the “Temperature Files” section of the “Command and Model Files” chapter for information on these files. Set SPTEMP=0 (the default value) for this option. The default TNOM for Cadence SPICE is 25, not 27 degrees. To use 27 degrees, set TNOM to 27. December 1998 227 Product Version 4.4.2 Cadence SPICE Reference Manual Components Diode Device Analog Artist Symbol Name: diode, zener, schottky np diode np Zener nn np Schottky nn nn General Form DXXXXX np n shModName [area] [off] Name [ic=VD] Description Default Unit P node, N node – – shModName Model name – – modFile Analog Artist model file name diode – area Area multiplication factor 1 – off Initial condition flag not set – ic Initial diode voltage – V Nodes np, nn Properties Refer to the “Semiconductor Devices” section for information on AREA, OFF, and IC. Examples DBRIDG 2 10 DIODE1 DCLMP 3 7 DMOD 3.0 December 1998 IC=0.2 228 Product Version 4.4.2 Cadence SPICE Reference Manual Components Bipolar Device Analog Artist Symbol Name: npn, pnp nc nb ne nb ne nc General Form QXXXXX nc nb ne [bn] shModName [off [area] [ic=Vbe Vce] Name Description Default Unit nc, nb, ne Collector, base, emitter nodes – – bn Substrate node ground (0) – shModName Model name – – modFile Analog Artist model filename npn/pnp – area Area multiplication factor 1 – off Initial condition flag not set – Vbe Base-emitter initial voltage – V Vce Collector-emitter initial voltage – V Nodes Properties See the “Semiconductor Devices” section for information on AREA, OFF, and IC. Examples Q1 1 4 3 2 QN IC=VA/VB =V1*V2 Q2121 10 24 13 QMOD IC=0.6 5.0 QINPUT 11 22 13 42 MODNPN December 1998 229 Product Version 4.4.2 Cadence SPICE Reference Manual Components The first example illustrates that the IC variables can be expressions if preceded by the equal sign (=). December 1998 230 Product Version 4.4.2 Cadence SPICE Reference Manual Components Silicon-Controlled Rectifier (SCR) Device Analog Artist Symbol Name: scr nag na nc ncg General Form PXXXXX na nag ncg nc [bn] shModName [off] [area] [ic=vag vcg [vbcc]] Name Description Default Unit na, nc Anode, cathode node – – nag, ncg Anode, cathode gate node – – shModName Model name – – modFile Analog Artist model filename scr – area Area multiplication factor 1- – off Initial condition flag not set – ic vag, vcg, vbcc initial condition vag (vcg)=anode (cathode) gate voltage with respect to anode (cathode), vbcc=internal junction voltage – V bn Optional substrate node (set model parameters to disable) cathode – Nodes Properties Refer to the “Semiconductor Devices” section for information on area, off, and ic. December 1998 231 Product Version 4.4.2 Cadence SPICE Reference Manual Components Examples P231 PN01 32 25 5 21 8 7 PSCR 14 18 2 PMOD IC=-.8 .8 -15 December 1998 232 Product Version 4.4.2 Cadence SPICE Reference Manual Components MOSFET Device Analog Artist Symbol Name: nmos, nmos4, pmos, pmos4 nd ng nd nd ng nd ng ng bn bn ns ns ns ns General Form MXXXXX nd ng ns bn shModName [L=l] [W=w] [AD=ad] [AS=as] [PD=pd] [PS=ps] [NRD=nrd] [NRS=nrs] [LD=ld] [LS=ls] [off] [IC=Vds Vgs Vbs] [M=m] Name Description Default Unit nd, ng, ns Drain, gate, source nodes – – bn Bulk node for nmos and pmos source – shModName Model name – – modFile Analog Artist model filename nmos/pmos – m Number of MOSFETs in parallel 1 – w Width 0 m l Length 0 m ad, as Drain, source diffusion area (see rules) m2 pd, ps Drain, source diffusion periphery (see rules) m nrd, nrs Drain, source diffusion resistor squares (see rules) – ld, ls Drain, source diffusion length (see rules) m off Initial condition flag not set – Vds Drain-source initial voltage – V Nodes Properties December 1998 233 Product Version 4.4.2 Cadence SPICE Reference Manual Components Name Description Default Unit Vgs Gate-source initial voltage – V Vbs Bulk-source initial voltage – V Usage Rules ■ Properties m through ls can be expressions. ■ Properties nrd and nrs multiply the sheet resistance model parameter RSH for an accurate representation of the parasitic series drain and source resistance of each transistor. ■ Properties ld and ls override model parameters LDD and LDS. ■ Property ps (pd) defaults to twice ls (ld) (or twice model parameter LDS (LDD) if these are specified), plus one channel width. ■ If you do not specify any of ld (ls) and LDD (LDS), then pd (ps) defaults to zero. ■ Properties ad and as default to ld*w (or LDD*w) and ls*w (or LDS*w), respectively. ■ If you do not specify as, ad, ld, ls, LDD and LDS, properties as and ad default to zero. Refer to the “Device Models” chapter for additional information on the MOSFET model parameters and to the “Semiconductor Devices” section of this chapter for information on OFF and IC. Also see the “Built-In Variables and Arrays” chapter for a description of the SCALE variable, which lets you scale the geometry-dependent properties of the MOSFET. Example M31 2 17 December 1998 6 10 MODM L=5UM W=2UM PS=40UM PD=40UM 234 Product Version 4.4.2 Cadence SPICE Reference Manual Components BSIM Device Analog Artist Symbol Name: nbsim, nbsim4, pbsim, pbsim4 nd ng nbsim ng ns nd nd bn ng bn ng pbsim nbsim4 nd ns ns pbsim4 ns General Form SXXXXX nd ng ns bn shModName [L=l] [W=w] [AD=ad] [AS=as] [PD=pd] [PS=ps] [NRD=nrd] [NRS=nrs] [LD=ld] [LS=ls] [off] [IC=Vds Vgs Vbs] [M=m] Name Description Default Unit nd, ng, ns Drain, gate, source nodes – – bn Bulk node for nmos and pmos (for nbsim and source psim valid values are G, D, S, and global nodes only) – shModName Model name – – modFile Analog Artist model filename nmos/pmos – m Number of MOSFETs in parallel (Analog Artist) 1 – w Width 0 m l Length 0 m ad, as Drain, source diffusion area (see rules) m2 pd, ps Drain, source diffusion periphery (see rules) m nrd, nrs Drain, source diffusion resistor squares (see rules) – ld, ls Drain, source diffusion length (see rules) m Nodes Properties December 1998 235 Product Version 4.4.2 Cadence SPICE Reference Manual Components Name Description Default Unit off Initial condition flag not set – Vds Drain-source initial voltage – V Vgs Gate-source initial voltage – V Vbs Bulk-source initial voltage – V Usage Rules ■ Properties m through ls can be expressions. ■ Properties nrd and nrs multiply the sheet resistance model parameter RSH for an accurate representation of the parasitic series drain and source resistance of each transistor. ■ Properties ld, ls, nrd and nrs default to zero. ■ Property ps (pd) defaults to zero if not specified. ■ Properties ad and as default to 1.E-9 if not specified. Refer to the “Device Models” chapter for additional information on the BSIM model parameters and to the “Semiconductor Devices” section of this chapter for information on OFF and IC. Example S1 24 2 December 1998 0 20 NMOSMOD 236 Product Version 4.4.2 Cadence SPICE Reference Manual Components GaAs MESFET Device Analog Artist Symbol Name: nmes, nmes4 nmes nmes4 nd ng nd ng ns bn ns General Form BXXXXX nd ng ns [bn] shModName [area] [off] [IC= Vds Vgs [Vbs]] Name Description Default Unit nd, ng, ns Drain, gate, source nodes – – bn Optional back gate node source – shModName Model name – – modFile Analog Artist model filename – – area Area multiplication factor (level 2 model only) 1 – off Initial condition flag not set – Vds Drain-source initial voltage – V Vgs Gate-source initial voltage – V Vbs Bulk-source initial voltage – V Nodes Properties Usage Rule ■ Not specifying bn turns off all back-gate effects. Use bn to sense a negative potential from an adjacent device (within 50-60 µ), which can affect lds. Connect bn (to the appropriate adjacent device) only when you want to simulate layout effects. See the “Semiconductor Devices” section for information on AREA, OFF, and IC. December 1998 237 Product Version 4.4.2 Cadence SPICE Reference Manual Components Examples B101N 3 22 5 GFET BN35 10 35 3 0 FETMOD BN02 5 2 9 MOD IC=3.0 December 1998 IC=3.0 -0.3 0.0 0.0 238 Product Version 4.4.2 Cadence SPICE Reference Manual Components Silicon-on-Insulator (SOI) MOSFET Device Analog Artist Symbol Name: nsoi, psoi ns psoi nsoi ngf ngb ns ngf nd ngb nd General Form ZXXXXX nd ngf ns ngb <bn> mtype shModName L=l W=w AD=ad AS=as AB=ab NRD=nrd NRS=nrs NRB=nrb [off] [IC=Vds Vgfs Vgbs <Vbys>] Name Description Default Unit nd, ns Drain, source nodes – – ngf, ngb Front, back gate nodes – – bn Optional body node – – shModName Model name – – modFile Analog Artist model filename soi – w Drawn channel width – m l Drawn channel length – m ad, as Drain, source diffusion area – m2 ab Body contact area – m2 nrd, nrs Drain, source diffusion resistor squares – – nrb Body diffusion resistor squares – – off Initial condition flag not set – Vds Drain-source initial voltage – V Nodes Properties December 1998 239 Product Version 4.4.2 Cadence SPICE Reference Manual Components Name Description Default Unit Vgfs Front gate-source initial voltage – V Vgbs Back gate-source initial voltage – V Vbys Body-source initial voltage (optional unless body node is biased) – – mtype Model type: TFA for thin-film accumulated – back surface TFD for thin-film depleted back surface – Usage Rules ■ The effective channel length and width are calculated with model parameters DL and DW. ■ ad, as, and ab are used for calculation of parasitic capacitances with model parameter TOXB (Capacitance per area=εox/TOXB). ■ If ab is unspecified, it defaults to l*w. ■ Resistance is calculated by multiplying nrd, nrs, and nrb by the sheet resistance model parameters RHOSD and RHOB. Instead, you can specify the total resistance model parameters RD, RS, and RB. Refer to the “Semiconductor Devices” section for information on OFF and IC. Examples ZN 11 22 13 6 TFD ZNMOD L=2U W=10U AD=200N AS=200N Z132 2 10 14 6 8 TFA Z132M L=10U W=100U IC=5.0 2.0 0.0 .5 ZFL 2 10 14 6 TFA Z132M L=10U W=100U IC=5.0 2.0 0.0 December 1998 240 Product Version 4.4.2 Cadence SPICE Reference Manual Components JFET Device Analog Artist Symbol Name: njfet, pjfet nd nd ns ns ng General Form JXXXXX nd ng ns [bn] shModName [area] [off] [ic=Vds Vgs Vgbs] Name Description Default Unit nd, ng, ns Drain, gate, source nodes (level 3 only) – – bn Optional back-gate node – – shModName Model name – – modFile Analog Artist model filename njfet/pjfet – area Area multiplication factor 1 – off Initial condition flag not set – Vds Drain-source initial voltage – V Vgs Gate-source initial voltage – V Vgbs Gate-to-bulk and source initial voltage – V Nodes Properties Refer to the “Semiconductor Devices” section for information on area, off, and ic. Example J1 7 2 3 December 1998 JM1 OFF 241 Product Version 4.4.2 Cadence SPICE Reference Manual Components Operating Point Parameters The operating point parameters listed below apply to devices not modeled in Chapter 8. Operating Point Parameters Element or Device Parameter Name Parameter Function Unit Resistor 1 VALUE 2 VOLTAGE 3 CURRENT Saturation current Voltage across the resistor Current through the resistor ohm V A Independent Voltage Source 1 CURRENT Current through the voltage source A Voltage Controlled 1 VSRC Voltage across the voltage source V Voltage Source 2 ISRC Current through the voltage source A Voltage Controlled Current Source 1 ISRC Current through the current source A Current Controlled 1 VSRC Voltage across the voltage source V Voltage Source 2 ISRC Current through the voltage source A Voltage Controlled Current Source 1 ISRC Current through the current source A Switch 1 VOLTAGE 2 CURRENT Voltage across the switch Current through the switch V A December 1998 242 Product Version 4.4.2 Cadence SPICE Reference Manual 7 Command and Model Files ■ Command Files ❑ ■ ■ Model Files ❑ Model File Syntax ❑ Examples ❑ Example Model File Temperature Files ❑ ■ Sample Command File Example Files Initialization and Update Files ❑ Initialization File ❑ Update File ❑ Using init.s and update.s Files for Statistical Analysis Command Files In the Cadence SPICE program, many functional dependencies of circuit and model variables are under complete user control, not predetermined by built-in, hard-coded expressions. You can use simulation command files (“use” files) to define dependencies by including Cadence SPICE commands such as set and function (see “Commands” chapter). These command files can contain any valid Cadence SPICE command and must end with the .s extension. The system first searches for a file name in which the case of the .s matches the case of the first letter of the filename (for example, file.s). If not found, the system searches for a file name in which the case of the .s is not the same as the case of the first letter of the file name (for example file.S). December 1998 243 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files The commands within this file are executed by issuing the use filename command (for example, use file) from within the Cadence SPICE environment. The file must be in the directory paths defined by the altqual command. The Analog Artist interface has special facilities for defining paths and executing Cadence SPICE command files. Refer to the Analog Artist Simulation Environment Help for more information. Refer to the “Introduction” chapter of this manual for file syntax conventions, which are the same as the command line conventions. Cadence SPICE can model temperature using SPICE2G-compatible built-in equations. You can also use your own equations. Refer to the “Temperature Files” section of this chapter for example command files that use temperature dependence functions.You can customize these files to create your own device temperature models. Sample Command File FUNCTION EGN(T)& =CHARGE*(1.16-7.02E-4*(T+273)*(T+273)/(1108+(T+273))) * NIN - INTRINSIC CARRIER CONCENTRATION FUNCTION NIN(T)& =.6380E16*(T+273)**1.5*EXP(-EGN(T)/(2*BOLTZ*(T+273))) * PHIN - TWICE THE FERMI POTENTIAL FUNCTION PHIN(T,N)& =2*BOLTZ*(T+273)/CHARGE*LOG(ABS(N)/NIN(T)) * VTON - ZERO-BIAS THRESHOLD FUNCTION VTON(V,TC)& =V+TC*(TEMPDC-25) * KPN - K’ FUNCTION KPN(K)& =2*K*(3.3356E-3*(TEMPDC+273))**(-TCKPN) * COMPUTE TEMP. DEPENDENCE ON JUNCTION CAP/RES. FUNCTION LINF(ALPHA,TEMPDC,YVN)& =YVN+ALPHA*(TEMPDC-25) *SECOND ORDER FUNCTION FUNCTION SNF(ALPHA,BETA,TEMPDC)& =1.0+ALPHA*(TEMPDC-25)*(TEMPDC+273)**2/(BETA+TEMPDC+273) *FUNCTION TCRNF(A,T)& =A+TCRN1*(T-25)+TCRN2*(T-25)*(T-25)+TCRN3*(T-25)*(T-25)*& (T-25)& +TCRN4*(T-25)*(T-25)*(T-25)*(T-25) * FUNCTION TCRNLF(A,T)& =A+TCRNL1*(T-25)+TCRNL2*(T-25)*(T-25)+TCRNL3*(T-25)* (T-25)*&(T-25)& +TCRNL4*(T-25)*(T-25)*(T-25)*(T-25) * MJN FUNCTION MJN(TEMPDC)& =MJN*SNF(TCMJN1,TCMJN2,TEMPDC) FUNCTION MJNSW(TEMPDC)& =MJNSW*SNF(TCMJNS1,TCMJNS2,TEMPDC) * PBN - JUNCTION BUILT IN POTENTIAL December 1998 244 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files FUNCTION PBN(TEMPDC)& =PBN*SNF(TCPBN1,TCPBN2,TEMPDC) FUNCTION PBNSW(TEMPDC)& =PBNSW*SNF(TCPBNS1,TCPBNS2,TEMPDC) * CJN - JUNCTION CAPACITANCE FUNCTION CJN(TEMPDC)& =CJN*SNF(TCCJN1,TCCJN2,TEMPDC) FUNCTION CJNSW(TEMPDC)& =CJNSW*SNF(TCCJNS1,TCCJNS2,TEMPDC) * JSN - REVERSE BIAS LEAKAGE FUNCTION JSN(J)& =J*EXP(EGN(TEMPDC)/BOLTZ*(1/300-1/(TEMPDC+273))) FUNCTION DELTALN(TEMPDC)& =0.6UM*(SNF(TCDLN1,TCDLN2,TEMPDC)- & SNF(TCDLN1,TCDLN2,25))+DELTALN FUNCTION LDDN(LFITN)=LFITN*XJN FUNCTION WN(W)=W-DELTAWN FUNCTION LN(L)=L-DELTALN(TEMPDC)+LDDN(LFITN)*2 FUNCTION LN1(L)=L-DELTALN(TEMPDC) SET LEVEL=5 CAPMOD=1 SET LAMBDN=0 LAMBDP=0 SET NSSN=0 NSSP=0 * *****DIMENSIONAL PARAMETERS* SET SET SET SET SET SET SET SET SET SET SET SET SET TOX=300 LSN=4UM LDN=4UM LDNOV=.2UM SPLDDP=.4UM LOVPT=2UM CWSN=5UM CSIZEW=2UM CSIZEL=2UM DELTAWN=.6UM DELTALN=.7UM DELWM1=.4UM DELWPOLY=0 LOOX=6000E-8 LSP=4UM LDP=4UM LDPOV=.2UM SPLDDN=.4UM CWSP=4UM DELTAWP=.6UM DELTALP=.7UM DELWM2=.4UM *TEMP COEFFICIENT OF DELTA LN/LP SET SET TCDLN1=0 TCDLN2=0 TCDLP1=0 TCDLP2=0 ***** THRESHOLD VOLTAGE ***** *SET SET SET SET SET SET SET VTN=0.8 KBN=1 PHIN=1 NSUBN=1E16 ETAN=.2 DELTAN=0.0 TCN=-5E-3 VTP=1 KBP=1 PHIP=1 NSUBP=1E16 ETAP=.1 DELTAP=0.0 TCP=-5E-3 **** MOBILITY **** December 1998 245 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files SET SET SET SET SET SET SET SET SET * KPN=50U TCKPN=2 VMAXN=3E07 THETANX=22U THETANY=.1 TCKNY1=-5E-7 TCKNY2=-200 TCKNX1=-4E-6 TCKNX2=-200 KPP=15U TCKPP=2 VMAXP=3E07 THETAPX=6U THETAPY=.1 TCKPY1=-4E-6 TCKPY2=-200 TCKPX1=-3E-6 TCKPX2=-250 Note: Values in this sample file are meaningless and provided only to illustrate the file setup. Substitute your own variables and values for those above. Model Files A Cadence SPICE model file is similar in syntax to SPICE2 model control statements. You can give the model file any name, but it must end with .m. The system first searches for a filename in which the case of the .m matches the case of the first letter of the filename. If not found, the system searches for a filename in which the case of the .m does not match the case of the first letter of the filename. Any number of models can reside in one model (.m) file. You can also add the models to the circuit (.c) file. Model File Syntax The syntax of a model file is as follows: .model modelName type modelParameter1=value1 [modelParameter2=value2 ...] .model Required keyword. modelName (Required) Must match the value of the shModName property of the device using it. You must set it to &1 for Monte Carlo simulations in the Analog Artist environment. type Equals one of the following: December 1998 d Diode model npn NPN BJT model pnp PNP BJT model 246 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files modelParametern lnpn Lateral NPN BJT model lpnp Lateral PNP BJT model njf N-channel JFET model pjf P-channel JFET model nmos N-channel MOSFET model pmos P-channel MOSFET model nbsim N-channel BSIM model pbsim P-channel BSIM model gasfet GaAs MESFET model scr SCR model nmosoi N-channel SOI MOSFET model pmosoi P-channel SOI MOSFET model Specified as appropriate; similar to SPICE2. Refer to the “Device Models” chapter for parameters. Examples You can use the following model file for a BJT: # qtyp.m file - typical bjt model file .model qntyp npn & bf=135 is=4.5e-15 rb=159 rc=17 ik=0.413 & c2=2.3 re=1 va=121 vb=20 br=16 & nel=1.45 ikr=120m c4=17 ncl=1.28 tf=5e-11 & tr=1e-7 ccs=0.4p cje=5ppe=0.48 me=0.24 & cjc=2p pc=0.48 mc=0.27 fc=0.5 af=1 & kf=6.6e-16 The model parameters within the file can also be any valid expression of built-in or userdefined variables or functions. Model files follow the same syntax conventions as the command files (see “Introduction” chapter). December 1998 247 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files The contents of these files are included in the circuit netlist by means of the usem command. That is, a usem myFile in the circuit netlist will search the defined simulator directory paths for the file myFile.m (or myFile.M) and include the contents of the file into that netlist. Note: Both command and model files can have arguments passed to them. Refer to the descriptions of use and usem in the “Commands” chapter. Note: Be sure that your model files do not include any of the following: ■ tabs ■ blank spaces between a parameter, the equal sign (=), and the value ■ an ampersand (&) in the last line of the model file The ampersand causes the following line to be appended to the model file, resulting in an error. Example Model File Below is an example of a more complex model file: .MODEL modelfile NMOS & LEVEL=LEVEL CAPMOD=CAPMOD & LAMBDA=LAMBDN NSS=NSSN & VTO=VTON(VTN,TCN) & TOX=TOX*1E-8 & PHI=PHIN(TEMPDC,NSUBN) & KP=KPN(KPN) & UO=KPN(KPN)*(TOX*1E-8)/(3.9*EPP0) & GAMMA=KBN & VMAX=VMAXN DELTA=DELTAN & THETA=THETANY*SNF(TCKNY1,TCKNY2,TEMPDC) & THETAX=THETANX*SNF(TCKNX1,TCKNX2,TEMPDC) & XJ=XJN KAPPA=KAPPAN ETA=ETAN & LDS=LSN LDD=LDN LD=LDDN(LFITN) & PB=PBN(TEMPDC) PBSW=PBNSW(TEMPDC) & MJ=MJN(TEMPDC) MJSW=MJNSW(TEMPDC) NSUB=NSUBN & CJ=CJN(TEMPDC) CJSW=CJNSW(TEMPDC) & RSH=LINF(TCRN,TEMPDC,RSHN) & CGBO=CGBN CGSO=CN CGDO=CN & RS=RN*CWSN+LINF(TCRN,TEMPDC,RSHN)*LSN & +TCRNLF(RLDDN,TEMPDC)* SPLDDN & RD=RN*CWSN+LINF(TCRN,TEMPDC,RSHN)*LDN & December 1998 248 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files JS=JSN(JSN) +TCRNLF(RLDDN,TEMPDC)* SPLDDN & NFS=NFSN*SNF(TCNFSN1,TCNFSN2,TEMPDC) Temperature Files Cadence SPICE can model temperature using SPICE2G-compatible built-in equations. To use these equations, set SPTEMP to 1 (refer to the “Built-in Variables and Arrays” chapter). Note: You can use your own equations to model temperature. The etc/analog/examples/ temperature directory in version 2.x includes command and model files describing temperature dependencies for diode, BJT, MOS, and JFET devices. You can customize these files to create your own device temperature models. You set SPTEMP=0 (the default value) for this option. The default TNOM for Cadence SPICE is 25, not 27 degrees. To use 27 degrees, set TNOM to 27. To achieve SPICE2G compatibility, set SPTEMP to 1 and TNOM to 27. To create a .TEMP file, set TEMPDC to the value you want to use. Example Files You can model temperature using your own equations when the SPTEMP variable is set to the default value of 0. The software includes example command and model files that describe temperature dependencies of Cadence SPICE model parameters. You can edit these files to model your own temperature dependencies. The files, which are in the . . . etc/analog/examples/ temperature/2.x directory, include the following: temperature.s Contains functions that describe temperature dependencies of model parameters. Functions include some that SPICE2G.6 uses internally and some currently popular temperature relationships. This file contains temperature functions for the MOSFET, BJT, diode, and JFET. Call this file from your init.s file with the line use temperature paramsTemp.s Contains SET commands that set various temperature variables. Call this file from your init.s file with the line use paramsTemp December 1998 249 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files bjtTemp.m BJT model file that utilizes all the temperature dependencies in the temperature.s file. Because this file contains only temperature-dependent model parameters, you should add to the file any parameters you want to set that are not temperature dependent. diodeTemp.m Diode model file that utilizes all the temperature dependencies in the temperature.s file. Because this file contains only temperature-dependent model parameters, you should add to the file any parameters you want to set that are not temperature dependent. mos1Temp.m MOS model file that utilizes all the temperature dependencies in the temperature.s file. Because this file contains only temperature-dependent model parameters, you should add to the file any parameters you want to set that are not temperature dependent. In this file the phi model parameter is explicitly set. mos2Temp.m MOS model file that utilizes all the temperature dependencies in the temperature.s file. Because this file contains only temperature-dependent model parameters, you should add to the file any parameters you want to set that are not temperature dependent. In this file the phi model parameter is not set. jfetTemp.m JFET model file that utilizes all the temperature dependencies in the temperature.s file. Because this file contains only temperature-dependent model parameters, you should add to the file any parameters you want to set that are not temperature dependent. Initialization and Update Files When Cadence SPICE is used in the Analog design environment, it uses two special command files: the initialization file and the update file. Usually you name the initialization file init.s, and the update file update.s, but you can use any names, as long as the name has the .s extension. Initialization File This file contains simulation commands that are executed when you initialize the simulation, or when you change the path or initialization filename. For example, to define a poly resistor function of temperature you can create an init.s file containing the following command: December 1998 250 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files FUNCTION rpoly(value)=value*(1+.01*(tempdc-25)+.002*(tempdc-25)**2) You can use this function when defining resistor values within your circuit. For example, the value of a resistor could be rpoly(1k) Update File This file contains simulation commands that are executed each time you run a simulation. You can define and update variables for temperature, statistical, and other variations. For example, instead of using the function just discussed, you can describe resistor temperature dependence with a resistor temperature coefficient variable rtempco within an update.s file. set rtempco=1+.01*(tempdc-25)+.002*&(tempdc-25)**2 You can assign a value of rtempco*1k to a resistor in your schematic. tempdc is a built-in Cadence SPICE variable. Note: The above examples illustrate the use of the initialization and update files. You can set resistor properties tc1 and tc2 so that the system automatically models resistor temperature effects, rather than defining your own functions as described here. Using init.s and update.s Files for Statistical Analysis This section explains how to use the init.s and update.s files to define ■ Statistical variations for simple elements and models ■ Hierarchical statistical variations (process and mismatch effects) Simple Element and Model Statistical Variations Before you perform a Monte Carlo analysis, you must define the input parameter statistical variations. You can set any Cadence SPICE variable, element, or model value within your circuit to a Gaussian distributed random value with the built-in GAUSS function (mean, stdev, N). The three function arguments are mean Distribution mean value stdev Distribution standard deviation December 1998 251 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files N RNG seed index (usually set to 1) Example 1 To describe a resistor with a mean value of 1K ohm and standard deviation of 100 ohms, define the resistor value as GAUSS(1K,100,1): set r=GAUSS(1K,100,1) Because Cadence SPICE supports variables and expressions within the argument list, you can describe the same function as GAUSS(rval,rval*.1,1). At simulation time, set the rval variable to 1K. Example 2 To make the Gummel-Poon forward current gain (BF) a statistical parameter with a mean of 200 and a standard deviation of 50, build a model file containing the following lines: .model &1 NPN & IS=1E-16 & BF=GAUSS(200,50,1) & . . . To make BF a log-n1hormal distribution, use the built-in function BF=LOGNORMAL(200,50) Note: The GAUSS and LOGNORMAL functions generate random values only when doing a Monte Carlo simulation. Otherwise, the functions return their mean values. Hierarchical Statistical Variations In analog integrated circuit (IC) design, both process and chip-level statistical variations affect circuit performance. Although variations between fabrication lots or wafers can be significant, variations are assumed to be relatively constant across the circuit die. For example, the sheet resistance of a P-base implant can vary from lot to lot by as much as ±10% around its mean. Resistors built from this implant vary accordingly. However, two adjacent resistors of the same geometry in the same circuit are assumed to have the same relative sheet resistivity and thus approximately the same relative value. Analog designers take advantage of this IC characteristic when designing differential amplifier circuits. Actually, small variations exist between these resistors and other “matched” components, causing imperfections (offsets) in analog circuits. You can model both process and mismatch variation with hierarchical random number generation. December 1998 252 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files Modeling Process Variations To model variations in process parameters like P-base sheet resistance (PbRho) and NPN transistor current gain (NpnBf), define variables within the update.s file using the set command, as in the following example: set PbRho=GAUSS(200,200*.05,1) set NpnBf=EXP(GAUSS(LOG(200),LOG(1.25),1)) Note: You can define these variable names. Then use these variables in any element or model value expression defined in your circuit. For example, a resistor of 50µ length and 10µ width has a value of PbRho * 50µ/10µ or r=PbRho*50u/10u For the NPN transistor current gain, the model file includes the following: .model &1 NPN & IS=1E16 BF=NpnBf VA=100 ... This update.s script file executes once before every simulation and these process variables update accordingly. In this way, sheet resistance and current gain values vary for every Monte Carlo simulation, but are the same for every resistor or BF model parameter defined as a function of the variables within the circuit. Modeling Mismatch Variations To model mismatch effects, define each element and/or model parameter as a function of a unique GAUSS( ) RNG as just described for simple statistical variations. For example, two matched P-base 1-K ohm resistors whose one standard deviation mismatch variation is ±1% can each have a value defined by GAUSS(1K,1K*.01,1): r=GAUSS(1K,1K*.01,1) To analyze transistor mismatch effects, each transistor must have its own model definition, where the model parameter mismatches are described as in the following example: .model &1 NPN & IS=GAUSS(1E-16,.03*1E-16,1) & BF=GAUSS(200,.03*200,1) & (These functions define a standard deviation of 3% mismatch.) If you must define many element and/or model parameter mismatches, you can create a userdefined FUNCTION, which you can then use to define the element or model value. This FUNCTION is defined within the init.s file script. The file script is executed only when the simulator is initialized or at your request. For the resistor example above, the init.s file is FUNCTION Rpb(value)=GAUSS(value,.01*value,1) December 1998 253 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files and the resistor value is r=Rpb(1k) Modeling Process and Mismatch Variations To model both process and mismatch variations, combine the individual definition methods. That is, define the process variables with the update.s file as just described, and define the mismatch variation for each element or model parameter value. For the P-base resistor and NPN current gain example, set up the init.s and update.s files as follows: init.s file: FUNCTION Rpb(l,w)=(PbRho*l/w)*GAUSS(1,.01,1) FUNCTION Nbf(dummy)=NpnBf*GAUSS(1,.03,1) . . update.s file: set PbRho=GAUSS(200,.05*200,1) set NpnBf=EXP(GAUSS(LOG(200),LOG(1.25),1)) . . Then, define the resistor and BF model parameter values by r=Rpb(50u,10u) and .model &1 NPN & IS=1E16 BF=Nbf(0) VA=100 ... Note: The zero argument to function Nbf is a dummy argument. Modeling Process or Mismatch Variations You can also selectively enable only the process or the mismatch level statistical models. In this way, you can analyze process variations using ideal matched components and model mismatch effects under deterministic process conditions. Use the SAM and MONTE variables with the blocked if-then-else statements within the update.s file script. Set the SAM variable to one of the following: SAM =0 =2 =3 =4 Deterministic analysis mode Process variations only Mismatch variations only Both process and mismatch variations The defdault value of SAM is 0. December 1998 254 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files The MONTE variable is a switch for the RNGs. When set to 1, the GAUSS( ) function returns a random number. When set to 0, the function returns the mean value. Build the update.s file script with these variables and the conditional if-then-else commands to ■ Set process variables to either their mean values or random numbers ■ Switch mismatch variations on or off Using the previous example, the update.s file script is as follows: if (SAM=0)!+(SAM=3) then # # # # if SAM is equal to 0 or 3, then set process variables to their means set PbRho=200 set NpnBf=200 . . if (SAM=2)!+(SAM=4) then# if SAM is equal to 2 or 4, # turn on process # variations by setting # variables to random # numbers set MONTE=1 set PbRho=GAUSS(200,.05*200,1) set NpnBf=EXP(GAUSS(LOG(200),LOG(1.25),1)) . . endif if (SAM=3)!+(SAM=4) then set MONTE=1 # if SAM equal to 3 or 4, # turn on mismatch # variations else set MONTE=0 # # # # # endif else,disable GAUSS( ) functions within the circuit definition so that they return the mean values Generating Correlated Random Process Variations Independent (unrelated) parameters are desirable, but not always possible, for the statistical process variables. If the statistical process variables are related and cannot be expressed as functions of each other, you can generate correlated Gaussian random variables. December 1998 255 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files Use the array command with the STATF function within the update.s file script. The array command lets you define vectors and matrices of numbers. In this case, the STATF function takes the following as arguments: STATF (mean(1), stdev(1),corr(1),rand(1),n) mean( ) Vector of correlated parameter mean values stdev( ) Vector of correlated parameter standard deviations corr( ) Vector of correlation matrix upper-right off-diagonal coefficients rand( ) Output vector of correlated random numbers n Number of correlated parameters (n<=10) For example, to model the statistical effect of the correlated process parameters Current gain (Nbf) Early voltage (Nva) Forward transit time (Ntf) Pinched base sheet resistance (Nrpb) amend the update.s file script to the following: if (SAM=0)!+(SAM=3) then set set set set # # # # if SAM is equal to 0 or 3, then set process variables to their means Nbf=200 Nva=100 Ntf=.1n Nrpb=15k if (SAM=2)!+(SAM=4) then ARRAY nmean(4) nstdev(4) ncorr(6) nrand(4) set nmean(1)=200 nmean(2)=100 nmean(3)=.1n nmean(4)=15k set nstdev(1)=30 nstdev(2)=10 nstdev(3)=.01n nstdev(4)=2k # upper right of correlation # matrix set ncorr(1)=-.6 ncorr(2)=.6 ncorr(3)=.9 set ncorr(4)=-.4 ncorr(5)=-.6 set ncorr(6)=.6 set MONTE=1 set dummy=STATF(nmean(1),nstdev(1),ncorr(1),nrand(1),4) set Nbf=nrand(1) Nva=nrand(2) Ntf=nrand(3) Nrpb=nrand(4) endif if (SAM=3)!+(SAM=4) then set MONTE=1 # if SAM is equal to 3 or 4, # turn on mismatch # variations else December 1998 256 Product Version 4.4.2 Cadence SPICE Reference Manual Command and Model Files set MONTE=0 # # # # # endif else, disable GAUSS( ) functions within the circuit definition so that they return the mean values The circuit uses Nbf, Nva, Ntf, and Nrpb as described above to define process variations. December 1998 257 Product Version 4.4.2 Cadence SPICE Reference Manual 8 Device Models ■ Introduction ■ Diode Model ■ Diode Model Parameters ❑ Diode Model Operating Point Parameters ❑ Model Descriptions ■ Bipolar Junction Transistor (BJT) Model ■ Modified Gummel-Poon BJT Model Parameters ■ Modified Gummel-Poon BJT Model Operating Point Parameters ■ Model Description ❑ DC Model Equations ❑ AC Model Equations ■ Junction Field-Effect Transistor (JFET) Model ■ JFET Model Parameters ■ JFET Model Operating Point Parameters ■ Model Description ■ ❑ Level 1 Model ❑ Level 2 Model ❑ Level 3 Model ❑ AC Model ❑ Noise Model Metal-Oxide-Semiconductor Field-Effect Transistor Model (Level 1) December 1998 258 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ MOSFET Model Parameters (Level 1) ■ MOSFET Model Operating Point Parameters (Level 1) ■ Model Description ❑ DC Model Equations ■ Metal-Oxide-Semiconductor Field-Effect Transistor Model (Levels 2 (MOS2) and 3 (MOS3)) ■ MOSFET Model Parameters (Levels 2 and 3) ■ MOSFET Model Operating Point Parameters (Levels 2 and 3) ■ MOSFET Model Operating Point Parameters (Charge Conserving Capacitance Option Level 3 Only) ■ Model Description ■ ❑ Parameters and Models Common to Levels 2 and 3 ❑ DC Model Equations ❑ Extrinsic AC Model Equations ❑ Parameters and Models Unique to Level 2 (MOS2) ❑ Parameters and Models Unique to Level 3 (MOS3) ❑ Temperature Equations ❑ Breakdown Equations Modified Level 3 (Berkeley MOS3) MOSFET Model ❑ Additional Model Parameters To Enable Level3+ / MOS3+ Equations ❑ Equation Modifications (Level-3+ / MOS3+) ■ Berkeley Short-Channel IGFET Model (BSIM) ■ BSIM Model Parameters ■ BSIM Model Operating Point Parameters ❑ Model Description ❑ Length/Width Sensitivity Parameters ❑ DC Model Equations December 1998 259 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ❑ AC Model Equations ❑ Temperature Equations ■ GaAs MESFET Model ■ GaAs MESFET Model Parameters ■ GaAs MESFET Model Operating Point Parameters ❑ Model Description ■ Silicon Controlled Rectifier (SCR) Model ■ SCR Model Parameters ■ SCR Model Operating Point Parameters ❑ Model Description ■ Silicon-on-Insulator (SOI) MOSFET Model ■ SOI MOSFET Model Parameters ■ SOI MOSFET Model Operating Point Parameters ❑ ■ Model Description References Introduction Each Cadence SPICE device model section covers: ■ ■ ■ Features ❑ Effects included in the model ❑ Model limitations ❑ Valid physical device structures Parameters ❑ Cadence SPICE parameters with descriptions and default values ❑ Operating point parameters with descriptions Model description December 1998 260 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ❑ Device equivalent circuit ❑ Model equations (DC, AC, and noise) ❑ Model parameters associated with specific effects Cadence SPICE documentation uses the following conventions: ■ Model parameters are designated in text by bold type. ■ An asterisk (*) following a parameter denotes that it is affected by the device AREA property. (Refer to the “Semiconductor Devices” section of the “Components” chapter.) ■ The constants and variable names defined in the table below are used in the model equations. Symbol Value/Units Definition k 1.38e-23 coulomb⋅V/K Boltzmann’s constant q 1.6e-19 coulombs electronic charge T kelvin temperature V volts potential I amperes current C farads capacitance ■ Cadence SPICE models do not permit blank spaces between a parameter and its value; for example bf=100is correct bf = 100is not correct ■ You can use an ampersand (&) as a continuation character at the end of a line in model files (as well as all other cdsSpice files) instead of using the plus sign (+) as the first character in a line. ■ You cannot use the “&” character on the last line of the model file. ■ You cannot use tabs in model files (or in any other cdsSpice files). Cadence SPICE can model temperature using SPICE2G-compatible built-in equations. To use these equations, set SPTEMP to 1 (the default value). (Refer to the “Built-in Variables and Arrays” chapter.) December 1998 261 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Note: You can use your own equations to model temperature. The etc/analog/examples/ temperature directory in version 2.x includes command and model files describing temperature dependencies for diode, BJT, MOS, and JFET devices. You can customize these files to create your own device temperature models. Refer to the “Temperature Files” section of the “Command and Model Files” chapter for information on these files. Set SPTEMP=0 for this option. The default TNOM for Cadence SPICE is 25, not 27 degrees. To use 27 degrees, set TNOM to 27. Diode Model The Cadence SPICE diode model (model type: d) includes ■ PN junction, Zener, and Schottky (including GaAs) diode models ■ Diode DC, large-signal, and small-signal models ■ Zener avalanche, burst, and 1/f noise models ■ Optional enhanced reverse breakdown model including “soft” breakdown characteristics ■ Temperature modeling December 1998 262 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Diode Model Parameters Parameter name Parameter description Unit Default Typical value 1 IS* Saturation current A 1.0e-14 1.0e-14 2 RS* Ohmic resistance ohm 0 10 3 N Emission coefficient - 1 1.0 4 TT Transit time s 0 0.1n 5 CJO* Zero-bias junction capacitance F 0 2p 6 PB (VJ) Junction potential V 1 0.6 7 M Grading coefficient - 0.5 0.5 8 KF Flicker noise coefficient - 0 - 9 AF Flicker noise exponent - 1 - 10 EF Flicker noise frequency exponent - 1.0 1.0 11 FC Forward-bias nonideal junction - capacitance coefficient 0.5 - 12 BV Reverse breakdown voltage V † 40.0 13 IBV Current at breakdown voltage A 1.0e-3 - 14 DOPE Background doping cm-3 0 - 15 RSV* Variable RS resistance ohm 0 - 16 RSM* Minimum RS resistance ohm 1 - 17 CCO* Current crowding normalizing constant A 1 - 18 CEX Current crowding exponent - 1 - 19 A Shallow GaAs SBD reverse-bias capacitance slope factor 0 -1.5e-2 20 VCBR Shallow GaAs SBD reverse-bias capacitance V fall-off voltage -500 -1.9 21 B Shallow GaAs SBD reverse-bias capacitance fall-off rate coefficient 10.0 5.0 22 ISRL Zener reverse low current IS 0 6.0e-15 December 1998 263 A Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 23 NRL Zener reverse low current ideality factor - 15.0 13.35 24 ISRH Zener reverse high current IS A 0 5.0e-15 25 NRH Zener reverse high current ideality factor - 0.5 0.2 26 AAV Avalanche noise constant - 3.3e-20 3.3e-20 27 RAV Avalanche noise resistance ohm 1.0 1.0 28 KAV Avalanche noise multiplier - 0 1 29 RBU Burst noise quasi-resistance ohm 2.3e-13 2.3e-13 30 CBU Burst noise quasi-capacitance F 9.0e+12 9.0e+12 31 KBU Burst noise multiplier - 0 1 32 BVR Maximum reverse voltage V 0 40 33 EG Activation energy eV 1.11 1.11 34 XTI‡ Saturation current temperature exponent - 3.0 3.0 When more than one parameter name appears on a line, you can use either name. * Parameter is affected by the device AREA property. (Refer to the “Semiconductor Devices” section of the “Components” chapter.) † The default for this parameter is that it is not calculated ‡ Used only if SPTEMP=1 December 1998 264 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Diode Model Operating Point Parameters Large Reverse Bias Parameter name Description Parameter unit 1 ID Diode current A 2 VD Diode voltage V 3 REG Small-signal diode resistance ohm 4 CAP Junction capacitance F 5 PWR Power W 6 RS Series resistance ohm 7 VDI Internal diode voltage V 8 BKDWN Breakdown flag s December 1998 265 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Model Descriptions DC Model Equations ■ DC characteristics are determined by IS, N, and RS. Small Bias ■ MKS=1: q ⋅ VD I D = IS ⋅ exp --------------- – 1 + G MIN ⋅ V D N ⋅ kT ■ 5 ⋅ N ⋅ kT V D ≥ – ----------------------q MKS=0: q ⋅ VD I D = IS ⋅ exp --------------- – 1 N ⋅ kT ■ VD > 0 N models non-ideality due to space-charge layer recombination and is ~1 for forward bias and ~0.1 for reverse bias. Diode Characteristics I D -BV V D -IBV December 1998 266 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Large Forward Bias V D ′ = V D + RS ⋅ I D ■ RS includes effects of ohmic resistance and high-level injection. ■ No reverse breakdown effects (BV=0): ❑ MKS=1: 5 ⋅ N ⋅ kT V D < – ----------------------- q I D = – IS + G MIN ⋅ V D ❑ MKS=0: q I D = IS ⋅ V D ⋅ --------------N ⋅ kT ■ VD < 0 With reverse breakdown effects (BV>0): ❑ MKS=1 5 ⋅ N ⋅ kT – BV < V D < – ----------------------- q I D = – IS + G MIN ⋅ V D for I D = – IBV kT ------ q IS ≤ IBV ⋅ -----------BV V D = – BV BV + V q D I D = – IS ⋅ exp – --------------------- – 1 + -------------- ⋅ BV + G MIN * V D N ⋅ kT N ⋅ kT ------------- q ❑ V D < – BV MKS=0 : – BV < V D < 0 q I D = IS ⋅ V D ⋅ --------------N ⋅ kT I D = – IBV for kT ------ q IS ≤ IBV ⋅ -----------BV V D = – BV BV + V q D I D = – IS ⋅ exp – --------------------- – 1 + -------------- ⋅ BV N ⋅ kT N ⋅ kT -------------- q December 1998 V D < – BV 267 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Enhanced Reverse Breakdown Model ■ Includes “soft” breakdown region. ■ Internal parameter XBV marks the boundary between low and high current regions (equal to BV in the simple model above). ■ Exponential term is added to original model above: –q ⋅ V D I D ( LOW ) = – ISRL ⋅ exp ----------------------- – 1 NRL ⋅ kT ■ ISRL, ISRH and NRL, NRH replace IS and N, respectively, for low and high current regions. ■ Reverse characteristics: – XBV < V D < 0: –q ⋅ VD q ⋅ ISRH ⋅ V D I D = – ISRL ⋅ exp ----------------------- – 1 + --------------------------------- NRL ⋅ kT NRH ⋅ kT V D < – XBV < 0: –q ⋅ V D XBV + VD q ⋅ ISRH ⋅ XBV I D = – ISRL ⋅ exp --------------------- – 1 – ------------------------------------ – ISRH ⋅ exp – q ⋅ --------------------------- – 1 NRL ⋅ kT NRH ⋅ kT NRH ⋅ kT ■ Model is turned off when ISRL and ISRH are set to 0 (default). Schottky Diode ■ Modeled using DOPE, RSV, RSM, CCO, and CEX. Conductivity modulated series resistor model is used only if DOPE > 0. The DOPE, RSV, RSM, CCO, and CEX parameters are used in the diode model as they are in the BJT conductivity-modulated RC. (Refer to the “Bipolar Junction Transistor (BJT) Model” section.) ■ Shallow GaAs Schottky barrier diode reverse capacitance is modeled by A, VCBR and B. (Refer to the “GaAs MESFET Model” section.) December 1998 268 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models AC Model Equations ■ Charge storage effects are modeled by transit time, TT, and a nonlinear depletion layer capacitance determined by CJO, PB, and M. Large-Signal Model ■ Charge storage (stored charge plus space charge): V D –M dI D C D = TT ⋅ ----------- + CJO ⋅ 1 – -------- PB dV D ( V D < FC ⋅ PB ) M ⋅ VD dI D CJO C D = TT ⋅ ----------- + ----------- ⋅ F 3 + -----------------d F V PB D 2 ( V D > FC ⋅ PB ) F 2 = ( 1 – FC ) 1 + M F 3 = 1 – FC ⋅ ( 1 + M ) Large-Signal Diode Model Equivalent Circuit p RS I C D D n December 1998 269 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Small-Signal Model ■ Small-signal conductance: q ⋅ VD q ⋅ IS g D = --------------- ⋅ exp --------------- N ⋅ kT N ⋅ kT ( V D < FC ⋅ PB ) V D –M C D = TT ⋅ g D + CJO ⋅ 1 – -------- PB ( V D > FC ⋅ PB ) M ⋅ VD CJO C D = TT ⋅ g D + ----------- ⋅ F 3 + ------------------ F PB 2 Small-Signal Diode Model Equivalent Circuit p RS C g D D n Noise Equations ■ Thermal noise: 4 ⋅ kT I R2 = -------------- ⋅ ∆ f RS where f = frequency December 1998 270 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Shot and flicker noise: AF KF ⋅ I D 2 = 2 ⋅ q ⋅ I ⋅ ∆ f + ---------------------- ⋅ ∆ f IN D EF f ■ Avalanche and burst noise (1/f 2) components in the buried Zener diode are modeled with AAV, RAV, KAV, RBU, CBU, and KBU. KBU=0 turns off the Burst component leaving only the Avalanche Noise (KAV=1). If both KBU=0 and KAV=0, then the normal 1/f noise parameters KF and AF are used (typical for a surface Zener): 2 2 AAV ⋅ BV I AVAL = KAV ⋅ ------------------------------2 I D ⋅ RAV RBU KBU I BURST = ------------- ⋅ -------------------------------------------------2 gB 1 + RBU ⋅ CBU ⋅ f wheref = frequency gB = diode conductance at operating point Temperature Equations Cadence SPICE can model temperature using SPICE2G-compatible built-in equations. To use these equations, set SPTEMP to 1 (refer to the “Built-in Variables and Arrays” chapter). Note: You can use your own equations to model temperature. The etc/analog/examples/ temperature directory in version 2.x includes command and model files describing temperature dependencies for diode, BJT, MOS, and JFET devices. You can customize these files to create your own device temperature models. Refer to the “Temperature Files” section of the “Command and Model Files” chapter for information on these files. Set SPTEMP=0 (the default value) for this option. The default TNOM for Cadence SPICE is 25, not 27 degrees. To use 27 degrees, set TNOM to 27. Breakdown Equations ■ Breakdown is modeled only if BVR does not equal 0. December 1998 271 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Breakdown occurs when V D ≥ BVR Bipolar Junction Transistor (BJT) Model The Cadence SPICE BJT model (model types: npn, pnp, lnpn, lpnp) ■ Applies to vertical (npn, pnp) and lateral (lnpn, lpnp) devices ■ Is an adaptation of Gummel-Poon integral charge control model ■ Extends the original SPICE model to include several high-low bias effects ■ Simplifies to Ebers-Moll model when certain parameters (Early voltages) are not specified You can use the display model command to see the values of the model parameters while running Cadence SPICE. The display model command only shows the values of sidewall parameters (73-86 in the following table) if at least one of the capacitances is not zero. December 1998 272 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Modified Gummel-Poon BJT Model Parameters Parameter name Parameter description Unit Default Typical value 1 IS* Saturation current A 0.1F 0.1F 2 BF Ideal forward current gain - 100 100 3 C2 Forward low-current nonideal base current coefficient A 0 100 4 IK (IKF)*† Forward high-current knee current for beta roll-off A infinite 10m 5 NEL (NE)† Nonideal low-current base-emitter emission coefficient 1.5 2.0 - 6 NF Forward current emission coefficient - 1.0 1.0 7 BR Ideal reverse current gain - 1 0.1 8 C4 Reverse low-current nonideal base current coefficient A 0 1.0 9 IKR* Reverse high-current knee current for beta roll-off A infinite 100m 10 NCL (NC)† Nonideal low-current base-collector emission coefficient - 2.0 2.0 11 NR Reverse current emission coefficient - 1.0 1.0 12 VA (VAF)† Forward Early voltage V infinite 200 13 VB (VAR)† Reverse Early voltage V infinite 200 14 KE Base-emitter space charge integral multiplier - 0 - 15 KC Base-collector space charge integral multiplier 0 - 16 RE* Emitter ohmic resistance ohm 0 1 17 RB*‡ Base ohmic resistance ohm 0 100 18 RC* Collector ohmic resistance ohm 0 10 19 RBM*‡ Minimum base resistance at high currents ohm 0 8 December 1998 273 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 20 RBV*‡ Variable base resistance ohm 0 2 21 IRB* Current where base resistance falls halfway to its minimum value A infinite - 22 RCM* Minimum collector resistance ohm 0 - 23 RCV* Variable collector resistance ohm 0 - 24 CEX Current crowding exponent - 1 - 25 CCO* Current crowding normalization constant A 1 - 26 DOPE Collector background doping concentration cm-3 0 - 27 VHS Hard saturation modulation potential V 0 0.56 28 NHS Hard saturation scaling factor - 0 0.1 29 TF Ideal forward transit time s 0 0.1n 30 XTF Coefficient for bias dependence of TF - 0 - 31 VTF Voltage describing VBC dependence V of TF infinite - 32 ITF* High-current parameter for effect on TF A 0 - 33 TR Ideal reverse transit time s 0 10n 34 TD Intrinsic base delay time s 0 0.2n 35 PTF Excess phase at frequency 1.0/(TD⋅ degree 2π) Hz 0 -5 36 CJE* Zero-bias B-E junction capacitance F 0 2p 37 PE (VJE)† B-E built-in potential V 0.75 0.7 38 ME (MJE)† B-E junction exponential grading coefficient - 0.33 0.33 39 FC Forward-bias nonideal junction capacitance coefficient - 0.5 0.5 40 CJC* Zero-bias B-C junction capacitance F 0 10p December 1998 274 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 41 PC (VJC)† B-C built-in potential V 0.75 0.5 42 MC (MJC)† B-C junction exponential grading coefficient - 0.33 0.33 43 XCJC - 1.0 0.95 44 CCS (CJS)* Zero-bias substrate junction capacitance F 0 2p 45 PS (VJS)† V 0.75 0.5 46 MS (MJS)† Substrate junction exponential grading coefficient - 0.0 0.5 47 KF Flicker noise coefficient - 0 npn: 0.66f pnp: 0.63p 48 AF Flicker noise exponent - 1 npn: 1.0 pnp: 1.5 49 EF Flicker noise frequency exponent - 1.0 1.0 50 CBO Extrapolated 0-volt leakage current A 0 40p 51 GBO Slope of Icbo vs. Vbc above VBO mho 0 4.6p 52 VBO Slope of Icbo vs. Vbc at 0 volts Vbc V 0 3.0 53 BVCE Maximum collector-to-emitter voltage V § 40 54 BVCB Maximum collector-to-base voltage V § 80 55 BVEB Maximum emitter-to-base voltage V § 8 56 RDPL Ratio of zero-bias collector-base depletion thickness to N-epi thickness (MOD.RC) - 0 0.5 57 RBF Value of BF/QB where emitter - 0 0.8*BF 0 4 Fraction of B-C depletion capacitance connected to internal base node Substrate junction built-in potential debiasing begins to affect base resistance 58 DRBF December 1998 First derivative of RB with respect to ohm BF/QB at BF/QB=RBF-ε(ε<<RBF) 275 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 59 DDRBF Second derivative of RB with respect ohm to BF/QB at BF/QB=RBF-ε(ε<<RBF) 0 0.2 60 ISE Base-emitter leakage saturation current (MKS=1 only) A 0 1E-13 61 ISC Base-collector leakage saturation current (MKS=1 only) A 0 1E-13 62 EG❖ Energy gap for temperature effect on eV IS 1.11 1.11 63 XTI❖ Temperature exponent for effect on IS - 3.0 3.0 64 XTB❖ Forward and reverse beta temperature exponent - 0.0 0.0 65 RCEX* External collector ohmic resistance ohm 0 - 66 RBEX* External base ohmic resistance ohm 0 - 67 CCSEX* Zero-bias substrate junction capacitance to RCEX-RC node. Uses PS, MS. F 0 - 68 CJCEX* Zero-bias B-C junction capacitance from RCEX-RC node to RBEX-RB node F 0 - 69 PCEX Junction built-in potential for CJCEX V 0.75 - 70 MCEX Junction exponential grading coefficient for CJCEX 0.33 - 71 ISS* Substrate junction saturation current A 0 - 72 NS Substrate junction current emission coefficient - 1.0 - 73 CJESW* Zero-bias B-E junction sidewall capacitance F 0 - 74 PESW B-E sidewall built-in potential V PE - 75 MESW B-E sidewall exponential grading coefficient - ME - December 1998 276 - Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 76 CJCSW* Zero-bias B-C junction sidewall capacitance F 0 - 77 PCSW B-C sidewall built-in potential V PC - 78 MCSW B-C sidewall exponential grading coefficient - MC - 79 XCJSW* Zero-bias external B-C junction sidewall capacitance F 0 - 80 XPCSW External B-C sidewall built-in potential V XPC - 81 XMCSW External B-C sidewall exponential grading coefficient - XMC - 82 XPC External B-C built-in potential V PC - 83 XMC External B-C exponential grading coefficient - MC - 84 CCSSW* Zero-bias substrate junction sidewall F capacitance 0 - 85 PSSW Substrate sidewall built-in potential V PS - 86 MSSW Substrate sidewall exponential grading coefficient - MS - *Parameter is affected by the device AREA property. (Refer to the “Semiconductor Devices” section of the “Components” chapter.) †When more than one parameter name appears on a line, you can use either name. ‡Internal to the BJT model (not seen with Display Model): If MKS=1 (RBV(mp) has no effect.) RB(model)=RBM(model+RBV(model) If RB(mp)>=RBM(mp) RBV(model)=RB(mp)-RBM(mp) RBM(model)=RBM(mp) December 1998 277 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models If RB(mp)<=RBM(mp) RBM(model)=RB(mp) RBV(model)=0 If MKS=0 (RBV(mp) does have an effect.) If RBM(mp)>0 and RBV(mp)>0 RB(model)=RBM(mp)+RBV(mp) If RBM(mp)=0 or RBV(mp)=0 RB(model)=RB(mp) §The default for this parameter is that it is not calculated. ❖Used only if SPTEMP=1 December 1998 278 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Modified Gummel-Poon BJT Model Operating Point Parameters Parameter name Parameter description Unit 1 IB Base current A 2 IC Collector current A 3 VBE Base-emitter voltage V 4 VBC Base-collector voltage V 5 VCE Collector-emitter voltage V 6 BETADC DC current gain unitless 7 GM Transconductance mho 8 RPI Input resistance ohm 9 RO Output resistance ohm 10 CPI Base-emitter capacitance F 11 CMU Base-collector capacitance F 12 BETAAC AC current gain unitless 13 FT Unity gain bandwidth Hz 14 PWR Power W 15 HOB Grounded base output admittance mho 16 HRB Grounded base reverse voltage feedback unitless 17 VBCI Internal base-collector voltage V 18 RC Collector series resistance ohm 19 ICBO Collector-base leakage current A 20 RB Base series resistance ohm 21 CSUB Substrate capacitance F 22 SAT Saturation flag s 23 BKDWN Breakdown flag s 24 CJCX Internal collector-external base capacitance F 25 CJCEX External collector-external base capacitance F December 1998 279 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit 26 CCSEX Substrate-external collector capacitance F 27 ISUB Substrate current A 28 VSUBI Substrate-internal collector voltage V Model Description DC Model Equations DC Model Parameter Summary ■ Forward current gain: IS, BF, C2, IK, NE, NF ■ Reverse current gain: IS, BR, C4, IKR, NC, NR ■ Output conductance: Forward region: VA Reverse region: VB Modified Gummel-Poon model: KE, KC ■ Ohmic resistances: RE RB: bias/current dependence: RBM, RBV,RBF,DRBF,DDRBF,IRB RC: bias/current dependence: RCM, RCV, RDPL, CEX, CCO, DOPE DC Model Parameter Summary ■ Collector-emitter transport current: V B′E′ V B′C′ IS I CT = -------- ⋅ exp q ⋅ ------------------- – exp q ⋅ ------------------- QB NF ⋅ kT NR ⋅ kT December 1998 280 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Emitter injection efficiency component of base current: V B′E′ IS I BEP = -------- ⋅ exp q ⋅ ------------------- – 1 BF NF ⋅ kT ■ Emitter-base space charge recombination current: V B′E′ I BES = C2 ⋅ IS ⋅ exp q ⋅ ----------------------- – 1 NEL ⋅ kT ■ Collector injection efficiency component of base current: V B′C′ IS I BCP = ------- ⋅ exp q ⋅ ------------------- – 1 NR ⋅ kT BR ■ Collector-base space charge recombination current: V B′C′ I BCS = C4 ⋅ IS ⋅ exp q ⋅ ----------------------- – 1 NCL ⋅ kT ■ ICBO model of reverse-biased collector-base junction: V B′C′ I CBO = [ – CBO + GBO ⋅ V B′C′ ] ⋅ 1 – exp -------------- VBO Base charge (assumes TF and TR proportional to Q 12 ): Q1 Q B = ------- ⋅ [ 1 + 1 + 4 ⋅ Q 2 ] 2 ■ Base width modulation component of base charge: 1 Q 1 = --------------------------------------------V B′C′ V B′E′ 1 – -------------- – -------------VA VB December 1998 281 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Base width modulation component of base charge with KE and KC specified: V B′C′ Q 1 = 1 + KC ■ V B′C′ dV dV - + KE ∫ ------------------------------∫ -----------------------------V MC V ME 0 1 – -------- 0 1 – ------- PC PE High injection component of base charge: V B′E′ V B′C′ IS IS Q 2 = ------ ⋅ exp q ⋅ ------------------- – 1 + ---------- ⋅ exp q ⋅ ------------------- – 1 NF ⋅ kT NR ⋅ kT IK IKR ■ Pinched and conductivity modulated base resistance: RBM>0 RBV R BB = RBM + -----------QB RB>0 RBF=0 IRB=0 RBV BF R BB = RBM + ------------ + DRBF ⋅ -------- – RBF Q QB B RBF>0 IRB=0 2 1 BF + --- ⋅ DDRBF ⋅ -------- – RBF Q 2 B [ tan ( x ) – x ] R B = RBM + 3 ⋅ RBV ⋅ -----------------------------[ x ⋅ tan 2 ( x ) ] IRB>0 RBM>0 RBF=0 144 I B 1 + --------- ⋅ ---------- – 1 π 2 IRB x = ---------------------------------------------IB 24 ------ ⋅ ---------2 IRB π ■ Conductivity modulated collector resistance: 2 ni V B′C′ – 1 I C CEX R CC = RCM + RCV ⋅ 1 + ----------------- ⋅ exp q ⋅ ------------------- ⋅ 1 + ------------- DOPE NR ⋅ kT CCO December 1998 282 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models If MKS=0, the intrinsic carrier concentration ni is not a function of temperature. ■ Modulated RC effects: For 0<DOPE<1E-20 No modulated RC effects For 1E-20<DOPE<1E21, RDPL=0, NHS=0 or RB=0 Quasi-saturation modulation (VBC>0) For 1E-20<DOPE<1E21, RDPL=0, NHS>0 and RB>0 Quasi-saturation modulation (VBC>0) Hard-saturation modulation (VBC>0) For 1E-20<DOPE<1E21, RDPL>0, NHS=0 or RB=0 Quasi-saturation modulation (VBC>0) Reverse-bias modulation (VBC<0) For 1E-20<DOPE<1E21, RDPL>0, NHS>0 and RB>0 Quasi-saturation modulation (VBC>0) Hard-saturation modulation (VBC>0) Reverse-bias modulation (VBC<0) For DOPE 1E21,RDPL>0, NHS=0 or RB=0 Reverse-bias modulation (VBC<0), where – VBC MC RC = RCV ⋅ 1 – RDPL ⋅ --------------- + RCM PC AC Model Equations AC Model Parameter Summary ■ Minority carrier base charge storage: TF, TR ■ Excess phase/time delays beyond those predicted by hybrid π form of Gummel-Poon model: PTF and TD or TF December 1998 283 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Nonlinear depletion layer capacitances: B-E junction: CJE, PE, ME, FC Internal and external B-C junctions: CJC, PC, MC, XCJC, FC Substrate: CCS, PS, MS ■ Collector leakage current modeling extension: CBO, GBO, VBO Equations ■ Base-emitter depletion and diffusion capacitance: V B′E′ – ME C π = CJE ⋅ 1 – -------------+ TF ⋅ gmf PE ■ Base-collector depletion and diffusion capacitance: V B′C′ – MC C µ = CJC ⋅ XCJC 1 – -------------+ TR ⋅ gmr PC ■ Forward and reverse transconductances: V B′E′ IS gmf = q ⋅ ------------------- ⋅ exp q ⋅ ------------------- NF ⋅ kT NF ⋅ kT V B′C′ IS gmr = q ⋅ ------------------- ⋅ exp q ⋅ ------------------- NR ⋅ kT NR ⋅ kT Note: The diffusion term (TF * gmf ) is generated from q ⋅ V b′e′ Q de = TF ⋅ IS exp -------------------- – 1 NF ⋅ kT where: d C de = TF ⋅ ---------------- ( Q de ) dV b′e′ December 1998 284 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models SPICE 2G.6 uses instead: q ⋅ V b′e′ IS Q de = TF ⋅ -------- exp -------------------- – 1 QB NF ⋅ kT The effective result is that Cadence SPICE adds a (TF * QB) bias dependence. ■ External base-collector depletion and diffusion capacitance: V B′C′ – MC C x = CJC ⋅ ( 1 – XCJC ) 1 – -------------PC ■ ■ Substrate depletion capacitance: V C′S – MS C s = CCS ⋅ 1 – -----------PS (NPN and PNP) V B′S – MS C s = CCS ⋅ 1 – -----------PS (LNPN and LPNP) All capacitances of the form: V –M C = C 0 ⋅ 1 – ---φ revert to: M C = C 0 ⋅ 1 + ----------------------------- ⋅ ( V – FC ⋅ φ ) ⋅ ( 1 – FC ) – M φ ⋅ ( 1 – FC ) for V > FC ⋅ φ (for substrate capacitance, V > 0). ■ Excess phase: time delay = PTF ⋅ TD(if TD specified) time delay = PTF ⋅ TF(if TD not specified) ■ Delay corresponds to linear excess phase in frequency domain using Laplacian delay operator. Also used during transient analysis using Bessel Polynomial Approximation. December 1998 285 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Effective transit time: V BC T F = TF ⋅ 1 + XTF ⋅ ( 3z 2 – 2z 3 ) ⋅ exp ------------------------- 1.44 ⋅ VTF I BE z = -----------------------I BE + ITF Noise Model Equations ■ Thermal noise components: 4 ⋅ kT 2 I RBB = -------------- ⋅ ∆ f R BB 4 ⋅ kT 2 = -------------- ⋅ ∆ f I RCC R CC ⋅ kT 2 = 4 -------------- ⋅ ∆ f I RE RE where f = frequency ■ Base current shot and flicker noise: KF ⋅ I BAF 2 = 2 ⋅ q ⋅ I ⋅ ∆ f + ---------------------- ⋅ ∆f I BN B f EF 2 I CN = 2 ⋅ q ⋅ IB ⋅ ∆ f Temperature Equations Cadence SPICE can model temperature using SPICE2G-compatible built-in equations. To use these equations, set SPTEMP to 1 (refer to the “Built-in Variables and Arrays” chapter). You can use your own equations. The etc/analog/examples/temperature directory in version 2.x includes command and model files describing temperature dependencies for diode, BJT, MOS, and JFET devices. You can customize these files to create your own device temperature models. Refer to the “Temperature Files” section of the “Command and Model Files” chapter for information on these files. Set SPTEMP=0 (the default value) for this option. December 1998 286 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models The default TNOM for Cadence SPICE is 25, not 27 degrees. To use 27 degrees, set TNOM to 27. Breakdown Equations ■ Breakdown modeled only if BVCE, BVCB, and BVEB do not equal 0. ■ Breakdown occurs when any of the following conditions hold: NPN V CE ≥ BVCE V CB ≥ BVCB V EB ≥ BVEB PNP – V CE ≥ BVCE – V CB ≥ BVCB – V EB ≥ BVEB December 1998 287 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models NPN and PNP BJT Model Equivalent Circuit C R CEX C" C CSEX C JCEX R C S C R BEX C B' B" B I SUB JCX R C' MU C B I BE C PI CS I CE E' R E E December 1998 288 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models LNPN and LPNP BJT Model Equivalent Circuit C R CEX C" C C JCEX CSEX R C S C B' B" B R B R BEX JCX C MU C I C' PI BE I CE E' I SUB C R E CS E Junction Field-Effect Transistor (JFET) Model The Cadence SPICE JFET model (model types: njf, pjf) includes three model levels: ■ ■ Level 1 model ❑ Uses Shichman-Hodges FET model ❑ Models charge storage using nonlinear depletion capacitances that vary as 1/2 power of junction voltages Level 2 model December 1998 289 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ ❑ Uses hyperbolic tangent function for current ❑ Includes subthreshold model ❑ Allows more accurate simulation of devices that do not follow ideal square-law characteristics Level 3 model ❑ Offers three- or four-terminal model with addition of back gate node ❑ Models top and bottom gate leakage ❑ Models internal gate charging capacitance and charging resistance December 1998 290 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models JFET Model Parameters Parameter name Parameter description Unit Default Typical value 1 VTO Threshold voltage V -2.0 -2.0 2 BETA* Transconductance parameter 0.1m 1m 3 LAMBDA Channel length modulation parameter 1/V 0 100 4 RD* Drain resistance ohm 0 100 5 RS* Source resistance ohm 0 100 6 CGS* Zero-bias G-S junction depletion capacitance F 0 5p 7 CGD* Zero-bias G-D junction depletion capacitance F 0 1p 8 PB Gate junction potential V 1.0 0.6 9 FC Coefficient for forward-bias depletion capacitance formula - 0.5 0.5 10 IS*‡ Gate junction saturation current A 10f 10f 11 KF Flicker noise coefficient - 0 - 12 AF Flicker noise exponent - 1.0 - 13 EF Flicker noise frequency exponent - 1.0 0.7 14 NP Power-law characteristic (L2, 3) - 2.0 1.8 15 ALPHA Linear to saturation region transition parameter (L2, 3) - 2.0 1.5 16 IO* Post-pinch-off drain saturation current (L2, 3) A 0 1p 17 LEVEL Model level - 1 - 18 TF Transit time s 0 .1ns 19 RG* Gate resistance ohm 0 - 20 M Gate junction exponential grading coefficient (L3) - 0.5 0.5 21 PBI Internal gate junction potential (L3) V 1.0 0.6 December 1998 291 NP A/V Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value - 0.5 0.45 22 MI Internal gate junction exponential grading coefficient (L3) 23 A Internal gate reverse-bias capacitance 1/V2 slope factor (L3) 0 -7m 24 VCBR Internal gate reverse bias capacitance V fall-off voltage (L3) -500 -1.8 25 B Internal gate reverse bias capacitance 1/V fall-off rate coefficient (L3) 10 4 26 CGSI* Internal gate charging capacitance (L3) F 0 9p 27 RGI* Internal gate charging resistance (L3) ohm 0 400 28 RGB* Back gate resistance ohm 0 70 29 CGBS* Zero-bias GB-S junction depletion capacitance (L3) F 0 5p 30 CGBD* Zero-bias GB-D junction depletion capacitance (L3) F 0 1p 31 PBB Back gate junction potential (L3) V 1.0 0.6 32 MB Back gate junction exponential grading coefficient (L3) 0.5 0.4 33 ISB*‡ Back gate junction saturation current (L3) A 10f 10f 34 CBO*‡ Top gate extrapolated 0-V leakage current (L3) A 0 40p 35 GBO*‡ Top gate slope of IGDO vs. V above mho 0 2p at 0V V 0 2.0 A 0 40p GD VBO (I GSO 36 VBO GD CBOB*‡ December 1998 ) (L3) GS Top gate slope of I V 37 vs. V (I GSO vs. V GDO vs. V GD ) (L3) GS Back gate extrapolated 0-V leakage current (L3) 292 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name 38 GBOB*‡ Parameter description Back gate slope of I above VBO (I GBS 39 VBOB vs. V Back gate slope of I 0V V GBD (I GBS GBDO vs. V GBD Unit Default Typical value mho 0 2p V 0 2.0 ) (L3) GBS GBDO vs. V vs. V GBD at ) (L3) GBS 40 VTOS Four-terminal slope in VTO4 calculation (L3) - 1.2 41 VTOP Four-terminal bottom gate to channel junction potential (L3) V 0.6 42 VTOE Four-terminal exponent in VTO4 calculation (L3) - 0.33 43 VTOC Four-terminal VTO4 calculation constant (L3) V -3.3 44 BVDS Maximum drain-to-source voltage V † 40 45 DSAR Drain-side scale factor for saturation and leakage current terms (for devices with unequal drain and source areas). 1 1 *Scales with AREA factor. (Refer to the “Semiconductor Devices” section of the “Components” chapter.) ‡Drain-side scales with DSAR † The default for this parameter is that it is not calculated. Note: Parameters valid in Level 2 or Level 3 only are denoted in parameter description by (L2) and (L3). December 1998 293 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models JFET Model Operating Point Parameters Parameter name Parameter description Unit 1 ID Drain current A 2 VGS Gate-source voltage V 3 VDS Drain-source voltage V 4 VGBS Back gate-source voltage V 5 GM Transconductance mho 6 GDS Output conductance mho 7 GMB Back gate transconductance mho 8 CGSI Internal gate charging capacitance F 9 CGS Gate source capacitance F 10 CGD Gate drain capacitance F 11 CGBS Back gate-source capacitance F 12 CGBD Back gate-drain capacitance F 13 VTO4 Four-terminal pinch-off voltage V 14 BETA4 Four-terminal transconductance parameter 1/V2 15 PWR Power W 16 LIN Linear region flag s 15 BKDWN Breakdown flag s Model Description Level 1 Model ■ Shichman-Hodges FET model ■ Provides square-law characteristic and includes two gate junction capacitances December 1998 294 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models DC Model ID = 0 V GS – VTO ≤ 0 I D = BETA ⋅ ( V GS – VTO ) 2 ⋅ ( 1 + λ ⋅ V DS ) 0 > V GS – VTO ≤ V DS I D = BETA ⋅ V DS ⋅ [ 2 ⋅ ( V GS – VTO ) – V DS ] ⋅ ( 1 + λ ⋅ V DS ) V GS – VTO > V DS λ = LAMBDA ■ Diode currents : q ⋅ V GD I GD = IS ⋅ exp ------------------- – 1 kT q ⋅ V GS I GS = IS ⋅ exp ------------------ – 1 kT ■ Ohmic resistances RD, RS, RG December 1998 295 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Level One Large-Signal Model Equivalent Circuit D RD CGD I GD RG I D G I GS CGS RS S AC Model ■ Reverse ( V GS < FC ⋅ PB ): CGS CAP GS = ----------------------------V GS 1 – ---------PB December 1998 296 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Forward ( V GS > FC ⋅ PB ): V GS CAP GS = CGS ⋅ ( 1 – FC ) – ( 1 + M ) ⋅ 1 – FC ⋅ ( 1 + M ) + -------------- + TF ⋅ G GS 2 ⋅ PB where d I GS G GS = -------------d V GS dID G M = -------------d V GS d I GD G GD = --------------d V GD dID G DS = -------------d V DS (Similarly for CAPGD using CDG.) Level One Small-Signal Model Equivalent Circuit CGD G RG RD GD G D G GS G CGS M G DS RS S December 1998 297 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Noise Model ■ Resistor thermal noise : I NR = ■ Flicker noise (when the JFET is in the linear region): I ND = ■ 4 ⋅ kT -------------R AF KF ⋅ I D 4 ⋅ kT ⋅ G M + --------------------EF f Flicker noise (when the JFET is in the saturation region): I ND = AF KF ⋅ I D 4 ⋅ kT ⋅ G M + --------------------f EF Level One Noise Model Equivalent Circuit INRG CGD INRD RG GGD RD G D GGS CGS GM GDS IND INRS RS S December 1998 298 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Level 2 Model ■ Identical to Level 1 model, except for DC current formulation and addition of subthreshold region (when IO >0). ■ Improved linear-to-saturation current characteristics: V GS NP α ⋅ V DS I DSS = BETA ⋅ VTO NP ⋅ 1 – ----------- ⋅ tanh ---------------------------- ⋅ ( 1 + λ ⋅ V DS ) VTO VTO – V GS α = ALPHA ■ Subthreshold model similar to BSIM: I DIF ⋅ I LIM I SUB = ----------------------------I DIF + I LIM V GS – VTO q ⋅ V DS I DIF = IO ⋅ exp q ⋅ ---------------------------- ⋅ 1 – exp – ------------------ kT kT kT 2 I LIM = 2 ⋅ BETA ⋅ ------ q ■ Total drain current: I D = I DSS + I SUB Level 3 Model ■ Formulation separates top and bottom gates. ■ Model consists of either a three- or a four-terminal structure: Three-terminal if back gate node is not specified or specified as same node number as top gate node. Four-terminal if back gate node is specified and is not the same node number as top gate. December 1998 299 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ The four-terminal model is identical to the three-terminal model, except for DC current characteristics. DC Model ■ DC model equations for the three-terminal structure are identical to those for Level 2 for ID and diode currents. ■ Additional parameters: ISB is back gate junction saturation current. RGB, CGBS and CGBD are included for back gate resistance and capacitances. ■ Pinch-off voltage for four-terminal structure depends on back gate potential. ■ Point of reference in four-terminal structure for defining VTO and BETA is at VGBS = 0, and voltage dependent parameters noted as VTO4 and BETA4: VTO4 = VTOS ⋅ ( VTOP – V GBS ) VTOE + VTOC VTO + VTOP BETA4 = BETA ⋅ ----------------------------------VTO4 + VTOP ■ Drain current component IDSS similar to Level 2 model: α ⋅ V DS I DSS = BETA4 ⋅ ( V GS – VTO4 ) NP ⋅ tanh ------------------------------- ⋅ ( 1 + λ ⋅ V DS ) VTO4 – V GS ■ Subthreshold current component is identical to Level 2. ■ Reverse junction leakage modeling for each of the four-gate diodes (“X” refers to specific diode): V GX I GX = [ – CBO + GBO ⋅ V GX ] ⋅ 1 – exp ----------- VBO (For back gate, parameters CBOB, GBOB, and VBOB apply.) December 1998 300 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models AC Model ■ AC model includes internal gate charging capacitor CGSI and charging resistance RGI. Level 3 Large-Signal Model Equivalent Circuit NG = NGB: 3 Terminals D RD CGBD CGD RG G IGBD IGD CGSI RGI RGB GB ID IGBS IGS CGS RS CGBS S ■ Reverse capacitance model parameters A, B, and VCBR can be set for a CGSI characteristic which reduces to 0 at pinch-off. (Refer to “GaAs MESFET model” section for details.) Noise Model ■ Resistor thermal noise: I NR = kT 4 ⋅ -----R December 1998 301 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Flicker noise: I ND = where AF 8 ⋅ kT ⋅ ( G M + G MB ) KF ⋅ I D -------------------------------------------------- + --------------------EF 3 f f = frequency Level 3 Small-Signal Model Equivalent Circuit D RD CGD RG CGBD GGD GGBD GM G GDS RGB GB GMB CGSI RGI GGS GGBS CGS RS CGBS S December 1998 302 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Level 3 Noise Model D CGD CGBD RD NRD GGBD RG GGD INRGI RGB GM G GB GDS CGSI RGI IND GMB GGS INRG GGBS NRS INRGB RS CGBS CGS S Temperature Equations Cadence SPICE can model temperature using SPICE2G-compatible built-in equations. To use these equations, set SPTEMP to 1 (refer to the “Built-in Variables and Arrays” chapter). Note: You can use your own equations to model temperature. The etc/analog/examples/ temperature directory in version 2.x includes command and model files describing temperature dependencies for diode, BJT, MOS, and JFET devices. You can customize these files to create your own device temperature models. Refer to the “Temperature Files” section of the “Command and Model Files” chapter for information on these files. Set SPTEMP=0 (the default value) for this option. The default TNOM for Cadence SPICE is 25, not 27 degrees. To use 27 degrees, set TNOM to 27. Breakdown Equations ■ Breakdown modeled only if BVDS does not equal 0. ■ Breakdown occurs when: V DS ≥ BVDS NJFET – V DS ≥ BVDS PJFET December 1998 303 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Metal-Oxide-Semiconductor Field-Effect Transistor Model (Level 1) The Cadence SPICE MOSFET Level 1 model (model types: nmos, pmos) ■ Is based on simple Shichman-Hodges model ■ Is designed to run quickly ■ Models channel length modulation and substrate bias effects ■ Does not model mobility variations or subthreshold ■ Offers optional impact ionization December 1998 304 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models MOSFET Model Parameters (Level 1) Parameter name Parameter description Unit Default Typical value 1 LEVEL Model index (set to 1 for this model) - 2 - 2 VTO Zero-bias threshold voltage V 0.0 1.0 3 KP Transconductance parameter 1.0e-5 3.1e-5 4 GAMMA Bulk threshold parameter 0.0 0.37 5 PHI Surface potential V 0.6 0.65 6 LAMBDA Channel-length modulation 1/V 0.0 0.02 7 RD Drain ohmic resistance per unit width W ohm⋅m 0.0 0.001 8 RS Source ohmic resistance per unit width W ohm⋅m 0.0 0.001 9 CBD Zero-bias B-D junction capacitance F 0.0 2.0e-8 10 CBS Zero-bias B-S junction capacitance F 0.0 2.0e-8 11 CGSO (CGS)* Gate-source overlap capacitance per m channel width F/m 0.0 4.0e-9 12 CGDO (CGD)* Gate-drain overlap capacitance per m channel width F/m 0.0 4.0e-9 13 CGBO (CGB)* Gate-bulk overlap capacitance per F/m m channel length 0.0 2.0e-8 14 RSH Drain and source diffusion sheet resistance ohm/sq 0.0 10.0 15 PB Bottom bulk junction potential V 0.8 0.37 16 PBSW (PHP)† Sidewall bulk junction potential V 0.8 0.87 December 1998 305 2 A/V 1/2 V Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Default Typical value 0.0 2.0e-4 F/m 0.0 1.0e-9 Bulk junction bottom grading coefficient - 0.5 0.5 MJSW Bulk junction sidewall grading coefficient - 0.33 0.3 JS Bulk junction saturation current 1.0e-8 1.0e-8 infinity 1.0e-5 3 0.0 4.0e15 2 0.0 1.0e10 1.0 - 0.0 0.8m 600 700 Parameter name Parameter description 17 CJ Zero-bias bulk junction bottom capacitance per m2 of junction area 18 CJSW Zero-bias bulk junction sidewall capacitance per m of junction perimeter 19 MJ 20 21 2 Unit 2 F/m 2 A/m per m of junction area 22 TOX Oxide thickness 23 NSUB Substrate doping 24 NSS Surface state density 25 TPS (TPG)† Type of gate material: m 1/cm 1/cm + 1 opposite to substrate - 1 same as substrate 26 LD (DLAT, LATD) Lateral diffusion 27 UO Surface mobility 28 KF Flicker noise coefficient - 0.0 1.0e-26 29 AF Flicker noise exponent - 1.0** 1.2 30 EF Flicker noise frequency exponent - 1.0 1.0 31 FC Coefficient for forward-bias depletion capacitance formula for junction bottom - 0.0 0.5 32 FCSW Coefficient for forward-bias depletion capacitance formula for junction sidewall - 0.0 0.5 December 1998 2 cm /V-s 306 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 33 LDS Source diffusion length m 0.0 1.0µ 34 LDD Drain diffusion length m 0.0 1.0µ 35 XJ Metallurgical junction depth m 0.0 1.0e-6 36 NGATE Gate doping concentration 0.0 - 37 BVDS Maximum drain-to-source voltage V ‡ 20 38 BVDB Maximum drain-to-body voltage V ‡ 20 39 BVSB Maximum source-to-body voltage V ‡ 20 40 BVSD Maximum source-to-drain voltage V ‡ 20 41 AI Factor for impact ionization current 1/V of drain-bulk diode 0.0 - 42 BI Impact ionization voltage for onset V of impact ionization 0.0 - 43 WD Lateral bulk diffusion along width m 0 0.1µ 44 XL Mask/etch effect on L m 0 0.1µ 45 XW Mask/etch effect on W m 0 0.1µ -3 cm *If you specify both names for this parameter, the name that ends with “O” overrides. †When more than one parameter name appears on a line, you can use either name. ‡The default for this parameter is that it is not calculated. **The default of AF is 0 when MFNOIS equals 2. December 1998 307 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models MOSFET Model Operating Point Parameters (Level 1) Parameter name Parameter description Unit 1 ID Diode current A 2 VGS Gate-source voltage V 3 VDS Drain-source voltage V 4 VBS Body-source voltage V 5 VTH Threshold voltage V 6 VDSAT Drain-source saturation voltage V 7 GM Transconductance (dIds/dVgs) mho 8 GDS Transconductance (dIds/dVds) mho 9 GMBS Transconductance (dIds/dVbs) mho 10 CBD Body-drain capacitance F 11 CBS Body-source capacitance F 12 CGS Gate-source capacitance F 13 CGD Gate-drain capacitance F 14 CGB Gate-body capacitance F 15 PWR Power W 16 RON Large signal resistance ohm 17 LIN Linear region flag s 18 BKDWN Breakdown flag s Model Description DC Model Equations ■ Specified electrical parameters always override electrical parameters calculated using process parameters. If neither electrical nor process parameters are specified, the electrical default parameter value is used. (That is, specified VTO overrides VTO calculated using NSUB. If neither VTO nor NSUB is specified, the default value of VTO is used.) December 1998 308 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ LDS and LDD: default source and drain diffusion lengths when LS and LD properties are not input. ■ VTO: zero-bias threshold voltage VTO is positive (negative) for enhancement mode and negative (positive) for depletion mode N-channel (P-channel) devices. Defines onset of strong inversion. If NSUB, but not VTO, is specified (see first bullet): VTO = V FB + φ s + γ φ s NSS V FB = φ ms – q ⋅ ----------C (flatband voltage) OX ■ Metal-semiconductor work function: If NGATE is given, then kT NSUB kT NGATE φ ms = – TPS ⋅ ------ ⋅ In --------------------- – ------ ⋅ In --------------- n n q q i i otherwise φ ms = 3.2 – ( 3.25 + 1/2E G + 1/2φ s ) ■ KP: intrinsic transconductance Parameter specification overrides the calculation below as well as a specified UO (see first bullet). If UO and TOX are specified, KP (if not specified) is calculated as follows, otherwise the default is used: KP = UO ⋅ C OX ε OX C OX = -----------TOX ■ PHI (φ): surface potential at strong inversion December 1998 309 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models If parameter PHI is not specified and NSUB is given: kT NSUB PHI = φ s = 2 ⋅ ------ ⋅ In --------------- n q i ■ GAMMA (γ): bulk threshold parameter Coefficient of term accounting for changes in the threshold voltage due to substrate bias. If NSUB, but not γ, is specified, γ is calculated from: 1 γ = ------------ ⋅ 2 ⋅ ε si ⋅ q ⋅ NSUB C OX V TH = VT O + γ ⋅ ( φ – V BS – φ ) ■ Drain and source resistance RD/RS: divided by W (gate width property) to obtain resistance. Note: This is different from SPICE2G, where RD and RS represent the total resistance. ■ Bulk junction saturation currents JS: current per unit area, total specific to each junction Total is obtained by multiplying JS by AS or AD (source and drain area properties, respectively). ■ MOSFET junction equations For Vd < 0 (Reverse leakage) IS I = -----*Vd Vt December 1998 310 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models For Vd >=0 (Forward conduction) I = IS* ( EXP ( Vd ⁄ Vt ) – 1 ) ■ Cadence SPICE uses XL and XW to calculate effective channel length and width . L eff = L ( drawn ) + XL – ( 2 ⋅ LD ) W eff = W ( drawn ) + XW – ( 2 ⋅ WD ) where L = drawn gate length (device property) W = drawn gate width (device property) ■ Junction capacitances Bottom drain/source junction capacitances: CBD/CBS (total capacitances) or CJ (capacitance per junction area) When both CBD/CBS and CJ are specified, CBD/CBS overrides. Junction sidewall capacitance per unit length: CJSW Total junction capacitances If you specify CBS (equivalent expressions for CBD): Reverse bias (V BS ≤ FC ⋅ PB): CBS CBS total = ---------------------------------------( 1 – V BS ⁄ PB ) Forward bias (VBS > FC ⋅ PB): V BS 1 – 1.5 ⋅ FC + ---------- ⋅ PB 2 CBS total = CBS ⋅ ---------------------------------------------------------------( 1 – FC ) 1.5 If you specify CJ, it includes specification of both bottom and sidewall capacitance components, and allows you to specify power by which capacitance varies with junction voltage. (Refer to the “Model Description” section for levels 5 and 6.) ■ Overlap capacitances: December 1998 311 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models CGS = CGS⋅W (gate-source) CGD = CGD⋅W (gate-drain) CGB = CGB⋅Leff (gate-bulk) Noise Model Equations ■ Flicker noise (current generator connected between drain and source) If MFNOIS=0 (default model): In = AF 8 ⋅ kT ⋅ G m KF ⋅ I DS --------------------------- + ---------------------------------------------------EF 3 ⋅ C OX ⋅ W ⋅ L eff f where IDS = drain current Gm = small-signal transconductance f = frequency If MFNOIS=1: In = In = AF 8 ⋅ kT ⋅ [ G m + G mb + G ds ] 3 KF ⋅ I DS V DS ----------------------------------------------------------------- ⋅ --- – -------------------------- + -----------------------------------------2 3 2 2 ⋅ V DSAT f EF ⋅ C OX ⋅ L eff AF 8 ⋅ kT ⋅ [ G m + G mb + G ds ] KF ⋅ I DS ----------------------------------------------------------------- + -----------------------------------------2 3 f EF ⋅ C OX ⋅ L eff if VDS<VDSAT if VDS>=VDSAT If MFNOIS=2 [9] and VDS < VDSAT, the equation becomes In = 8 ⋅ kT ⋅ [ G m + G mb + G ds ] 3 V DS q Gm 2 q 2 ----------------------------------------------------------------- ⋅ --- – -------------------------- + --------------------------------- ⋅ KF --------- + AF --------- – ( V gs – V th ) C ef C 3 2 2 ⋅ V DSAT L eff ⋅ W ⋅ f ox ox For MFNOIS=2 [9] and VDS >= VDSAT December 1998 312 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models In = 8 ⋅ kT ⋅ [ G m + G mb + G ds ] q 2 q Gm 2 ----------------------------------------------------------------- + --------------------------------- ⋅ KF --------- + AF --------- – ( V gs – V th ) C C 3 L eff ⋅ W ⋅ f ef ox ox Impact Ionization ■ Appears when device channel length shortens. ■ Drain-to-bulk impact ionization current is added to drain diode current. ■ Current function of voltage difference (vdiff) between VDS and VDSAT (saturation voltage): v diff = V DS – V DSAT BI I DB = I DS ⋅ AI ⋅ v diff ⋅ exp - ----------- v diff whereIDS= DC current between drain and source I = DC diode current between drain and bulk DB Note: If AI is less than or equal to zero, impact ionization is not modeled. Drain Current ■ Cutoff region: V -V ≤ 0 GS TH I =0 D ■ Linear region: 0<V <V DS GS −V TH V DS I D = b p ⋅ V DS ⋅ V GS – V TH – ----------- 2 where β p = β ⋅ ( 1 + λ ⋅ V DS ) W β = KP ⋅ ----L December 1998 313 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Saturation region: 0<V GS −V TH <V DS βp I D = ------ ⋅ ( V GS – V TH ) 2 2 Temperature Equations Cadence SPICE can model temperature using SPICE2G-compatible built-in equations. To use these equations, set SPTEMP to 1 (refer to the “Built-in Variables and Arrays” chapter). Note: You can use your own equations to model temperature. The etc/analog/examples/ temperature directory in version 2.x includes command and model files describing temperature dependencies for diode, BJT, MOS, and JFET devices. You can customize these files to create your own device temperature models. Refer to the “Temperature Files” section of the “Command and Model Files” chapter for information on these files. Set SPTEMP=0 (the default value) for this option. The default TNOM for Cadence SPICE is 25, not 27 degrees. To use 27 degrees, set TNOM to 27. Breakdown Equations ■ Breakdown modeled only if BVDS, BVDB, and BVSB do not equal 0. ■ Breakdown occurs when any of the following conditions hold: NMOS V DS ≥ BVDS V DB ≥ BVDB V SB ≥ BVSB PMOS – V DS ≥ BVDS – V DB ≥ BVDB – V SB ≥ BVSB December 1998 314 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Metal-Oxide-Semiconductor Field-Effect Transistor Model (Levels 2 (MOS2) and 3 (MOS3)) The Cadence SPICE MOSFET Level 2 and 3 model (model types: nmos, pmos) includes Level 2(MOS2 Grove-Frohman) and Level 3 (MOS3 semi-empirical) models from SPICE2G.6 and features ■ Backgate bias and short/narrow channel effects on threshold voltage, including static feedback from drain to gate ■ Saturation due to scattering limited drift velocity of carriers and finite voltage-dependent output conductance ■ Surface field-dependent mobility ■ Subthreshold conduction ■ Charge controlled model of regenerative effects ■ Optional charge conservation model (Level 3) similar to BSIM model ■ Optional impact ionization modeling December 1998 315 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models MOSFET Model Parameters (Levels 2 and 3) Parameter name Parameter description Unit Default Typical value 1 LEVEL‡ Model index - 2 - 2 VTO Zero-bias threshold voltage V 0.0 1.0 3 KP Transconductance parameter 4 GAMMA Bulk threshold parameter 5 PHI Surface potential 6 LAMBDA Channel-length modulation (Level 2 only) 7 RD 8 UO*C 3.1e-5 0.0 0.37 V 0.6 0.65 1/V 0.0 0.2 Drain ohmic resistance per unit width ohm⋅m W 0.0 0.001 RS Source ohmic resistance per unit width W ohm⋅m 0.0 0.001 9 BD Zero-bias B-D junction capacitance F 0.0 20f 10 CBS Zero-bias B-S junction capacitance F 0.0 20f 11 IS Bulk junction saturation current A 1.0e-14 1.0e-15 12 CGSO (CGS)† Gate-source overlap capacitance per F/m m channel width 0.0 4.0e-9 13 CGDO (CGD)† Gate-drain overlap capacitance per m channel width F/m 0.0 4.0e-9 14 CGBO (CGB)† Gate-bulk overlap capacitance per m F/m channel length 0.0 2.0e-8 15 RSH Drain and source diffusion sheet resistance ohm/sq 0.0 10.0 16 PB Bottom bulk junction potential V 0.8 0.87 17 PBSW (PHP)‡ Sidewall bulk junction potential V 0.8 0.87 18 CJ Zero-bias bulk junction bottom capacitance per m2 of junction area F/m 0.0 2.0e-4 December 1998 2 A/V 1/2 V 316 2 OX Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 19 CJSW Zero-bias bulk junction sidewall capacitance per m of junction perimeter F/m 0.0 1.0e-9 20 MJ Bulk junction bottom grading coefficient - 0.5 0.5 21 MJSW Bulk junction sidewall grading coefficient - 0.33 0.3 22 JS Bulk junction saturation current per 0.0 1.0e-8 1.0e-7 1.0e-7 3 0.0 4.0e15 2 0.0 1.0e10 2 0.0 1.0e10 - 1.0 - m 0.0 0.8µ 600 700 2 2 A/m m of junction area 23 TOX Oxide thickness 24 NSUB Substrate doping 25 NSS Surface state density 26 NFS Fast surface state density 27 TPS (TPG)‡ Type of gate material: +1 opposite to substrate -1 same as substrate 0 Aluminum gate 28 LD (DLAT, Lateral diffusion LATD)‡ 29 UO Surface mobility 30 UCRIT Critical field for mobility degradation (Level 2 only) V/cm 1.0e4 1.0e4 31 UEXP Critical field exponent in mobility degradation (Level 2 only) - 0.0 0.1 32 UTRA Transverse field coefficient (mobility) (not implemented in this version) 0.0 0.3 33 VMAX Maximum drift velocity of carriers m/s 0.0 5.0e4 34 NEFF Total channel charge (fixed and mobile coefficient) (Level 2 only) - 1.0 5.0 December 1998 m 1/cm 1/cm 1/cm 2 cm /V-s 317 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 35 KF Flicker noise coefficient - 0.0 1.0e-26 36 AF Flicker noise exponent - 1.0 1.2 37 EF Flicker noise frequency exponent - 1.0 1.0 38 FC Coefficient for forward-bias depletion capacitance formula for junction bottom 0.5 0.5 39 FCSW Coefficient for forward-bias depletion capacitance formula for junction sidewall 0.0 0.5 40 DELTA Width effect on threshold voltage - 0.0 1.0 41 THETA Mobility modulation (Level 3 only) 1/V 0.0 0.1 42 ETA Static feedback (Level 3 only) - 0.0 1.0 43 KAPPA Saturation field factor (Level 3 only) - 0.2 0.5 44 LDS Source diffusion length m 0.0 1.0µ 45 LDD Drain diffusion length m 0.0 1.0µ 46 CAPMOD Type of capacitance (Level 3 only) 0 - Meyer 1 - charge conserving - 0.0 0.0 47 XJ Metallurgical junction depth m 0.0 1.0e-6 48 NGATE Gate doping concentration (used only if VTO not specified) cm 0.0 - 49 BVDS Maximum drain-to-source voltage V § 20 50 BVDB Maximum drain-to-body voltage V § 20 51 BVSB Maximum source-to-body voltage V § 20 52 BVSD Maximum source-to-drain voltage V § 20 53 AI Factor for impact ionization current of 1/V drain-bulk diode 0.0 - 54 BI Impact ionization voltage for onset of 0.0 iV mpact ionization - 55 THETAX Mobility modulation (Level 3 only) 0.0 December 1998 318 -3 cm/V 5.0e2 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 56 WD Lateral bulk diffusion along width m 0 0.1µ 57 XL Mask/etch effect on L m 0 0.1µ 58 XW Mask/etch effect on W m 0 0.1µ 59 FBODY Substrate bias effect coefficient (Level 3 only) - 4.0 - Note: For MKS=1, the default, to invoke the Level 3 model, set LEVEL to 3 or 5. To invoke the Level 2 model, set LEVEL to 2 or 6. † If you specify both names for this parameter, the name that ends with “O” overrides. ‡When more than one parameter name appears on a line, you can use either name. §The default for this parameter is that it is not calculated. December 1998 319 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models MOSFET Model Operating Point Parameters (Levels 2 and 3) Parameter name Parameter description Unit 1 ID Drain current A 2 VGS Gate-source voltage V 3 VDS Drain-source voltage V 4 VBS Body-source voltage V 5 VTH Threshold voltage V 6 VDSAT Drain-source saturation voltage V 7 GM Transconductance (dIds/dVgs) mho 8 GDS Transconductance (dIds/dVds) mho 9 GMBS Transconductance (dIds/dVbs) mho 10 CBD Body-drain capacitance F 11 CBS Body-source capacitance F 12 CGS Gate-source capacitance F 13 CGD Gate-drain capacitance F 14 CGB Gate-body capacitance F 15 PWR Power W 16 RON Large signal resistance ohm 17 LIN Linear region flag s 18 BKDWN Breakdown flag s MOSFET Model Operating Point Parameters (Charge Conserving Capacitance Option - Level 3 Only) Parameter name 19 QG December 1998 Parameter description Unit Total gate charge C 320 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit 20 QB Total bulk charge C 21 QD Total drain charge C 22 QS Total source charge C 23 CGGB Total capacitance reflected on the gate F 24 CBGB Bulk-gate capacitance F 25 CDGB Drain-gate capacitance F 26 CSGB Source-gate capacitance F 27 CGBB Gate-bulk capacitance F 28 CBBB Total capacitance reflected on the bulk F 29 CDBB Drain-bulk capacitance F 30 CSBB Source-bulk capacitance F 31 CGDB Gate-drain capacitance F 32 CBDB Bulk-drain capacitance F 33 CDDB Total capacitance reflected on the drain F 34 CSDB Source- drain capacitance F 35 CGSB Gate-source capacitance F 36 CBSB Bulk-source capacitance F 37 CDSB Drain-source capacitance F 38 CSSB Total capacitance reflected on the source F Model Description Parameters and Models Common to Levels 2 and 3 Note: For MKS=1, set LEVEL to 2 or 6 to invoke Level 2. Set LEVEL to 3 or 5 to invoke Level 3. December 1998 321 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models DC Model Equations Specified electrical parameters always override electrical parameters calculated using process parameters. If neither electrical nor process parameters are specified, the electrical default parameter value is used. (That is, specified VTO overrides VTO calculated using NSUB. If neither VTO nor NSUB is specified, the default value of VTO is used.) ■ LDS and LDD: default source and drain diffusion lengths when LS and LD properties are not input. ■ VTO: threshold voltage VTO is positive (negative) for enhancement mode and negative (positive) for depletion mode N-channel (P-channel) devices. Defines onset of strong inversion. If NSUB, but not VTO, is specified (see first bullet): VTO = V FB + φ s + γ ⋅ φ s q ⋅ NSS V FB = φ ms – ----------------C (flatband voltage) OX ■ Metal-semiconductor work function If NGATE is given, then: kT NGATE kT NSUB φ ms = – TPS ⋅ ------ ⋅ In ------------------- – ------ ⋅ In --------------- q q n n i i otherwise φ ms = 3.2 – ( 3.25 + 1/2EG + 1/2φ s ) ■ KP: intrinsic transconductance Parameter specification overrides calculation below as well as specified UO (see first bullet). December 1998 322 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models If UO and TOX are specified, KP (if not specified) is calculated as follows, otherwise the default is used: KP = UO ⋅ C OX ε OX C OX = -----------TOX ■ PHI (φ): surface potential at strong inversion If parameter PHI not specified, and NSUB is given: kT NSUB PHI = φ s = 2 ⋅ ------ ⋅ In --------------- n q i ■ GAMMA (γ): bulk threshold parameter Coefficient of term accounting for changes in the threshold voltage due to substrate bias. If NSUB, but not γ, is specified, γ is calculated from: 1 ϒ = ------------ ⋅ 2 ⋅ ε si ⋅ q ⋅ NSUB C OX V TH = V BI + ϒ ⋅ φ – V BS + ( φ – V BS ) V BI = VTO – ϒ ⋅ φ Refer to the following sections on Levels 2 and 3 for second-order effects on VTH. ■ Drain and source resistance RD/RS: divided by W (gate width property) to obtain resistance. Note: This is different from SPICE2G, where RD and RS represent the total resistance December 1998 323 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models and do not vary with W. RSH: sheet resistance multiplied by the number of squares NRD and NRS (device property input). NRS and NRD cannot equal zero. If RSH > 0 and NRD > 0 and NRS > 0: actual R = RSH⋅NRD (or RSH⋅NRS) otherwise: actual R = RD/W ■ (or RS/W) Bulk junction saturation currents IS: total current, same for all junctions. JS: current per unit area, total specific to each junction. Total obtained by multiplying JS by AS or AD (source and drain area properties, respectively). If both IS and JS are specified, JS overrides. If neither IS nor JS are specified, the default IS value is used. ■ MOSFET junction equations For Vd < 0 (Reverse leakage) IS I = -----*Vd Vt For Vd >=0 (Forward conduction) I = IS* ( EXP ( Vd ⁄ Vt ) – 1 ) ■ Cadence SPICE uses XL and XW to calculate effective channel length and width. L eff = L ( drawn ) + XL – ( 2 ⋅ LD ) W eff = W ( drawn ) + XW – ( 2 ⋅ WD ) where L = drawn gate length (device property) W = drawn gate width (device property) December 1998 324 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models MOSFET Equivalent Circuits D n-channel RD CGD G CGS CBD I DS B CGB CBS RS S D p-channel RD CGD G CGS CBD I DS CGB B CBS RS S Extrinsic AC Model Equations ■ Junction capacitances: Bottom drain/source junction capacitances: CBD/CBS (total capacitances) or CJ (capacitance per junction area). When both CBD/CBS and CJ are specified, CBD/CBS overrides. Junction sidewall capacitance per unit length: CJSW. Total junction capacitances: December 1998 325 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Reverse bias (VBS ≤ FC PB): CJ ⋅ AS CJSW ⋅ PS CBS total = --------------------------------- + -------------------------------------------V BS MJ V BS MJSW 1 – ----------- 1 – -------------- PB PBSW Forward bias (VBS > FC PB): MJ 1 – ( 1 + MJ ) ⋅ FC + V BS ⋅ ------PB CBS total = CJ ⋅ AS ⋅ ----------------------------------------------------------------------------( 1 – FC ) ( 1 + MJ ) MJSW 1 – ( 1 + MSJW ) ⋅ FCSW + V BS ⋅ --------------PBSW + CJSW ⋅ PS ⋅ ----------------------------------------------------------------------------------------------------( 1 – FCSW ) ( 1 + MJSW ) where AS = source diffusion area (device property) PS = source diffusion periphery (device property) (or CBS, CBD instead of CJ⋅AS) , replace V with V , AS with AD, and CBS For the equivalent expressions for CBD total BS BD with CBD. (Reference [1] contains additional charge relations.) ■ Overlap capacitances (left side of equations are operating points): CGS = CGS(channel component) + CGSO⋅W(gate-source) CGD = CGD(channel component) + CGDO⋅W(gate-drain) CGB = CGB(channel component) + CGBO⋅Leff(gate-bulk) The channel component depends on the bias region. ■ Charge storage Effects associated with thin oxide from Meyer’s voltage dependent capacitance model. December 1998 326 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models The charge conserving capacitance model is available for Level 3 only (CAPMOD=1). Refer to the “Parameters and Models Unique to Level 3 (MOS3)” section later in this chapter. Noise Model Equations ■ Flicker noise (current generator connected between drain and source) If MFNOIS=0 (default model): In = AF KF ⋅ I DS 8 ⋅ kT ⋅ ( G m + G mb ) ------------------------------------------------- + ---------------------------------------------------- 3 f EF ⋅ C OX ⋅ W ⋅ L eff whereID S= drain current Gm = small-signal transconductance f = frequency If MFNOIS=1: In = AF 8 ⋅ kT ⋅ G m KF ⋅ I DS --------------------------- + -----------------------------------------EF 2 3 ⋅ C OX ⋅ L eff f If MFNOIS=2 [9], the equation becomes: In = AF 8 ⋅ kT ⋅ [ G m + G mb + G ds ] 3 V DS KF ⋅ I DS ----------------------------------------------------------------- ⋅ --- – -------------------------- + -----------------------------------------2 3 2 2 ⋅ V DSAT f EF ⋅ C OX ⋅ L eff In = AF 8 ⋅ kT ⋅ [ G m + G mb + G ds ] KF ⋅ I DS ----------------------------------------------------------------- + -----------------------------------------EF 2 3 f ⋅ C OX ⋅ L eff if VDS<VDSAT if VDS>=VDSAT Impact Ionization Equations ■ Appears when device channel length shortens. ■ Drain to bulk impact ionization current added to drain diode current. December 1998 327 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Current function of voltage difference (vdiff) between VDS and VDSAT (saturation voltage) : v diff = V DS – V DSAT BI I DB = I DS ⋅ AI ⋅ v diff ⋅ exp – ----------- v diff whereIDS=DC current between drain and source IDB= DC diode current between drain and bulk Note: If AI is less than or equal to zero, impact ionization is not modeled. Parameters and Models Unique to Level 2 (MOS2) ■ For MKS=1, set LEVEL to 2 or 6 to invoke Level 2. ■ Parameters used in Level 2 only: LAMBDA, UCRIT, UEXP, and NEFF. ■ Mobility variation: Setting UEXP to zero (default) turns off mobility variation. If UCRIT ⋅ ε si ( V GS – V TH ) > ---------------------------C OX UO ⋅ ( UCRIT ⋅ ε si ) UEXP µ s = -------------------------------------------------------------------[ C OX ⋅ ( V GS – V TH ) ] UEXP Otherwise µs =UO ■ Threshold voltage adjustment for short/narrow channel: V TH = V BIN + γ s ⋅ φ s – V BS Corrected built-in voltage for narrow channel: December 1998 328 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models DELTA ⋅ ( φ s -V BS ) ⋅ π ⋅ ε si V BIN = V BI + ----------------------------------------------------------------⋅W 4⋅C OX V BI = V FB + φ s Corrected γ for short channel with static drain-to-gate feedback: γ s = GAMMA ⋅ ( 1 – α S – α D ) Correction factors for depletion charge at drain and source: WS XJ α S = ------------- ⋅ 1 + 2 ⋅ -------- – 1 XJ 2L eff WD XJ α D = ------------- ⋅ 1 + 2 ⋅ --------- – 1 2L eff XJ Depletion widths: W S = X D ⋅ φ S – V BS W D = X D ⋅ φ S – V BS + V DS XD = ε si 2 ⋅ ---------------------q ⋅ NSUB ■ Calculation of VDSAT: ■ VMAX: maximum drift velocity of carriers I DSAT VMAX = -----------------------------W ⋅ Q CHAN DELTA ⋅ π ⋅ ε si η = 1 + --------------------------------------4 ⋅ C OX ⋅ W December 1998 329 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models If VMAX is not input, pinch-off formulation is used: γs 2 V GS – V BIN η 2 V GS – V BIN V DSAT = ------------------------------- + 0.5 ⋅ ----- ⋅ 1- 1 + 4 ⋅ ----- ⋅ ------------------------------- + φ s – V BS γ s η η η If VMAX is input, scattering-limited carrier velocity determines VDSAT, calculated through iteration of the following equation: η ⋅ V DSAT V – V BIN – -------------------------- ⋅ V DSAT GS 2 VMAX = µ s ⋅ ---------------------------------------------------------------------------------------------------------------------------------------------------------- L eff ⋅ [ V GS – V BIN – η ⋅ V DSAT – γ s ⋅ ( V DSAT + φ s – V BS ) ] 2 ⋅ γs ------------ ⋅ [ ( V DSAT + φ s – V BS ) 3 ⁄ 2 – ( φ s – V BS ) 3 ⁄ 2 ] 3 – ----------------------------------------------------------------------------------------------------------------------------------------------------------- L eff ⋅ [ V GS – V BIN – η ⋅ V DSAT – γ s ⋅ ( V DSAT + φ s – V BS ) ] ■ Weak inversion (subthreshold) region: C FS CD n = 1 + ------------ + -----------C OX C OX n ⋅ kT V ON = V TH + -------------q CFS and CD are defined as follows: C FS = q ⋅ NFS (NFS is necessary to invoke weak inversion modeling and is a curve fitting parameter.) φs F ( V BS ) = -----------------------------------------1 + ( V BS ) ⁄ ( 2φ s ) dF ( V BS ) d γ s π ⋅ ε si ⋅ DELTA C D = C OX ⋅ – γ s ⋅ ----------------------- – -------------- ⋅ F ( V BS ) + --------------------------------------dV dV ⋅W 4⋅C BS December 1998 BS OX 330 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models VON > VTH Marks Transition from Weak to Strong Inversion ■ Channel-length modulation LAMBDA (λ): Channel length modulation parameter If λ is not specified, it is calculated from : 2 ⋅ ε si ( V DS – V DSAT ) 2 ( V DS – V DSAT ) 1 λ = -------------------------- ⋅ ------------------------ ⋅ --------------------------------------- + 1 + --------------------------------------L eff ⋅ V DS q ⋅ NSUB 4 4 If (λ>0) LMOD=1-λ⋅VDS If (λ≤ 0 and NSUB > 0 and VMAX = 0) XD V DS – V DSAT 2 V DS – V DSAT L MOD = 1- ---------- ⋅ ---------------------------------- + 1 + ---------------------------------- L eff 4 4 December 1998 331 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models If (λ≤ 0 and NSUB > 0 and VMAX > 0): XD L MOD = 1- ----------------------------------- ⋅ NEFF ⋅ L eff ■ VMAX ⋅ X D VMAX ⋅ X D 2 -------------------------------------- + V DS -V DSAT – -------------------------------------2 ⋅ NEFF ⋅ µ s 2 ⋅ NEFF ⋅ µ s Effective beta: W β = µ s ⋅ C OX ⋅ ------------------------L – DL eff DL = L eff ⋅ λ ⋅ V DS W B = X D ⋅ PB If DL ≥ Leff – W B , then the system prints a punchthrough warning message and uses the following equation for β: µ ⋅ C OX ⋅ W L eff 2 2 ⋅ W B DL β = ----------------------------- ⋅ ---------- ⋅ ---------------- + ---------- – 1 L eff L eff L eff WB 1 β eff = ---------------- ⋅ β L MOD Drain Current, MOS2 Model (Level 2) γs I DS = β eff ⋅ [ V GS – V BIN – 0.5 ⋅ η ⋅ V DS ] ⋅ V DS – 2 ⋅ ----- ⋅ [ ( φ s – V BS + V DS ) 3 ⁄ 2 – ( φ – V BS ) 3 ⁄ 2 ] 3 ■ In the equation above : If V DS < V DSAT V DS = V D – V S If V DS ≥ V DSAT V DS = V DSAT December 1998 332 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ If V GS < V ON : 2 ⋅ γs q ⋅ ( V GS -V ON ) η ⋅ V DS I DS = β eff ⋅ V ON -V BIN – ------------------- ⋅ V DS - ------------ ⋅ [ ( φ s -V BS +V DS ) 3 / 2 – ( φ s -V BS ) 3 / 2 ] ⋅ exp ------------------------------------- 3 n ⋅ kT 2 Parameters and Models Unique to Level 3 (MOS3) ■ For MKS=1, set LEVEL to 3 or 5 to invoke Level 3. ■ Parameters used in Level 3 only: ETA, THETA, THETAX, KAPPA, and CAPMOD. ■ Threshold voltage adjustment for short/narrow channel is: V TH = V FB + φ s – σ ⋅ V DS + γ ⋅ F S ⋅ φ s – V BS + F N ⋅ ( φ s – V BS ) where coefficient of static feedback is: ETA ⋅ Ω σ = ---------------------C OX ⋅ L 3 December 1998 [Ω = empirical constant = 8.15e-22 (F • m)] 333 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Correlation factor of short channel effect, FS, is: W P = X D φ s – V BS WP WP 2 W C = XJ ⋅ C 1 + C 2 ⋅ -------- + C 3 ⋅ -------- XJ XJ (depletion layer width of plane junction) (depletion layer width of cylindrical junction) ( W P / XJ ) 2 XJ LD + W C LD F S = 1 – ------- ⋅ ----------------------- ⋅ 1- ----------------------------------- – -------- XJ L ( 1 + W P / XJ ) 2 XJ C 1 = 0.0631353 C 2 = 0.8013292 C 3 = 0.01110777 Correlation factor of narrow channel effect, FN, is: π ⋅ ε SI F N = DELTA ⋅ ----------------------------2 ⋅ C OX ⋅ W ■ Mobility Empirical relation for gate voltage modulation: UO µ s = -------------------------------------------------------------1 + THETA ⋅ ( V GS -V TH ) THETAX THETA = THETA + ---------------------L Velocity saturation of hot electrons: µs µ eff = -----------------------------------------µ s ⋅ V DS 1 + -------------------------------L eff ⋅ VMAX December 1998 334 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models If VMAX is not specified, µeff is set to µs, and the effect is not modeled. ■ Saturation voltage If VMAX is specified: Taylor series expansion coefficient of bulk charge: γ ⋅ FS F B = ------------------------------ + F N 4 ⋅ φ s -V BS V GS – V TH L eff ⋅ VMAX V GS – V TH 2 L eff ⋅ VMAX 2 V DSAT = ---------------------------- + ------------------------------ – ---------------------------- + ------------------------------ µ eff 1 + FB µ eff 1 + FB (If ETA is not 0, VDSAT depends on VDS.) If VMAX is not specified: V GS – V TH V DSAT = ---------------------------1 + FB ■ Channel length modulation DL (VDS>VDSAT) Lateral field at channel pinch-off point EP: G DSAT = drainconductanceatsaturation I DSAT E P = -------------------------------G DSAT ⋅ L eff DL = 2 ) 2 + KAPPA ⋅ X 2 ⋅ ( V 2 [ ( 0.5 ⋅ E P ⋅ X D D DS – V DSAT ) ] – 0.5 ⋅ E P ⋅ X D December 1998 335 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Effective beta: µ eff ⋅ W ⋅ C OX β eff = -----------------------------------L – DL L eff IF DL > ---------2 µ eff ⋅ W ⋅ C OX 4 ⋅ DL β eff = ------------------------------------ ⋅ --------------- L L eff eff ■ Optional charge conserving capacitance model: May greatly improve simulation of charge sensitive circuits; run time may be 10-20% longer than Meyer model. Similar to BSIM model (refer to “Berkeley Short-Channel IGFET Model (BSIM)” section and Reference [2]). Invoked by setting CAPMOD to 1 (default of 0 yields Meyer model). ■ Drain current equation: 1 I DS = β eff ⋅ V GS – V TH – --- ⋅ ( 1 + F B ) ⋅ V DS ⋅ V DS 2 Drain Current ■ Weak inversion: Same model and parameters as Level 2 (see previous section). Temperature Equations Cadence SPICE can model temperature using SPICE2G-compatible built-in equations. To use these equations, set SPTEMP to 1 (refer to the “Built-in Variables and Arrays” chapter). Note: You can use your own equations to model temperature. The etc/analog/examples/ temperature directory in version 2.x includes command and model files describing temperature dependencies for diode, BJT, MOS, and JFET devices. You can customize these files to create your own device temperature models. Refer to the “Temperature Files” section of the “Command and Model Files” chapter for information on these files. Set SPTEMP=0 (the default value) for this option. December 1998 336 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models The default TNOM for Cadence SPICE is 25, not 27 degrees. To use 27 degrees, set TNOM to 27. Breakdown Equations ■ Breakdown modeled only if BVDS, BVDB, and BVSB do not equal 0. ■ Breakdown occurs when any of the following conditions hold: NMOS V DS ≥ BVDS V DB ≥ BVDB V SB ≥ BVSB PMOS – V DS ≥ BVDS – V DB ≥ BVDB – V SB ≥ BVSB Modified Level 3 (Berkeley MOS3) MOSFET Model The changes made to the original Level 3 (MOS3) model are driven by analog design requirements. Many of the changes are based on the work by J. A. Power and W. A. Lane from ‘Enhanced SPICE MOSFET Model for Analog Applications Including Parameter Extraction Schemes’, as published in Proc. IEEE 1990 Int. Conference on Microelectronic Test Structures, Vol 3, March 1990. The main improvements, listed below, include continuous output conductance through all regions of operation and improved geometry dependence from a single model file: ■ The channel-length modulation equation is changed to a simpler physical relation. ■ A smoothing function combines saturation, linear and subthreshold regions into a single equation. ■ A modified subthreshold equation is used. ■ The channel-length dependence of ETA is changed. December 1998 337 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ A length- and width-dependence effect is incorporated for body-bias effects on threshold voltage. ■ Gate-bias effects are introduced into the drain-induced, barrier-lowering parameter. ■ Body-bias dependence is added to the mobility model. This feature, presented in Power and Lane, is generally useful for P-channel devices. This model is separate from the Level 3 model, and a new model parameter is introduced to enable the modified version. This parameter, MOS, has a default value of ‘0’. It must be set to ‘1’ to use the modified version. In addition, the LEVEL parameter must be set to ‘3’, CAPMOD set to ‘1’, and MKS set to ‘1’. The following parameters are used as well as the normal Level 3 MOSFET parameters: Additional Model Parameters To Enable Level3+ / MOS3+ Equations Parameter name Parameter description Unit Default Typical value 1 MOS Modified MOS3+ (Level-3) selector - 0 2 ETAV Gate-voltage sensitivity of ETA V 0 0.3 3 VTL Channel-length sensitivity on Vth caused by the body effect V*meter 0 1N 4 VTLE Exponent of length sensitivity on Vth caused by the body effect - 2 2 5 VTW Channel-width sensitivity on Vth caused by the body effect V*meter 0 100N 6 VTWE Exponent of width sensitivity on Vth caused by the body effect - 1 1 7 G2 A gamma2 parameter for width sensitivity in the subthreshold region meter 0 1U 8 AX A linear to saturation region smooth functioning parameter - 10 10 9 GAMMAU Body-bias effect on mobility - 0 0.1 December 1998 338 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Equation Modifications (Level-3+ / MOS3+) The following enhancements are based on the results of fitting the model to actual device data for a range of geometries. Static Feedback Effect 8.15E-15*ETA ( mp ) * GATE ETA = --------------------------------------------------------------------Leff Negative Body-Bias Effect on Vth VTH = VTH + Vth ( L ) + Vth ( W ) 1 GATE = Vgs effect ETA = Max ( tanh ( VGS – ETAV ( mp ) ), 0 ) ❑ 1 for ETAV(mp) = 0 ❑ Max (tanh (VGS - ETAV(mp)),0) for ETAV(mp) ≠ 0 VTLE VTL ( mp ) Vth ( L ) = ----------------------- ⋅ ( – VBS ) Leff VTWE VTW ( mp ) Vth ( W ) = -------------------------- ⋅ ( – VBS ) Weff December 1998 339 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Continuous Drain Current Equation Weff ( 1 + Fb ) ID = K′eff * ------------------------- * VGSX – VTH – --------------------- * VDS * VDSX Leff – DL 2 Original MOS3: VGSX = MAX( VGS, VTH ) VDSX = MIN( VDS, VDSAT) VGS – VTH VGSX = VA * ln 1 + exp ------------------------------ + VTH VA kT q * NFS ( GAMMA * PHI – VBS + G2 ⁄ Weff ) VA = ------ * 1 + ----------------- + ----------------------------------------------------------------------------------------------q COX 2 * ( PHI – VBS ) 1 VDS VDSX = VDSAT * 1 – -------- * ln 1 – exp AX * 1 – ------------------- AY VDSAT AY = ln [ 1 + exp ( AX ) ] DL = 2 * Esi * KAPPA * ( VDS – VDSX ) -------------------------------------------------------------------------------q * NSUB Body-bias Dependent Mobility Model UO US = -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------1 + THETAT * ( VGSX – VTH ) + 2 * GAMMA * GAMMAU * ( PHI – VBS – PHI ) December 1998 340 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models THETAX THETAT = THETA + -----------------------L Berkeley Short-Channel IGFET Model (BSIM) The Cadence SPICE Berkeley short-channel IGFET model (model types: nbsim, pbsim) offers ■ Charge-oriented model employing semi-empirical approach ■ Terms with strong physical meaning to model fundamental physical effects and specific parameters to characterize subtle device characteristics ■ Semi-empirical model including ■ ❑ Strong inversion and subthreshold drain currents ❑ Substrate current ❑ Capacitance and charge model ❑ Degradation and lifetime model ❑ Drain-induced barrier lowering The best approach for circuit analysis, especially when two- and three- dimensional effects become important December 1998 341 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models BSIM Model Parameters Parameter name Parameter description Unit Default 1 VFB† Flatband voltage V -1.0 2 PHI† Surface inversion potential V 0.7 3 K1† Body effect coefficient V1/2 1.0 4 K2† Drain/source depletion charge sharing coefficient - 0.02 5 ETA† Zero-bias drain-induced barrier lowering coefficient - 5.0e-3 6 MUZ Zero-bias mobility cm2/V⋅s 500 7 DL Change in channel length micron 0.0 8 DW Change in channel width micron 0.0 9 U0† Zero-bias transverse-field mobility degradation coefficient 1/V 4.0e-2 10 U1† Zero-bias velocity saturation coefficient micron/V 0.0 11 X2MZ† Sensitivity of the mobility to substrate bias at Vds=0 cm2/V2⋅s 10.0 12 X2E† Sensitivity of drain induced barrier lowering effect 1/V to substrate bias -1.0e-3 13 X3E† Sensitivity of the drain-induced barrier lowering effect to the drain bias at Vds=VDD 0.0 14 X2U0† Sensitivity of transverse-field mobility degradation 1/V2 effect to the substrate bias 15 X2U1† Sensitivity of velocity saturation effect to the substrate bias micron/V2 0.0 16 MUS† Mobility at zero substrate bias and Vds=VDD cm2/V⋅s 500 17 X2MS† Sensitivity of the mobility to substrate bias at Vds=VDD cm2/V2⋅s -15 18 X3MS† Sensitivity of mobility to drain bias at Vds=VDD cm2/V2⋅s 0.0 December 1998 342 1/V 1.0e-3 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default 19 X3U1 †Sensitivity of velocity saturation effect to the drain bias at Vds=VDD micron/V2 0.0 20 TOX Gate-oxide thickness micron 21 TEMP Temperature at which the process parameters are Celsius measured 27 22 VDD Measurement bias range V 5.0 23 CGDO Gate-drain overlap capacitance per meter channel width F/m 0.0 24 CGSO Gate-source overlap capacitance per meter channel width F/m 0.0 25 CGBO Gate-bulk overlap capacitance per meter channel F/m length 0.0 26 XPART Gate-oxide capacitance model flag - 1.0 27 NO†◊ Zero-bias subthreshold slope coefficient - 200.0 28 NB† Sensitivity of subthreshold slope to substrate bias - 0.0 29 ND† Sensitivity of subthreshold slope to the drain bias - 0.0 30 RSH Sheet resistance per square ohm/sq 0.0 31 CJ Zero-bias bulk junction bottom capacitance per unit area F/m2 2.0e-4 32 CJW‡ (CJSW) Zero-bias bulk junction sidewall capacitance per unit length F/m 1.0e-9 33 IJS (JS)‡ Bulk junction saturation current per unit area A/m2 1.0e-8 34 PJ (PB)‡ Bulk junction bottom potential V 0.8 35 Bulk junction sidewall potential PJW (PBSW)‡ V 0.4 36 MJ - 0.5 37 Bulk junction sidewall grading coefficient MJW (MJSW)‡ - 0.33 38 KF - 0 December 1998 Bulk junction bottom grading coefficient Flicker noise coefficient 343 5.0e-2 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default 39 AF Flicker noise exponent - 1.0 40 EF Flicker noise frequency exponent - 1.0 41 BVDS Maximum drain-to-source voltage V § 42 BVDB Maximum drain-to-body voltage V § 43 BVSB Maximum source-to-body voltage V § 44 LEAK Reverse junction leakage GMIN multiplier - 1.0 †These parameters have corresponding length and width sensitivity parameters in which the nominal parameter name is preceded by “L” or “W,” respectively (refer to the “Length/Width Sensitivity Parameters” in the next section of this chapter). ◊NO greater than or equal to 200 skips calculation of subthreshold characteristics. ‡When more than one parameter name appears on a line, you can use either name. §The default for this parameter is that it is not calculated. December 1998 344 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models BSIM Model Operating Point Parameters Parameter name Parameter description Unit 1 ID Drain current A 2 VGS Gate-source voltage V 3 VDS Drain-source voltage V 4 VBS Body-source voltage V 5 VTH Threshold voltage V 6 VDSAT Drain-source saturation voltage V 7 GM Transconductance (dIds/dVgs) mho 8 GDS Transconductance (dIds/dVds) mho 9 GMBS Transconductance (dIds/dVbs) mho 10 CBD Body-drain capacitance F 11 CBS Body-source capacitance F 12 CGSOV Gate-source overlap capacitance F 13 CGDOV Gate-drain overlap capacitance F 14 CGBOV Gate-bulk overlap capacitance F 15 QG Total gate charge C 16 QB Total bulk charge C 17 QD Total drain charge C 18 QS Total source charge C 19 CGGB Total capacitance reflected on the gate F 20 CBGB Bulk-gate capacitance F 21 CDGB Drain-gate capacitance F 22 CSGB Source-gate capacitance F 23 CGBB Gate-bulk capacitance F 24 CBBB Total capacitance reflected on the bulk F 25 CDBB Drain-bulk capacitance F December 1998 345 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit 26 CSBB Source-bulk capacitance F 27 CGDB Gate-drain capacitance F 28 CBDB Bulk-drain capacitance F 29 CDDB Total capacitance reflected on the drain F 30 CSDB Source-drain capacitance F 31 CGSB Gate-source capacitance F 32 CBSB Bulk-source capacitance F 33 CDSB Drain-source capacitance F 34 CSSB Total capacitance reflected on the source F 35 PWR Power W 36 LIN Linear region flag s 36 BKDWN Breakdown flag s Model Description Length/Width Sensitivity Parameters ■ Model employs width and length sensitivities for 19 electrical parameters as follows: Pl Pw P = P o + ---------- + -----------L W eff L eff = L – DL, ■ eff W eff = W – DW Three parameters can be used to describe each of the electrical parameters: Po=offset value of the parameter Pl=length sensitivity of the parameter (Po preceded by L) Pw=width sensitivity of the parameter (Po preceded by W) L=gate length (device property) December 1998 346 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models W=gate width (device property) Example: PHI is described by PHI ( Po) , LPHI ( Pl) , and WPHI ( Pw) . ■ Length/width sensitivity parameters have default values of 0, and for brevity are not listed in the “BSIM Model Parameters” section (but are designated by a “†” following the nominal parameter name in the list). ■ In the following equation, section length/width sensitive parameters are denoted by capitalized italics (such as PHI). DC Model Equations Source and Drain Resistance ■ RSH: sheet resistance multiplied by the number of squares from properties NRD and NRS . V TH = VFB + PHI + K1 ⋅ ( PHI – V BS ) – K2 ⋅ ( PHI – V BS ) – η ⋅ V DS Threshold Voltage ■ VFB, PHI, K1 and K2 are bias independent. ■ Bias dependence of drain-induced barrier lowering effect: η = ETA + X 2E ⋅ V BS + X 3E ⋅ ( V DS – VDD ) December 1998 347 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Linear Region VDS < VDSAT VGS > VTH ■ Drain current : β a 2 I DS = -------------------------------- ⋅ ( V GS – V TH ) ⋅ V DS – --- ⋅ V DS 2 1 + U 1 ⋅ V DS β0 β = ------------------------------------------------------1 + U 0 ⋅ ( V GS – V TH ) W eff β 0 = u 0 ⋅ C OX ⋅ -----------L eff U1 + X2U1 ⋅ V BS + X3U1 ⋅ ( V DS – VDD ) U 1 = ------------------------------------------------------------------------------------------------------------L eff ■ Bulk doping effect : g ⋅ K1 a = 1 + --------------------------------------2 ⋅ PHI – V BS 1 g = 1 – ------------------------------------------------------------------------1.744 + 0.8364 ⋅ ( PHI – V BS ) ■ Carrier mobility obtained from interpolation: u0 = MUZ + X2MZ⋅ VBS (VDS = 0) u0 = MUS + X2MS⋅ VBS (VDS = VDD) X3MS: Sensitivity of u0 to VDS(VDS = VDD) ■ Mobility degradation effects due to vertical electric field: U0 = U0 + X2U0 ⋅VBS December 1998 348 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Saturation Region VDS> VDSAT VGS > VTH ■ Drain current: β ⋅ ( V GS – V TH ) 2 I DS = -------------------------------------------2⋅a⋅K 1 K = --- ⋅ ( 1 + V c + 1 + 2 ⋅ V c ) 2 1 V c = --- ⋅ U 1 ⋅ ( V GS – V TH ) a ■ Saturation voltage: V GS – V TH V DSAT = ---------------------------a⋅ K Subthreshold Region VGS < VTH ■ Subthreshold current is added to the linear and saturation region IDS to give total current when subthreshold is modeled. ■ Modeled only when N0 <200:1fs I exp ⋅ I lim I sub = ------------------------I exp + I lim q ⋅ ( V GS – V TH ) kT 2 I exp = β 0 ⋅ ------ ⋅ exp ( 1.8 ) ⋅ exp ---------------------------------------- q N ⋅ kT – q ⋅ V DS 1 – exp ---------------------- kT 9 ⋅ β 0 kT 2 I lim = ------------- ⋅ ------ q 2 ■ Subthreshold swing coefficient: N = N 0 + NB ⋅ VBS + ND ⋅ V DS December 1998 349 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Reverse Leakage Current ■ LEAK helps to control reverse-biased junction leakages: the GMIN term (see “Built-In Variables and Arrays” chapter) is multiplied by LEAK in the reverse current equation. ■ IJS also contributes to the reverse leakage current. ■ MOSFET junction equations For Vd < 0 (Reverse leakage) IS I = -----*Vd Vt For Vd >=0 (Forward conduction) I = IS*(EXP(Vd/Vt) - 1) December 1998 350 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models BSIM Equivalent Circuits D n-channel R C D C GD BD + G C GS I DS V D B C C GB R BS S S D p-channel C R GD D C BD + G C GS V D I DS B C GB C R BS S S AC Model Equations Capacitance ■ Refer to common parameters section for MOSFET Levels 5 and 6 December 1998 351 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Junction capacitance: CJ⋅AD=drain bottom junction capacitance CJ⋅AS=source bottom junction capacitance AS=source diffusion area (device property) AD=drain diffusion area (device property) CJW=junction sidewall capacitance per unit length PJ, PJW=bulk junction bottom and sidewall capacitances MJ, MJW=bulk junction bottom and sidewall grading coefficients Refer to the “Metal-Oxide-Semiconductor Field Effect Transistor Model (Levels 5 and 6)” section for total junction capacitance equations. ■ Overlap capacitances: CGS = CGSO ⋅ W (gate-source) CGD = CGDO ⋅ W (gate-drain) CGB = CGBO ⋅ L (gate-bulk) Charge Conservation Model ■ Drain/source partitioning of charge in saturation region: XPART = 040/60 XPART = 0.550/50 XPART = 10/100 ■ Smooth change from above to 50/50 in triode region. ■ Definitions: QG=terminal charge associated with gate QB=terminal charge associated with bulk QC=terminal charge associated with channel QS=terminal charge associated with source December 1998 352 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models QD=terminal charge associated with drain C = W EFF ⋅ L EFF ⋅ C OX a x = a ⋅ [ 1 + U 1 ⋅ ( V GS – V TH ) ] V GT = V GS – V TH ■ Accumulation region charge (V GS < VFB): QG = C ⋅ (VGS - VFB - VBS) QB = QG QS = QD = 0 QC =QS + QD = 0 ■ Subthreshold region charge (VFB < V GS <V TH ): 2 V GS – VFB – V BS C ⋅ K1 Q G = ------------------- ⋅ – 1 + 1 + 4 ⋅ --------------------------------------------2 2 K1 QB = -QG QS = QD = QC = 0 ■ Inversion (values of Q , Q , and Q regardless of channel charge partitioning): G B C Linear region: 2 ( V DS ) ⋅ a x V DS Q G = C ⋅ V GS – VFB – PHI – ----------- + -------------------------------------------------------------------------- 2 12 ⋅ [ V – ( 1 ⁄ 2 ) ⋅ a ⋅ V ] GT x DS 2 ( 1 – a x ) ⋅ V DS ( V DS ) ⋅ ( 1 – a x ) ⋅ a x Q B = C ⋅ VFB + PHI – V TH + ----------------------------------- – ---------------------------------------------------------------- 2 1 12 V GT – --- ⋅ a x ⋅ V DS 2 Saturation region: December 1998 353 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models V GT Q G = C ⋅ V GS – VFB – PHI – ------------3 ⋅ ax ( 1 – a x ) ⋅ V GT Q B = C ⋅ VFB + PHI – V TH + ------------------------------------3 ⋅ ax Charge neutrality determines QC: QG + QB + QC = 0 ■ 40/60 channel charge partitioning for drain and source: Linear region : 2 ( a x ⋅ V DS ) 2 a x ⋅ V DS V GT a x ⋅ V DS ⋅ V GT ( a x ⋅ V DS ) 2 V GT Q S = – C ⋅ ----------- + ------------------------------------------------------- – ------------------------------------------------ ⋅ ------------ – ------------------------------------- + ----------------------------2 2 a ⋅ V a ⋅ V 6 40 8 x DS x DS 12 ⋅ V GT – --------------------- V GT – --------------------- 2 2 2 a x ⋅ V DS ⋅ V GT ( a x ⋅ V DS ) 2 V GT a x ⋅ V DS V GT a x ⋅ V DS Q D = – C ⋅ ----------- + --------------------- – ------------------------------------------------ ⋅ ------------ – ------------------------------------- + ----------------------------a x ⋅ V DS 2 6 40 2 8 2 V – --------------------- GT 2 Equations for QG, QB, and QC are given above. Saturation region: Q S = – ( 2 ⁄ 5 ) ⋅ C ⋅ V GT Q D = – ( 4 ⁄ 15 ) ⋅ C ⋅ V GT Equations for QG, QB, and QC are given above. ■ 0/100 channel charge partitioning for drain and source: December 1998 354 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Linear region: 2 V ( a x ⋅ V DS ) GT a x ⋅ V DS Q S = – C ⋅ ------------ + ---------------------- – --------------------------------------------------------- 4 a x ⋅ V DS 2 24 ⋅ V GT – ---------------------- 2 2 V ( a x ⋅ V DS ) GT 3 ⋅ a x ⋅ V DS Q D = – C ⋅ ------------ – ------------------------------ – ------------------------------------------------------ 4 a x ⋅ V DS 2 V 8 ⋅ – ---------------------- GT 2 Equations for QG, QB, and QC are given above. Saturation region: Q S = – ( 2 ⁄ 3 ) ⋅ C ⋅ V GT QD = 0 Equations for QG, QB, and QC are given above. ■ 50/50 channel charge partitioning for drain and source: Linear region: 2 a x ⋅ V DS ( a x ⋅ V DS ) –C Q S = Q D = ------- ⋅ V GT – --------------------- + ------------------------------------------------------2 2 a x ⋅ V DS 12 ⋅ V GT – --------------------- 2 Equations for QG, QB, and QC are given above. Saturation region: Q S = Q D = – ( 1 ⁄ 3 ) ⋅ C ⋅ V GT Equations for QG, QB, and QC given above. December 1998 355 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Noise Model Equations ■ Flicker noise (current generator connected between drain and source): In = AF 8 ⋅ kT ⋅ G m KF ⋅ I DS --------------------------- + --------------------------------------------------3 f EF ⋅ C OX ⋅ W ⋅ L eff whereIDS=drain current Gm=small-signal transconductance f=frequency Breakdown Equations ■ Breakdown modeled only if BVDS, BVDB, and BVSB do not equal 0. ■ Breakdown occurs when any of the following conditions hold: NBSIM V DS ≥ BVDS V DB ≥ BVDB V SB ≥ BVSB PBSIM – V DS ≥ BVDS – V DB ≥ BVDB – V SB ≥ BVSB Temperature Equations Currently, internal temperature equations for BSIM do not exist. You must supply your own temperature equations if you want to use temperature with the BSIM models. GaAs MESFET Model The Cadence SPICE GaAs MESFET model (model type: gasfet) offers ■ Level 1 December 1998 356 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ❑ Based on Curtice model [4] adapted for SPICE by Sussman-Fort [5] ❑ Four terminals ❑ DC models DC current from source to drain and through gate-source and gate-drain diodes pinch-off voltage variation with back gate bias reverse breakdown gate-to-source and gate-to-drain diodes channel length modulation variation with VGS ❑ ■ ■ Capacitance model 1 (see below) Level 2 ❑ Based on Raytheon-Statz model [8] ❑ Three terminals ❑ Choice of capacitance model 1 or 2 (see below) ❑ AREA value property AC Models ❑ Capacitance model 1 (CAPMOD=1) reverse voltage dependence of dopant grading effect of depletion edge extension to substrate gate-source and gate-drain diode and channel transit time capacitances. Note: Transit time capacitance should be invoked only for devices used in saturation. Refer to “Transit Time Capacitance” section later in this chapter. ❑ Capacitance model 2 (CAPMOD=2) applies to Level 2 model only symmetrical for drain and source ■ Thermal and flicker noise models December 1998 357 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models GaAs MESFET Model Parameters The following “typical” model parameters are for a 1-micron gate length device with a width of 50 microns. Parameter name Parameter description 1 ALPHA DC hyperbolic tangent function constant 1/V 2 BETA Transconductance parameter 3 VTO Pinch-off (threshold) voltage 4 KAPPA Pinch-off voltage exponent multiplier 5 Default Typical value 2.0 5.0 1e-4 3.3e-3 V -2.5 -1.9 - 0 0.1 VBGMAX Maximum characterized back gate voltage V -5 -5 6 VTEXP Pinch-off voltage exponent - 0 2.0 7 LAMBDA Channel length modulation parameter 1/V 0 6.0e-2 8 LMULT LAMBDA effect multiplier - 1 2.0 9 LEXP LAMBDA effect exponent - 0 2.6 10 RS Source resistance ohm 0 36 11 RD Drain resistance ohm 0 36 12 RG Gate resistance ohm 0 1.7 13 CDS Drain-source parasitic capacitance (fixed) F 0 - 14 CBS Back gate-source parasitic capacitance F (fixed) 0 0 15 CBD Back gate-drain parasitic capacitance (fixed) F 0 0 16 CPGD Gate-drain parasitic capacitance (fixed) F 0 - 17 CPGS Gate-source parasitic capacitance (fixed) 18 CDSS Series drain-source RC capacitance (fixed) F 0 0.35nf 19 RDSS Series drain-source RC resistance ohm 0 4.0K December 1998 Unit 358 2 A/V Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 20 ISD Drain diode saturation current A 1.0e-14 2e-13 21 ISS Source diode saturation current A 1.0e-14 2e-13 22 ND Drain diode emission coefficient - 1.0 1.2 23 NS Source diode emission coefficient - 1.0 1.2 24 BVD Drain diode reverse breakdown voltage V 0 8.0 25 BVS Source diode reverse breakdown voltage V 0 8.0 26 CBVD Drain diode current at breakdown voltage A 1.0e-3 1.0e-6 27 CBVS Source diode current at breakdown voltage A 1.0e-3 1.0e-6 28 CGDO Drain diode zero-bias capacitance F 0 0.1pF 29 CGSO Source diode zero-bias capacitance F 0 0.1pF 30 FCD Drain diode forward-bias nonideal junction capacitance coefficient - 0 - 31 FCS Source diode forward-bias nonideal unction capacitance coefficient - 0 - 32 PBD Drain diode junction potential V 1.0 0.74 33 PBS Source diode junction potential V 1.0 0.74 34 MD Drain diode grading coefficient - 0.5 0.5 35 MS Source diode grading coefficient - 0.5 0.5 36 AD Drain diode reverse-bias capacitance slope factor 1/V 2 0 -1.5e-2 37 AS Source diode reverse-bias capacitance slope factor 1/V 2 0 -1.5e-2 38 VCBD Drain diode reverse-bias capacitance fall-off voltage V -500 -1.9 39 VCBS Source diode reverse-bias capacitance fall-off voltage V -500 -1.9 December 1998 359 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default Typical value 40 BD Drain diode reverse-bias capacitance fall-off rate coefficient - 10.0 5.0 41 BS Source diode reverse-bias capacitance fall-off rate coefficient - 10.0 5.0 42 TTD Drain diode transit time s 0.0 - 43 TTS Source diode transit time s 0.0 - 44 TAU Transit time under device gate s 0.0 - 45 BVDS Maximum drain-to-source voltage V † 20 46 LEVEL DC model level 1=Curtice model 2=Raytheon-Statz model - 1 - 47 B Doping tail extending parameter (Level 2 only) 0.3 - 48 CAPMOD Capacitance model level – used only for Raytheon-Statz model (Level 2) 1=original Cadence SPICE capacitance model 2=Raytheon-Statz capacitance model 2 - 49 KF Flicker noise coefficient - 0 - 50 AF Flicker noise exponent - 1.0 - † The default for this parameter is that it is not calculated. GaAs MESFET Model Operating Point Parameters Parameter name Parameter description Unit 1 ID Drain current A 2 VGS Gate-source voltage V 3 VDS Drain-source voltage V 4 VBS Body-source voltage V December 1998 360 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit 5 GM Transconductance mho 6 GDS Output conductance mho 7 GMBG Back gate transconductance mho 8 CGS Gate-source capacitance F 9 CGD Gate-drain capacitance F 10 CDS Drain-source capacitance F 11 VTH Threshold voltage V 12 LAMB Channel length modulation parameter 1/V 13 PWR Power W 14 LIN Linear region flag s 15 BKDWN Breakdown flag s December 1998 361 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Model Description Level 1 (Curtice) DC Model Equations ■ Four-terminal model ■ RS, RG, RD: series resistances for source, gate, and drain, respectively DC Current Source Between Drain and Source ■ ( V DS ≥ 0 ): I DS = BETA ⋅ ( V GS – V P ) 2 ⋅ ( 1 + LAM' ⋅ V DS ) ⋅ tanh ( ALPHA ⋅ V DS ) V GS > V P I DS = 0 V GS < V P V BS ≤ 0 V P = VTO ⋅ exp [ – KAPPA ⋅ ( V BS ⁄ VBGMAX ) VTEXP ] LAM' = ( LAMBDA ⋅ LMULT ) ■ ( V DS < 0 [ LEXP ⋅ ( 1 – V GS + V P ) ] ): I DS = BETA ⋅ ( V GD – V P ) 2 ⋅ ( 1 – LAM' ⋅ V DS ) ⋅ tanh ( ALPHA ⋅ V DS ) V GD > V P I DS = 0 V GD < V P V BD ≤ 0 V P = VTO ⋅ exp [ – KAPPA ⋅ ( V BD ⁄ VBGMAX ) VTEXP ] LAM' = ( LAMBDA ⋅ LMULT ) [ LEXP ⋅ ( 1 – V GD + V P ) ] DC Current Through Gate-Drain or Gate-Source Diode ■ Forward bias: V GS > 0 V GS I DGS = ISS ⋅ exp q ⋅ ----------------------- – 1 ( NS ⋅ kT ) ■ Reverse bias before breakdown: 0 > V GS > – BVS I DGS = K 1 ⋅ V GS December 1998 362 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ K1 is a constant found by iteration: I DGS = 0 at V GS = 0 I DGS = CBVS at V GS = – BVS dI DGS ----------------dV GS is continuous ■ Reverse bias beyond breakdown: ■ The same equations that apply to the gate-source diode also apply to the gate-drain diode if you replace parameters ISS, BVS, NS, CBVS with ISD, BVD, ND, CBVD, respectively. DC I-V Characteristics for All Regions of Diode Current Breakdown Reverse bias Forward bias I D -3 December 1998 0 V D 363 1 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models MESFET Equivalent Circuit (Curtice Model) D CPDG RD IGD CDSS CBD + G VDS - IDS RG CDS B RDSS CBS IGS RS CPGS S Level 2 (Raytheon-Statz) DC Model Equations ■ Three-terminal model ■ Choice of capacitance model (CAPMOD=1 or 2) ■ AREA value property ■ Same parameters as level 1, plus B and CAPMOD Normal Mode (V >= 0) DS V GST = V GS – VTO December 1998 364 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Cutoff region ( V GST ≤ 0 ): I DS = 0 ■ Linear and saturation regions ( V GST > 0 ): 3 Saturation region ( V DS ≥ ----------------- ): 3 Linear region ( 0 < V DS < ----------------- ): ALPHA ALPHA Inverse Mode (V < 0) DS VGDT =VGD-VTO ■ Cutoff region ( V GDT < 0 ): I DS = 0 ■ Linear and saturation regions ( V GDT ≥ 0 ): Saturation region ( V DS 3 ≥ -----------------ALPHA ): 2 BETA ⋅ ( 1 – LAMBDA ⋅ V DS ) ⋅ V GDT --------------------------------------------------------------------------------------------1 + B ⋅ V GDT Linear region ( 0 < 3 V DS < -----------------ALPHA ): AC Model Equations (CAPMOD=1) ■ Mandatory model for Level 1, optional for Level 2. ■ Fixed capacitors CDS, CPGS, CPGD. (Fixed capacitors CBS and CBD are for parasitic capacitance from back gate to source or drain, but are normally omitted and thus default to zero.) ■ Series R-C elements RDSS, CDSS. ■ Five nonlinear capacitances in addition to the fixed linear capacitances: gate-drain, gatesource, diode junction, charge stored in each diode due to transit time effects, and charge stored in the channel due to drain-source transit time effects. December 1998 365 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models MESFET Equivalent Circuit (Raytheon-Statz Model) D RD CGDTOT +VGDRG G + VDS - IGD IGS IDS GCDS +VGSCGSTOT RS S Gate-Drain and Gate-Source Capacitance ■ Reverse bias : CJ ( O ) C ( V ) = --------------------------V M 1 – ----- PB V < FC ⋅ PB ■ Forward bias: ■ Parameters for drain and source diodes, respectively, are: FCÆ FCD, FCS PBÆ PBD, PBS MÆ MD, MS CJ(0)Æ CGDO, CGSO ■ The above equations give erroneous capacitance in the reverse bias region due to the assumption of constant grading (M coefficients). The correction for reverse voltage dependence is: December 1998 366 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models 2 M = M(0) + A⋅V where A → AD, AS ■ Additional correction due to depletion layer extending to substrate, resulting in little change in stored charge with increasing reverse bias. Therefore, capacitance drops to near zero: PB ⋅ CJ ( 0 ) V (– M + A ⋅ V 2) C ( V ) = --------------------------- ⋅ [ 1 + TANF ( V ) ] ⋅ 1 – ------- ⋅… 2 ⋅ (1 – M ) PB 1–M+A⋅V V V … ⋅ --------------------------------- – 2 ⋅ A ⋅ V ⋅ LOG 1 – ------- ⋅ 1 – ------- + … PB PB PB VCB ( 1 – M + A ⋅ VCB 2 ) V (1 – M + A ⋅ V 2) … + B ⋅ [ 1 – ( TAN ( V ) ) 2 ] ⋅ 1 – ----------- – 1 – ------- PB PB where TANF(V) = TANH[B⋅(V - VCB)] B determines rate at which TANF moves from +1 to -1 about VCB: B → BD, BS Diode charge is variable until V = VCB and constant for V < VCB: VCB → VCBD, VCBS Transit Time Capacitance ■ Gate-drain and gate-source diode transit time capacitance: CTR⋅DIODE = TT⋅GDIODE where TT → TTD, TTS GDIODE = conductance for a given diode voltage December 1998 367 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models MESFET Capacitance Model Capacitance versus Voltage V = FC*PB Reverse bias Forward bias V=0 V = VP ■ Channel transit time capacitance: C TR.CHAN = TAU⋅G M where GM = device transconductance Note: To simplify the model, the assumption was made that drain-source conductance = ~0. Therefore, TAU should be used only for devices used in saturation (driving transistors and source followers), where this assumption is valid. Total Terminal-to-Terminal Capacitances CGS.TOT = CPGS + CGS.DIODE + CTR.GS (gate to source) CGD.TOT = CPGD + CGD.DIODE + CTR.GD (gate CDS.TOT = CDS + CTR.CHAN (drain to drain) to source) where CTR.GS and CTR.GD are source and drain transit time capacitances CGS.DIODE and CGD.DIODE are source and drain diode capacitances C(V), respectively Total Terminal-to-Terminal Capacitances ■ Applies to Level 2 (Raytheon-Statz) model only (default). December 1998 368 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Gate-drain and gate-source diode capacitance: C GSO C GS ⋅ TOT = --------------- ⋅ par1 ⋅ cplus + C GDO ⋅ cminus qroot C GSO C GD ⋅ TOT = --------------- ⋅ par1 ⋅ cminus + C GD ⋅ cplus qroot V max = 0.5 delta = 0.2 1 vcap = -----------------ALPHA C GSO = CGSO ⋅ AREA (Note: AREA is the AREA property on the device card) C GDO = CDSO ⋅ AREA qroot = V new 1 – -----------PBD ( V eff – VTO ) par1 = 0.5 * 1 + ------------------------------------------------------------------ 2 2 [(V – VTO ) + delta ] eff ( V GS – V GD ) cplus = 0.5 * 1 + ------------------------------------------------------------------- [(V –V ) 2 + vcap 2 ] GS GD ( V GS – V GD ) cminus = 0.5 * 1 – ------------------------------------------------------------------- 2 2 [ ( V GS – V GD ) + vcap ] V GS + V GD + [ ( V GS – V GD ) 2 + vcap 2 ] V eff = ------------------------------------------------------------------------------------------------------2 If V eff + VTO + [ ( V eff – VTO ) 2 + delta 2 ] ---------------------------------------------------------------------------------------------------- < V max 2 V eff + VTO + [ ( V eff – VTO ) 2 + delta 2 ] V new = ---------------------------------------------------------------------------------------------------2 December 1998 369 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Otherwise Vnew = Vmax ■ Drain-source capacitance ■ CDS=CDS+CTR⋅CHAN Channel transit time capacitance: ■ CTR⋅CHAN= TAU⋅GM GM is device transconductance. Noise Equations ■ Resistor thermal noise : I ND = ■ 4 ⋅ kT -------------R Flicker noise : I ND = AF 8 ⋅ kT ⋅ G M KF ⋅ I D ---------------------------- + ----------------------3 f where f = frequency Breakdown Equations ■ Breakdown is modeled only if BVDS does not equal 0. ■ Breakdown occurs when VDS ≥ BVDS Silicon Controlled Rectifier (SCR) Model The Cadence SPICE SCR model (model type: scr) ■ Has four-layer structure, built-in dielectrically isolated (DI) tub surrounded by thick isolation oxide, no buried layer ■ Is not applicable to parasitic SCR structure ■ Includes first-order effects of negative substrate bias December 1998 370 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Is a five-terminal device: anode, anode gate, cathode, cathode gate, and polysilicon ■ Uses Cadence SPICE BJT Model for the bipolar transistors ■ Does not model noise December 1998 371 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models SCR Model Parameters Parameter name Parameter description Unit Default 1 ISN* ISP* Saturation current Saturation current A A 0.25f 0.09f 2 BFN BFP Ideal forward current gain Ideal forward current gain - 50 3 3 C2N C2P Forward low-current nonideal base current coefficient Forward low-current nonideal base current coefficient - 5 6.02 4 IKN* IKP* Forward high-current knee current for beta roll-off Forward high-current knee current for beta roll-off A A 13.05m 13.05m 5 NEN NEP Nonideal low-current base-emitter emission coefficient Nonideal low-current base-emitter emission coefficient - 1.4 1.32 6 NFN NFP Forward current emission coefficient Forward current emission coefficient - 1.0 1.0 7 BRN BRP Ideal reverse current gain Ideal reverse current gain - 14.3 3.6 8 C4N C4P Reverse low-current nonideal base current coefficient Reverse low-current nonideal base current coefficient - 5 5 9 IKRN* IKRP* Reverse high-current knee current for beta roll-off Reverse high-current knee current for beta roll-off A A 9.32m 3.6m 10 NCN/P NCN/P Nonideal low-current base-collector emission coefficient Nonideal low-current base-collector emission coefficient - 1.48 1.4 11 NRN NRP Reverse current emission coefficient Reverse current emission coefficient - 1.11 1.0 12 VAN VAP Forward Early voltage Forward Early voltage V V 750 145 13 VBN VBP Reverse Early voltage Reverse Early voltage V V 20 40 14 REN* REP* Cathode/anode ohmic resistance Cathode/anode ohmic resistance ohm ohm 5 5 15 RBMN* RBMP* Minimum ohmic external gate resistance Minimum ohmic external gate resistance ohm ohm 110 270 December 1998 372 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default 16 RBVN* RBVP* Modulated ohmic internal gate resistance Modulated ohmic internal gate resistance ohm ohm 0 0 17 RCMN* RCMP* Minimum ohmic internal junction resistance Minimum ohmic internal junction resistance ohm ohm 0 0 18 RCVN* RCVP* Modulated ohmic internal junction resistance Modulated ohmic internal junction resistance ohm ohm 0 0 19 CEXN CEXP Current crowding exponent Current crowding exponent - 1 1 20 CCON* CCOP* Current crowding normalization constant Current crowding normalization constant A A 1 1 21 DOPEN DOPEP Collector background doping concentration Collector background doping concentration cm-3 5.8e14 cm-3 0 22 TFN TFP Ideal forward transit time Ideal forward transit time s s 50n 83n 23 FTFP Fraction of TFP affected by substrate bias - 0.75 24 ETFP Exponent of TFP reduction due to substrate bias - 0.40 25 TRN TRP Ideal reverse transit time Ideal reverse transit time s s 50n 600n 26 TDN TDP Intrinsic base delay time Intrinsic base delay time s s 0 0 27 PTFN PTFP Excess phase at frequency 1.0/(TD⋅ 2π) Hz Excess phase at frequency 1.0/(TD⋅ 2π) Hz degr ee degr ee 0 0 28 CJEN* CJEP* Zero-bias cathode/anode junction capacitance Zero-bias cathode/anode junction capacitance F F 0.705p 0.453p 29 PEN PEP Cathode/anode built-in potential Cathode/anode built-in potential V V 0.85 0.72 30 MEN MEP Cathode/anode junction exponential grading coefficient Cathode/anode junction exponential grading coefficient - 0.4 0.36 31 FCN FCP Forward bias nonideal junction capacitance coefficient Forward bias nonideal junction capacitance coefficient - 0 0 December 1998 373 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default 32 CJCN* CJCP* Zero-bias internal base-collector capacitance Zero-bias internal base-collector capacitance - 0.75p 0.75p 33 PCN PCP Internal base-collector built-in potential Internal base-collector built-in potential V V 0.325 0.325 34 MCN MCP Internal base-collector exponential grading coefficient Internal base-collector exponential grading coefficient - 0.406 0/406 35 XCJCN Fraction of base-collector depletion capacitance connected to internal gate node Fraction of base-collector depletion capacitance connected to internal gate node - 1 - 1 F 0.66p XCJCP 36 CCS* Zero-bias substrate oxide capacitance 37 CCSM Minimum fraction of total CCS allowed due to substrate bias 38 CTOX Substrate oxide thickness micro 3.55 n 39 CVNOT Substrate potential at which bias effects begin to affect TFP and CCS V -35 40 CBON CBOP Extrapolated 0-volt internal junction leakage current Extrapolated 0-volt internal junction leakage current A A 0 0 41 GBON GBOP Slope of ICBO vs. VBC above VBON/P mho mho 0 0 VBON VBOP Slope of ICBO vs. VBC at 0 volts VBC V V 0 0 42 Slope of ICBO vs. VBC above VBON/P Slope of ICBO vs. VBC at 0 volts VBC 0.50 43 RPOL* Polysilicon substrate resistance under DI ohms tub 541k - 44 EPOL Exponent of RPOL reduction due to substrate bias - 0.40 45 VRT Substrate potential at which bias effects begin to affect RPOL V -35 46 BVCA Maximum cathode-to-anode voltage V † 47 BVAGA Maximum anode gate-to-anode voltage V † 48 BVCCG Maximum cathode-to-cathode gate voltage V † December 1998 374 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models *Parameter is affected by the device AREA property. (Refer to the “Semiconductor Devices” section of the “Components” chapter.) † The default for this parameter is that it is not calculated. SCR Model Operating Point Parameters Parameter name Parameter description Unit 1 IA Anode current A 2 IAG Anode-gate current A 3 ICG Cathode-gate current A 4 IC Cathode current A 5 VAC Anode-cathode voltage V 6 VAG Anode-gate anode voltage V 7 VCG Cathode-gate cathode voltage V 8 VAGI Internal anode gate-anode voltage V 9 VCGI Internal cathode gate-cathode voltage V 10 VNPAI Internal anode pnp collector-base junction voltage V 11 VNPCI Internal cathode npn collector-base junction voltage V 12 RAG External anode gate resistance ohm 13 RCG External cathode gate resistance ohm 14 RAGI Internal anode gate resistance ohm 15 RCGI Internal cathode gate resistance ohm 16 RNPAI Internal anode pnp collector resistance ohm 17 RNPCI Internal cathode npn collector resistance ohm 18 CPIA Anode pnp emitter-base capacitance F 19 CMUA Anode pnp collector-base capacitance F 20 CPIC Cathode npn emitter-base capacitance F December 1998 375 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit 21 CMUC Cathode npn collector-base capacitance F 22 ICBOA Anode pnp collector-base leakage current A 23 ICBOC Cathode npn collector-base leakage current A 24 RPOL Substrate polysilicon resistance component ohm 25 CSUB Substrate capacitance F 26 BKDWN Breakdown flag s December 1998 376 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Model Description Substrate Bias Effects ■ DOPEN, CTOX, CCSM, and VNOT: used to implement deep depletion effects (due to substrate bias) on the total DI island capacitance CCS. ■ Island-to-poly capacitance as a function of substrate bias: CCS C sub ( V poly ) = ------------------------------------------------------------------------------------ARG ⋅ Max ( 0, – V poly + V 0 ) + 1 ε OX 2 2 ⋅ ---------- t OX ARG = -------------------------q ⋅ N ⋅ ε si where Vpoly = poly potential with respect to the island VO=potential associated with surface states and work function q=electronic charge N=island impurity concentration esi=permittivity of silicon eox=permittivity of oxide tox=isolation oxide thickness ■ ■ CSUB is limited to prevent unrealistically small substrate capacitance values (island not infinitely thick nor void of diffusions): Csubmin = CCSM ⋅ CCS Base transit time: TFP ⋅ FTFP T FP ( V poly ) = ---------------------------------------------------------------------------------------- + TFP ⋅ ( 1 – FTFP ) Max [ 0, ( – V poly + V 0 ) ] ETFP 1 + ---------------------------------------------------------–V 0 December 1998 377 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Poly resistance: RPOL R poly ( V poly ) = --------------------------------------------------------------------------------------------Max [ 0, ( – V poly + VRT ) ] EPOL 1 + ---------------------------------------------------------------– VRT NPN and PNP Devices ■ Same parameters as BJT model, but followed by “n” for npn or “p” for pnp device. Example: IS → ISN or ISP. ■ Exceptions: KE, KC, RC, PS, MS, KF and AF are not included in the SCR model. ■ npn/pnp parameters are described in the “Bipolar Junction Transistor (BJT) Model” section. Breakdown Equations ■ Breakdown is modeled only if BVCA, BVAGA, and BVCCG do not equal 0. ■ Breakdown occurs when any of the following conditions hold: V CA ≥ BVCA V AGA ≥ BVAGA V CCG ≥ BVCCG December 1998 378 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models SCR Device Cross-Section cathode anode anode gate cathode gate n+ p cathode cathode gate n+ p+ n p- p p- n- island oxide polysilicon SCR Model Equivalent Circuit anode REP RBVP RBMP anode gate CCS RCMP +RCVP RCMN +RCVN RPOL cathode gate RBMN substrate RBVN REN cathode Silicon-on-Insulator (SOI) MOSFET Model The Cadence SPICE SOI MOSFET model (model types: nmosoi, pmosoi) ■ Uses the Lim and Fossum [6] thin-film charge-oriented model, extended by Veeraraghavan [7] to include short-channel effects December 1998 379 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Applies to both accumulated back surface (TFA) and depleted back surface (TFD) devices ■ Models DC, transient, and AC characteristics ■ Does not model noise December 1998 380 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models SOI MOSFET Model Parameters Parameter name Parameter description Unit Default 1 VFBF* Front-gate flatband voltage V -0.9351 NMOS 0.2800 PMOS 2 VFBB Back-gate flatband voltage V -0.5547 3 TOXF* Front-gate oxide thickness cm 0.5e-5 4 TOXB* Back-gate oxide thickness cm 0.5e-4 5 WKF Front-gate work function differential (pmsf) V -0.9351 NMOS 0.2800 PMOS 6 WKB Back-gate work function differential (pmsb) V -0.5547 NMOS 0.5547 PMOS 7 NQFF Front-gate fixed oxide charge (Qff) 8 NQFB Back-gate fixed oxide charge (Qbb) 9 NSUB Substrate doping density 10 NGATE Poly-gate doping density 11 NSF Front-gate fast surface state density 12 NSB Back-gate fast surface state density 13 TB* Device body thickness 14 NBODY Effective body doping concentration 15 PHIB Body potential 16 UO Surface mobility 17 THETA Mobility degradation coefficient V/cm 0.0 18 VSAT Velocity saturation field V/cm 0.0 December 1998 2 0.0 2 0.0 3 1el4 3 1el9 2 0.0 2 0.0 1/cm 1/cm 1/cm 1/cm 1/cm 1/cm cm 1e-5 3 1/cm V 0.6552 2 cm /V⋅s 381 5el5 700.0 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default 19 TPG Type of gate: +1 opposite to body - 1 same as body 0 aluminum gatee - 1.0 20 TPS Type of substrate: +1 opposite to body - 1 same as body - 1.0 21 CGFDO* Gate-drain overlap capacitance F/cm 0.0 22 CGFSO* Gate-source overlap capacitance F/cm 0.0 23 CGFBO* Gate-body overlap capacitance F/cm 0.0 24 RHOSD Source/drain sheet resistivity ohm/sq. 0.0 25 RHOB Body sheet resistivity ohm/sq. 0.0 26 RD Parasitic drain resistance ohm 0.0 27 RS Parasitic source resistance ohm 0.0 28 RB Parasitic body resistance ohm 0.0 29 IRO* Parasitic diode saturation current A/cm 1e-10 30 N Parasitic diode emission coefficient - 1.0 31 QSMA Charge-sharing parameter alpha - 0.0 32 QSMB Charge-sharing parameter beta - 0.0 33 ETA DICE (Drain-Induced Conductivity Enhancement) parameter - 0.0 34 ZETA DICE parameter - 0.0 35 LMOD Channel-length modulation parameter - 0.0 36 ALPHA Impact-ionization parameter V/cm 0.0 37 BETA Impact-ionization parameter V/cm 0.0 38 BFACT* Empirical parameter in v-E model - 1.0 39 DL* Channel length reduction parameter cm 0.0 40 DW* Channel width reduction parameter cm 0.0 41 CIITOL Avalanche current tolerance A 1e-12 December 1998 382 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit Default 42 BVDS Maximum drain-to-source voltage V † 43 BVDB Maximum drain-to-body voltage V † 44 BVSB Maximum source-to-body voltage V † *Parameter is affected by the device AREA property. (Refer to the “Semiconductor Devices” section of the “Components” chapter.) † The default for this parameter is that it is not calculated. SOI MOSFET Model Operating Point Parameters Parameter name Parameter description Unit 1 ID Drain current A 2 VGFS Front gate-source voltage V 3 VDS Drain-source voltage V 4 VGBS Back gate-source voltage V 5 VBS Body-source voltage V 6 GM Transconductance (dIds/dVgfs) mho 7 GDS Transconductance (dIds/dVds) mho 8 GMBS Transconductance (dIds/dVbs) mho 9 GMGB Transconductance (dIds/dVgbs) mho 10 GMION Transconductance (dCiion/dVgfs) mho 11 GDSION Transconductance (dCiion/dVds) mho 12 GMBSIO Transconductance (dCiion/dVbs) mho 13 CIION Impact ionization current A 14 CBS Body-source current A 15 CBD Body-drain current A 16 VTFF Threshold voltage V December 1998 383 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit 17 VTFB Drain-source saturation voltage V 18 QD Total drain charge C 19 QGF Total front-gate charge C 20 QS Total source-charge C 21 QGB Total back-gate charge C 22 QBY Total body charge C 23 CGFGF Total capacitance reflected on the front gate F 24 CGFD Front gate-drain capacitance F 25 CGFBY Front gate-body capacitance F 26 CGFS Front gate-source capacitance F 27 CGFGB Front gate-back gate capacitance F 28 CGBGF Back gate-front gate capacitance F 29 CGBD Back gate-drain capacitance F 30 GGBBY Back gate-body capacitance F 31 CGBS Back gate-source capacitance F 32 CGBGB Total capacitance reflected on the back gate F 33 CBYGF Body-front gate capacitance F 34 CBYD Body-drain capacitance F 35 CBYBY Total capacitance reflected on the body F 36 CBYS Body-source capacitance F 37 CBYGB Body-back gate capacitance F 38 CDGF Drain-front gate capacitance F 39 CDD Total capacitance reflected on the drain F 40 CDBY Drain-body capacitance F 41 CDS Drain-source capacitance F December 1998 384 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Parameter name Parameter description Unit 42 CDGB Drain-back gate capacitance F 43 CSGF Source-front gate capacitance F 44 CSD Source-drain capacitance F 45 CSBY Source-body capacitance F 46 CSS Total capacitance reflected on the source F 47 CSGB Source-back gate capacitance F 48 PWR Power W 49 BKDWN Breakdown flag s December 1998 385 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Model Description DC Model Equations Default Parameter Calculations ■ User-specified values override calculated and default values for the following parameters. Default values are used only when the parameters needed for parameter calculations are not specified. ■ If NBODY is unspecified and PHIB is input: q ⋅ PHIB NBODY = n i ⋅ exp ⋅ --------------------- 2 ⋅ kT otherwise, the default value of NBODY is used. ■ If PHIB is unspecified: NBODY kT PHIB = 2 ⋅ ------ ⋅ ln ------------------- q n i ■ If work functions are unspecified : Al gate E G PHIB WKF = – 0.05 – ------- – ------------2 2 kT NGATE PHIB WKF = TPG ⋅ ------ ⋅ ln ------------------- – ------------ q n 2 i poly gate kT NSUB PHIB WKB = TPS ⋅ ------ ⋅ ln --------------- – ------------ n q 2 i poly gate December 1998 386 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ If flatband voltages are unspecified: NQFF VFBF = WKF – --------------C OF NQFB WFBB = WKB – --------------C OB where ε OX C OF = --------------TOXF ε OX C OB = --------------TOXB Parasitic Resistances ■ Parameter overlap: explicit resistance parameters (RD, RS, RB) equivalent to sheet resistances (RHOSD, RHOB) multiplied by the number of diffusion squares for the drain source and body (device properties NRD, NRS, NRB, respectively). Threshold Voltage V TFF = V TFO + δV TF Q BEFF ψ SBO CB V TFO = VFBF + 1 + ----------- ⋅ PHIB – 0.5 ⋅ ----------------- – C B ⋅ -------------C C OF C OF OF where CB εs = -------- TB Q BEFF = effective body charge due to charge sharing. ψ SBO (for TFA device) = VBS. (for TFD device) must be solved for iteratively. December 1998 387 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Contribution via channel-charge enhancement due to non-zero drain voltage: CB TB 2 δV TF = – ETA ⋅ ----------- ⋅ ------- ⋅ β ⋅ V DS C OF L where for TFD device β = 1 CB β = 1 + ------------------------C B + C OB for TFA device Velocity-Field Model µ EFF ⋅ Ey v ( y ) = -----------------------------------µ EFF ⋅ Ey 1 + --------------------------2 ⋅ VSAT v ( y ) ≤ VSAT = VSAT otherwise v ( y ) > VSAT December 1998 388 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models SOI Device Structure S GF D SiO 2 N+ N+ P SiO 2 B GB ■ Average field mobility : UO µ EFF = ---------------denom CB Q BEFF THETA denom = 1 + C OF ⋅ ------------------ ⋅ V GFS – VTFO + δV TF – ----------------- + 2 ⋅ ----------- ⋅ ( PHIB – ψ 2 ⋅ ε si C OF C OF CB Q BEFF + δV TF – ----------------- + 2 ⋅ ----------- ⋅ ( PHIB – ψ SB ) – BFACT ⋅ ( 1 – α ) ⋅ V DS C OF C OF CB α = ----------C OF for TFA devices C B ⋅ C OB α = ---------------------------------------------C OF ⋅ ( C B + C OB ) for TFD devices December 1998 389 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Drain Current ■ Triode region : ( V GFS – V TFF ) 2 – [ V GFS – V TFF – ( 1 + α ) ⋅ V DS ] 2 I DS = W ⋅ µ EFF ⋅ C OF ⋅ ( 1 + α ) ⋅ -------------------------------------------------------------------------------------------------------------------------------µ EFF ⋅ V DS 2 ⋅ L ⋅ 1 + ----------------------------2 ⋅ VSAT ⋅ L where W = gate width (device property) L = gate length (device property) ■ Saturation region : ( V GFS – V TFF ) 2 – [ V GFS – V TFF – ( 1 + α ) ⋅ V DSAT ] 2 I DS = W ⋅ µ EFF ⋅ C OF ⋅ ( 1 + α ) ⋅ -------------------------------------------------------------------------------------------------------------------------------------µ EFF ⋅ V DSAT 2 ⋅ L EFF ⋅ 1 + --------------------------------------2 ⋅ VSAT ⋅ L EFF a --b V DSAT = ----------------------------------------------------------a 2 0.5 + 0.25 – B ⋅ --- b µ THETA C OE B = BFACT ⋅ -------- ⋅ ( 1 – α ) ⋅ ------------------ ⋅ ------------------UO 2 CB ⋅ T B where V GFS – V TFF a = --------------------------------1+α µ b = 1 + a ⋅ B + ----------------------------- 2 ⋅ VSAT ⋅ L µ = µ EFF atV DS = 0 December 1998 390 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Channel length modulation : µ EFF ⋅ ( V DS – V DSAT ) L EFF = L – I C ⋅ sinh– 1 -------------------------------------------------------2 ⋅ VSAT ⋅ I C CB ⋅ β I C = TB ⋅ LMOD ⋅ ----------------------------------------2 ⋅ C OF ⋅ ( 1 + α ) ■ Impact ionization current: ■ Recombination current: AC Model Equations ■ Terminal charges are determined by integrating out the spatial dependencies of charges within the device. Accumulation/Cutoff Region ■ Front gate charge : I C 2 2 ⋅ VSAT ⋅ L V GFS – V TFF L – L EFF Q GF = W ⋅ L ⋅ C OF ⋅ V GFS – WKF – PHIB – --------------------------------- – LMOD ⋅ ----- ⋅ ------------------------------- ⋅ cosh ---------------------- – 1 L µ 1 + α IC EFF for TFA device V GFS – V TFF I C 2 2 ⋅ VSAT ⋅ L L – L EFF Q GF = W ⋅ L ⋅ C OF ⋅ V GFS – WKF – PHIB – --------------------------------- – ----- ⋅ ------------------------------- ⋅ cosh ---------------------- – 1 µ L 1+α IC EFF for TFD device ■ Back gate charge: Q GB = W ⋅ L ⋅ C OB ⋅ ( V GBS – WKB – V BS ) = for TFA device (QGB for TFD device is determined via charge-neutrality.) December 1998 391 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models ■ Channel and drain charge for both TFA and TFD devices : TB 2 Q N = W ⋅ L ⋅ ( Q B – Q BEFF ) + W ⋅ L EFF ⋅ C B ⋅ ETA ⋅ ------- ⋅ V DS L TB 2 Q D = 0.5 ⋅ W ⋅ L ⋅ ( Q B – Q BEFF ) + W ⋅ L EFF ⋅ C B ⋅ ETA ⋅ ------- ⋅ V DS L Triode Region: µ EFF ⋅ V DS 2 ( 1 + α ) ⋅ 1 + ------------------------------- ⋅ V DS 2 ⋅ VSAT ⋅ L Q GF = W ⋅ L ⋅ C OF ⋅ V GFS – WKF – PHIB – ( 0.5 ⋅ V DS ) + ----------------------------------------------------------------------------------------------------------- ⋅ { – V – [ 0.5 ⋅ ( 1 + α ) ⋅ V ] } 12 V GFS TFF DS 2 z3 – ( z – 1 )3 Q N = W ⋅ L ⋅ C OF ⋅ ( 1 + α ) ⋅ V DS ⋅ --- ⋅ ------------------------------- + u – z 2z – 1 3 TB 2 + W ⋅ L ⋅ ( Q B – Q BEFF ) + W ⋅ L ⋅ C B ⋅ ETA ⋅ ------- ⋅ V DS L –2 ⋅ ( z – 1 ) 3 4 ⋅ [ z5 – ( z – 1 ) 5 ] Q D = W ⋅ L ⋅ C OF ⋅ ( 1 + α ) ⋅ V DS ⋅ ------------------------------ + ------------------------------------------- + 0.5 ⋅ ( u – z ) 15 ⋅ ( 2z – 1 ) 2 3 ⋅ ( 2z – 1 ) TB 2 + 0.5 ⋅ W ⋅ L ⋅ ( Q B – Q BEFF ) + W ⋅ L ⋅ C B ⋅ ETA ⋅ ------- ⋅ V DS L V GFS – V TFF u = ---------------------------------( 1 + α ) ⋅ V DS I DS 1 z = --------------------------------- ⋅ V GFS – V TFF – ----------------------------------------------( 1 + α ) ⋅ V DS 2 ⋅ W ⋅ VSAT ⋅ C OF Q GB = W ⋅ L ⋅ C OB ⋅ ( V GBS – WKB – V BS ) for TFA device (QGB for TFD device is determined via charge-neutrality.) December 1998 392 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Saturation Region µ EFF ⋅ V DSAT 2 ( 1 + α ) ⋅ 1 + ---------------------------------------- ⋅ V DSAT ⋅ VSAT ⋅ L EFF 2 Q GF = W ⋅ L ⋅ C OF ⋅ V GFS – WKF – PHIB – ( 0.5 ⋅ V DSAT ) + ------------------------------------------------------------------------------------------------------------------ ⋅ { – V – [ 0.5 ⋅ ( 1 + α ) ⋅ V ] } 12 V GFS TFF DSAT I C 2 2 ⋅ VSAT ⋅ L L – L EFF + W ⋅ C OF ⋅ ( L – L EFF ) ⋅ ( V GFS – WKF – PHIB – V DSAT ) – ----- ⋅ ------------------------------- ⋅ cosh ---------------------- – 1 L µ IC EFF 2 ⋅ [ z3 – ( z – 1 )3 ] Q N = W ⋅ L EFF ⋅ C OF ⋅ ( 1 + α ) ⋅ V DSAT ⋅ ------------------------------------------- + u – z 3 ⋅ ( 2z – 1 ) TB 2 + W ⋅ L ⋅ ( Q B – Q BEFF ) + W ⋅ L EFF ⋅ C B ⋅ ETA ⋅ ------- ⋅ V DS L –2 ⋅ ( z – 1 ) 3 4 ⋅ [ z 5 – ( z – 1 ) 5 ] Q D = W ⋅ L EFF ⋅ C OF ⋅ ( 1 + α ) ⋅ V DSAT ⋅ ------------------------------ + ------------------------------------------- + 0.5 ⋅ ( u – z ) 15 ⋅ ( 2z – 1 ) 2 3 ⋅ ( 2z – 1 ) TB 2 + 0.5 ⋅ W ⋅ L ⋅ ( Q B – Q BEFF ) + W ⋅ L EFF ⋅ C B ⋅ ETA ⋅ ------- ⋅ V DS = L V GFS – V TFF u = --------------------------------------( 1 + α ) ⋅ V DSAT I DS 1 z = --------------------------------------- ⋅ V GFS – V TFF – ----------------------------------------------( 1 + α ) ⋅ V DSAT 2 ⋅ W ⋅ VSAT ⋅ C OF Q GB = W ⋅ L ⋅ C OB ⋅ ( V GBS – WKB – V BS ) for TFA device (QGB for TFD device determined via charge-neutrality.) December 1998 393 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models Total Charge Including Parasitic Charge Components Q GFTOT = Q GF + CGFDO ⋅ W ⋅ V GFD + CGFSO ⋅ W ⋅ V GFS + CGFBO ⋅ W ⋅ V GFB Q GBTOT = Q GB + C OB ⋅ AD ⋅ V GBD + C OB ⋅ AS ⋅ V GBS + C OB ⋅ AB ⋅ V GBB Q DTOT = Q D – CGFDO ⋅ W ⋅ V GFD – C OB ⋅ AD ⋅ V GBD Q STOT = Q S – CGFSO ⋅ W ⋅ V GFS – C OB ⋅ AS ⋅ V GBS Q BTOT = Q B – CGFBO ⋅ L ⋅ V GFB – C OB ⋅ AB ⋅ V GBB where AB = body contact area (device property) AD = drain diffusion area (device property) AS = source diffusion area (device property) Breakdown Equations ■ Breakdown is modeled only if BVDS, BVDB, and BVSB do not equal 0. ■ Model applies only if body node is specified. ■ Breakdown occurs when any of the following conditions hold: 1fs V DS ≥ BVDS V DB ≥ BVDB V SB ≥ BVSB References 1. A. Vladimirescu and S. Liu. “The Simulation of MOS Integrated Circuits Using SPICE2,” ERL Memo No. ERL M80/7, Electronics Research Laboratory, University of California, Berkeley. Oct. 1980. 2. P. Yang, B.D. Epler, and P.K. Chatterjee. “An Investigation of the Charge Conservation Problem for MOSFET Circuit Simulation,” IEEE Journal of Solid State Circuits, Vol. SC18. Feb. 1983. 3. M.C. Jeng, P.M. Lee, M.M. Kuo, P.K. Ko, and C. Hu. “Theory, Algorithms, and User’s Guide for BSIM,” ERL Memo No. ERL M87/35, Electronics Research Laboratory, University of California, Berkeley. May 1987. December 1998 394 Product Version 4.4.2 Cadence SPICE Reference Manual Device Models 4. W.R. Curtice. “A MESFET Model for Use in the Design of GaAS Integrated Circuits,” IEEE Transactions on Microwave Theory and Techniques, MTT-28, 448-456. 1980. 5. S.E. Sussman-Fort, S. Narasimhan, and K. Mayaram. “A Complete GaAs MESFET Computer Model for SPICE,” IEEE Transactions on Microwave Theory and Techniques, MTT-32, 471-473. 1984. 6. H.K. Lim. Charge-Based Modeling of Thin-Film Silicon on Insulator MOS Field-Effect Transistors. Ph.D. Dissertation, University of Florida. 1984. 7. S. Veeraraghavan. Modeling Small-Geometry Silicon on Insulator Transistors for Device and Circuit Computer-Aided Design. Ph.D. Dissertation, University of Florida. 1988. 8. H. Statz. “GaAs FET Device and Circuit Simulation in SPICE,” IEEE Transactions on Electron Devices, Vol. ED-34, No. 2. Feb. 1987. 9. G. Nicollini, D. Pancini, and S. Pernici. “Simulation Oriented Noise Model for MOS Devices,” SGS Microelettronica Via C. Olivetti, 2-20041 Agrate Brianza (MI). 10. P. Antognetti and G. Massobrio, Semiconductor Modeling with SPICE. New York: McGraw-Hill, 1988. 11. I. Getreu, Modeling the Bipolar Transistor. Beaverton, Oregon: Tektronix, Inc., 1976. December 1998 395 Product Version 4.4.2 Cadence SPICE Reference Manual 9 Subcircuits ■ Introduction ■ Data File Examples ■ Sample Subcircuit File Introduction You can define and reference a subcircuit consisting of Cadence SPICE elements in a fashion similar to device models. You define the subcircuit in the input deck by a group of element cards; the program inserts the group of elements wherever the subcircuit is referenced. There is no limit on the size or complexity of subcircuits, and subcircuits can contain other subcircuits. .SUBCKT line: .SUBCKT SUBNAM N1 [N2 N3...] .SUBCKT Begins a subcircuit definition SUBNAM Subcircuit name N1, N2,... External nodes (cannot be zero) Example SUBCKT OPAMP 1 2 3 4 The lines that immediately follow the .SUBCKT line define the subcircuit. The last line in a subcircuit definition is .ENDS (see below). You cannot put control cards within a subcircuit definition. However, subcircuit definitions can contain anything else, including other subcircuit definitions, device models, and subcircuit calls (see below). Any device models or subcircuit definitions that you include in a subcircuit definition are strictly local (that is, such models and definitions are not known outside the subcircuit definition). Also, any element nodes that you December 1998 396 Product Version 4.4.2 Cadence SPICE Reference Manual Subcircuits do not include on the .SUBCKT line are strictly local, with the exception of 0 (ground), which is always global. .ENDS line: .ENDS SUBNAM Example ENDS OPAMP This must be the last card for any subcircuit description. The subcircuit name SUBNAM indicates which subcircuit definition to terminate. Subcircuit calls: XYYYYY N1 [N2 N3...] SUBNAM Example X1 2 4 17 3 1 MULTI The following conventions apply to subcircuits: ■ Specify pseudo-elements by the initial letter X and a maximum of five additional characters. ■ Follow the XYYYYY identifier by the circuit nodes to use in expanding the subcircuit (N1...), then by the subcircuit name SUBNAM. ■ There should be the same number of nodes in the call as in the definition. ■ The nodes must be in the order in which you define them on the .SUBCKT line. ■ On the subcircuit call line the name is identical to the name on the subcircuit definition line. ■ When accessing subcircuits, use the caret (^) as a delimiter between names of nested subcircuits and to show where the subcircuit name ends and the node or element names begin. From the previous example: X1234^1 references local node 1 in subcircuit X1234 X1234^X2^R2ND11 references local resistor R2ND11 in subcircuit X2, located inside subcircuit X1234 ■ Access different levels using the following characters: December 1998 397 Product Version 4.4.2 Cadence SPICE Reference Manual Subcircuits *everything in the top level and all subcircuit levels .*everything in the top level only *^*everything in all subcircuits one level deep ■ You can use the following commands with subcircuits : display equate device element node model keep noise plot printvs nv, nvl tnv, tnvl op, ops, opl probe tp, tps,tpl noise sens sens acsens sweep tplot wplot December 1998 398 Product Version 4.4.2 Cadence SPICE Reference Manual Subcircuits Data File Examples Simple Differential Pair The following file determines the DC operating point and small-signal transfer function of a simple differential pair. VCC 7 C 12 VEE 8 0 -12 VIN 1 0 RS1 1 2 1K RS2 6 0 1K Q1 3 2 4 MOD1 Q2 5 6 4 MOD1 RC1 7 3 10K RC2 7 5 10K RE 4 8 10K .MODEL MOD1 NPN BF=50 VA=50 IS=1.0E-12 RB=100 Simple RTL Inverter The following file determines the DC transfer curve and the transient pulse response of a simple RTL inverter. The input is a pulse from 0 to 5 volts with delay, rise, and fall times of 2 ns and a pulse width of 30 ns. The transient interval is 0 to 100 ns, with printing to be done every nanosecond. VCC 4 0 5 VIN 1 0 PULSE 0 5 2NS 2NS 2NS 30NS RB 1 2 10K Q1 3 2 0 Q1 RC 3 4 1K .MODEL Q1 NPN BF=20 RB=100 TF=0.1NS CJC=2PF One-Transistor Amplifier The following file determines the AC small-signal response of a one-transistor amplifier over the frequency range 1 Hz to 100 MHz. VCC 5 0 12 VEE 6 0 -12 VIN 1 0 AC 1 RS 1 2 1K Q1 3 2 4 X33 December 1998 399 Product Version 4.4.2 Cadence SPICE Reference Manual Subcircuits RC 5 3 500 RE 4 6 1K CBYPASS 4 0 1 UFDC 5 Adder—4 Bit All-NAND-Gate Binary Adder The following file simulates a four-bit binary adder, using several subcircuits to describe various pieces of the circuit. .SUBCKT NAND 1 2 3 4 * NODES: INPUT(2), OUTPUT, VCC Q1 9 5 1 QMOD D1CLAMP 0 1 DMOD Q2 9 5 2 QMOD D 2CLAMP 0 2 DMOD RB 4 5 4K R1 4 6 1.6K Q3 6 9 8 QMOD R2 8 0 1K RC 4 7 130 Q4 7 6 10 QMOD DVBEDROP 10 3 DMOD Q5 3 8 0 QMOD .ENDS NAND .SUBCKT ONEBIT 1 2 3 4 5 6 * NODES: INPUT(2), CARRY-IN, OUTPUT, CARRY-OUT, VCC X1 1 2 7 6 NAND X2 1 7 8 6 NAND X3 2 7 9 6 NAND X4 8 9 10 6 NAND X5 3 10 11 6 NAND X6 3 11 12 6 NAND X7 10 11 13 6 NAND X8 12 13 4 6 NAND X9 11 7 5 6 NAND .ENDS ONEBIT .SUBCKT TWOBIT 1 2 3 4 5 6 7 8 9 * NODES: INPUT - BITO(2) / BIT1(2), OUTPUT - BITO / BIT1 * CARRY-IN, CARRY-OUT, VCC X1 1 2 7 5 10 9 ONEBIT X2 3 4 10 6 8 9 ONEBIT .ENDS TWOBIT .SUBCKT FOURBIT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 * NODES: INPUT - BITO(2) / BIT1(2) / BIT2(2) / BIT3(2) * OUTPUT - BITO / BIT1 / BIT2 / BIT3, CARRY-IN, * CARRY-OUT, VCC X1 1 2 3 4 9 10 13 16 15 TWOBIT X2 5 6 7 8 11 12 16 14 15 TWOBIT .ENDS FOURBITT N December 1998 400 15 Product Version 4.4.2 Cadence SPICE Reference Manual Subcircuits Define Nominal Circuit .MODEL DMOD D .MODEL QMOD NPN BF=75 RB=100 CJE=1PF CJC=3PF VCC 99 0 DC 5V VIN1A 1 0 PULSE 0 3 0 10NS 10NS 10NS 50NS VIN1B 2 0 PULSE 0 3 0 10NS 10NS 20NS 100NS VIN2A 3 0 PULSE 0 3 0 10NS 10NS 40NS 200NS VIN2B 4 0 PULSE 0 3 0 10NS 10NS 80NS 400NS VIN3A 5 0 PULSE 0 3 0 10NS 10NS 160NS 800NS VIN3B 6 0 PULSE 0 3 0 10NS 10NS 320NS 1600NS VIN4A 7 0 PULSE 0 3 0 10NS 10NS 640NS 3200NS VIN4B 8 0 PULSE 0 3 0 10NS 10NS 1280NS 6400NS X1 1 2 3 4 5 6 7 8 9 10 11 12 0 13 99 FOURBIT RBITO 9 0 1K RBIT1 10 0 1K RBIT2 11 0 K RBIT3 12 0 1K RCOUT 13 0 1K Transmission-Line Inverter The following file simulates a transmission-line inverter. This example requires two transmission-line elements because two propagation modes are used. In the case of a coaxial line, the first line (T1) models the inner conductor with respect to the shield, and the second line (T2) models the shield with respect to the outside world. V1 1 0 PULSE 0 1 0 0.1N R1 1 2 50 X1 2 0 0 4 TLINE R2 4 0 50 .SUBCKT TLINE 1 2 3 4 T1 1 2 3 4 ZO=50 TD=1.5NS T2 2 0 4 0 ZO=100 TD=1NS .ENDS TLINE Sample Subcircuit File Circuit File SAMPLE.C SUBCIRCUIT RTOP11 1 RTOP22 2 RTOP33 3 RTOP44 5 RTOP55 5 VTOP11 1 December 1998 EXAMPLE 0 1K 0 2K 0 3K 0 4K 0 5K 0 PWL 0 .6 200N .7 600N .7 401 800N .6 1U .6 Product Version 4.4.2 Cadence SPICE Reference Manual Subcircuits VTOP22 ETOP11 ITOP11 ITOP22 FTOP11 FTOP22 DTOP11 DTOP22 DTOP33 DTOP44 QTOP11 QTOP22 QTOP33 .MODEL .MODEL .MODEL X1234 V1ST11 I1ST11 R1ST11 R1ST22 R1ST33 E1ST11 E1ST22 G1ST11 G1ST22 G1ST33 F1ST11 F1ST22 F1ST33 F1ST44 Q1ST11 Q1ST22 D1ST11 J1ST11 J1ST22 M1ST11 .MODEL X2 2 .ENDS V2ND11 2 0 .65 3 0 1 0 1.0 0 4 100U 0 7 200U 5 0 VTOP11 1M 8 0 VTOP22 1.0 4 6 DT 8 0 DT 7 0 DT 6 0 DT 1 1 0 QTN 2 2 0 QTN 0 0 6 QTP DT D QTN NPN QTP PNP 5 LEVEL1 1 0 .5 6 0 10U 1 0 1K 2 0 2K 3 0 3K 2 0 1 0 1.0 5 0 1 0 2.0 0 3 1 0 1.0M 0 4 1 0 2.0M 0 5 1 0 3.0M 0 7 V1ST11 1.0 0 8 V1ST11 .2M 0 8 V1ST11 .4M 0 8 V1ST11 .6M 5 5 0 QTN 0 0 5 QTP 4 0 DT 0 0 6 JFET 0 0 8 JFET 7 7 0 0 NMOS L=10UM NMOS NMOS LEVEL2 LEVEL1 1 0 1.0 December 1998 W=100UM 402 AS=40UM AD=40UM Product Version 4.4.2 Cadence SPICE Reference Manual Subcircuits R2ND11 1 0 1K H2ND11 2 0 V2ND11 1.0 H2ND22 3 0 V2ND11 2.0 G2ND11 0 4 1 0 1M G2ND22 5 0 1 0 2M M2ND11 2 2 0 0 NMOS L=10UM M2ND22 3 3 0 0 NMOS L=10UM M2ND33 0 0 5 5 NMOS L=10UM J2ND11 0 0 4 JFETP .MODEL JFETP PJF .ENDS LEVEL2 W=50UM W=55UM W=50UM AS=30UM AS=35UM AS=30UM AD=40UM AD=45UM AD=40UM USE File SAMPLE.S *THIS IS A SAMPLE TEST FOR SUBCIRCUITS SIM SAMPLE KEEP 1 2 X1234^1 X1234^2 X1234^X2^1 SWEEP TIME FROM 0 TO .5U BY 50N GO OPEN 1 W1 PROBE.1 NV * DISPLAY.1 NODE X1234^1 DISPLAY.1 ELEMENT X1234^R* DISPLAY.1 DEVICE X1234^Q1ST11 DISPLAY.1 MODEL J* PROBE.1 NV 1,2 X1234^* X1234^X2^2 PRINTVS.1 V(X1234^2) QUIT X1234^X2^2 Output from SAMPLE NODE VOLTS NODE VOLTS NODE VOLTS TOP LEVEL CIRCUIT 1) 0.60000 2) 0.65000 3) 0.60000 4) 1.1652 5) 0.63924 6) 0.57364 7) 0.60938 8) 0.65760 SUBCIRCUIT: X1234 LOCAL NODES 1) 0.50000 6) -2.48457E-02 2) 0.50000 5) 1.00000 4) 0.65073 7) -0.41984 8) -1.49944E-03 PASSED NODES 3) 0.63924 SUBCIRCUIT: X1234^X2 December 1998 403 NODE VOLTS Product Version 4.4.2 Cadence SPICE Reference Manual Subcircuits LOCAL NODES 1) 1.00000 2) -1.00000E-03 3) 4) 0.64165 PASSED NODES 5) 0.50000 ----- NODE TABLE----NODE: X1234^1 SUBCIRCUIT: X1234 R1ST11 V1ST11 ----- RESISTORS ----NAME NODES VALUE SUBCIRCUIT: X123^4 R1ST11 1 0 1.000000D+03 R1ST22 2 0 2.000000D+03 R1ST33 5 0 3.000000D+03 SUBCIRCUIT: X1234^X2 LOCAL NODES 2)) -1.00000E-03 V(X1234^2) 0.000E+00 5.000E-01 5.000E-085.000E-01 1.000E-07 5.000E-01 1.500E-07 5.000E-01 2.000E-07 5.000E-01 2.500E-07 5.000E-01 3.000E-07 5.000E-01 3.500E-07 5.000E-01 4.000E-07 5.000E-01 4.500E-07 5.000E-01 5.000E-07 5.000E-01 December 1998 -2.00000E-03 404 Product Version 4.4.2 Cadence SPICE Reference Manual 10 Examples ■ ■ Resistor and Capacitor SweepDifferential Pair ❑ Resistor Sweep ❑ Capacitor Sweep Simple Op Amp Macromodel ❑ File: BJTOP.S ■ Nonlinear Capacitor Macromodel ■ Nonlinear Inductor Macromodel Resistor and Capacitor Sweep The circuit file for the resistor and capacitor sweep follows: SAMP.C SAMPLE CIRCUIT VDC 1 0 1VOLT AC 1 R1 1 2 1K R2 2 0 R2 C2 2 0 CAPVAL The schematic below corresponds to the circuit file. December 1998 405 Product Version 4.4.2 Cadence SPICE Reference Manual Examples Example Schematic R1 1 2 C2 R2 VDC Resistor Sweep ********************** RESISTOR SWEEP **************************** * * FILE TO SHOW HOW CADENCE SPICE CAN BE USED TO SWEEP A RESISTOR AND * PLOT THE RESULTING NODE VOLTAGE OF A CIRCUIT. * * SETUP ARRAYS FOR 3 RESISTOR VALUES AND 3 OUTPUT VOLTAGE VALUES. * SET RESISTOR SWEEP VALUES INTO THE ARRAY. * ARRAY RVALUE(3) OUTPUT(3) SET RVALUE(1)=1K RVALUE(2)=2K RVALUE(3)=2.5K * * SIM THE CIRCUIT FILE AND BEGIN THE LOOP OVER THE RESISTORS. NODE * NUMBER TWO’S VOLTAGE IS STORED INTO ARRAY OUTPUT() EACH ANALYSIS SIM SAMP SET CAPVAL=1UF * LOOP K FROM 1 TO 3 BY 1 SET R2=RVALUE(K) GO SET OUTPUT(K)=VDC(2) ENDLOOP * PLOT OUTPUT(K):P VS K FROM 1 TO 3 BY 1 December 1998 406 Product Version 4.4.2 Cadence SPICE Reference Manual Examples Resistor Sweep File Output OUTPUT(K):P VS K FROM 1 TO 3 BY 1 40.000E-02 60.000E-02 80.000E-02 • • • • • • • • • • • • • • • • • • • • • 5.000E-01 • 1 • • • 6.667E-01 • • • 1•• 7.143E-01 • • • •1 • • • • • • • • • • • • • • • • • • • • • • Y1 1.000E+00 2.000E+00 3.000E+00 Capacitor Sweep ************************ CAPACITOR SWEEP ************************* * * FILE TO SHOW HOW CADENCE SPICE CAN BE USED TO SWEEP A CAPACITOR * AND PLOT 3 DIFFERENT FREQUENCY RESPONSES ON THE SAME GRAPH. * * SETUP ARRAYS FOR 3 CAPACITOR VALUES AND 3 SETS OF OUTPUT VOLTAGE * VALUES. 11 SWEEP FREQUENCY POINTS PER ANALYSIS. SET CAPACITOR * SWEEP VALUES INTO THE ARRAY. ARRAY CVALUE(3) OUTPUT(11,3) SET CVALUE(1)=.010 CVALUE(2)=0.020 CVALUE(3)=.030 * * SIM THE CIRCUIT FILE AND BEGIN THE LOOP OVER THE CAPACITORS. * NODE NUMBER TWO’S MAGNITUDE VS FREQUENCY IS STORED INTO ARRAY * OUTPUT() EACH ANALYSIS. SIM SAMP SET R2=1K SWEEP FREQ FROM 2K TO 200K DEC 5 KEEP 2 * LOOP K FROM 1 TO 3 BY 1 SET CAPVAL=CVALUE(K) GO LOOP FREQ FROM 2K TO 200K DEC 5 SET OUTPUT(INDEX,K)=VM(2) ENDLOOP ENDLOOP * * PLOT OUTPUT(INDEX,1):PL OUTPUT(INDEX,2):PL OUTPUT(INDEX,3):PL Note: This example also illustrates the INDEX parameter, which is the internal pass counter for loop, oplot, plot, and wplot commands. This parameter counts the number of passes for the innermost loop only. Do not reset the INDEX parameter. December 1998 407 Product Version 4.4.2 Cadence SPICE Reference Manual Examples Capacitor Sweep Output The figure below shows the output. OUTPUT(INDEX,1):PL OUTPUT(INDEX,2):PL OUTPUT(INDEX,3):PL Y1 2.000E+03 3.170E+03 5.024E+03 7.962E+03 1.262E+04 2.000E+04 3.170E+04 5.024E+04 7.962E+04 1.262E+05 2.000E+05 7.958E-06 5.021E-06 3.168E-06 1.999E-06 1.261E-06 7.958E-07 5.021E-07 3.168E-07 1.999E-07 1.261E-07 7.958E-08 Y2 Y3 3.979E-06 2.510E-06 1.584E-06 9.994E-07 6.306E-07 3.979E-07 2.510E-07 1.584E-07 9.994E-07 6.306E-08 3.979E-08 2.653E-06 1.674E-06 1.056E-06 6.663E-07 4.204E-07 2.653E-07 1.674E-07 1.056E-07 6.663E-08 4.204E-08 2.653E-08 10.000E-09 0.100000E-03 ••••••••••••••••••••• • • 32 1 • • •32 1 • • 32 1 • • 32 1 • • 32 1 • • 32 1 • • 32 1 • • 32 1• • • 32 1 • • • 32 1 • • • 32 1 • • ••••••••••••••••••••• Differential Pair The following example finds the gain of a simple differential pair with the collector resistor varied. The diff.c circuit description file is shown below: SIMPLE DIFFERENTIAL PAIR VCC 7 0 12 VEE 8 0 -12 VIN 1 0 AC 1 RS1 1 2 1K RS2 6 0 1K Q1 3 2 4 MOD1 Q2 5 6 4 MOD1 RC1 7 3 10K RC2 7 5 RC2 RE 4 8 10K .MODEL MOD1 NPN BF=50 VA=50 IS=1.0E-12 RB=100 TF=10NS TR=10NS December 1998 408 Product Version 4.4.2 Cadence SPICE Reference Manual Examples The schematic for this circuit is below. (Refer to the “Capacitor Sweep” section for a note about the INDEX parameter.) Differential Pair Schematic 7 5 3 2 1 Q1 Q2 6 4 RS1 + RS2 RE VIN + N VCC - 8 VEE - The use file diff.s follows: ARRAY RVAR(3) VOUT(500,3) VPHASE(500,3) SET RVAR(1)=5K RVAR(2)=10K RVAR(3)=15K SIM DIFF SWEEP FREQ FROM 1K TO 10ME DEC 5 KEEP 5 LOOP K FROM 1 TO 3 BY 1 SET RC2=RVAR(K) GO GET AC LOOP FREQ FROM 1K TO 10ME DEC 5 SET VOUT(INDEX,K)=VM(5) SET VPHASE(INDEX,K)=VP(5) ENDLOOP ENDLOOP PLOT VOUT(INDEX,1):PL VOUT(INDEX,2):PL VOUT(INDEX,3):PL PLOT VPHASE(INDEX,1):P VPHASE(INDEX,2):P VPHASE(INDEX,3):P December 1998 409 Product Version 4.4.2 Cadence SPICE Reference Manual Examples Differential Pair Output VOUT(INDEX,1):PL VOUT(INDEX,2):PL VOUT(INDEX,3):PL Y1 1.000E+03 1.585E+03 2.512E+03 3.981E+03 6.310E+03 1.000E+04 1.585E+04 2.512E+04 3.981E+04 6.310E+04 1.000E+05 1.585E+05 2.512E+05 3.981E+05 6.310E+05 1.000E+06 1.585E+06 2.512E+06 3.981E+06 6.310E+06 1.000E+07 December 1998 3.594E+01 3.594E+01 3.594E+01 3.594E+01 3.594E+01 3.593E+01 3.593E+01 3.593E+01 3.591E+01 3.588E+01 3.578E+01 3.556E+01 3.500E+01 3.372E+01 3.103E+01 2.637E+01 2.024E+01 1.419E+01 9.403E+00 6.053E+00 3.845E+00 Y2 6.958E+01 6.958E+01 6.958E+01 6.957E+01 6.957E+01 6.957E+01 6.957E+01 6.956E+01 6.953E+01 6.945E+01 6.927E+01 6.881E+01 6.770E+01 6.514E+01 5.980E+01 5.063E+01 3.870E+01 2.705E+01 1.787E+01 1.145E+00 7.226E+00 Y3 0.100000E+00 1.00000E+03 ••••••••••••••••••••• • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 123 • • • 1 23 • • • 1 * • • • 123 • • •123 • • 123 • • 123 • • 123 • ••••••••••••••••••••• 1.008E+02 1.008E+02 1.008E+02 1.008E+02 1.008E+02 1.008E+02 1.008E+02 1.007E+02 1.007E-02 1.006E+02 1.003E+02 9.963E+01 9.797E+01 9.415E+01 8.623E+01 7.274E+01 5.537E+01 3.875E+01 2.540E+01 1.622E+01 1.016E+01 410 Product Version 4.4.2 Cadence SPICE Reference Manual Examples Differential Pair Output VPHASE(INDEX,1):P VPHASE(INDEX,2):P VPHASE(INDEX,3):P Y1 1.000E+03 1.585E+03 2.512E+03 3.981E+03 6.310E+03 1.000E+04 1.585E+04 2.512E+04 3.981E+04 6.310E+04 1.000E+05 1.585E+05 2.512E+05 3.981E+05 6.310E+05 1.000E+06 1.585E+06 2.512E+06 3.981E+06 6.310E+06 1.000E+07 -5.306E-02 -8.409E-02 -1.333E-01 -2.112E-01 -3.348E-01 -5.306E-01 -8.409E-01 -1.333E+06 -2.111E+00 -3.344E+00 -5.291E+00 -8.350E+00 -1.310E+01 -2.024E+01 -3.030E+01 -4.281E+01 -5.575E+01 -6.676E+01 -7.486E+01 -8.033E+01 -8.385E+01 Y2 -5.415E-02 -8.582E-02 -1.360E-01 -2.156E-01 -3.417E-01 -5.415E-01 -8.581E-01 -1.360E+00 -2.155E+00 -3.413E+00 -5.399E+00 -8.519E+00 -1.336E+01 -2.063E+01 -3.084E+01 -4.346E+01 -5.646E+01 -6.752E+01 -7.571E+01 -8.137E+01 -8.510E+01 Y3 -100.0E-00 100.0E+00 • ••••••••••••••••••• -5.523E-02 • * • -8.753E-02 • * • -1.387E-01 • * • -2.199E-01 • * • -3.485E-01 • * • -5.523E-01 • * • -8.752E-01 • * • -1.387E+00 • * • -2.198E+00 • * • -3.480E+00 • * • -5.506E+00 • *• • -8.687E+00 • *• • -1.362E+01 • *• • -2.101E+01 • * • • -3.136E+01 • * • • -4.411E+01 • * • • -5.716E+01 • * • • -6.825E+01 • * • • -7.655E+01 • *1 • • -8.239E+01 • * • • -8.632E+01 • *1 • • ••••••••••••••••••• • Simple Op Amp Macromodel The macromodel emulates the characteristics in the following table: Op Amp Macromodel Characteristics Specification Name Unit DC open loop gain DC gain V/V Ideal gain bandwidth product GBW Hz Open-loop output resistance ROUT ohm December 1998 411 Product Version 4.4.2 Cadence SPICE Reference Manual Examples Op Amp Macromodel Characteristics Specification Name Unit Slew rate SR V/s Input bias current IBIAS A Input offset voltage VOS V Common-mode rejection ratio CMRR dB Phase margin PM degree Call up the macromodel in a circuit file by the following command: USE BJTOP NAME IN+ IN- VOUT DCGAIN GBW ROUT SR IBIAS VOS CMRR PM The arguments can be constants or variables. There are limitations to the possible combinations of parameters: ■ The slew rate must be >4*VT*GBW. ■ If the CMRR is too small (<90 dB), it will affect the large-signal slew rate. ■ The phase margin must be <90 and >0. ■ The offset voltage VCS and CMRR should satisfy the inequality (VOS*(CMRR/20)**10)>10 ■ If MONTE=0 then the offset voltage will be zero, and the CMRR will be infinite, independent of VOS and CMRR. To obtain an offset voltage and CMRR set the parameter MONTE to 1, which also creates an offset current with a standard deviation of 0.1*IBIAS. Output capacitance loading has no effect in this model. The following circuit file (SRV.C) describes the circuit for testing the op amp macromodel: CIRCUIT TO V1 1 0 PWL RL 2 0 2K * * * USE BJTOP TEST OP AMP MODEL 0 0 TIN VIN 1 VIN AC 1 NAME IN+ IN- VO OP1 1 2 2 GAIN GBW ROUT SR IBIAS VOS CMRR PM 100K GBW 50 SR 1U 1M 120 PM The following use file (SRV.S) plots a family of macromodel transient responses for ten different slew rates. December 1998 412 Product Version 4.4.2 Cadence SPICE Reference Manual Examples * SLEW RATE VARIATIONS USE FILE ALTQUAL 9822USER SET TTYPE=6 SIM SRV KEEP 2 1 SET VIN=10 TIN=20N PM=45 SET GBW=10ME NIDENT=3 SWEEP TIME FROM 0 TO 1U BY 50N ARRAY VOUT(22,15) SET N=0 LOOP SR FROM 1E6 TO 21E6 BY 2E6 SET N=N+1 GO GET TRAN SET I=0 LOOP TIME FROM 0 TO 1U BY 50N SET I=I+1 SET VOUT(I,N)=V(2) ENDLOOP ENDLOOP WERASE WPLOT VOUT(INDEX,1) VOUT(INDEX,3) VOUT(INDEX,5) VOUT(INDEX,7)& VOUT(INDEX,9) VOUT(INDEX,11) File: BJTOP.S ****************** BIPOLAR OP AMP MACROMODEL ******************** * *FORMAT * *USE BJTOP NAME IN+ IN- VOUT DCGAIN GBW ROUT SR IBIAS VOS CMRR PM * &1 &2 &3 &4 &5 &6 &7 &8 &9 &10 &11 &12 * *SET HIGH IMPEDANCE RESISTANCE @RH=100K SET @RH=100K X&1 &2 &3 &4 &1 .SUBCKT &1 1 2 10 QP 6 1 3 QP QN 7 2 4 QN RL1 8 6 1.0/1M RL2 8 7 1.0/1M CL 6 7.5*1M*TAN(PI*(.5-&12/180))*SQRT((TAN(PI*(.5-&12/180)))**2+1)& /(2*PI*&6) RE1 3 5 TRACK(((&8/(2*PI*&6))-(2*BOLTZ*(TEMPDC+273))/CHARGE)/& 1M,&10/1M,1,0) RE2 4 5 TRACK(((&8/(2*PI*&6))-(2*BOLTZ*(TEMPDC+273))/CHARGE)/& 1M,&10/1M,1,0) IO 5 9 1M R0 5 0 (&10/1M)*(10.0**ABS(&11/20)) VP 8 0 15 VN 9 0 -15 GM1 100 0 6 7 SQRT((&8*(&5/(2*PI*&6*&7)))/@RH) GM2 0 10 100 0 SQRT((&8*(&5/(2*PI*&6*&7)))/@RH) RH 100 0 @RH CH 100 0 &5/(2*PI*&6*@RH) ROUT 10 0 &7 .MODEL QP NPN IS=1E-14 BF=TRACK(1M/(2*&9),.1*(1M/(2*&9)),1,0) .MODEL QN NPN IS=1E-14 BF=TRACK(1M/(2*&9),.1*(1M/(2*&9)),1,0) December 1998 413 Product Version 4.4.2 Cadence SPICE Reference Manual Examples Generalized Op Amp Macromodel +V RL1 CL RL2 + - GM1VL QPVL QN RE1 RE2 I R O O V H V OUT GM2V H R C H H R OUT -V V 10v V IN 20ns + - V OUT OP AMP Output of Slew Rate Variations USE File VOUT(INDEX,1) VOUT(INDEX,3) VOUT(INDEX,5) VOUT(INDEX,7) VOUT(INDEX,9) VOUT(INDEX,11) December 1998 414 Product Version 4.4.2 Cadence SPICE Reference Manual Examples 1.100 X 101 0.900 0.700 =1 1V/µs =2 5V/µs =3 9V/µs =4 13V/µs =5 17V/µs =6 21V/µs 0.500 0.300 0.100 -0.100 0.000 2.000 4.000 6.000 8.000 10.000 X 10-7 Nonlinear Capacitor Macromodel The macromodel emulates an arbitrary nonlinear capacitor. This macromodel uses the following files: poly_cap.stemplate file for non-linear capacitor cp.ctest circuit for poly_cap cp.sexample USE file December 1998 415 Product Version 4.4.2 Cadence SPICE Reference Manual Examples The poly_cap.s file can be changed to model C=F(v1, v2, . . .,vn I1, I2, . . .In) where F can be any function (including functions other than polynomials). This feature makes the nonlinear capacitor macromodel more powerful than the generic SPICE nonlinear capacitor and inductor. The procedure to describe the function is included in the template files. The test circuit plots the capacitance as a polynomial function of a ramping voltage and current, along with the polynomial itself for comparison. The following is the nonlinear capacitor file: poly_cap.s File ******************************************************************** * A Macromodel for a Nonlinear Capacitor * * This macromodel implements a nonlinear capacitor as a function of * ONE voltage pair. The same methodology can be used if more than * one voltage dependency is required. For AC analysis the capacitance * is a function of the DC value of the controlling voltage, i.e., * C = f(V1) transient analysis * C = f(V1dc) AC analysis * Thus the capacitor is fixed through the course of an AC analysis. * This methodology complies with the way all the internal bias * dependent capacitors are handled. * Syntax: * use poly_cap name n+ n- nc+ nc- p0 p1 p2 .... ******************************************************************** X&1 &2 &3 &4 &5 &1 .SUBCKT &1 1 2 3 4 FNLCAP 1 2 V0 1 ******************************************************************** * The following line is where you describe C=f(V,I). This functional * description can be implemented either by a “POLY” source or a UDCS. * Syntax: GNLCAP 30 0 POLY 1 3 4 P0 P1 P2 P3 P4 .... * 0r GNLCAP 30 0 POLY 1 3 4 EXTERN UUNAME P0 P1 ...... * For example the following is for: * * C = c0 + c1*V + c2*V**2 + .... + c10*V**10 * * (poly cap for an order of 10 or less) * ******************************************************************** GNLCAP 0 30 POLY 1 3 4 0 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 INLCAP 0 30 &6 **************************************** RNLCAP 30 0 1.0 ENLCAP 40 0 POLY 2 1 2 30 0 0 0 0 0 1.0 V0 40 50 0 CNLCAP 50 0 1.0 .ENDS &1 cp.s File set tend=200n set tdel=1n sim cp sweep time from 0 to tend by tdel keep all December 1998 416 Product Version 4.4.2 Cadence SPICE Reference Manual Examples keep i(v1) i(r1) go set y=7.5/tend array integ(nsweep) tt(nsweep) v1(nsweep) ic(nsweep) p(nsweep) loop i from 1 to nsweep set tt(i)=sweepvar(i) set time=tt(i) v1(i)=v(1) ic(i)=-i(v1)-i(r1) set p(i)=1p*(tt(i)*y)**4-15p*(tt(i)*y)**3+71p*(tt(i)*y)**2 -105p*(tt(i)*y)+100p endloop set init=sweepvar(2)*ic(2)/2 #Error in numerical integration because #of the discontinuous ic at t=0. #The error is caused by transferring ic(0+) #to t=tinit by the simulator. ic(0+) #is non-zero but the simulator uses ic=0 #at t=0 (which is really ic(0-)). set integ(1)=init loop i from 2 to nsweep set integ(i)=init+(ic(i)+ic(i-1))*(tt(i)-tt(i-1))/2 set init=integ(i) endloop erase oplot integ(i)/v1(i) p(i) tt(i) vs i from 2 to nsweep cp.c File V1 1 0 PWL 0 0 200n 7.5 500n 7.5 R1 1 0 1K use poly_cap cc1 1 0 1 0 100p -105p 71p -15p 1p Nonlinear Inductor Macromodel This macromodel emulates an arbitrary nonlinear inductor. This macromodel uses the following files: poly_ind.stemplate file for non-linear inductor cp.ctest circuit for poly_ind cl.sexample USE file Please note that the poly_ind.s file can easily be changed to model L=F(v1,v2,....,vn,I1,I2,....,In), where F can be any function (including functions other than polynomials), making this macromodel much more powerful than the generic SPICE nonlinear capacitor and inductor. The procedure to describe the functions is included in the template files. The test circuit plots the inductance as a polynomial function of a ramping voltage and current, along with the polynomial itself for comparison. December 1998 417 Product Version 4.4.2 Cadence SPICE Reference Manual Examples The following is the nonlinear inductor file: poly_ind.s File ******************************************************************** * A Macromodel for a Nonlinear Inductor * * * This macromodel implements a nonlinear inductor as a function of * ONE current. The same methodology can be used if more than * one current dependency is required. For AC analysis the capacitance * will be a function of the DC value of the controlling current, i.e., * L = f(I1) transient analysis * L = f(I1dc) AC analysis * Thus the inductor is fixed through the course of an AC analysis * This methodology complies with the way all the internal bias * dependent inductors are handled. * Syntax: * use poly_ind name n+ n- nc+ nc- p0 p1 p2 .... ******************************************************************** X&1 &2 &3 &4 &5 &1 .SUBCKT &1 1 2 3 4 ENL 1 11 50 0 1 V00 11 2 0.0 ******************************************************************** * The following line is where you describe L=f(V,I). This functional * description can be implemented either by a “POLY” source or a UDCS. * Syntax: GNLCAP 30 0 POLY 1 3 4 P0 P1 P2 P3 P4 .... * * 0r GNLCAP 30 0 POLY 1 3 4 EXTERN UUNAME P0 P1 ...... * For example the following is for: * L = l0 + l1*I + l2*I**2 + .... + l10*I**10 * (poly ind for an order of 10 or less) ******************************************************************** FNLL 0 30 POLY 1 V00 0 &7 &8 &9 &10 &11 &12 &13 &14 &15 &16 INL 0 30 &6 ************************************ V0 30 40 0 RNL 40 0 1.0 FNL 0 50 POLY 2 V0 V00 0 0 0 0 1.0 LNL 50 0 1.0 .ENDS &1 cl.s File set tend=200n set tdel=1n sim cl sweep time from 0 to tend by tdel keep all keep i(I1) go set y=7.5/tend array integ(nsweep) tt(nsweep) i1(nsweep) vl(nsweep) p(nsweep) loop j from 1 to nsweep December 1998 418 Product Version 4.4.2 Cadence SPICE Reference Manual Examples set tt(j)=sweepvar(j) set time=tt(j) i1(j)=i(I1) vl(j)=v(2) set p(j)=1p*(tt(j)*y)**4-15p*(tt(j)*y)**3+71p*(tt(j)*y)**2 -105p*(tt(j)*y)+100p endloop set init=sweepvar(2)*vl(2)/2 #Error in numerical integration because of #the discontinuous vl at t=0. #The error is causes by transferring vl(0+) #to t=tinit by the simulator. vl(0+) #is non-zero but the simulator uses vl=0 #at t=0 (which is really vl(0-)). set integ(1)=init loop i from 2 to nsweep set integ(i)=init+(vl(i)+vl(i-1))*(tt(i)-tt(i-1))/2 set init=integ(i) endloop erase oplot integ(i)/I1(i) p(i) tt(i) vs i from 2 to nsweep cl.c File I1 0 1 PWL 0 0 200n 7.5 500n 7.5 R1 1 2 1K use poly_ind ll1 2 0 2 0 100p -105p 71p -15p 1p December 1998 419 Product Version 4.4.2 Cadence SPICE Reference Manual A Monte Carlo Analysis The Monte Carlo statistical capability is applicable to DC, AC, and transient analyses. You can also use Monte Carlo functions in general Cadence SPICE commands. Set the MONTE variable to 1 to invoke Monte Carlo. Setting MONTE to 0 (the default value) turns off Monte Carlo and causes the GAUSS, LOGNORMAL, TRACK, and UNIFORM functions to return their mean values. Four functions characterize the Monte Carlo method in the Cadence SPICE program: UNIFORM (mn,tol,n) GAUSS (X1,s1,N) TRACK (X2,s2,N,r) LOGNORMAL (mn,std) The GAUSS function is a Gaussian random number generator with mean value X1 and standard deviation s1. The integer N specifies one of the possible 20 independent generators. The TRACK function generates random numbers correlated to the resultant number of a GAUSS function call. Parameter X2 defines the mean and s2 defines the standard deviation of the TRACK number. The r parameter is the correlation or tracking coefficient to the number generated by GAUSS. The N parameter (an integer between 1 and 20, inclusive) relates the TRACK function to the corresponding GAUSS function. Only one GAUSS function is specified for each N integer while many TRACK functions can use the same value of N. The r parameter (real number between -1 and 1, inclusive) is the tracking coefficient, which determines how closely correlated the TRACK number is to its corresponding GAUSS number. A tracking coefficient of 1 tracks a corresponding Gaussian number exactly. For example, the value of TRACK(3,2,1,1) is equal to the value of GAUSS(3,2,1). A tracking coefficient of 0 results in a completely independent Gaussian number, that is, TRACK(3,2,1,0) is December 1998 420 Product Version 4.4.2 Cadence SPICE Reference Manual Monte Carlo Analysis independent of GAUSS(3,2,1). The closer a tracking coefficient is to 1, the more closely correlated the two numbers are. An example circuit file using the Monte Carlo method follows: (MCT.C) MONTE CARLO TEST V1 1 0 1 R1 1 2 TRACK(1K,200,2,.95) R2 2 0 TRACK(1K,200,2,-.95) The figure below defines the circuit. The use file that simulates this circuit follows: (MCT.S) SIM MCT SET MONTE=1 ARRAY VOUT(100) LOOP M FROM 1 TO 100 BY 1 GO GET DC SET VOUT(M)=VDC(2) ENDLOOP SET NBINS=20 HISTO VOUT(1) 100 .2 .8 We recommend that a GAUSS function not be used in a circuit file involving correlated parameters because the order in which the functions are specified is important when updating the values of the 20 seeds. December 1998 421 Product Version 4.4.2 Cadence SPICE Reference Manual Monte Carlo Analysis Circuit Used in Monte Carlo File Example R1 V1 V2 + - R2 Each time GAUSS is called, the seed value of the Nth generator is updated and a new Gaussian number is generated. Subsequent calls to a TRACK function with the same value as N will track the last GAUSS number to use that same value of N. The TRACK function does not update the seed of its GAUSS generator. All 20 seeds are updated following a go command. In the mct.s example file, each time through the loop, the call to TRACK using seed number 2 for the two resistors uses a different seed than the two calls to TRACK in the previous iteration. Also, because of the method used when the seeds are updated (that is, after a go), the two resistor values during a single iteration are never identical. In the example, the value of R1 is a Gaussian random number with a mean of 1K and a standard deviation of 200 that is generated from seed number 2, and is tracked with a tracking coefficient of 0.95. R2 is another Gaussian random number with the same mean, standard deviation, and seed, but with a tracking coefficient of -0.95. Therefore, if R1 is larger than its mean value by a certain percentage, R2 will be smaller by that certain percentage with a 95% probability. The example runs 100 iterations and creates histograms of the 100 values of VOUT. A typical histogram from this example follows. The results could vary slightly depending on the starting seed value and the number of times through the Monte Carlo loop. December 1998 422 Product Version 4.4.2 Cadence SPICE Reference Manual Monte Carlo Analysis Note: Refer to the “STATF: Correlated Random Number Generator” appendix for information on correlated random number generation (by means of the STATF function). Sample Histogram Cell bounds Cum % QTY 200.0E-03 0.0 0 230.0E-03 0.0 0 260.0E-03 0.0 0 290.0E-03 1.0 1 320.0E-03 2.0 1 X 350.0E-03 6.0 4 XXXX 380.0E-03 13.0 7 XXXXXXX 410.0E-03 20.0 7 XXXXXXX 440.0E-03 30.0 10 XXXXXXXXXX 470.0E-03 45.0 15 XXXXXXXXXXXXX XX 500.0E-03 56.0 11 XXXXXXXXXXX 530.0E-03 65.0 9 XXXXXXXXX 560.0E-03 83.0 18 XXXXXXXXXXXXX XXXXX 590.0E-03 93.0 10 XXXXXXXXXX 620.0E-03 96.0 3 XXX 650.0E-03 99.0 3 XXX 680.0E-03 99.0 0 710.0E-03 100.0 1 740.0E-03 100.0 0 770.0E-03 100.0 0 800.0E-03 100.0 0 # Points Minimum Maximum 100 284.1E-03 739.7E-03 481.6E-03 December 1998 > or = X X Average 423 Std. Dev Num per 'X’ 83.27E-03 1 Product Version 4.4.2 Cadence SPICE Reference Manual Monte Carlo Analysis December 1998 424 Product Version 4.4.2 Cadence SPICE Reference Manual B STATF: Correlated Random Number Generator The Cadence SPICE program can generate random variables by means of the STATF function. All of the random variables have a Gaussian distribution. A call to STATF must be in the following form: SET DUMMY=STATF (MN(1),STD(1),CORR(1),RAND(1),N) MN, STD, and CORR arrays are inputs to the function that you set before the call to STATF. Also specify argument N. Array RAND is the output array, which you dimension to length N. Length N must be less than or equal to 50. DUMMY is a dummy variable. MN and STD are one-dimensional arrays of length N that contain the means and standard deviations of Gaussian distributions for the N random variables. The Ith entries in these two arrays relate to the Ith mean and standard deviation. CORR is a one-dimensional array of length (N(N-1))/2 containing the correlation coefficient among the N Gaussian distributions. The first entry in the array is ρ1,2 , (the correlation between random variables 1 and 2); the second entry is ρ1,3, ...; the (N-1)th entry will be ρ1,n; the Nth entry will be ρ2,3, ...; and the last entry will be ρn-1,n. Only the upper-triangular entries of the correlation coefficient matrix need be stored since, for all i and j, it is true that ρi,j =1 and ρi,j = ρj,i. December 1998 425 Product Version 4.4.2 Cadence SPICE Reference Manual STATF: Correlated Random Number Generator For example, if N=3 and the correlation coefficient matrix is: ρ1,1 ρ1,2 ρ1,3 ρ2,1 ρ2,2 ρ2,3 ρ3,1 ρ3,2 ρ3,3 For N=3, the length of array CORR is (3(3-1))/2=3. Only the following three elements need be stored in array CORR: - ρ1,2 ρ1,3 - - ρ2,3 - - - Therefore, CORR(1)=ρ1,2; CORR(2)=ρ1,3; CORR(3)=ρ2,3. If MONTE=1, the output of STATF contains the N generated random variables returned in array RAND. The Ith entry is the random number assigned to the Ith variable for the current call to STATF. Successive calls to STATF, each specifying the same set of arrays, generate a sequence of sets of N numbers (the successive contents of RAND), which are statistically related as specified by arrays MN, STD, and CORR. If MONTE=0, array RAND outputs the mean value from array MN. An example is the following use file: ARRAY MN(3 STD(3) COR(3) Y1(2500) Y2(2500) Y3(2500) Y(3) SET MN(1)=1K MN(2)=5K MN(3)=7K SET STD(1)=.1K STD(2)=.5K STD(3)=.7K SET COR(1)=.453314 COR(2)=.179308 COR(3)=.738461 SET Y(1)=0 Y(2)=0 Y(3)=0 LOOP I FROM 1 TO 2500 SET DUMMY=STATF(MN(1),STD(1),Y(1),3) December 1998 426 Product Version 4.4.2 Cadence SPICE Reference Manual STATF: Correlated Random Number Generator SET YI(1)=Y(1) ENDLOOP Y2(I)=Y(2) Y3(I)=Y(3) In this example, each of arrays Y1, Y2, and Y3 are Gaussian distributed arrays of random variables. Array Y1 has a mean of approximately 1000 and a standard deviation of approximately 100. Y2 has a mean of 5000 and a standard deviation of 500. Y3 has a mean of 7000 and a standard deviation of 700. The correlation coefficient between array Y1 and Y2 should be very close to the value of COR(1), (0.453314). The correlation between Y1 and Y3 should be approximately 0.179308; and between Y2 and Y3, approximately 0.738461. December 1998 427 Product Version 4.4.2 Cadence SPICE Reference Manual C Fourier Analysis The Cadence SPICE program includes an option for generating the harmonics of an arbitrary periodic waveform. The following command invokes Fourier analysis: call FORSER(VAR(1), ASTAGE, F(1,1)) ASTAGE 2**ASTAGE is the number of equally spaced time points in one period of the general function V(t). ASTAGE is an integer less than or equal to 13, and 1+(2**ASTAGE)/2 is the number of calculated harmonics. VAR(I) is dimensioned in an ARRAY statement as VAR(2**ASTAGE). The array VAR(I) contains the values of V(t) at each time point. F(1,1) is dimensioned in an array statement as F(2,1+ (2**ASTAGE)/2). The array F(1,I) contains the returned magnitudes of the first 1+(2**ASTAGE)/2 harmonics. The array F(2,I) contains the returned phase angle in degrees of the first 1+(2**ASTAGE)/2 harmonics. For ASTAGE>10, the first 990 values are returned and F(1,1) is dimensioned as F(2,991). December 1998 428 Product Version 4.4.2 Cadence SPICE Reference Manual Fourier Analysis The Fourier series of the function f(t) having period T is defined as follows : ∞ a0 f ( t ) = ----- + ∑ c n cos ( nwt – ψ n ) 2 , n=1 cn = 2 a n + b n2 b n Ψ n = tan– 1 ----- a n 2 a n = --T , , T ⁄2 ∫ f (t) cos ( nwt ) dt , f (t) cos ( nwt ) dt . –T ⁄ 2 and 2 b n = --T T ⁄2 ∫ –T ⁄ 2 After the call to FORSER , a0 F (1,1) = ----2 F (2,1) = 0 F (1,2) = c 1 b 1 F (2,2) = atan ----- a 1 F (1,3) = c 2 b 2 F (2,3) = atan ----- a 2 • • • December 1998 429 Product Version 4.4.2 Cadence SPICE Reference Manual D Cadence SPICE Limits Type Description Limit altqual Number of alternate qualifiers specified at one time 20 blocked if-then-else Number of nesting levels 15 controlled source subroutines Maximum number used 18 filenames Maximum length of complete directory pathname plus file name 250 histogram Number of points in HISTOGRAM Number of bins for histo Number of bins for whisto and thisto 5250 101 101 if-then-else Levels of nesting 15 keep Number of separate keep nodes Number of keep currents 200 200 line Number of characters 3000 loops Number of nesting levels 15 use Numbers of levels deep Number of passed arguments 20 100 usem Number of levels deep 1 user functions Number of functions 2000 user subroutines Number of subroutines Number of arguments 100 10 Note: When calculating the number of characters in all names, include one trailing blank for each name. December 1998 430 Product Version 4.4.2 Cadence SPICE Reference Manual E Node Referencing ■ Introduction ■ Conventions ■ Restrictions and Limitations ■ Example Introduction Node referencing (N-R) superimposes circuit elements upon the internal structures of the semiconductor device models. This technique allows you to simulate unconventional device structures and environmental effects. Consider, for example, the following circuit file, GD.C, for simulating the transient photoresponse of an NPN transistor. *Circuit file to examine transient response of BJT Q1 1 2 3 0 NPNMOD AREA=1 VCOLL 1 0 DC 5.0V VBASE 2 0 DC 1.0V RE 3 0 10OHMS IPPC @(Q1,CP) @(Q1,BP) PULSE 0.0 IMAXC 1N 1N IPPE @(Q1,EP) @(Q1,BP) PULSE 0.0 IMAXE 1N 1N USEM NPNMOD PW PW 1 1 This file uses two independent current sources to model the prompt current generated within the base-emitter and base-collector depletion regions. The current sources are referenced (internal emitter)-to-(internal base) and (internal collector)-to-(internal base), using the N-R technique described in the following sections. Therefore, the independent current sources simulate photocurrents generated within the depletion regions of the BJT, internal to any device parasitic resistances in the NPNMOD.M model file. December 1998 431 Product Version 4.4.2 Cadence SPICE Reference Manual Node Referencing Conventions Node referencing supports the following circuit elements: ■ independent voltage sources ■ independent current sources ■ voltage-dependent sources (for placement of the source and its controlling voltages) ■ current-dependent sources (for placement of the source only) The N-R convention for these circuit elements is as follows: XXXXXX @(DNAME1,ND1) characteristics.> @(DNAME2,ND2) . . . . <circuit element XXXXXX name of one of the four circuit element types @(param1,param2) specifies that this node of the circuit element XXXXXX is referenced to a node described by the param1 and param2 parameters DNAME1(param1) name of a device within the same circuit level (top level or subcircuit) ND1(param2) node designator for the device type referenced by DNAME(param1) The node designators for the devices use the following formats: BJTs: C B E S CP BP EP external collector node external base node external emitter node external substrate node internal collector node internal base node internal emitter node MOSFETs, JFETs, and MESFETs: D G S external drain node external gate node external source node December 1998 432 Product Version 4.4.2 Cadence SPICE Reference Manual Node Referencing B external body node DP internal drain node GP internal JFET gate node SP internal source node GBP internal back gate (Level-3 JFET) node Diodes: P N PP external anode external cathode internal anode SOI MOSFETs: D GF S GB B DP SP BP external drain node external front-gate node external source node external back-gate (substrate) node external body node internal drain node internal source node internal body node Restrictions and Limitations ■ You must define any element that uses node referencing by the first five alphanumeric characters. For example, the following lines generate an internal error because the first five characters of each circuit element (GMOS1) are the same for both voltage-controlled current sources. GMOS10 @(MOS10,DP) @(MOS10,B) @(MOS10,DP) @(MOS10,B) GRAD GMOS11 @(MOS11,DP) @(MOS11,B) @(MOS11,DP) @(MOS11,B) GRAD ■ Internal checks for voltage-source loops and current-source cutsets are done with all node referencing devices (Circuit A in figure). After checks are completed, the nodes are reassigned to the internal nodes of the referenced devices, if that is the objective (Circuit B in figure). This should not be a problem if you use node referencing as intended. December 1998 433 Product Version 4.4.2 Cadence SPICE Reference Manual Node Referencing Circuit A Circuit B ■ Subcircuit use of node referencing requires that any circuit element that invokes node referencing be on the same circuit level as the referenced device. Node referencing used December 1998 434 Product Version 4.4.2 Cadence SPICE Reference Manual Node Referencing within a subcircuit can only refer to devices within that subcircuit, not to devices within the “parent” subcircuit or nominal circuit. Example The following example simulates the effect of ionizing radiation on a cross-coupled inverter pair static RAM cell. The example includes parasitics of finite interconnect resistance to model the effect of “rail-span collapse.” The photocurrents are implemented as “voltagedependent” current sources. By performing a DC sweep of their referenced voltage, VGAMMA, you can achieve a DC sweep of the induced photocurrent level. December 1998 435 Product Version 4.4.2 Cadence SPICE Reference Manual Node Referencing Circuit R 6 SS = 50W 3 SP1 GPWELL SP2 + - V = 5.0V DD GPP2 GPP1 2 1 VGAMMA + RGAMMA GPN1 GPN2 7 SN2 SN1 R DD = 50W Circuit File *Circuit file to test n-r technique.Also test usage with BSIM *devices, mixed node specification (both numeric and n-r) for *current source, and multidimensional current sources. SP1 1 2 6 6 PM2DU2 W=6.4U L=1.6U SN1 1 2 7 7 NM2DU1 W=6.4U L=1.6U December 1998 436 Product Version 4.4.2 Cadence SPICE Reference Manual Node Referencing SP2 2 1 6 6 PM2DU2 W=6.4U L=1.6U SN2 2 1 7 7 NM2DU1 W=6.4U L=1.6U *Line resistances RDD 6 3 50 RSS 7 0 50 *Supply voltages VDD 3 0 5.0 VSS 4 0 0.0 USEM NM2DU1 USEM PM2DU2 *Rad-effect elements GPP1 @(SP1,SP) @(SP1,DP) POLY 1 100 GPN1 @(SN1,DP) @(SN1,SP) POLY 1 100 GPP2 @(SP2,SP) @(SP2,DP) POLY 1 100 GPN2 @(SN2,DP) @(SN2,SP) POLY 1 100 GPWELL 6 7 POLY 1 100 0 3.44e-10 VGAMMA 100 0 GAMMA RGAMMA 100 0 1K December 1998 437 0 0 0 0 6.88E-12 6.88E-12 6.88E-12 6.88E-12 Product Version 4.4.2 Cadence SPICE Reference Manual F User-Defined Subroutines ■ Customizing the Cadence SPICE Program ■ Using Subroutines ■ Examples Customizing the Cadence SPICE Program Note: The features described in this chapter are not part of the standard Cadence SPICE program. Contact your local Cadence field office for information on availability. You can link your own FORTRAN functions and subroutines and then call them directly from the Cadence SPICE program using the cdsload macro. The syntax is: cdsload -s [sublist] The arguments are files that contain the following lists: sublist filenames of files that contain FORTRAN function definitions, one name per line. These functions link to the program and are treated as normal functions. (Refer to the “User-Defined FORTRAN Functions” appendix.) Note: To avoid name conflicts with Cadence SPICE subroutines, begin all user-defined subroutine names with the letters uu. If you load two subroutines with the same name, the link/loader does not flag an error, but an error occurs during execution. Example cdsload -s sub1 December 1998 438 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Subroutines Using Subroutines You can define your own subroutines and link them to the Cadence SPICE program. Once you link these subroutines, you can access them while running the program by entering call sub1 where sub1 is the subroutine. Perform the following steps to use your subroutines: 1. For each subroutine that you define, create a file that contains the subroutine and has the same name as the subroutine. You can pass no more than ten arguments to a user-defined subroutine, and all the arguments must be double precision if you call the subroutine directly from the Cadence SPICE program. Use one of the following procedures if you need integer arguments: ❑ Convert the argument to an integer inside the subroutine using the INT (integer) function. ❑ Write a small subroutine that converts the real arguments into integers (using INT), and then calls the subroutine. (See “Examples” section.) 2. Generate a sublist file that contains a list of the user-defined subroutine names, one name per line. Also include any subroutines that are called by a user-defined subroutine. The subroutine names in sublist can have blanks before the name, but it is preferable that they begin in column one. Acceptable types of names are ❑ <filename> ❑ <pathname/filename> 3. Link your subroutines to the Cadence SPICE program using the cdsload macro to create a “customized” version of the program. Type cdsload -s sublist You can also have user-defined controlled sources in conjunction with user-defined subroutines by typing cdsload <-s subload> <-u ucdslist1> 1. Begin the Cadence SPICE program by entering UcdsSpice. The revisions of the program and cdsload must match. 2. To access a user-defined subroutine, use the call command, which has the following syntax (see the “Commands” chapter): call subname(arg1,...,arg10) December 1998 439 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Subroutines Examples The following examples include ■ subroutine to be linked to the Cadence SPICE program, GAUSS1 ■ subroutine list to be used during cdsload, FTEST ■ data file of matrix for Gaussian test, MTEST ■ answer file that contains the answers to the matrix, ANSW ■ example Cadence SPICE session GAUSS1 is an example of a user-defined subroutine that converts real to integer and then calls a standard subroutine. SUBROUTINE GAUSS1(A,B,SIZE) NSIZE=IROUND(SIZE) C.....CALL GAUSSIAN ELIMINATION ROUTINE CALL GAUSS(A,B,NSIZE) RETURN END FTEST is a file of names of user-defined subroutines that are to be linked to the Cadence SPICE program. GAUSS1 GAUSS MTEST is a matrix of data to be solved by GAUSS, for example. .15893 .40506 .50958 .61122 .65500 .67606 .66498 .48108 .192906 .03431 .75170687E-3 .17667 .42882 .52776 .62796 .67700 .69582 .69072 .50678 .031601 .7886121E-3 .21053 .49634 .59728 .70872 .74000 .75392 .7381 .5511 .032035 .85461974E-3 .21964 .51176 .6195 .74276 .78000 .79482 .77272 .58484 .03529 .90913405E-3 .23169 .54262 .6551 .79296 .82000 .82804 .81146 .6201 .037109 .92843021E-3 .21855 .55582 .6871 .84284 .8870 .89528 .87416 .675 .040516 .98062475E-3 December 1998 440 .19244 .2112 .23068 .2437 .271 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Subroutines .19745 .546 .70142 .87384 .92500 .93416 .8957 .70478 .042791 1.0172664E-3 .18177 .54374 .70284 .87514 .93500 .95248 .93212 .7592 .048974 1.0199025E-3 .19331 .5633 .74874 .93956 1.0100 1.04086 1.03036 .36438 .05883 1.0865428E-3 .17836 .53628 .73192 .93862 1.040 1.10068 1.10566 .44124 .06742 1.1166469E-3 .28426 .31312 .85198 .93238 ANSW holds the answers to the input matrix. 2.79915E-04 2.69892E-03 -4.48467E-03 1.16875E-03 -2.15087E-03 5.48232E-03 -1.91263E-03 1.13698E-03 -2.83078E-03 4.61369E-03 Example Cadence SPICE Session cdsload -s ftest • • • UcdsSpice open 1 mtest open 2 answ set nsig=8 array x(10,10) loop i from 1 to 10 by 1 read.1 x(i,1) x(i,2) x(i,3)...x(i,10) read.1 y(i) endloop set size=10.0 call gauss1 (x(1,1),y(1),size) loop i from 1 to 10 by 1 print.2 y(i) endloop quit December 1998 441 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Subroutines Note: When using the call command, if any of the arguments are arrays, the argument should be the first element in the array. The command only needs the starting memory position of the array. (See above example.) December 1998 442 Product Version 4.4.2 Cadence SPICE Reference Manual G User-Defined FORTRAN Functions ■ Using FORTRAN Functions ■ Limitations ■ Examples Using FORTRAN Functions Note: The features described in this chapter are not part of the standard Cadence SPICE program. Contact your local Cadence field office for information on availability. You can define and use FORTRAN functions like any other Cadence SPICE function. First you “define” the functions, that is, write them in FORTRAN. You can link up to 2000 functions to the Cadence SPICE program. Any number of files can contain the function definitions. For example, 1800 files can have one function each or one file can have 1800 functions. You can associate the filenames with the function names for clarity, but it is not required. In addition to the function definition files, you need a single file that contains the filenames of each of the definition files, with one name per line. Prepare your own version of the program by using the cdsload macro (described in the “UserDefined Subroutines” appendix): cdsload -f funlist where funlist is the name of the file that contains the name(s) of the file(s) that contain(s) the function definitions. The filenames in funlist can start in any column of the line. The name format is: directory/<filename> You can use user-defined control sources, subroutines, and functions concurrently by typing cdsload <-u udcslist> <-s sublist> <-f funlist> December 1998 443 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined FORTRAN Functions Limitations The FORTRAN functions that you define have limitations beyond those ordinarily imposed by FORTRAN. ■ All functions that you call from the Cadence SPICE program are double precision. Do not use the DOUBLE PRECISION function statement. The cdsload macro compiles with an option that makes all real functions and variables double precision. Use only the FUNCTION keyword for defining functions. ■ The FUNCTION keyword must begin in the seventh column of the definition file, which allows much faster code parsing for function name extraction. ■ Functions can have a maximum of 20 arguments. For functions that the program calls directly, all arguments must be double precision. Therefore, you should declare all passed arguments as DOUBLE PRECISION in the function. Otherwise, there are no limitations beyond those imposed by the FORTRAN compiler. Examples The rfuncs file contains two of the FORTRAN function definitions. These functions can call library functions as well as each other. C.....DETINV RETURNS THE DETERMINANT OF A 2 X 2 MATRIX FUNCTION DETINV(AR1) DOUBLE PRECISION AR1(2,2) A=AR1(I,1) * AR1(2,2) - AR1(1,2) * AR1(2,1) DETINV=INVRT(A) RETURN END C.....THIS FUNCTION MULTIPLIES 4 NUMBERS FUNCTION FOURM(A, B, C, D) DOUBLE PRECISION A, B, C, D FOURM=A*B*C*D RETURN END The func2 file contains a function that returns the inverse of x: C.....INVRT RETURNS THE INVERSE OF X FUNCTIONS INVRT(X) DOUBLE PRECISION X INVRT=1/X RETURN END The ftest file contains the names of the files that contain the functions to be linked to the Cadence SPICE program. RFUNCS FUNCS2 December 1998 444 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined FORTRAN Functions Example of Usage cdsload -f ftest (takes several minutes) To invoke the program, type: UcdsSpice The following commands are in the Cadence SPICE program: ARRAY C(2,2)=3 SET C(1,2)=2 SET D=DETINV(C(1,1)) PRINT D QUIT D equals 0.33333 Note: Array addresses are passed the same way as in standard ANSI FORTRAN. For example, for array A: A(1)=10 A(2)=20 A(3)=30 Define function nex: FUNCTION NEX(ARR) DOUBLE PRECISION NEX=ARR(2) RETURN END Then if X=NEX(A(1)), X equals 20. If X=NEX(A(2)), X equals 30. December 1998 445 Product Version 4.4.2 Cadence SPICE Reference Manual H User-Defined Controlled Sources ■ Using Controlled Sources ■ Examples Using Controlled Sources Note: The features described in this appendix are not part of the standard Cadence SPICE program. Contact your local Cadence field office for information. You can write FORTRAN subroutines that define the voltage/current relationships of controlled source elements. Element files for a user-defined controlled source (UDCS) appear as follows: ■ Voltage-controlled current source: GXXXXX N+ N[IC=IC1...] POLY ND NC1+ NC1-...EXTERN NAME [C1...] GXXXXX source name N+ N- connecting nodes ND number of controlling voltages NC1+ NC1-... controlling node-pairs NAME name of CSSUB (Controlled-Source SUBroutine) that defines the source-control relationship C1... parameters (function coefficients) to pass to CSSUB at run time IC1... initial conditions for controlling voltages ■ Voltage-controlled voltage source: same as above, except that initial letter is E rather than G. December 1998 446 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources Current-controlled current source: ■ FXXXXX N+ N[IC=IC1...] POLY ND VN1 EXTERN NAME [C1...] FXXXXX source name N+ N- connecting nodes ND number of controlling currents VN1... names of voltage sources through which controlling currents flow ■ Current-controlled voltage source: same as above, except that initial letter is H rather than F. Note: The syntax for a UDCS element differs from that for a conventional (and still available) controlled-source element in the following ways: ■ The POLY keyword must be present, even if ND is 1. ■ Any of the C1... parameters can be a variable if preceded by an equal sign (=), otherwise it is a constant. For example: G1 1 2 POLY 1 3 4 EXTERN UUTST .5 G1 1 2 POLY 1 3 4 EXTERN UUTST =A1 3 or =P2*m where A1, P2, and m were previously set to some value. ■ C1 parameters are optional. (For conventional controlled sources, you need at least one.) To run a simulation on a circuit file that uses the EXTERN specification to reference one or more CSSUBs, you must first create a FORTRAN file.f file for each reference of CSSUB. The file.f file must contain a subroutine with the same name as the CSSUB. Begin the names of the subroutines that you write with the letters UU to avoid conflicts with other internal Cadence SPICE subroutines. Presently, the maximum number of CSSUBs you can use is 80. To create a UDCS, refer to the template below. If you need a copy of this file, Cadence will send it to you on tape. C C C C C C ************************************************************ ***OUTPUTS*** Y - THE OUTPUT OF THE USER DEFINED CONTROLLED SOURCE JERROR - INDICATES AN ERROR TO CDSSPICE 1 < JERROR < 9999 - CDSSPICE WILL SIMPLY PRINT AN ERROR MESSAGE CONTAINING December 1998 447 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C c C C C C C C C THE JERROR NUMBER -9999 < JERROR <-1- CDSSPICE WILL PRINT AN ERROR MESSAGE, SET NOGO=1, AND GRACEFULLY END THE SIMULATION ALL OTHER VALUES ARE RESERVED FOR CDSSPICE TO USE. ***INPUTS*** IFLAG - INDICATES -1 0 >1 WHICH SECTION OF CODE TO "GOTO" - ERROR - RETURN THE VALUE OF THE SOURCE - "IFLAG-TH" COMPONENT OF THE GRADIENT OF THE SOURCE LP - POINTER TO THE USER SETTABLE PARAMETERS PASSED INTO THIS ROUTINE Example: G1 3 0 POLY 1 1 2 EXTERN UUEX 5 3E3 2 4u X(LP+1) = 5 X(LP+2) = 3E3 X(LP+3) = 2 X(LP+4) = 4u NP - NUMBER OF USER SETTABLE PARAMETERS PASSED INTO THIS ROUTINE. Example: G1 3 0 POLY 1 1 2 EXTERN UUEX 5 3E3 2 4u NP = 4 LC - POINTER TO THE CONTROLLING ARGUMENTS (VOLTAGES OR CURRENTS) Example:G1 3 0 POLY 3 1 2 3 0 4 0 EXTERN UUEX 5 3E3 X(LC+1) = voltage between nodes 1 and 2 X(LC+2) = voltage between nodes 3 and 0 X(LC+3) = voltage between nodes 4 and 0 NC - NUMBER OF CONTROLLING ARGUMENTS Example:G1 3 0 POLY 3 1 2 3 0 4 0 EXTERN UUEX 5 3E3 NC = 3 ALL COMMENTS REQUIRING ACTION ON YOUR PART WILL START AND END WITH THREE ASTERISKS (***). NOTE: YOU CAN USE ANY FORTRAN-77 CONSTRUCT NEEDED IN THIS ROUTINE. SUBROUTINE UUTEMP(Y,IFLAG,LP,NP,LC,NC,JERROR) implicit double precision (a-h,o-z) COMMON /BLANK/ X(64) ***YOU SHOULD CHANGE THE NAME OF THE SUBROUTINE, BUT DO NOT CHANGE ANY OF THE ARGUMENTS.ALSO KEEP THE IMPLICIT DOUBLE PRECISION DECLARATION,AS WELL AS THE COMMON /BLANK/. HERE YOU MAY ADD THE COMMON BLOCKS MENTIONED IN THE READ_ME FILE,IF NEEDED. ALSO ADD ANY OTHER FORTRAN DECLARATIONS REQUIRED.*** THIS GOTO ASSUMES 2 CONTROLLING NODE PAIRS, I.E. NC=2. GOTO 25 - CHECK FOR THE CORRECT NUMBER OF CONTROLLING ARGUMENTS. GOTO 50 - RETURN THE VALUE OF THE SOURCE GOTO 100 - RETURN THE GRADIENT WRT TO THE FIRST CONTROLLING ARGUMENT December 1998 448 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources C C C C C C C C C C C C C C C C C C C C C C C C C C C GOTO 150 - RETURN THE GRADIENT WRT TO THE SECOND CONTROLLING ARGUMENT *** ADD MORE GOTO STATEMENTS, IF YOU HAVE MORE CONTROLLING ARGUMENTS, I.E. NC > 2.REMOVE THE LAST GOTO (150), IF YOU HAVE ONLY ONE CONTROLLING ARGUMENT *** GOTO (.25 . , 50 . , 100 . , 150 . ), IFLAG + 2 PERFORM ONE-TIME INITIALIZATION OR ERROR CHECKING *** If YOU HAVE MORE/LESS THAN 2 CONTROLLING ARGUMENTS, THEN CHANGE THE FOLLOWING IF STATEMENT ACCORDINGLY. KEEP THE SAME JERROR NUMBER. (KEEP JERROR = -99010 *** . . . . . . . . . . . . . . . . . . . . . . . . . . 25 CONTINUE IF (NC .NE. 2 ) JERROR = -99010 GOTO 99901 SET ’Y’ TO VALUE OF SOURCE AND PERFORM ANY ELEMENT-DEPENDENT OR TIME-DEPENDENT INITIALIZATION OR ERROR-CHECKING. DSIN = DOUBLE PRECISION SIN. *** CHANGE THE EQUATION, TO YOUR EQUATION Y = ETC....THIS IS JUST HERE TO SERVE AS AN EXAMPLE.*** 50 CONTINUE Y = 1.0 + 2.0 * X(LC + 1) ** 2 DSIN (X(LC + 2) ) GOTO 99901 SET ’Y’ TO COMPONENT 1 OF GRADIENT (I.E. THE PARTIAL DERIVATIVE WRT X(LC+1). *** REPLACE THIS EQUATION WITH YOUR OWN.*** 100 CONTINUE Y = 4.0 * X(LC + 1) GOTO 99901 SET ’Y’ TO COMPONENT 2 OF GRADIENT (I.E. THE PARTIAL DERIVATIVE WRT X(LC+2). *** REPLACE THIS EQUATION WITH YOUR OWN.IF YOU ONLY HAVE ONE CONTROLLING ARGUMENT, THEN DELETE THIS SECTION. IF YOU HAVE MORE,THEN ADD EXTRA SECTIONS.*** 150 CONTINUE Y = DCOS (X(LC+2) ) GOTO 99901 99901 CONTINUE RETURN END ■ Create sublist, a file containing a list of all the CSSUB filenames that you need, one file name per line. ■ Prepare a “customized” version of the Cadence SPICE program, using the macro cdsload. Below are descriptions of the cdsload macro and the revised usage of the Cadence SPICE program necessary with user-defined controlled sources. You must use the cdsload macro to December 1998 449 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources set up a version of the Cadence SPICE program with linking to the particular CSSUBs to be used at run time (described in the “User-Defined Subroutines” appendix). The syntax of the call is cdsload -u udcslist udcslist is the name of a file containing the CSSUB file names to be used, one name per line. You can also use user-defined subroutines and/or user-defined functions with the CCSUBs by typing cdsload -s sublist -u udcslist -f funlist The files after the word cdsload contain the following lists: udcslist CSSUB filenames sublist user-defined subroutines funlist user-defined functions Note: If you use UDCSs, you must call cdsload prior to the Cadence SPICE program if you have modified in any way the CSSUBs or the udcslist, or substantially modified circuit files (such as additions, deletions, or references to CSSUBs, or changes to number or order of parameters). cdsload creates UcdsSpice, which you can use just like cdsSpice. Examples This section contains a complete example of user-defined controlled source subroutines, including ■ A Cadence SPICE input file that simulates a circuit ■ A circuit file referencing three CSSUBs ■ Three complete CSSUBs: UUSUBA, UUSUBB, and UUSUBC ■ A file udcslist1 containing the names of all subroutines that are used The calls to cdsload and the Cadence SPICE program are necessary to run the routines. UDS1.S File * INPUT FILE FOR UDS1.S * SIM UDS1 December 1998 450 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources SWEEP V100 FROM 0 TO 1.8 BY .001 KEEP 14 GO QUIT There are three controlled-source subroutines: ■ UUSUBA, with no arguments ■ UUSUBB, with the parameter 2.0 ■ UUSUBC, with the parameter 2.0 UDS1.C File * TEST FILE FOR USER-DEFINED * V100 1 0 2.0 V91 1 2 0.0 R91 2 3 1.0 V92 3 4 0.0 R92 4 0 1.0 * * VOLTAGE-CONTROLLED CURRENT * RG13 0 13 1.0 G13 0 13 POLY 1 2 * RG14 0 14 1.0 G14 0 14 POLY 1 2 * RG15 0 15 1.0 G15 0 15 POLY 2 2 * RG16 0 16 1.0 G16 0 16 POLY 2 2 * RG17 0 17 1.0 G17 0 17 POLY 1 2 * * VOLTAGE-CONTROLLED VOLTAGE * RE23 0 23 1.0 E23 23 0 POLY 1 2 * RE24 0 24 1.0 E24 24 0 POLY 1 2 * RE25 0 25 1.0 E25 25 0 POLY 2 2 * RE26 0 26 1.0 E26 26 0 POLY 2 2 * RE27 0 27 1.0 E27 27 0 POLY 1 2 * * CURRENT-CONTROLLED CURRENT December 1998 CONTROLLED SOURCES SOURCES 3 1.0 2.0 2.0 3 EXTERN UUSUBA 3 4 3 0 3 4 2.0 0 2.0 1.0 EXTERN UUSUBB EXTERN UUSUBC 2.0 2.0 SOURCES 3 1.0 3 EXTERN UUSUBA 3 4 3 3 2.0 0 4 2.0 2.0 0 2.0 1.0 EXTERN UUSUBB EXTERN UUSUBC 2.0 2.0 SOURCES 451 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources * RF33 0 33 1.0 F33 0 33 POLY 1 V91 1.0 2.0 2.0 * RF34 0 34 1.0 F34 0 34 POLY 1 V91 EXTERN UUSUBA * RF35 0 35 1.0 F35 0 35 POLY 2 V91 V92 2.0 2.0 1.0 * RF36 0 36 1.0 F36 0 36 POLY 2 V91 V92 EXTERN UUSUBB 2.0 * RF37 0 37 1.0 F37 0 37 POLY 1 V91 EXTERN UUSUBC 2.0 * * CURRENT-CONTROLLED VOLTAGE SOURCES * RH43 0 43 1.0 H43 43 0 POLY 1 V91 1.0 2.0 2.0 * RH44 0 44 1.0 H44 44 0 POLY 1 V91 EXTERN UUSUBA * RH45 0 45 1.0 H45 45 0 POLY 2 V91 V92 2.0 2.0 1.0 * RH46 0 46 1.0 H46 46 0 POLY 2 V91 V92 EXTERN UUSUBB 2.0 * RH47 0 47 1.0 H47 47 0 POLY 1 V91 EXTERN UUSUBC 2.0 * UUSUBA Subroutine This subroutine is in file UUSUBA.F. UUSUBA defines a source function with one controlling argument (u) and no parameters. The source equation and gradient are y=1 + 2u + 2u**2 y=2 + 4u (source equation) (gradient) In other words, if UUSUBA defines a voltage-controlled current source, then u denotes the single controlling-voltage value. In the first equation, y denotes the source current, and in the second equation, y denotes the small-signal transconductance. UUSUBA SUBROUTINE UUSUBA(Y,IFLAG,LP,NP,LC,NC,JERROR) SPECIAL COMMON BLANK COMMON /BLANK/ X(64) C GOTO ( December 1998 452 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources . . . . , , , 25 50 100 ), IFLAG + 2 25 CONTINUE C.... PERFORM ONE-TIME INITIALIZATION OR ERROR CHECKING IF (NC .NE. 1) JERROR = -99010 GOTO 99901 C 50 CONTINUE C.... SET ’Y’ TO VALUE OF SOURCE AND PERFORM ANY ELEMENTDEPENDENT OR TIME-DEPENDENT INITIALIZATION OR ERROR CHECKING Y = 1.0 + 2.0 * X(LC + 1) + 2.0 * X(LC + 1) ** 2 GOTO 99901 C 100 CONTINUE C.... SET ’Y’ TO COMPONENT 1 OF GRADIENT Y = 2.0 + 4.0 * X(LC + 1) GOTO 99901 C 99901 CONTINUE C RETURN END UUSUBB Subroutine This subroutine is in file UUSUBB.F. UUSUBB defines a source with two controlling arguments (u, v) and one parameter (a). The source equation and gradient are (source equation) (gradient) y = a + 2u + v y=2 and y=1 UUSUBB SUBROUTINE UUSUBB(Y,IFLAG,LP,NP,LC,NC,JERROR) SPECIAL COMMON BLANK COMMON /BLANK/ X(64) C C... GOTO ( . 25 . , 50 . , 100 . , 200 . ), IFLAG + 2 25 CONTINUE PERFORM ONE-TIME INITIALIZATION OR ERROR CHECKING IF (NC .NE. 2) JERROR = -99010 GOTO 99901 C 50 December 1998 CONTINUE 453 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources C.... SET ’Y’ TO VALUE OF SOURCE AND PERFORM ANY ELEMENTDEPENDENT OR TIME-DEPENDENT INITIALIZATION OR ERROR CHECKING Y = X(LP + 1) + 2.0 * X(LC + 1) + X(LC + 2) GOTO 99901 C C.... 100 CONTINUE SET ’Y’ TO COMPONENT Y = 2.0 GOTO 99901 1 OF GRADIENT 200 CONTINUE SET ’Y’ TO COMPONENT Y = 1.0 GOTO 99901 2 OF GRADIENT C C.... C 99901 CONTINUE C RETURN END UUSUBC Subroutine This subroutine is in the UUSUBC.F file. UUSUBC defines a source with one controlling argument (u) and one parameter (a). The source equation and gradient are (source equation) (gradient) y = tanh (u/a) y = (1 - tanh**2 (u/a)) /a UUSUBC SUBROUTINE UUSUBC(Y,IFLAG,LP,NP,LC,NC,JERROR) SPECIAL COMMON BLANK COMMON /BLANK/ X(64) C GOTO ( . 25 . , 50 . , 100 . ), IFLAG + 2 25 CONTINUE C.... PERFORM ONE-TIME INITIALIZATION OR ERROR CHECKING IF (NC .NE. 1) JERROR = -99010 GOTO 99901 C 50 CONTINUE C.... SET ’Y’ TO VALUE OF SOURCE AND PERFORM ANY ELEMENTDEPENDENT OR TIME-DEPENDENT INITIALIZATION OR ERROR-CHECKING Y = TANH(X(LC + 1) / X(LP + 1)) GOTO 99901 C 100 CONTINUE December 1998 454 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources C.... SET ’Y’ TO COMPONENT 1 OF GRADIENT Y = (1.0 - TANH(X(LC + 1) / X(LP + 1)) ** 2) / X(LP + 1) GOTO 99901 C 99901 CONTINUE RETURN END UDCSLIST1 File The three controlled source subroutines used are listed, one per line, in the UDCSLIST1 file. UUSUBB.F UUSUBC.F UUSUBA.F The calls to cdsload and the Cadence SPICE program are cdsload -u UDCSLIST1 UcdsSpice UDS1 Comparator Macromodel Example This section provides an example of a comparator macromodel using user-defined controlled sources. The model uses the hyperbolic tangent function. The power supply voltage and the gain constant are passed into the controlled source subroutine. Below are the general formula and the schematic of the macromodel . V out = V ps ⋅ tanh ( V in ⋅ k ) Vps power supply voltage (Vps=G1*R1) Vin voltage between positive and negative terminals of the macromodel k gain constant that determines the minimum Vin required for fullscale output swing (rail to rail) December 1998 455 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources Macromodel Schematic 2 + 3 V 5 + - IN G 1 4 R R 1 2 V OUT E 1 C 1 1 - CPMAC.S File USE FILE FOR CPMAC.C SIM CPMAC SET VIN=0 SWEEP VIN FROM -1M TO 1M BY 10U KEEP 1 2 GO ERASE WPLOT V(2) QUIT The rest of this section shows the use file, circuit file, the controlled source subroutine, and the file containing the name of the subroutine that links the routine to the Cadence SPICE program. CPMAC.C File One controlled-source subroutine is used: UUCMAC, with two parameters, 5 and 3E3. In the formula: Vout=Vps*tanh(Vin*k) Vps=5 and k=3E3 * COMPARATOR MACRO-MODEL USING USER DEFINED CONTROLLED * SOURCES XA1 1 0 2 A1 * NODES +IN -IN OUT .SUBCKT A1 2 1 4 G1 3 0 POLY 1 1 2 EXTERN UUCMAC 5 3E3 R1 3 0 1K C1 3 0 100P December 1998 456 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources C2 3 5 10P R2 5 4 50 E1 5 0 3 0 .ENDS CL1 2 0 10P RL1 2 0 1K VIN 1 0 VIN 1 UUCMAC File This subroutine is in the UUCMAC.F file. Note that DAX, in the following calculation of tanh(DAX), is limited to 30 to avoid FORTRAN overflow errors. It is sufficient to limit DAX to 30 because tanh(4)=0.999. (The hyperbolic tangent has minimum and maximum values at -1.0 and +1.0. The function reaches >99% of its final value when |DAX|>3.) Comparator Circuit 1 2 + - V IN + R C L1 L1 C********************************************************** C* * C* SPICE2 CONTROLLED-SOURCE SUBROUTINE * C* * C********************************************************** SUBROUTINE UUCMAC(Y,IFLAG,LP,NP,LC,NC,JERROR) COMMON /BLANK/ X(64) GOTO ( . 25 . , 50 . , 100 . ), IFLAG + 2 25 CONTINUE C . . . . PERFORM ONE-TIME INITIALIZATION OR ERROR CHECKING December 1998 457 Product Version 4.4.2 Cadence SPICE Reference Manual User-Defined Controlled Sources C . C . C . C . IF (NC .NE. 1 ) JERROR = -99010 G 99901 50 CONTINUE . . SET ’Y’ TO VALUE OF SOURCE AND PERFORM ANY ELEMENT. . DEPENDENT OR TIME-DEPENDENT INITIALIZATION OR . . ERROR-CHECKING DAX=(X(LP+2)*X(LC+1)) IF(DABS(DAX).GT.30) THEN IF(DAX.GT.0) THEN DAX=30 ELSE DAX=-30 ENDIF ENDIF Y=X(LP+1)*TANH(DAX)/1000 GOTO 99901 100 CONTINUE . . .SET ’Y’ TO COMPONENT 1 OF GRADIENT DAX=(X(LP+2)*X(LC+1)) IF(DABS(DAX).GT.30) THEN IF(DAX.GT.0) THEN DAX=30 ELSE DAX=-30 ENDIF ENDIF DEN=(COSH(DAX))*(COSH(DAX)) Y=(X(LP+2)*X(LP+1))/(DEN*1000) GOTO 99901 99901 CONTINUE RETURN END UDCSLIST File The controlled source subroutine is listed in the UDCSLIST file. UUCMAC.F December 1998 458 Product Version 4.4.2 Cadence SPICE Reference Manual I Mixed-Signal Simulation ■ IntroductionStarting the Control Shell ■ Primitive Statements ❑ .A2D/.D2A ■ Additional Information ■ References Introduction The Cadence SPICE simulator runs mixed analog-digital simulations with the Verilog-XL® digital logic simulator. You can run both DC operating point and transient simulations. In the mixed-signal environment, you start the Cadence SPICE simulator with a “control shell program” (isc), which interactively sends commands to both the Cadence SPICE and the Verilog-XL simulators. You can use most Cadence SPICE commands. Exceptions are listed in the “Additional Information” section. This appendix discusses the control shell and the interface model statements. The Analog Artist Mixed-Signal Simulation Reference Manual describes mixed-signal interface models, circuit partitioning, and netlisting in detail. Enter Cadence SPICE commands in the control shell as usual; however, precede all VerilogXL commands by a dollar sign ($), as shown in the following example: $$display ($time,"in_ref=%b",n4); This example begins with two dollar signs because the Verilog command is $display, not display. Starting the Control Shell Type the following to start the control shell: December 1998 459 Product Version 4.4.2 Cadence SPICE Reference Manual Mixed-Signal Simulation isc hostname ’cdsSpice -mixmod [command line arguments]’ hostname is the host machine on which Cadence SPICE is running. For example: isc sunspot ’cdsSpice -mixmod’ sunspot is the name of the machine on which Cadence SPICE is running, and isc is on another machine. The -mixmod argument is required for mixed signal simulation. If Cadence SPICE is running on the same host machine as the isc, you can use a dash (-) instead. For example: isc - ’cdsSpice -mixmod’ In order to run Mixed-Signal you must specify the Verilog command line arguments. This can be accomplished by sending the -slave argument to the cdsSpice psprop.s file. The following example demonstrates how the slave argument can be specified: psprop CDSVMX -slave "verilog -f pass inverter.v" This example indicates that the "slave" simulator is verilog, and in this case, the argument list is only the name of the password file and the name of the input circuit, inverter.v. Any of Verilog’s command line arguments can be used. In addition to the command line arguments to Verilog, you can also specify the following information for Mixed-Signal: ■ -slvhostIndicates the slave’s hostname. Only needed if the slave is running on a separate machine. Can be set if the slave, the Verilog-XL simulator, is running on a different machine than the Cadence SPICE simulator. ■ -mmdebugFlag that turns on the interprocess communication (IPC) debug. mmdebug=0 indicates false (don’t print debug) (default) mmdebug=1 indicates true (print debug) The following examples show how these variables could be set using the psprop.s and ptprop.s files: ptprop CDSVMX -mmdebug 1 psprop CDSVMX -slvhost sunspot The first example will turn on the interproccess communication debug. The second example will indicate that Verilog will be running on a different machine, and that machine is called sunspot. Note: ptprop.s and psprop.s are cdsSpice USE files located in: Artist 2.X:/install_dir /etc/analog/dotS December 1998 460 Product Version 4.4.2 Cadence SPICE Reference Manual Mixed-Signal Simulation Artist 4.X:/install_dir /etc/cdsSpice/dotS ptprop.s sets a number, psprop.s sets a string. CDSVMX indicates that these properties are for mixed-signal simulation. Following is an example Cadence SPICE input file that could be used to run a mixed-signal simulation: * inverter.s sim inverter keep all sweep time from 0 to 200n by 1n psprop CDSVMX -slave "verilog -f pass -y modFile +time_scale1e-09 inverter.v" go In this example, the circuit inverter.c will be used by Cadence SPICE, and inverter.v by Verilog, during the Mixed Signal simulation. Primitive Statements .A2D/.D2A Add the .A2D and .D2A primitive statements, which model the analog-to-digital (A2D) and digital-to-analog (D2A) interfaces, to the circuit (.c) file. Consult the Analog Artist MixedSignal Simulation Help for detailed information on these models. The .A2D primitive syntax is as follows: .A2D N1_D1 N1 V0 V1 TX NESTLEV Arguments and Definitions N1_D1 Interface node known by the Verilog-XL logic simulator. N1 Interface node known by the Cadence SPICE circuit simulator. V0 Low voltage level. Below this value, the node translates to a digital “0.” V1 High voltage level. Above this value, the node translates to a digital “1.” TX Length of time that a node must be between A2D_V0 and A2D_V1 to translate to a digital unknown (“X”) state. December 1998 461 Product Version 4.4.2 Cadence SPICE Reference Manual Mixed-Signal Simulation NESTLEV The level of nested subcircuits (for text-based subcircuits). You must specify all parameters on the .A2D statement. An incomplete .A2D statement results in an error. The .D2A primitive syntax is as follows: .D2A N0_1 VBCV VL VH TR TF NESTLEV Argument and Definitions N0_1 Name of the digital input pin of the primitive. The logic state on this pin controls the Boolean Controlled Voltage (BCV) source. VBCV Name of the BCV. VL Low voltage value of VBCV. VH High voltage value of VBCV. TR Rise time for rising transitions on VBCV. TF Fall time for falling transitions on VBCV. NESTLEV The level of nested subciruits (for text-based subcircuits). You must specify all parameters on the .D2A statement. Omitting any parameter results in an error. You can model A2D and D2A interfaces by Cadence SPICE use files. To model the loading and drive behavior at the interfaces, use files can contain, in addition to the A2D/D2A primitives described above, regular circuit primitives such as resistors, capacitors, and controlled switches. The simplest D2A model consists of a .D2A primitive and one BCV source. The simplest A2D model consists of a .A2D primitive only. Consult the Analog Artist Mixed-Signal Simulation Help for more detailed information. After using the correct command line arguments and adding the interface circuit elements and statements, you can run a mixed-signal simulation. December 1998 462 Product Version 4.4.2 Cadence SPICE Reference Manual Mixed-Signal Simulation Additional Information Running ■ You can run only DC operating point and transient simulations with mixed-signal. If you request an AC or related analysis, only the Cadence SPICE simulator runs, and the Verilog-XL simulator does not start. If you subsequently start a transient analysis, the Verilog-XL simulator starts. ■ If you do not specify D2A or A2D interface nodes, the Verilog-XL simulator does not start. Interrupting ■ An interrupt ([CTRL] [C]) of a transient analysis does not interrupt the Verilog-XL simulator, which remains suspended until the next continue command. ■ If an interrupt occurs while the Verilog-XL program is simulating, the interrupt is not processed immediately, but delayed until the Verilog-XL simulator returns control to the Cadence SPICE simulator. The interrupt handler issues the message: “The simulator is busy, please wait.” Viewing ■ From the Verilog-XL simulator you can view only the signal waveforms after the simulation. Therefore, all other back-end commands, such as probe, display, equate, store, and senstr, provide only the Cadence SPICE simulator information. ■ Waveforms can be viewed by using the following commands and dotS files, assuming you have the dotS directory in your path. use vfuncs use verilog openwsf raw/waves wsfnames wplot v(n1) # # # # # # to plot digital WSF waveforms set up the Verilog logic state table opens Verilog output file where the digital waveforms are stored prints list of plottable digital nets wplot the digital net net1 Note: With the wsf file now open, you can use any of the plot or print commands with the digital nets. Quitting ■ One segmentation fault encountered by the Cadence SPICE simulator results in the Verilog-XL simulator quitting, while three segmentation faults in the same session results in the Cadence SPICE simulator quitting. December 1998 463 Product Version 4.4.2 Cadence SPICE Reference Manual Mixed-Signal Simulation ■ The quit command quits the Cadence SPICE simulator and the Verilog simulator. References For more information on the Verilog-XL simulator, refer to the Verilog-XL Reference Manual . For more information on mixed-signal simulation and netlist splitting, refer to the Analog Artist Mixed-Signal Simulation Help. December 1998 464 Product Version 4.4.2 Cadence SPICE Reference Manual J Quick Command Reference qual1 [qual2 ...] altqual off append logunt filename array aname(dim1,dim2,...) [aname2(dim1,dim2,...)...] bread.logunt array (or parameter) expression break bwrite.logunt array (or parameter) expression c/old/new/ call subname (arg1, arg2, arg3,...,arg10) continue [to expression by expression] off convrg [gminon [intval lstval]] off on datime delay expression December 1998 465 Product Version 4.4.2 Cadence SPICE Reference Manual Quick Command Reference datimefilename1 filename2 filename3 delvar delay expression param * delvar filename1 filename2 filename3 parnam uparam * uparnam altqual open * 1...9 display keep stat nodset noise restore trstore nodnam macro * macnam... node * node1 node2.. x1node1,node2 element r* v1 v2 vcc...x1x2 r* device q* j101 jfet...x1x2 j1,j2 model * mod1 mod2...x1x2 mod2 sweep array function December 1998 * array1 array2... * fun1 fun2... 466 Product Version 4.4.2 Cadence SPICE Reference Manual Quick Command Reference datime fortfunc delay expression * f* fun1 fun2 filename1 filename2 filename3 edelvar /old/new/ endloop equate param1= op model sens acsenm acsenp (named, namep)... erase exit function get fname1(arg1,arg2,...) =expr1[fname2(arg1,arg2,...)=expr2...] off dc ac tran noise getvar [percent permat] mag at freqval [percent permat] phs at freqval [percent permat] go [create] [simulator] [filename] hcopy help December 1998 command * 467 Product Version 4.4.2 Cadence SPICE Reference Manual Quick Command Reference datime histo param arrayname(exp1, exp2) numpoint[min max] delay expression if expression then command [else command] OR delvar filename1 filename2 filename3 if expression then commands [else commands] endif keep node1 [node2 node3...] I(name) I(name,port) off all alliv list filename [startline numlines] loop param from startexp to stopexp macro by times oct dec increxp macnam macro-definition off next nodset nodnum1 volt1 [nodnum2 volt2...] off noise nodenum sourcename [list every num] off open logunt filename December 1998 468 Product Version 4.4.2 Cadence SPICE Reference Manual Quick Command Reference datime oplot y1expr[:L] [y2expr[:L]...] xexpr[:L] [vs param from startexp to stopexp delay expression by times delvar filename1 filename2 filename3 oct dec increxp plot expr1[:LP] [expr2[:LP]...expr9[:LP]] [vs param from by times oct dec startexp to stopexp increxp plot3dexpr1...vsparam1fromstartexp1tostopexp1[byincrexp1] vs param2 from startexp2 to stopexp2 [by increxp2] print ["string1"] [expr1] ["string2"] [expr2]... printvs expr1 [expr2] [vs param from startexp to all by stopexp times increxp oct dec probe * acsen at * wrt r* freqval disto at c1 c2 . . . * freq December 1998 469 Product Version 4.4.2 Cadence SPICE Reference Manual Quick Command Reference trans op opl * ops v* tp q1 q2 . . . tpl tps sens wrt * r* q1 q2 . . . * four at *r ou1 . . . oun nv * nvl X1^X2^ node1,node2 tnv X1^* tnvl node1,node2 . . . December 1998 470 Product Version 4.4.2 Cadence SPICE Reference Manual Quick Command Reference noise at * freqval quit read [numitem:] param arrayname(expr1[,expr2,. . .]) . . . recall filename reset restore filename off save filename sens node1 node2 ac node1 [node2] senstr filename set param=expr arrayname(expr1[,expr2,. . .]) . . . sim filename [old] spec outvariable mag phs store filename sweep December 1998 vname iname time freq off from startexp to stopexp by oct increxp dec 471 Product Version 4.4.2 Cadence SPICE Reference Manual Quick Command Reference trstore filename off tstore filename use filename [arg1 arg2 ...] usem filename [arg1 arg2 ...] view3d [xlabel ylabel zlabel n] whisto param arrayname(expr1,expr2,...) numpoints [forcemin forcemax] window xorigin yorigin xdelta ydelta werase [xorigin yorigin xdelta ydelta] wplot yexpr1[:L] [yexpr2[:L]...yexpr9[:L]] [vs param from startexp to stopexp by time oct dec increxp wscat arrayy(indexy1,indexy2,...) vs arrayx(indexx1,indexx2,...) for numpoints wtext “text string” December 1998 x-pos y-pos [color] [size] 472 Product Version 4.4.2 Cadence SPICE Reference Manual Index Symbols transient 158, 160 append command 77 AREA property 264, 277, 293, 357 defined 226 ARGCNT function 41 arguments, notation of 16 array command 55, 256 arrays, built-in. See built-in arrays 37 ARTSTR variable 24, 136 ASIN function 41 ATABLE function 41 ATABLE2 function 42 ATAN function 41 AVSTEP variable 24 AXES variable 24 ! (concatenation) 75 " (literal) 88 # (comment) 22 # (literal) 88 & (line continuation) 22, 88, 110 * (comment) 22 * (non-converging nodes) 162 * (wild card) 121, 131 ,... in syntax 16 . (wild card) 121, 131 ... in syntax 16 / in syntax 17 [] in syntax 16 \ (literal) 22, 88 {} in syntax 16 | in syntax 16 B BEGSIM variable 25 Berkeley MOS3 337 bipolar junction transistor (BJT) model BJT model AC equations 283 breakdown equations 287, 303 DC equations 280 device properties 229 model parameters 273 noise equations 286 operating point parameters 279 temperature equations 303 blocked if-then-else commands 67 examples 68 limits 430 body-bias dependent mobility model (equations) MOSFET (level 3+) 340 BOLTZ variable 25 braces in syntax 16 brackets in syntax 16 bread command 78 break command 60 BREAK variable 25 breakdown equations BJT model 287, 303 BSIM model 356 A ABS function 41 ABSTOL variable 23, 159 effect on tolerance 174 AC analysis 158, 160 AC equations BJT model 283 BSIM model 351 diode model 269 GaAs MESFET model CAPMOD=1 365 JFET model (level 1, 2) 296 JFET model (level 3) 301 MOSFET model (level 2, 3) 325 SOI MOSFET model 391 AC small-signal analysis 158 accumulated back surface (TFA) devices 380 ACOS function 41 altqual command 59, 244 limits 430 analysis AC 158, 160 DC 158 noise 158 December 1998 473 272 Product Version 4.4.2 Cadence SPICE Reference Manual diode model 271 enhanced reverse 268 GaAs MESFET model 370 MOSFET model (level 1) 314 (level 5, 6) 337 SCR model 378 SOI MOSFET model 394 breakpoint table 172 BSIM model 341 AC equations 351 breakdown equations 356 DC equations 347 device properties 235 length/width sensitivity equations 346 model parameters 342 noise equations 356 operating point parameters 345 built-in arrays 37, 38 built-in variables 23 bwrite command 80 format 178 in mixed-signal simulation 461 nodes in 178 syntax 177 circuit analysis 158 to 159 DC 158 circuit elements 179 capacitor 183 inductor 182 mutual inductor 185 properties 179 resistive switch 188 resistor 180 transformer 185 transmission line (lossless) 186 circuits charge-sensitive 174 MESFET 174 switched capacitor 174 close command 82 command (.s) files 21, 243 command line conventions 244 commands altqual 59 append 77 array 55 bread 78 break 60 bwrite 80 c (change) 61 call 62 close 82 contif 91 continue 93 continue/trstore 96 convrg 97 datime 84 delay 138 delvar 118 display 119 disto 98 e (execute) 63 else 67 endloop 64 equate 122 erase 139 exit 65 four 99 function 56 get 124 getdis 126 C c (change) command 61 used with if-then-else command 67 Cadence Analog Simulation Environment 18 Cadence Design Framework 19 Cadence SPICE interrupting 21, 93 running 100 starting 20 using 18 call command 62, 439, 442 capacitors 183 CDS_TMP_DIR 19 cdsload macro 62, 439 with user-defined controlled sources 449 with user-defined FORTRAN functions 443 cdsSpice 20 CDSSPICE_DIR 19 CHARGE variable 25 charge-sensitive circuits 174 CHGTOL variable 25 effect on tolerance 174 circuit (.c) files 21 circuit elements in 178 December 1998 474 Product Version 4.4.2 Cadence SPICE Reference Manual getvar 127 go 100 hcopy 140 help 66 histo 141 hlist 85 if 67 keep 103 l (list) 69 list 86 loop 70 macro 57 next 71 nodset 105 noise 106 open 87 oplot 142 plot 143 plot3d 145 print 88 printvs 128 probe 129 quit 72 read 89 recall 132 reset 107 restore 108 save 134 sens 109 senstr 135 set 73 sim 110 spec 146 store 136 sweep 114 system 74 then 67 trans 116 trstore 117 tstore 137 use 75 usem 76 view3d 147 werase 148 whisto 149 window 150 wplot 151 wscat 153 wtext 154 commands, information about accessing/displaying numerical December 1998 results 117 Cadence SPICE 53 called by user interface 54 circuit simulation and analysis 89 declarations 54 format 22 graphics 137 input/output 76 language 58 used in subcircuits 398 constants, used in device models 261 contif command 91 continue command 93 continue/trstore command 96 continuous drain current equation MOSFET (level 3+) 340 control shell, mixed signal simulation 459 controlled sources user-defined 446 controlled-source subroutines 447 limits 430 conventions circuit file 110 commands 22 filenames 21 node naming 112 node referencing 432 user-defined arguments 16 convergence DC solving problems 160 using NRAMP to achieve 166 definition of 159 increasing variables to achieve 168 iteration timestep control method for 169 transient 164 convrg command 97, 159 CORR function 42 correlated random variables 255 COS 42 csh (Cshell) command 74 CSSUB. See controlled-source subroutines current sources current-controlled 223 DC 204 exponential 211 piecewise linear 205 piecewise linear file 207 pulse 209 single frequency FM 215 475 Product Version 4.4.2 Cadence SPICE Reference Manual sinusoidal 213 voltage-controlled 225 current-controlled current sources 223 user-defined 447 current-controlled voltage sources 221 user-defined 447 Curtice model (GaAs MESFET model) 357, 362 initial conditions 226 device type designations, for model (.m) file 246 devices, semiconductor 226 bipolar (BJT) devices 229 BSIM devices 235 diode devices 228 GaAs MESFET devices 237 JFET devices 241 MOSFET devices 233 SCR devices 231 SOI MOSFET devices 239 differential pair example files 408 diode model 262 DC model equations 20 device properties 228 equations AC 269 breakdown 271 enhanced reverse breakdown 268 large reverse bias 265 large-signal 269 noise 270 Schottky diode 268 small bias 266 small-signal 270 model parameters 263 operating point parameters 265 Schottky 228, 268 Zener 228 display command 119, 168 used to find errors 160 disto command 98 distortion 159 DIVDIF variable 26 DOACCT variable 26 drain current, MOSFET model (level 1) 313 (level 2) 332 (level 5) 336 D DATE variable 25 DB function 42 DC analysis 158 DC current sources 204 DC equations BJT model 280 BSIM model 347 diode model 20 GaAs MESFET level 1 (Curtice) 362 level 2 (Raytheon-Statz) 364 JFET model (level 1, 2) 295 JFET model (level 3) 300 MOSFET model (level 1) 308 MOSFET model (level 2, 3) 322 SOI MOSFET model 386 DC operating point 158 DC transfer curves 158 DC voltage sources 191 DCOPPT variable 25 DCSAT variable 25 delay command 138 DELMAX variable 25, 94, 96, 167, 170 DELTA variable, effect on convergence 172 delvar command 118 dependent sources current-controlled current source 223 current-controlled voltage source 221 multidimensional polynomialdependent 217 voltage-controlled current source 225 voltage-controlled voltage source 219 depleted back surface (TFD) devices 380 Design Framework II environment 15 designators, for node referencing 432 device models 260 device properties area 226 December 1998 E e (execute) command 63 used with if-then-else command 67 Early voltages 272 Ebers-Moll BJT model 272 ECHO variable 26 EGAUSS function 42 elements, circuit. See circuit elements 179 476 Product Version 4.4.2 Cadence SPICE Reference Manual else command 67 endloop command 64 used with if-then-else command ENGNOTE variable 26 EPPO variable 26 equate command 122 equation modifications MOSFET model (level 3+) 339 erase command 139 ERF function 42 ERF1 function 42 ERFC function 42 errors circuit file 160, 167 local truncation 167 transient analysis 167 example files differential pair 408 node referencing 435 nonlinear capacitor macromodel nonlinear inductor macromodel op amp macromodel 411 random number generator 426 resistor sweep 406 subroutines 440 user-defined controlled source subroutines 450 examples FORTRAN functions 444 exit command 65 EXP function 42 exponential current sources 211 exponential voltage sources 198 expressions 39 allowed in transistor lines 112 FORTRAN, with sim command operators in 40 rules 39 EXQTIM function 42 EXTERN specification 447 function (.f) 22 help 66 initialization (init.s) 250 model (.m) device models in 226 device type designations 247 model parameters 247 syntax 246 netlist 21 piecewise linear current source 207 piecewise linear voltage source 194 simulation command (.s) 243 sublist 439 temperature 249 update (.s) 251 use (.s) 65, 75, 243 files, example. See example files FIND function 42 finding timestep 169 flicker noise 159 FORSER 429 FORTRAN functions 443 with display command 120 FORTRAN subroutines, user-defined controlled sources 446 four command 99 Fourier analysis 99, 131, 159, 428 FREQ variable 26 function (.f) files 22, 56 function command 56 functions 39 built-in 41 calculator 47 FORTRAN 40, 443 listing 40 to 48 transfer 158 user-defined 40 67 415 417 110 G GaAs MESFET model 356 AC equations CAPMOD=1 365 breakdown equations 370 DC equations level 1 (Curtice) 362 level 2 (Raytheon-Statz) 364 device properties 237 model parameters 358 noise equations 370 F FFTFLOOR variable 26 file syntax 244 files circuit (.c) 21, 110, 160, 167 command (.s) 243 command and subcircuit (.s) 21 device model (.m) 22, 76 December 1998 477 Product Version 4.4.2 Cadence SPICE Reference Manual operating point parameters 360 GAUSS function 43, 45, 251, 420, 422 Gear integration method 169 get command 124 getdis command 126 getvar command 127 GMIN variable 26 with convrg command 97 GMINON variable 27 go command 100 GO2OFF variable 27 GRTEXT variable 27 GSAVE variable 27 Gummel-Poon BJT model 272 exponential voltage 198 piecewise linear current 205 piecewise linear current file 207 piecewise linear voltage 192 piecewise linear voltage file 194 pulse current 209 pulse voltage 196 single frequency FM current 215 single frequency FM voltage 202 sinusoidal current 213 sinusoidal voltage 200 INDEX variable 27, 64, 144, 407 inductors 182 mutual 185 initial conditions 112, 165 specifying 226 initialization (init.s) file 250 installation instructions 15 INT function 43, 439 integration method Gear 169 trapezoidal 167 interrupting Cadence SPICE 21, 93 INTTIM variable 27 used for convergence 170 IP(name) function 43, 124 IP(name,port) function 43, 125 IR(name) function 43, 124 IR(name,port) function 43, 125 iteration control effect on timestep 173 method 169 ITL1 variable 27 ITL2 variable 28 ITL3 variable 28 ITL4 variable 28 ITL5 variable 28 H hcopy command 140 help command 66 help files 66 hierarchical random number generation 252 histo command 141 histograms, limits 430 hlist command 85 HSPICE simulator 102 I I(name) function 43, 124 I(name,port) function 43, 124 ideal switch element. See resistive switch elements 188 ideal voltage summer 220 if command 67 if-then-else command 67 limits 430 II(name) function 43, 124 II(name,port) function 43, 125 IM(name) function 43, 124 IM(name,port) function 43, 124 impact ionization equations, MOSFET model (level 1) 313 (level 2, 3) 327 independent sources DC current 204 DC voltage 191 exponential current 211 December 1998 J JFET model 289 AC equations (level 1, 2) 296 (level 3) 301 DC equations (level 1, 2) 295 (level 3) 300 device properties 241 level 1 289, 294 level 2 289, 299 478 Product Version 4.4.2 Cadence SPICE Reference Manual level 3 289, 299 model parameters 291 noise equations (level 1, 2) 298 (level 3) 301 operating point parameters 294 Shichman-Hodges model 289 MEAN function 44 memory size, setting 20 MESFET circuits 174 MESFET circuits, affected by variables 174 MESFET devices. See GaAs MESFET devices 237 MESFET. See GaAs MESFET 356 METHOD variable 28 MFNOIS variable 28 MIN function 44 mismatch variation modeling 252 mixed analog-digital simulations 459 mixed-signal simulation analog-to-digital 461 digital-to-analog 461 interrupting 463 primitive statements 461 quitting 463 running 463 viewing 463 MKS variable 29 MOD function 44 model (.m) files 22 device models in 226 device type designations 246 parameters 247 syntax 246 model descriptions BJT 280 BSIM 346 diode 266 GaAs MESFET 362 JFET 294 MOSFET (level 1) 308 (level 2, 3) 321 (level 3+) 339 SCR 377 SOI MESFET 386 model statements 22, 76 model types (modified level 3) 337 BJT 272 BSIM 341 diode 262 GaAs MESFET 356 JFET 289 MOSFET (level 2, 3) 315 SCR 370 SOI MOSFET 379 K keep command 103 limits 430 keeplist (built-in array) keywords 16 37, 42 L l (list) command 69 used with if-then-else command 67 large-signal equations, diode model 269 length/width sensitivity parameters, BSIM model 346 LGFILE variable 28 Lim and Fossum SOI MOSFET model 379 limits 430 FORTRAN functions 444 lines, characters allowed per 430 list command 86 literal characters 16 LOG function 43 LOG10 function 43 logical unit number 75, 76, 87 LOGNORMAL function 420 logunt. See logical unit number 87 loop command 70 used with break command 60 used with if-then-else command 67 used with next command 71 loops, number of nesting levels 430 LTE (local truncation error) 167, 169 effect on timestep 173 LVLTIM variable 28, 169 M macro command 57 MAX function 43 MAXORD variable 28, 169 December 1998 479 Product Version 4.4.2 Cadence SPICE Reference Manual modeling mismatch variation 252 process variation 252 temperature dependencies 249 modified level 3 MOSFET model 337 Monte Carlo analysis 44, 107, 251, 420 sample histogram 423 MONTE variable 29, 43, 45, 420, 426 MORBKP variable 29 effect on convergence 172 MOS circuits, affected by variables 174 MOS2 (MOSFET level 2) model 328 MOS2 (MOSFET level 6) model 321 MOS3 (MOSFET level 3) model 333 MOS3 (MOSFET level 5) model 321 MOS3(Berkeley MOS3) 337 MOS3(modified MOS3) 337 MOS3+ 337 MOSFET model (modified level 3) 337 common parameters 321 device properties 233 equations negative body-bias effect on Vth 339 MOS2 (level 2) 328 MOS3 (level 3) 333 MOSFET model (level 1) 304 breakdown equations 314 DC equations 308 drain current equations 313 impact ionization equations 313 model parameters 305 noise equations 312 operating point parameters 308 MOSFET model (level 2) drain current 332 MOSFET model (level 2, 3) 315 AC equations 325 DC equations 322 impact ionization equations 327 model parameters 316 noise equations 327 operating point parameters 320 MOSFET model (level 3) operating point parameters 320 MOSFET model (level 3+) additional model parameters 338 equation modifications 339 equations body-bias dependent mobility December 1998 model 340 continuous drain current 340 static feedback effect 339 MOSFET model (level 5) drain current 336 MOSFET model (level 5, 6) breakdown equations 337 multidimensional polynomial-dependent sources 217 mutual inductors 185 N NBINS variable 29, 141, 149 negative body-bias effect on Vth (equations) MOSFET (level 3+) 339 netlist files 21 Newton-Raphson iterations 120, 163 next command 71 NIDENT variable 29 NKEEPI variable 29 NKEEPV variable 29 NNODES variable 29 NODCHR variable 30, 112 node referencing 431 conventions 432 designators 432 examples 435 in subcircuits 434 nodes forcing voltages 162 naming 112 non-converging 162 setting values 163 nodset command 105, 159 used to force node voltages 162 NOGO variable 30 noise analysis 158 flicker 159 noise command 106 noise equations BJT model 286 shot and flicker noise 286 thermal noise 286 BSIM model 356 diode model 270 avalanche and burst noise 271 shot and flicker noise 271 thermal noise 270 480 Product Version 4.4.2 Cadence SPICE Reference Manual GaAs MESFET model 370 JFET model (level 1, 2) 298 (level 3) 301 MOSFET model (level 1) 312 (level 2, 3) 327 nonconvergence problems, solving 160 nonlinear capacitor macromodel example file 415 nonlinear inductor macromodel example file 417 nonlinear resistors 226 NOWARN variable 30 NPN and PNP devices (SCR) 378 N-R. See node referencing NRAMP variable 30, 166 NSETN variable 30 NSIG variable 31 NSUBS variable 31 NSWEEP variable 31 Poon) 273 BSIM model 342 diode model 263 GaAs MESFET model 358 JFET model 291 model (.m) file 247 MOSFET model (level 1) 305 (level 2, 3) 316 (level 3+) 338 SCR model 372 SOI MOSFET model 380 PERTAB function 44 PI variable 31 plot command 143 plot3d command 145 plots, Tektronix 154 PNP and NPN devices (SCR) 378 primitive statements (mixed-signal simulation) .A2D 461 .D2A 461 print command 88 printvs command 128 PRNOTE variable 31 probe command 129, 160, 165 used to show problem nodes 162 process variation modeling 252 properties device area 226 initial conditions 226 expressions 39 functions 39 of circuit elements 179 of semiconductor device models 226 pulse current sources 209 pulse voltage sources 196 PWIDTH variable 31 O op amp macromodel example file 411 open command 87 operating point parameters BJT model 279 BSIM model 345 diode model 265 GaAs MESFET model 360 JFET model 294 MOSFET model (level 1) 308 (level 2, 3) 320 (level 3) 320 SCR model 375 SOI MOSFET model 383 operating points, DC 158 operators (arithmetic and relational), in expressions 40 oplot command 142 optional properties, specifying 226 Or-bars in syntax 16 Q quit command 72, 82 R P RADCLK function 44 RANDOM function 44 random number generation 252 parameters BJT model (modified GummelDecember 1998 481 Product Version 4.4.2 Cadence SPICE Reference Manual Raytheon-Statz model (GaAs MESFET model) 357, 364 read command 89 readin-bypass 20 with continue command 93 recall command 132 RELTOL variable 31, 159 effect on tolerance 174 reset command 107 resistive switch elements 188 resistor sweep example file 406 resistors, nonlinear 226 restore command 108, 158, 161 REV variable 32 reverse bias equations, diode model 265 right arrow in syntax 16 RON variable 32, 162 with nodset command 105 running Cadence SPICE 100 simulations, mixed-signal 459 SIN function 44 single frequency FM current sources 215 single frequency FM voltage sources 202 sinusoidal current sources 213 sinusoidal voltage sources 200 SINWAV variable 33 effect on convergence 172 SKILL language 49 slash in syntax 17 small bias equations, diode model 266 small-signal analysis, AC 158 small-signal equations, diode model 270 SOI MOSFET model 380 AC equations 391 breakdown equations 394 DC equations 386 device properties 239 model parameters 380 noise 380 operating point parameters 383 solving nonconvergence problems 160 sources current-controlled current 223 current-controlled voltage 221 DC current 204 DC voltage 191 exponential current 211 exponential voltage 198 piecewise linear current 205 piecewise linear voltage 192 pulse current 209 pulse voltage 196 single frequency FM current 215 single frequency FM voltage 202 sinusoidal current 213 sinusoidal voltage 200 voltage-controlled current 225 voltage-controlled voltage 219 spec command 146 specifying initial conditions 226 Spectre simulator 101 SPICE2G variable 33 SPMESS variable 33 SPTEMP variable 112, 227 SPTIME variable 34 SSAVE variable 34 STARTIME variable 34 starting Cadence SPICE 20 STATF function 44, 425, 426 static feedback effect equations S SAM variable 32 SAMPRB variable 32 save command 134 SCALE variable 32, 33 Schottky diode model equations 268 Schottky diode models 228 SCR model 370 breakdown equations 378 device properties 231 model parameters 372 NPN and PNP devices 378 operating point parameters 375 substrate bias effects 377 seed (built-in array) 37, 44, 45, 107 SEEDUP variable 33 semiconductor devices 226 sens command 109 senstr command 135 set command 23, 73, 159 Shichman-Hodges model 289, 304 SIGN function 44 silicon-on-insulator MOSFET model. SeeSOI MOSFET model 379 sim command 110 with set command 111 with use command 111 with usem command 111 simulation command (.s) files 243 December 1998 482 Product Version 4.4.2 Cadence SPICE Reference Manual MOSFET (level 3+) 339 statistical analysis 251 statistical variations 251 STDEV function 44 store command 136, 161 subcircuit (.s) files 21 subcircuits calls 397 commands used in 398 conventions 397 defining 396 examples 399 with display command 120 with keep command 103 with probe command 131 with sens command 109 with sweep command 115 sublist files 439 subroutines cdsload macro 439 controlled-source 447 user-defined 439 substrate bias effects (SCR model) 377 suffixes numeric 48 SKILL 49 sweep command 114, 159 determining timestep 167 sweepvar (built-in array) 37 switch element 188 switched capacitor circuits 174 syntax 22 .A2D primitive 461 .D2A primitive 462 cdsload macro 62, 438, 449 circuit (.c) files 177, 178 help with 66 model (.m) files 246 non-linear capacitor macromodel 415 non-linear inductor macromodel 417 subcircuits with keep command 103 UDCS element 447 syntax conventions 16 system command 74 Tektronix plots 154 TEMPDC variable 34, 112, 249 temperature dependencies, modeling 249 temperature equations BJT model 303 temperature files 249 temperature models 227 temporary files (tmp.SLXXXX). See CDS_TMP_DIR 19 then command 67 TIME variable 34 timestep determining 169 problems 167 TIMSAT variable 34 TINIT variable 35, 94, 96, 167 effect on convergence 172 TNOM variable 35, 227 tolerances, affected by variables 174 TRACK function 45, 420, 422 trans command 116 transfer curves, DC 158 transfer functions 116, 158 transformers 185 transient analysis 158, 159, 164 transmission lines (lossless) 186 trapezoidal integration method 167 TRLIM variable 35 trstore command 117, 158, 159 TRTOL variable 35 effect on tolerance 174 TSAVE variable 35 TSTEP (sweep command variable), effect on convergence 171 tstore command 137 TTYPE variable 35, 151, 153 TWOPI variable 36 U UDCS. See user-defined controlled sources UIC variable 36 specifying initial conditions 227 unblocked if-then-else examples 67 UNIFORM function 45, 420 update.s files 251 use (.s) files 243 use command 75, 244 number of levels allowed 430 number of passed arguments T TABLE function 44 TAN function 44 TANH function 44 December 1998 483 Product Version 4.4.2 Cadence SPICE Reference Manual allowed 430 with sim command 111 usem command 76, 248 number of levels allowed 430 with sim command 111 user functions, number allowed 430 user subroutines, number allowed 430 user-defined controlled sources 446 user-defined subroutines 439 user-defined, FORTRAN functions 443 METHOD 28 MFNOIS 28 MKS 29 MONTE 29 MORBKP 29 NBINS 29 NIDENT 29 NKEEPI 29 NKEEPV 29 NNODES 29 NODCHR 30 NOGO 30 NOWARN 30 NRAMP 30 NSETN 30 NSIG 31 NSUBS 31 NSWEEP 31 PI 31 PRNOTE 31 PWIDTH 31 RELTOL 31 REV 32 RON 32 SAM 32 SAMPRB 32 SCALE 32, 33 SINWAV 33 SPEEDUP 33 SPICE2G 33 SPMESS 33 SPTIME 34 SSAVE 34 STARTIME 34 TEMPDC 34 TIME 34 TIMSAT 34 TINIT 35 TNOM 35 TRLIM 35 TRTOL 35 TSAVE 35 TTYPE 35 TWOPI 36 UIC 36 VBCSAT 36 VBESAT 36 VCESAT 36 VNTOL 36 VT 36 WRFLAG 36 V V(node) function 46, 124 valueary (built-in array) 38, 42 variables ABSTOL 23 ARTSTR 24 AVSTEP 24 AXES 24 BEGSIM 25 BOLTZ 25 BREAK 25 CHARGE 25 CHGTOL 25 DATE 25 DCOPPT 25 DCSAT 25 DELMAX 25 DIVDIF 26 DOACCT 26 ECHO 26 ENGNOTE 26 EPPO 26 FFTFLOOR 26 FREQ 26 GMIN 26, 27 GO2OFF 27 GRTEXT 27 GSAVE 27 INDEX 27 INTTIM 27 ITL1 27 ITL2 28 ITL3 28 ITL4 28 ITL5 28 LGFILE 28 LVLTIM 28 MAXORD 28 December 1998 484 Product Version 4.4.2 Cadence SPICE Reference Manual XMAX 36 XMIN 36 YLIM 37 YMAX 37 YMIN 37 variables, information about affecting tolerance 174 affecting transient timesteps 171 built-in 23 correlated random 255 in expressions 39 random generation of 425 set in cdsSpicerc file 19 used in achieving convergence 168 used in device models 261 user-controlled 243 VBCSAT variable 36 VBESAT variable 36 VCESAT variable 36 VDC(node) function 46 Verilog-XL digital logic simulator, for mixedsignal simulation 459 vertical bars in syntax 16 VI(node) function 46, 124 view3d command 147 VM(node) function 46, 124 VMD function 47 VNTOL variable 36, 159 effect on tolerance 174 voltage sources current-controlled 221 DC 191 exponential 198 piecewise linear 192 piecewise linear source file 194 pulse 196 single frequency FM 202 sinusoidal 200 voltage-controlled 219 voltage summer, ideal 220 voltage-controlled current sources 225 user-defined 446 voltage-controlled voltage sources 219 user-defined 446 VP(node) function 47, 124 VPD function 47 VPD180 function 47 VPD360 function 47 VPIIO180 function 47 VPIIO360 function 47 VR(node) function 47, 124 December 1998 VT variable 36, 112 W werase command 148 whisto command 149 wild card characters 121, 131 window command 150 windows, Tektronix 154 wplot command 151 WRFLAG variable 36 wscat command 153 wtext command 154 X XMAX variable 36, 145, 151, 153 XMIN variable 36, 145, 151, 153 Y YLIM variable 37 YMAX variable 37, 143, 145, 151, 153 YMIN variable 37, 143, 145, 151, 153 Z Zener diode buried, noise components in 271 models 228 485 Product Version 4.4.2