Simulator interfaces¶
Cadence¶
pycircuit.post.cds¶
- class pycircuit.post.cds.CadenceSession(cmd=None, timeout=30, verbose=False)¶
Bases:
objectClass to handle a non-graphical cadence session
>>> s = CadenceSession() >>> s.send("(list 1 2 3)") [1, 2, 3] >>> s.callfunc('list', 1,2,3) [1, 2, 3] >>> s.list(1,2,3) [1, 2, 3]
- callfunc(name, *args, **optargs)¶
Call skill function in session
- evalexpr(expr, *args)¶
Eval skill-expression with optional SkillObjects arguments expanded
SkillObjects can be used in the expression by using %s and supplying the SkillObjects to be expanded in the args argument
- send(expr, parse=True, parseall=False)¶
- class pycircuit.post.cds.CadenceSessionFile(file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, timeout=30, verbose=False)¶
Bases:
CadenceSessionClass to handle that writes to a skill file instead of real cadence session.
>>> s = CadenceSessionFile(file=sys.stdout) >>> s.send("(list 1 2 3)") (list 1 2 3) >>> s.callfunc('list', 1,2,3) (list 1 2 3) >>> s.list(1,2,3) (list 1 2 3) >>> s.testfunc(1,2,3,apa=3,b="test",c=False) (testfunc 1 2 3 ?c nil ?apa 3 ?b "test")
- send(expr)¶
- class pycircuit.post.cds.PSFResultSet(resultdir=None)¶
Bases:
ResultDictPSFResultSet class handles a PSF result directory
A PSFResultSet may contain one or more runs (PSFRun objects) which in turn contain one or more results (PSFResult).
- isfamily()¶
Return true if resultset is a parametric sweep
>>> resultset=PSFResultSet('./test/resultdirs/simple') >>> resultset.isfamily() False >>> resultset=PSFResultSet('./test/resultdirs/parsweep/psf') >>> resultset.isfamily() True
- keys()¶
Get name of results
>>> resultset=PSFResultSet('./test/resultdirs/simple') >>> resultset.keys() ('srcSweep', 'opBegin')
>>> resultset=PSFResultSet('./test/resultdirs/parsweep/psf') >>> resultset.keys() ('srcSweep', 'opBegin')
pycircuit.post.cds.skill¶
- class pycircuit.post.cds.skill.Symbol(name)¶
Bases:
object
- pycircuit.post.cds.skill.parse(str)¶
Parse skill expression. @return Python representation of str
>>> parse("1")==1 True >>> parse("1.0")==1.0 True >>> parse('"apa"')=="apa" True >>> parse('apa')!="apa" True >>> parse("(1 2 3)")==[1,2,3] True >>> parse("nil").name == 'nil' True >>> parse("nil")==Symbol('nil') True >>> parse("(1 ?a)")==[1,Symbol('?a')] True
- pycircuit.post.cds.skill.toSkill(x)¶
Convert python type to skill code
>>> toSkill([1,2,3,"apa"]) '(list 1 2 3 "apa")' >>> toSkill([1,False,"apa",True]) '(list 1 nil "apa" t)'