MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _createSubCKT

Function _createSubCKT

SLiCAP/SLiCAPyacc.py:293–312  ·  view source on GitHub ↗
(line, name, cirType)

Source from the content-addressed store, hash-verified

291 _CIRCUITS[name].title = title
292
293def _createSubCKT(line, name, cirType):
294 global _CIRCUITS, _USERCIRCUITS, _SLiCAPCIRCUITS
295 nodes = []
296 params = {}
297 errors = 0
298 for i in range(2, len(line)):
299 if line[i].type in _NODES:
300 nodes.append(line[i].value)
301 elif line[i].type == "PARDEF":
302 parName, parValue = line[i].value
303 params[parName] = parValue
304 else:
305 _printError("Error: Unexpected input.", line[i])
306 errors += 1
307 subCKT = circuit()
308 subCKT.title = name
309 subCKT.nodes = nodes
310 subCKT.params = params
311 subCKT.errors += errors
312 _saveCircuit(subCKT, name, cirType)
313
314def _addErrors(name, cirType, n):
315 global _CIRCUITS, _USERCIRCUITS, _SLiCAPCIRCUITS

Callers 1

_parseNetlistFunction · 0.85

Calls 3

_printErrorFunction · 0.90
circuitClass · 0.90
_saveCircuitFunction · 0.85

Tested by

no test coverage detected