from pyopus.evaluator.auxfunc import listParamDesc, paramDict from pyopus.evaluator.performance import PerformanceEvaluator # If MPI is imported an application not using MPI will behave correctly # (i.e. only slot 0 will run the program) even when started with mpirun from pyopus.parallel.mpi import MPI from pyopus.parallel.cooperative import cOS import numpy as np if __name__=='__main__': # Prepare statistical parameters dictionary with nominal values (0) nominalStat=paramDict(np.zeros(len(statParams)), statParams.keys()) # Prepare operating parameters dictionary with nominal values names=opParams.keys() nominalOp=paramDict(listParamDesc(opParams, names, "init"), names) # Prepare nominal design parameters dictionaries names=designParams.keys() nominalDesign=paramDict(listParamDesc(designParams, names, "init"), names) # Prepare one corner, module 'tm', nominal op parameters corners={ 'nom': { 'params': nominalOp, 'modules': ['tm'] } } # Prepare parallel environment cOS.setVM(MPI(mirrorMap={'*':'.'}))
}, { 'measure': 'mirr_area', 'norm': Nbelow(800e-12, 100e-12), 'shape': Slinear2(1.0,0.001) } ] # Performance and cost evaluators pe=PerformanceEvaluator(heads, analyses, measures, corners, variables=variables, debug=0) # Input parameter order in vector x is defined by inOrder. ce=Aggregator(pe, costDefinition, inOrder, debug=0) # Initial, low, and high value of input parameters. xlow=listParamDesc(costInput, inOrder, "lo") xhi=listParamDesc(costInput, inOrder, "hi") xinit=listParamDesc(costInput, inOrder, "init") # Optimizer (Hooke-Jeeves). xlo and xhi must be numpy arrays. opt=optimizerClass("HookeJeeves")(ce, xlo=xlow, xhi=xhi, maxiter=1000) # Set initial point. Must be a numpy array; xinit is a python list. opt.reset(xinit) # Install reporter plugin. # Print cost. Print performance every time cost is decreased. opt.installPlugin(ce.getReporter()) # Install stopper plugin. # Stop when all requirements are satisfied (all cost contributions are 0).
from definitions import * from pyopus.evaluator.auxfunc import listParamDesc, paramDict from pyopus.evaluator.performance import PerformanceEvaluator # If MPI is imported an application not using MPI will behave correctly # (i.e. only slot 0 will run the program) even when started with mpirun from pyopus.parallel.mpi import MPI from pyopus.parallel.cooperative import cOS import numpy as np if __name__ == '__main__': # Prepare statistical parameters dictionary with nominal values (0) nominalStat = paramDict(np.zeros(len(statParams)), statParams.keys()) # Prepare operating parameters dictionary with nominal values names = opParams.keys() nominalOp = paramDict(listParamDesc(opParams, names, "init"), names) # Prepare nominal design parameters dictionaries names = designParams.keys() nominalDesign = paramDict(listParamDesc(designParams, names, "init"), names) # Prepare one corner, module 'tm', nominal op parameters corners = {'nom': {'params': nominalOp, 'modules': ['tm']}} # Prepare parallel environment cOS.setVM(MPI(mirrorMap={'*': '.'})) # Measures have no corners listed - they are evaluated across all specified corners pe = PerformanceEvaluator(heads, analyses,
from pyopus.evaluator.auxfunc import listParamDesc, paramDict from pyopus.design.cbd import CornerBasedDesign, generateCorners from pyopus.evaluator.aggregate import formatParameters # If MPI is imported an application not using MPI will behave correctly # (i.e. only slot 0 will run the program) even when started with mpirun from pyopus.parallel.mpi import MPI from pyopus.parallel.cooperative import cOS import numpy as np if __name__ == '__main__': # Prepare statistical parameters dictionary with nominal values (0) nominalStat = paramDict(np.zeros(len(statParams)), statParams.keys()) # Prepare nominal design parameters dictionaries names = designParams.keys() nominalDesign = paramDict(listParamDesc(designParams, names, "init"), names) loDesign = paramDict(listParamDesc(designParams, names, "lo"), names) # Prepare one corner, module 'tm', nominal op parameters corners = generateCorners( paramSpec={ 'vdd': [1.7, 1.8, 2.0], 'temperature': [0.0, 25, 100.0] }, modelSpec={'mos': ['tm', 'wp', 'ws', 'wo', 'wz']}) # Add nominal corner nominalCorner = { 'nom': { 'params': { 'vdd': 1.8,
pe = PerformanceEvaluator(heads, analyses, measures, corners, variables=variables, debug=0) # Plotter plotter = WxMplPlotter(visualisation, pe) # Input parameter order in vector x is defined by inOrder. ce = Aggregator(pe, costDefinition, inOrder, debug=0) # Initial, low, high, and step value of input parameters. # Initial, low, and high value of input parameters. xlow = listParamDesc(costInput, inOrder, "lo") xhi = listParamDesc(costInput, inOrder, "hi") xinit = listParamDesc(costInput, inOrder, "init") # Optimizer (Hooke-Jeeves). xlo and xhi must be numpy arrays. opt = optimizerClass("HookeJeeves")(ce, xlo=xlow, xhi=xhi, maxiter=1 + 1 * 1000) # Set initial point. Must be a numpy array; xinit is a Python list. opt.reset(xinit) # Install reporter plugin. # Print cost. Print performance every time cost is decreased. opt.installPlugin(ce.getReporter())
from pyopus.design.cbd import CornerBasedDesign, generateCorners from pyopus.evaluator.aggregate import formatParameters # If MPI is imported an application not using MPI will behave correctly # (i.e. only slot 0 will run the program) even when started with mpirun from pyopus.parallel.mpi import MPI from pyopus.parallel.cooperative import cOS import numpy as np if __name__=='__main__': # Prepare statistical parameters dictionary with nominal values (0) nominalStat=paramDict(np.zeros(len(statParams)), statParams.keys()) # Prepare nominal design parameters dictionaries names=designParams.keys() nominalDesign=paramDict(listParamDesc(designParams, names, "init"), names) loDesign=paramDict(listParamDesc(designParams, names, "lo"), names) # Prepare one corner, module 'tm', nominal op parameters corners=generateCorners( paramSpec={ 'vdd': [1.7, 1.8, 2.0], 'temperature': [0.0, 25, 100.0] }, modelSpec={ 'mos': ['tm', 'wp', 'ws', 'wo', 'wz'] } ) # Add nominal corner nominalCorner={ 'nom': {