Parses a user library file and writes the subcircuit, models, and global parameters to USERCIRCUITS, USERPMODELS, and USERPARAMS, respectively. :param fileName: Path of the library file :type fileName: str :return: None :rtype: NoneType
(fileName)
| 144 | ini.SLiCAPPARAMS = _SLiCAPPARAMS |
| 145 | |
| 146 | def _compileUSERLibrary(fileName): |
| 147 | """ |
| 148 | Parses a user library file and writes the subcircuit, models, |
| 149 | and global parameters to USERCIRCUITS, USERPMODELS, and USERPARAMS, |
| 150 | respectively. |
| 151 | |
| 152 | :param fileName: Path of the library file |
| 153 | |
| 154 | :type fileName: str |
| 155 | |
| 156 | :return: None |
| 157 | :rtype: NoneType |
| 158 | """ |
| 159 | global _USERCIRCUITS, _USERPARAMS, _USERMODELS |
| 160 | print("Compiling library: " + fileName + ".") |
| 161 | f = open(fileName, 'r') |
| 162 | netlist = f.read() |
| 163 | f.close() |
| 164 | cirName = netlist.splitlines()[0][0:-1].replace(" ", "_") |
| 165 | _parseNetlist(netlist, cirName, 'user') |
| 166 | for model in _USERCIRCUITS[cirName].modelDefs.keys(): |
| 167 | _USERMODELS[model] = _USERCIRCUITS[cirName].modelDefs[model] |
| 168 | for param in _USERCIRCUITS[cirName].parDefs.keys(): |
| 169 | _USERPARAMS[param] = _USERCIRCUITS[cirName].parDefs[param] |
| 170 | del _USERCIRCUITS[cirName] |
| 171 | # PASS 2 and 3 |
| 172 | for cir in _USERCIRCUITS.keys(): |
| 173 | _checkReferences(_USERCIRCUITS[cir]) |
| 174 | |
| 175 | def _parseNetlist(netlist, name, cirType): |
| 176 | """ |
no test coverage detected