def substep1(depth="", diedepth="", **args): sshaft.beginstep('substep1',args) depth=depth+":substep1" if (depth==diedepth): sshaft.dief("ERROR: Error depth reached: "+diedepth) sshaft.substep(cmd=[substep2,[],{'depth':depth, 'diedepth':diedepth }]) return sshaft.endstep()
def substep1(depth="", diedepth="", **args): sshaft.beginstep('substep1', args) depth = depth + ":substep1" if (depth == diedepth): sshaft.dief("ERROR: Error depth reached: " + diedepth) sshaft.substep(cmd=[substep2, [], {'depth': depth, 'diedepth': diedepth}]) return sshaft.endstep()
def substep2(depth="", diedepth="", **args): sshaft.beginstep('substep2', args) depth = depth + ":substep2" if (depth == diedepth): sshaft.dief("ERROR: Error depth reached: " + diedepth) cmd = "testsshaft.tcl" cmd = cmd + " -depth " + depth cmd = cmd + " -return" if (diedepth): cmd = cmd + " -die " + diedepth sshaft.substep(mode='unix_step', cmd=cmd) for app in string.split(sshaft.gettechvar('Sshaft::Apps::AppList')): sshaft.dir_init('run/' + app, app) cmd = sshaft.gettechvar('Sshaft::Apps::' + app + '::TestCmd') sshaft.substep(mode=app + '_step', cmd=cmd, rundir='run/' + app) return sshaft.endstep()
def substep2(depth="", diedepth="", **args): sshaft.beginstep('substep2',args) depth=depth+":substep2" if (depth==diedepth): sshaft.dief("ERROR: Error depth reached: "+diedepth) cmd="testsshaft.tcl" cmd=cmd+" -depth "+depth cmd=cmd+" -return" if (diedepth): cmd=cmd+" -die "+diedepth sshaft.substep(mode='unix_step',cmd=cmd) for app in string.split(sshaft.gettechvar('Sshaft::Apps::AppList')): sshaft.dir_init('run/'+app,app) cmd=sshaft.gettechvar('Sshaft::Apps::'+app+'::TestCmd') sshaft.substep(mode=app+'_step',cmd=cmd,rundir='run/'+app) return sshaft.endstep()
#sshaft.dir_init('run/cds','cds') #cmd='pdkCompileTechLibrary( ?libname "'+libname+'" ?path "'+path+'"' #cmd+=' ?filename "'+filename+'" ?tech "'+tech+'" )' #sshaft.substep(mode='cds_step', cmd=cmd, rundir='run/cds') filename = os.environ['PDK_DIR'] + '/ncsu_basekit/techfile/cni/Santana.tech' libname = 'NCSU_TechLib_FreePDK45' pycellname = os.environ['PDK_DIR'] + '/ncsu_basekit/lib/' + libname path = os.environ['PDK_DIR'] + '/ncsu_basekit/lib/' + libname if os.access(path, os.F_OK): os.system('rm -rf ' + path) os.system('rm -rf ' + pycellname) #cmd='cngenlib -c --techfile '+filename+' tech:only '+libname+' '+path+' >& cngenlib.log' #cmd2='cngenlib --techlib '+libname+' pkg:pycells Xtors '+pycellname+' >& cngenlib2.log' cmd = 'cngenlib -c --techfile ' + filename + ' pkg:pycells ' + libname + ' ' + path + ' >& cngenlib.log' sshaft.substep(mode='unix_prog', cmd=cmd, env='cadence') #sshaft.substep(mode='unix_prog', cmd=cmd2, env='pycell') # log='cngenlib.log', logcheck=r"Error", checkmode='fail') sshaft.dir_init('run/cds', 'cds') sshaft.substep(mode='cds_step', cmd='pdkAppendTechfile()', rundir='run/cds') #inpath=os.environ['PDK_DIR']+'/techfile' #outpath=path #os.environ['PDK_DIR']+'/techfile/assura' #sshaft.verify_dir(outpath) #cmd='genDRC.py -in '+inpath+' -out '+outpath+' >& genDRC.log' #sshaft.substep(mode='unix_prog',cmd=cmd) #calibrefile = os.environ['PDK_DIR']+'/ncsu_basekit/techfile/calibre/calibreDRC.rul' #cmd = 'cp '+calibrefile+' '+path #sshaft.substep(mode='unix_prog',cmd=cmd)
##################################################### import sshaft, os, sys, testproc sshaft.beginstep("genlitho.py") # Parse arguments args = sys.argv[1:] while len(args) > 0: arg = args[0] args = args[1:] sshaft.logf("LOG_WARN", "WARNING: Unrecognized argument " + arg) opticdir = os.environ["PDK_DIR"] + "/ncsu_basekit/techfile/calibre/models/" cmd = "calibrewb -a opticsgen -opticalfile " + opticdir + "OpticalD0 -o " + opticdir + "opticalD0 >& calibrewb.log.D0" sshaft.substep(mode="unix_prog", cmd=cmd, env="calibre") cmd = ( "calibrewb -a opticsgen -opticalfile " + opticdir + "OpticalD10 -o " + opticdir + "opticalD10 >& calibrewb.log.D10" ) sshaft.substep(mode="unix_prog", cmd=cmd, env="calibre") cmd = ( "calibrewb -a opticsgen -opticalfile " + opticdir + "OpticalDM10 -o " + opticdir + "opticalDM10 >& calibrewb.log.DM10" ) sshaft.substep(mode="unix_prog", cmd=cmd, env="calibre")
# Parse arguments args=sys.argv[1:] sshaft.logf('LOG_INFO',"Arguments: "+str(args)) while (len(args)>0): arg=args[0] args=args[1:] if (arg=="-return"): ret=1 elif (arg=="-depth"): depth=args[0] args=args[1:] elif (arg=="-die"): diedepth=args[0] args=args[1:] else: sshaft.logf('LOG_WARN',"WARNING: Unrecognized argument "+arg) if (not depth): depth="testapp.py" else: depth=depth+":testapp.py" if (depth==diedepth): sshaft.dief("ERROR: Error depth reached: "+diedepth) if (not ret): sshaft.substep(cmd=[testproc.substep1,[],{'depth':depth, 'diedepth':diedepth }]) sshaft.endstep()
import sshaft, os, sys, testproc sshaft.beginstep('genlitho.py') # Parse arguments args = sys.argv[1:] while (len(args) > 0): arg = args[0] args = args[1:] sshaft.logf('LOG_WARN', "WARNING: Unrecognized argument " + arg) opticdir = os.environ[ 'PDK_DIR'] + '/ncsu_basekit/techfile/calibre/models/metal_contact/' cmd = 'calibrewb -a opticsgen -opticalfile ' + opticdir + 'OpticalD0 -o ' + opticdir + 'opticalD0 >& calibrewb.log.D0' sshaft.substep(mode='unix_prog', cmd=cmd, env='calibre') cmd = 'calibrewb -a opticsgen -opticalfile ' + opticdir + 'OpticalD10 -o ' + opticdir + 'opticalD10 >& calibrewb.log.D10' sshaft.substep(mode='unix_prog', cmd=cmd, env='calibre') cmd = 'calibrewb -a opticsgen -opticalfile ' + opticdir + 'OpticalDM10 -o ' + opticdir + 'opticalDM10 >& calibrewb.log.DM10' sshaft.substep(mode='unix_prog', cmd=cmd, env='calibre') opticdir = os.environ[ 'PDK_DIR'] + '/ncsu_basekit/techfile/calibre/models/poly_active/' cmd = 'calibrewb -a opticsgen -opticalfile ' + opticdir + 'OpticalD0 -o ' + opticdir + 'opticalD0 >& calibrewb.log.D0' sshaft.substep(mode='unix_prog', cmd=cmd, env='calibre') cmd = 'calibrewb -a opticsgen -opticalfile ' + opticdir + 'OpticalD10 -o ' + opticdir + 'opticalD10 >& calibrewb.log.D10' sshaft.substep(mode='unix_prog', cmd=cmd, env='calibre')
#sshaft.dir_init('run/cds','cds') #cmd='pdkCompileTechLibrary( ?libname "'+libname+'" ?path "'+path+'"' #cmd+=' ?filename "'+filename+'" ?tech "'+tech+'" )' #sshaft.substep(mode='cds_step', cmd=cmd, rundir='run/cds') filename=os.environ['PDK_DIR']+'/ncsu_basekit/techfile/cni/Santana.tech' libname='NCSU_TechLib_FreePDK45' pycellname=os.environ['PDK_DIR']+'/ncsu_basekit/lib/'+libname path=os.environ['PDK_DIR']+'/ncsu_basekit/lib/'+libname if os.access(path,os.F_OK): os.system('rm -rf '+path) os.system('rm -rf '+pycellname) #cmd='cngenlib -c --techfile '+filename+' tech:only '+libname+' '+path+' >& cngenlib.log' #cmd2='cngenlib --techlib '+libname+' pkg:pycells Xtors '+pycellname+' >& cngenlib2.log' cmd='cngenlib -c --techfile '+filename+' pkg:pycells '+libname+' '+path+' >& cngenlib.log' sshaft.substep(mode='unix_prog', cmd=cmd, env='cadence') #sshaft.substep(mode='unix_prog', cmd=cmd2, env='pycell') # log='cngenlib.log', logcheck=r"Error", checkmode='fail') sshaft.dir_init('run/cds','cds') sshaft.substep(mode='cds_step', cmd='pdkAppendTechfile()', rundir='run/cds') #inpath=os.environ['PDK_DIR']+'/techfile' #outpath=path #os.environ['PDK_DIR']+'/techfile/assura' #sshaft.verify_dir(outpath) #cmd='genDRC.py -in '+inpath+' -out '+outpath+' >& genDRC.log' #sshaft.substep(mode='unix_prog',cmd=cmd) #calibrefile = os.environ['PDK_DIR']+'/ncsu_basekit/techfile/calibre/calibreDRC.rul' #cmd = 'cp '+calibrefile+' '+path #sshaft.substep(mode='unix_prog',cmd=cmd)
while (len(args) > 0): arg = args[0] args = args[1:] if (arg == "-return"): ret = 1 elif (arg == "-depth"): depth = args[0] args = args[1:] elif (arg == "-die"): diedepth = args[0] args = args[1:] else: sshaft.logf('LOG_WARN', "WARNING: Unrecognized argument " + arg) if (not depth): depth = "testapp.py" else: depth = depth + ":testapp.py" if (depth == diedepth): sshaft.dief("ERROR: Error depth reached: " + diedepth) if (not ret): sshaft.substep( cmd=[testproc.substep1, [], { 'depth': depth, 'diedepth': diedepth }]) sshaft.endstep()