Returns operating point information of the device with the gate voltage as (swept) independent variable. :param W: Width of the device in [m] :type W: float :param L: Length of the device in [m] :type L: float :param M: Number of devices in
(self, VG, VD, VS, VB, f, step=None)
| 126 | self._determineAccuracy() |
| 127 | |
| 128 | def getOPvg(self, VG, VD, VS, VB, f, step=None): |
| 129 | """ |
| 130 | Returns operating point information of the device with the gate |
| 131 | voltage as (swept) independent variable. |
| 132 | |
| 133 | :param W: Width of the device in [m] |
| 134 | :type W: float |
| 135 | |
| 136 | :param L: Length of the device in [m] |
| 137 | :type L: float |
| 138 | |
| 139 | :param M: Number of devices in parallel |
| 140 | :type M: int |
| 141 | |
| 142 | :param VG: Gate voltage with respect to ground in [V] |
| 143 | :type VG: float |
| 144 | |
| 145 | :param VD: Drain voltage with respect to ground in [V] |
| 146 | :type VD: float |
| 147 | |
| 148 | :param VS: Source voltage with respect to ground in [V] |
| 149 | :type VS: float |
| 150 | |
| 151 | :param VB: Bulk voltage with respect to ground in [V] |
| 152 | :type VB: float |
| 153 | |
| 154 | :param step: Step data for VG; list with start value, number of values |
| 155 | and stop value. Defaults to None |
| 156 | """ |
| 157 | if not isinstance(step, list) or len(step) != 3: |
| 158 | stepStart = '{VG}' |
| 159 | stepNum = '1' |
| 160 | stepStep = '0' |
| 161 | else: |
| 162 | stepStart = str(float(step[0])) |
| 163 | stepNum = str(int(step[1])) |
| 164 | stepStep = str(float(step[2])) |
| 165 | self.step = True |
| 166 | txt = 'MOS_OP_V\n' |
| 167 | txt += '.param VG = %s\n'%(VG) |
| 168 | txt += '.param VD = %s\n'%(VD) |
| 169 | txt += '.param VS = %s\n'%(VS) |
| 170 | txt += '.param VB = %s\n'%(VB) |
| 171 | txt += '.param L = %s\n'%(self.L) |
| 172 | txt += '.param W = %s\n'%(self.W) |
| 173 | txt += '.param M = %s\n'%(self.M) |
| 174 | txt += '.param freq = %s\n'%(f) |
| 175 | txt += '.param num = %s\n'%(stepNum) |
| 176 | txt += '.param start = %s\n'%(stepStart) |
| 177 | txt += '.param delta = %s\n'%(stepStep) |
| 178 | txt += '.param select = 0\n\n' |
| 179 | txt += '%s\n\n'%(self.lib) |
| 180 | txt += '%s d g s b %s W={W} L={L} M={M}\n\n'%(self.refDes, self.dev) |
| 181 | with open('cir/MOS_OP_V.cir', 'r') as f: |
| 182 | txt += f.read() |
| 183 | with open('MOS_OP.cir', 'w') as f: |
| 184 | f.write(txt) |
| 185 | _run_ngspice([ini.ngspice, '-b', 'MOS_OP.cir', '-o', 'MOS_OP.log']) |
nothing calls this directly
no test coverage detected