;---- Oct 2 16:06 95 sasha 36707 ------------------------------------- ;;;######################################################## ;;;# ;;;# SUNY at Stony Brook RSFQ Laboratory ;;;# Author: A. Rylyakov ;;;# Date: Nov 21, 1994 ;;;# Description: ;;;# ;;;# User interface to the PSCAN netlister. ;;;# ;;;# Projects: "rsfq.basic" and "hSFQHDL" ;;;# Project group: P.Bunyk and A.Rylyakov ( "rsfq.basic" ) ;;;# S.Polonsky and A.Rylyakov ( "hSFQHDL" ) ;;;# ;;;######################################################### ;;; ;;; RCS: $Header: /home/rsfq1/cdsuser/RCS/pn.il,v 1.37 1997/01/29 01:27:53 sasha Exp sasha $ ;;; ;;; encrypt( "~sasha/cadence/SKILL/PNil/pn.il" "~sasha/cadence/SKILL/PNil/pn.ile" ) ;;; (load "~sasha/cadence/SKILL/PNil/pn.ile") ;;; encrypt( "~cdsuser/pn.il" "~cdsuser/pn.ile" ) ;;; (load "~cdsuser/pn.ile") ;;; !!Note!! if you want to make your own changes: ;;; copy this file, edit it,encrypt it and make sure ;;; your .cdsinit points to your version ;;; encryption is essential for netlister ;;;######################################################## ;;;# ;;;# Initialization ;;;# ;;;######################################################### (procedure avrCopyrightPNString() ;;; returns the copyright string to be ;;; printed to the console every time ;;; pn.il is loaded strcat("\n*********************************************************\n*\tSUNY at Stony Brook RSFQ Laboratory\n" "*\tNetlisters for PSCAN and lm2cir\n" "*\tCopyright (c) 1995- by A.Rylyakov, P.Bunyk and S.Polonsky\n" "*********************************************************\n\n") ) printf("Loading pn.il\n") printf(avrCopyrightPNString()) pnContextPath = prependInstallPath("etc/context/") ;(loadContext strcat(pnContextPath "schView.cxt")) ;(loadContext strcat(pnContextPath "selectSv.cxt")) ;(loadContext strcat(pnContextPath "schematic.cxt")) (loadContext strcat(pnContextPath "cdf.cxt")) ;; here we register our application (cond ( deGetAppInfo("schematic") -> userPostInstallTrigger != 'pnEnterSchematic deRegUserTriggers("schematic" nil nil 'pnEnterSchematic ) )) ;... pnEnterSchematic ......... Sep 19 95 sasha 99 (procedure pnEnterSchematic(dummy) ;_Jan 5 00 paul 58 pnAddPSCANmenu() pnGetExternals() ;; !! we change the callbacks of the schCreateInstForm schCreateInstForm ->instanceName->_callback = "pnInstanceNameAddCB()" schCreateInstForm ->cellName->_callback = "pnCellNameCB()" ;; !! we modify the buttonLayout of the schObjPropForm schObjPropForm -> buttonLayout = list('ApplyCancel list('Close "pnObjPropCloseCB()") list('Defaults "schPropDefault()") list('Previous "schSetEnv(\"figureOrder\" \"previous\")") list('Next "schSetEnv(\"figureOrder\" \"next\")")) ;; we also want to control all possible ways ;; these 2 forms can be called by user; ;; we cover all 3 entrances: fixed menu, banner menu and keybinding ;; P.B.: Menu format seems to be changed in 4.4.3, _schEditMenu is undefined, ;; commented these out... hiSetMenuItemCallback(schEditFixedMenu 'schFixedMenuProperty "pnInPropForm()") ;_schEditMenu->schPropertiesItem->hiSubMenu->schPropObjItem->_itemCallback = ; "pnInPropForm()" ;hiSetMenuItemCallback(_schEditMenu->schPropertiesItem->hiSubMenu ; 'schPropObjItem "pnInPropForm()") hiSetBindKey("Schematics" "q" "pnInPropForm()" ) ;; 3 more ;_schCreateMenu->schCreateInstanceItem ->_itemCallback = "pnInInstForm()" hiSetMenuItemCallback(schEditFixedMenu 'schFixedMenuInstance "pnInInstForm()") ; hiSetMenuItemCallback(_schCreateMenu 'schCreateInstanceItem "pnInInstForm()") hiSetBindKey("Schematics" "i" "pnInInstForm()" ) ;; 3 more for schHiCheckAndSave() hiSetMenuItemCallback(schEditFixedMenu 'schFixedMenuCheck "pnCheckModelsExternals()") ; hiSetMenuItemCallback(_schDesignMenuEdit 'schDesignCheckSaveItem ; "pnCheckModelsExternals()") hiSetBindKey("Schematics" "Shiftx" "pnCheckModelsExternals()" ) ) ; ** procedure ** (procedure pnInInstForm() (cond (hiIsFormDisplayed( schObjPropForm ) hiFormDone( schObjPropForm ))) finishEnterFun() (cond (hiGetAppType( hiGetCurrentWindow()) == "Schematics" geDeselectAllFig())) schHiCreateInst() ) ; ** procedure ** ;... pnInPropForm ............. Mar 1 95 sasha 26 (procedure pnInPropForm() ;_Jan 5 00 paul 53 schHiObjectProperty() (cond (! pnGetPropCB() schHiObjectProperty() pnSetPropCB()) (t schHiObjectProperty())) ) ; ** procedure pnInPropForm ** ;; this function checks if the callback have been set ;... pnGetPropCB .............. Mar 1 95 sasha 25 (procedure pnGetPropCB() pnBasicFieldList = schObjPropForm ->basic->fieldList pnObjPropCBSet = nil (while pnBasicFieldList pnFieldId = car( car(pnBasicFieldList)) (cond (pnFieldId ->dbName == "name" && pnFieldId -> _callback == "pnInstanceNameCB()" pnObjPropCBSet = t)) pnBasicFieldList = cdr(pnBasicFieldList)) pnObjPropCBSet ) ; ** procedure ** ;... pnSetPropCB .............. Nov 18 94 sasha 368 ;; this function attempts to change the callback ;; of the "Instance Name" field in the schObjPropForm ;; note how much more complicated is to set a callback on this field ;; than it is with a similar filed on the schCreateInstForm ( see ;; pnEnterSchematic ) ;... pnSetPropCB .............. Nov 29 94 sasha 26 (procedure pnSetPropCB() (cond (! pnGetPropCB() pnBasicFieldList = schObjPropForm ->basic->fieldList (while pnBasicFieldList pnFieldId = car( car(pnBasicFieldList)) (cond (pnFieldId ->dbName == "name" pnFieldId -> _callback = "pnInstanceNameCB()" pnFieldId -> prompt= "instance name" schUpdateForm = schObjPropForm )) pnBasicFieldList = cdr(pnBasicFieldList)) )) ) ; ** procedure ** ;... pnObjPropCloseCB ......... Mar 1 95 sasha 31 (procedure pnObjPropCloseCB() pnSetPropCB() applyEnterFun() schObjectApplyCB(list(schObjPropForm -> objId)) ; we use the Apply button CB (cond (hiGetAppType( hiGetCurrentWindow()) == "Schematics" geDeselectAllFig())) finishEnterFun() hiFormDone( schObjPropForm ) ) ;;;######################################################## ;;;# ;;;# CDF and other callbacks ( user interface "on the go" ) ;;;# ;;;######################################################### ;; ;; see ~cdsuser/rsfq.libcmd ;; Used in: pnCheckPrefix (setq pnRSFQbasicList list("jj" "ind1" "ind2" "ind3" "res" "psrc" "isrc" "isrcg" "usrc" "muind" "cap")) (procedure pnCellNameCB() (cond (hiGetCurrentForm() == schCreateInstForm && hiIsFormDisplayed( schCreateInstForm ) && boundp( 'cdfgData ) pnName = pnGenerateName() (cond (pnName && cdfgData ->pnModel cdfgData ->pnModel->value = pnFindModel(nil pnName))) schCreateInstForm ->instanceName->value = "")) schiCreateInstCellNameCB( schCreateInstForm 'cellName) ;; !! ) ;; we had to separate similar callbacks pnInstanceNameCB() on schObjPropForm ;; and pnInstanceNameAddCB() on schCreateInstForm, because the last ;; callback should include certain important built-in callbacks ;; which better be executed unconditionally ;... pnInstanceNameCB ......... Mar 1 95 sasha 0 (procedure pnInstanceNameCB() (cond ( hiGetCurrentForm() == schObjPropForm && hiIsFormDisplayed( schObjPropForm ) pnSetPropCB() pnName = pnReadName( schObjPropForm ) pnPrefix= substring(pnName 1 1) (cond ( pnCheckPrefix(pnPrefix schObjPropForm -> master) && cdfgForm -> objId ->name && pnFindModel(nil pnName) != "" cdfgForm -> objId ->name = pnName pnFindModel(nil pnName) ;; this updates the pnModel pnSetInstCounter( pnGetNumber(pnName)))))) ) ; ** procedure ** ;... pnInstanceNameAddCB ...... Dec 16 94 sasha 544 (procedure pnInstanceNameAddCB() (cond ( hiGetCurrentForm() == schCreateInstForm && hiIsFormDisplayed( schCreateInstForm ) && boundp( 'cdfgData ) pnGenerateName() ; this gets us the pnCellId of the master cell pnName= pnReadName( schCreateInstForm ) pnPrefix= substring(pnName 1 1) (cond (boundp('pnCellId) && pnPrefix && pnCheckPrefix(pnPrefix pnCellId) && schCreateInstForm ->pnModel schCreateInstForm ->pnModel->value = pnFindModel(nil pnName) pnSetInstCounter( pnGetNumber(pnName) + 1))))) schiInstanceNameSyntaxCB(schCreateInstForm 'instanceName) ) ; ** procedure ** ;... pnModelNameCB ............ Mar 1 95 sasha 0 (procedure pnModelNameCB() (cond (hiGetCurrentForm() == schObjPropForm && hiIsFormDisplayed( schObjPropForm ) ;; every CDF callback we attempt to set this instance name callback ;; this is until we find a simpler way pnSetPropCB() pnFindModel(cdfgForm ->objId)) (hiGetCurrentForm() == schCreateInstForm && hiIsFormDisplayed( schCreateInstForm ) && boundp( 'cdfgData ) && cdfgData ->pnModel pnName= pnReadName( schCreateInstForm ) (cond (pnName != "" cdfgData ->pnModel->value = pnFindModel(nil pnName)) (t pnName = pnGenerateName() (cond (pnName cdfgData ->pnModel->value = pnFindModel(nil pnName))))))) ) ; ** procedure ** ;... pnValueNameCB ............ Mar 1 95 sasha 287 (procedure pnValueNameCB() (setq pnValueName cdfgData ->pnValueName->value) (setq pnValue cdfgData ->pnValue->value) (cond (pnValueName && pnValue pnGetExternals() (cond ( hiGetCurrentForm() == schObjPropForm && hiIsFormDisplayed( schObjPropForm ) pnSetPropCB() (setq pnName cdfgForm ->objId->name) (cond (pnValueName == "*" pnExtTable[pnName] = pnValue ) (t (cond ( pnExtTable[pnValueName] == 'unbound pnExtTable[pnValueName] = pnValue ) (t cdfgForm ->pnValue->value = pnExtTable[pnValueName])))) pnFindModel(cdfgForm -> objId) )) ; ** cond cdfgForm ** (cond ( hiGetCurrentForm() == schCreateInstForm && hiIsFormDisplayed( schCreateInstForm ) (cond ( pnExtTable[pnValueName] == 'unbound pnExtTable[pnValueName] = pnValue ) (t cdfgData ->pnValue->value = pnExtTable[pnValueName] )) pnName= pnReadName( schCreateInstForm ) (cond (pnName != "" cdfgData ->pnModel->value = pnFindModel(nil pnName)) (t pnName = pnGenerateName() (cond (pnName cdfgData ->pnModel->value = pnFindModel(nil pnName))))))) pnSaveExternals())) ); ** procedure ** ;; when a named value is changed it is changed everywhere, ;; that's what pnUpdate function is for. ;; also: the new value should be stored in pnExtTable ;... pnValueCB ................ Mar 1 95 sasha 0 (procedure pnValueCB() (setq pnValueName cdfgData ->pnValueName->value) (setq pnValue cdfgData ->pnValue->value) (cond (pnValueName && pnValue pnGetExternals() (cond (pnValueName != "*" pnExtTable[pnValueName] = pnValue (cond (pnExtTable[pnValueName] != 'unbound pnUpdate(pnValueName pnValue)))) (hiGetCurrentForm() == schObjPropForm && hiIsFormDisplayed( schObjPropForm ) pnSetPropCB() pnExtTable[ cdfgForm ->objId->name ] = pnValue )) (cond (hiGetCurrentForm() == schCreateInstForm && hiIsFormDisplayed( schCreateInstForm ) && boundp( 'cdfgData ) pnName= pnReadName( schCreateInstForm ) schCreateInstForm ->pnModel->value = pnFindModel(nil pnName))) pnSaveExternals())) ) ; ** procedure ** ;... pnModelCB ................ Mar 1 95 sasha 0 (procedure pnModelCB() (cond (hiGetCurrentForm() == schObjPropForm && hiIsFormDisplayed( schObjPropForm ) pnSetPropCB() pnFindModel(cdfgForm -> objId)) (hiGetCurrentForm() == schCreateInstForm && hiIsFormDisplayed( schCreateInstForm ) && boundp( 'cdfgData ) && cdfgData ->pnModel pnName= pnReadName( schCreateInstForm ) (cond (pnName != "" cdfgData ->pnModel->value = pnFindModel(nil pnName)) (t pnName = pnGenerateName() (cond (pnName cdfgData ->pnModel->value = pnFindModel(nil pnName))))))) ) ; ** procedure ** ;;;######################################################## ;;;# ;;;# General-purpose functions ;;;# ;;;######################################################### ;; this function formats models according to instId when ;; called as pnFindModel(instId) or based on pnName when called as ;; pnFindModel(nil pnName) - this last call is used when ;; instance is being created and does not have an Id yet ;; also used in HNL as pnFindModel(nil pnName pnMasterInstId) ;... pnFindModel .............. Dec 23 94 sasha 1325 (procedure pnFindModel(instId @optional pnName (pnMasterInstId nil)) ;_Jan 28 97 sasha 2632 (cond (pnMasterInstId (setq pnValueName dbGet(pnMasterInstId "pnValueName")) (setq pnModelName dbGet(pnMasterInstId "pnModelName")) (setq pnFormatString dbGet(pnMasterInstId "pnModel")) ;; this is used when we run FNL after HNL ;; we want to get the right names for the ;; externals ;; the idea is to find the cell name ("mylib" "mycell") ;; using the path "/M6/I2/I17/" to the element "/M6/I2/I17/J19" ;; for this we need fnlCurrentInstCdsName(), pnGetElemPath() ;; and pnPathMacroTable. After that we find the flat name ;; of the external "Q117" using the pnExtMapTable ;; but first we check if the external is not a member of pnStandardExtList ;; if such a list exists (cond (! boundp('pnStandardExtList) || ! assoc(pnValueName pnStandardExtList) libcell= pnPathMacroTable[ pnGetElemPath( fnlCurrentInstCdsName())] triplet = append(libcell list(pnValueName)) (cond (pnExtMapTable[triplet] pnValueName = pnExtMapTable[triplet])))) (cond (pnValueName == "*" libcell= pnPathMacroTable[ pnGetElemPath( fnlCurrentInstCdsName())] triplet = append(libcell list( dbGet(pnMasterInstId "name"))) (cond (pnExtMapTable[triplet] pnValueName = pnExtMapTable[triplet] )) )) ) ) ; ** cond pnMasterInstId ** (cond (instId (setq pnName dbGet(instId "name")) (setq pnValueName dbGet(instId "pnValueName")) (setq pnModelName dbGet(instId "pnModelName")) (setq pnFormatString dbGet(instId "pnModel")))) (setq pnPrefix substring(pnName 1 1)) ; "J" or "L", etc (setq pnXName strcat("X" pnName)) ; "XJ11" or "XL12", etc pnPropFormp = hiGetCurrentForm() == schObjPropForm && hiIsFormDisplayed( schObjPropForm ) pnInstFormp = hiGetCurrentForm() == schCreateInstForm && hiIsFormDisplayed( schCreateInstForm ) pnAnyFormp = pnPropFormp || pnInstFormp (cond (boundp('cdfgData ) && cdfgData && pnAnyFormp pnValueName = cdfgData ->pnValueName->value pnModelName = cdfgData ->pnModelName->value pnFormatString = cdfgData ->pnModel->value)) (cond (pnValueName == "*" pnUName = pnName) (t pnUName = pnValueName)) (cond (pnFormatString && substring(pnFormatString 1 1) != "'" (cond (pnPrefix == "J" pnFormatString = strcat(pnModelName "(" pnUName "," pnXName ")" )) ;; Jan 29, 1997 current sources are different now: ;; pnModelName's are I, IA, IB, IC and ID, see pnWriteXExternCir() ;; where we add global XIA, XIB, XIC, and XID (pnPrefix == "I" pnFormatString = strcat(pnUName "*X" pnModelName) (cond (pnValueName != "*" pnFormatString = strcat(pnFormatString "*" pnXName)))) (pnPrefix != "P" && pnModelName != "LP" pnFormatString = strcat(pnUName "*X" pnPrefix) (cond (pnValueName != "*" pnFormatString = strcat(pnFormatString "*" pnXName)))) (t pnFormatString = pnUName) ) ; ** cond pnPrefix ** (cond (instId dbSet(instId pnFormatString "pnModel"))) (cond (hiGetCurrentForm() == schObjPropForm && hiIsFormDisplayed( schObjPropForm ) && cdfgForm ->pnModel cdfgForm ->pnModel ->value = pnFormatString)) ) ) ; ** cond substring ** (cond (pnFormatString pnFormatString)(t "")) ); procedure ;; this function returns the cellId of the current schematics cell ;; if it is found and nil otherwise. ;; this function is needed because hiGetCurrentWindow() may ;; return the "Library Browser" window or some other irrelevant window ;; pnWindowList keeps track of all successive current windows if they are ;; different, variable pnCurrentWindow is set ;... pnGetCurrentCellId ....... Dec 23 94 sasha 731 (procedure pnGetCurrentCellId() (let (dummy) (cond (boundp('pnWindowList) && hiGetCurrentWindow() != car(pnWindowList) pnWindowList = (cons hiGetCurrentWindow() pnWindowList)) ( ! boundp('pnWindowList) pnWindowList = (cons hiGetCurrentWindow() nil))) pnWindowNotFoundp = t dummy = pnWindowList (while dummy && pnWindowNotFoundp (cond (windowp( car(dummy)) && member( hiGetAppType(car(dummy)) list("Schematics" "Other-Schematic")) pnCurrentWindow = car(dummy) thisCellId = geGetWindowCellView(car(dummy)) pnWindowNotFoundp = nil)) dummy = cdr(dummy)) (cond (pnWindowNotFoundp printf("Schematics window not found") nil) (t thisCellId)) ) ; ** let ** ) ; ** procedure ** ;; reads pnName off the schObjPropForm ;... pnReadName ............... Nov 19 94 sasha 419 (procedure pnReadName(form) (cond (form== schObjPropForm pnBasicFieldList = schObjPropForm ->basic->fieldList (while pnBasicFieldList pnFieldId = car( car(pnBasicFieldList)) (cond (pnFieldId ->dbName == "name" pnName = pnFieldId ->value)) pnBasicFieldList = cdr(pnBasicFieldList)) (cond (boundp('pnName) pnName = pnGetNameString(pnName)))) (form== schCreateInstForm pnName = pnGetNameString(schCreateInstForm ->instanceName->value))) ) ; ** procedure ** ;; when instance is being created and Instance Name field ;; on the schCreateInstForm is empty ;; we attempt to generate a name, using internal counter ;; of the cell and the instance prefix in the master cell ;; also: used in pnInstanceNameAddCB() for finding the pnCellId ;... pnGenerateName ........... Dec 16 94 sasha 0 (procedure pnGenerateName() pnLibName= schCreateInstForm ->libraryName->value pnCellName= schCreateInstForm ->cellName->value pnViewName= schCreateInstForm ->viewName->value (cond (pnLibName&& pnCellName && pnViewName pnCellId= dbOpenCellView( ddGetObj(pnLibName) pnCellName pnViewName) (cond (pnCellId pnPrefix= dbGet(pnCellId "instNamePrefix"))) pnNumberString= pnGetString( pnGetInstCounter() ) (cond (pnPrefix pnName = strcat(pnPrefix pnNumberString))))) (cond (boundp('pnName) && pnName != "" pnName)) ) ; ** procedure ** ;; !! here pnCellId is the Id of the master cell ;; !! of the current instance ;... pnCheckPrefix ............ Feb 10 95 sasha 242 (procedure pnCheckPrefix(pnPrefix id) pnExpectedPrefix= dbGet(id "instNamePrefix") (cond (pnExpectedPrefix pnExpectedPrefix= substring(pnExpectedPrefix 1 1))) (cond (pnPrefix && pnExpectedPrefix && pnPrefix != pnExpectedPrefix && member(id~>cellName pnRSFQbasicList) hiDisplayAppDBox( ?name 'pnWrongPrefixBox ?dboxText sprintf(result "Element %s's name \n should start with \n a letter %s !" id~>cellName pnExpectedPrefix)) nil) (t t)) ) ; ** procedure ** ;; uses regexps, so that names like " J1 " would be possible ;... pnGetNameString .......... Nov 20 94 sasha 0 (procedure pnGetNameString(pnName) rexMatchp("^\\ *\\([A-Za-z_-]*[0-9]*\\)\\ *" pnName) pnName = rexSubstitute("\\1") (cond (pnName pnName)(t "")) ) (procedure pnGetElemPath(astring) ;;; returns "/I1/M6/" if given "/I1/M6/J12" rexMatchp("^\\([A-Za-z0-9/]*/\\)[A-Za-z0-9]+$" astring) rexSubstitute("\\1") ) ;; SKILL seems to lack functions like sscanf ;... pnGetNumber .............. Dec 29 94 sasha 669 (procedure pnGetNumber(pnName) (let (dummy) ;; --------- convert string of type "AAA123" to integer 123 --------- rexMatchp("^[A-Za-z_-]*\\([0-9]*\\)" pnName) pnNumberString = rexSubstitute("\\1") pnTmpFile = makeTempFileName("/tmp/foo_foo_") pnTmpPort = outfile(pnTmpFile) fprintf(pnTmpPort "%s\n" pnNumberString) close(pnTmpPort) pnTmpPort = infile(pnTmpFile) (cond ( fscanf(pnTmpPort "%d\n" dummy) pnNumber = dummy ) ( t pnNumber = 0 )) close(pnTmpPort) deleteFile(pnTmpFile) ;; ---------------------------------------------------- pnNumber ) ; ** let ** ) ; ** procedure ** (procedure pnGetString(pnNumber) ;; --------- convert integer to string -------------- ; pnTmpFile = makeTempFileName("/tmp/foo_foo_") ; pnTmpPort = outfile(pnTmpFile) ; fprintf(pnTmpPort "%d\n" pnNumber) ; close(pnTmpPort) ; pnTmpPort = infile(pnTmpFile) ; fscanf(pnTmpPort "%s\n" pnNumberString) ; close(pnTmpPort) ; deleteFile(pnTmpFile) ;;; ---------------------------------------------------- sprintf(pnNumberString "%d" pnNumber) ) ; ** procedure ** ;; this is a rather robust function, it sets the instance counter ;; to the newvalue (procedure pnSetInstCounter(newvalue) (cond (numberp(newvalue) ;; we hope it is integer pnPropList = pnGetCurrentCellId()->prop pnPropNotFoundp = t (while pnPropList && pnPropNotFoundp pnProp = car(pnPropList) (cond (pnProp->name == "instance#" pnProp->value=newvalue pnPropNotFoundp = nil)) pnPropList = cdr(pnPropList)))) ) ; ** procedure ** ;... pnGetInstCounter ......... Dec 15 94 sasha 383 (procedure pnGetInstCounter() pnPropList = pnGetCurrentCellId()->prop pnPropNotFoundp = t (while pnPropList && pnPropNotFoundp pnProp = car(pnPropList) (cond (pnProp->name == "instance#" pnCounter = pnProp->value pnPropNotFoundp = nil)) pnPropList = cdr(pnPropList) ) ; ** while pnPropList ** (cond ( ! boundp('pnCounter) pnCounter = 1)) pnCounter ) ; ** procedure ** ;;;######################################################## ;;;# ;;;# pre-netlist, user interface procedures ;;;# and functions working with files ;;;# ;;;######################################################### (setq pnCDSuserDir "/home/rsfq1/cdsuser") (setq pnCDSpersonalDir "/home/matilda/sergey/Cadence") (procedure pnGetExternals() (let (dummy) ;; we store externals as an assoc.list pnExtList on disk in ;; property pnExternals, but work with ass. table pnExtTable ;; optional argument is used by pnCheckModelsExternals too ;; when they are called from pnGetHierExternals thisCellId = pnGetCurrentCellId() pnExtList = dbGet(thisCellId "pnExternals") (cond ( ! pnExtList pnExtList = dbGet( dbOpenCellView("rsfq.basic" "nlpglobals" "pscan") "pnExternals"))) pnExtTable = makeTable("table1") dummy = pnExtList (while dummy pair = car(dummy) key = car(pair) value= cadr(pair) pnExtTable[key] =value dummy = cdr(dummy)) ) ; ** let ** ) ; ** procedure ** ;... pnSaveExternals .......... Dec 23 94 sasha 29 (procedure pnSaveExternals() thisCellId = pnGetCurrentCellId() pnExtList = tableToList(pnExtTable) dbSet(thisCellId pnExtList "pnExternals") ) ;... pnGetHierExternals ....... Feb 15 95 sasha 1534 (procedure pnGetHierExternals() ;; gathers pnExtMapList and pnHierExtList ;; this procedure is called only once, after HNL ;; was done and we know all the cells we need, ;; i.e. pnMacroCellsList + pnTopCellName ;; we take all these cells, take their externals ;; and assign to all non-standard (i.e. not found in rsfq.basic/nlpglobals) ;; externals unique names ;; and store them in pnExtMapList which has the following format: ;; ("Q117" "mylib" "mycell" "JA") ;; we then print it to the file "extern.map" using pnPrintList() ;; pnHierExtList contains all standard and flat externals ;; and is printed to "extern.cir" by pnWriteExternCir() (let (dummy pair lib cell cellId counter prefix ext val pair2) counter = 0 prefix = "Q" (cond ( ! boundp('pnStandardExtList) pnStandardExtList = dbGet( dbOpenCellView("rsfq.basic" "nlpglobals" "pscan") "pnExternals"))) pnExtMapList = nil pnExtMapTable = makeTable("table11" nil) ;; used in pnFindModel ;;; pnStandardExtList's externals will not be mapped ;;; so we make sure pnHierExtList contains the values ;;; from the top cell's pnExtList pnHierExtList = pnStandardExtList pnGetExternals() (cond (pnExtList pnHierExtList = nil dummy = pnStandardExtList (while dummy pair = car(dummy) ext = car(pair) val = cadr(pair) pair2 = assoc(ext pnExtList) (cond (pair2 pnHierExtList = cons( list(ext cadr(pair2)) pnHierExtList))) dummy = cdr(dummy)))) ;;; pnTopCellName should be included for mapping of ;;; non-standard externals pnAllCellsList = cons(pnTopCellName pnMacroCellsList) dummy = pnAllCellsList (while dummy pair = car(dummy) lib = car(pair) cell= cadr(pair) cellId= dbOpenCellView(lib cell "schematic") pnThisCellExtList = dbGet(cellId "pnExternals") (while pnThisCellExtList pnExtPair = car(pnThisCellExtList) pnExtKey = car(pnExtPair) pnExtValue = cadr(pnExtPair) (cond ( ! assoc(pnExtKey pnStandardExtList) counter = counter + 1 pnNewExt = strcat(prefix pnGetString(counter)) pnNewPair = list(pnNewExt pnExtValue) pnHierExtList = cons(pnNewPair pnHierExtList) pnExtMapList= cons( list(pnNewExt lib cell pnExtKey) pnExtMapList) pnExtMapTable[ list(lib cell pnExtKey) ] = pnNewExt )) pnThisCellExtList = cdr(pnThisCellExtList)) dummy = cdr(dummy))) ) ; ** procedure ** (procedure pnUpdate(pnValueName pnValue) thisCellId = pnGetCurrentCellId() pnInstList = thisCellId->instances (while pnInstList pnInstId = car(pnInstList) (cond ( cdfGetInstCDF(pnInstId)->pnValueName->value == pnValueName dbSet(pnInstId pnValue "pnValue") )) pnInstList = cdr(pnInstList) ) pnGetCurrentCellId() (cond (boundp('pnCurrentWindow) geRefreshWindow(pnCurrentWindow))) ); ** procedure ** ;... pnPurge .................. Jul 3 95 sasha 1602 (procedure pnPurge() ;; this procedure is called before the netlist - it may be hooked ;; on Check and and Save for example . ;; it removes all irrelevant entries from pnExtList, i.e. ;; obsolete elements like "J1234" 2.1 if J1234 is not found ;; on schematic or non-character entries like nil 3.5 ;; all other entries will be preserved ;; Feb 22, 1995 addition: if there's a difference between the value ;; of the external in pnExtList and in pnValue, pnValue wins. ;; July 3, 1995 correction: regexp "^[CIJKLPRTU][0-9]+" ;; did not cover legitimate names like JA1 or LPJO1, so another check ;; was added "^[CIJKLPRTU][A-Za-z]+[0-9]*" , this time without ;; removing keys from the table. ;; A qoute from the RCS log: ;;>> regexp in pnPurge was changed so that we will no longer have problems ;;>> with names like JO1 LPJO2 if there are differences between ;;>> the value in pnExtList and in pnValue ;;>> but the idea of storing values in 2 different places begins ;;>> to irritate me, esp. since the introduction of the frext element ;;>> so that we can store values right on the schematic if we wish to. ;;>> Also: names like IA or LO (without numbers) are also legal, ;;>> and they also may have to be pnPurged, so we have to put a * anstead of + ;;>> in the [0-9] part of the regexp, but that means that ;;>> "independent" externals like JS have to taken care of separately ;;>> so finally a another cond with another regexp was inserted (let (dummy gop) thisCellId = pnGetCurrentCellId() pnInstList = thisCellId->instances pnGetExternals() (foreach key pnExtTable ;; key-removing part with pnValue update (cond ( ! stringp(key) || rexMatchp("^[^A-Za-z].*" key) || key == "" remove(key pnExtTable) ) ( rexMatchp("^[CIJKLPRTUY][0-9]+" key) pnKeyNotFoundp = t dummy = pnInstList (while dummy && pnKeyNotFoundp pnInstId = car(dummy) (cond (pnInstId->name == key pnKeyNotFoundp = nil (cond (pnInstId->pnValue && ! suppEqual(pnInstId->pnValue pnExtTable[key]) pnExtTable[key] = pnInstId->pnValue )))) dummy = cdr(dummy)) (cond (pnKeyNotFoundp remove(key pnExtTable))) )) ;; non-key-removing part, pnValue update only (cond ( rexMatchp("^[CIJKLPRTUY][A-Za-z]+[0-9]*" key) dummy = pnInstList gop = t (while dummy && gop pnInstId = car(dummy) (cond (pnInstId->name == key gop = nil (cond (pnInstId->pnValue && ! suppEqual(pnInstId->pnValue pnExtTable[key]) pnExtTable[key] = pnInstId->pnValue )))) dummy = cdr(dummy)) )) ) ; ** foreach key ** pnSaveExternals() ) ; ** let ** ) ; ** procedure ** ;... pnCheckModelsExternals ... Mar 1 95 sasha 546 (procedure pnCheckModelsExternals(@optional pnCheckp ) ;; this procedure is called whenever schHiCheckAndSave() is called. ;; it traverses the schematic and checks if all pnValueName - pnValue ;; pairs have been set, updates models and creates pnXExtTable ;; we call it as pnCheckModelsExternals(t) from pnNetlist and pnHierNetlist ;; when we want to perform schHiCheckAndSave() from within the ;; "Other-Schematics" - the natural media for the Netlister thisCellId = pnGetCurrentCellId() printf("Updating models and externals of cell %L %L\n" thisCellId~>libName thisCellId~>cellName) pnInstList = thisCellId->instances pnGetExternals() ;; gets pnExtTable pnXExtTable = makeTable("table2" 1.0) (while pnInstList pnInstId = car(pnInstList) pnName = dbGet(pnInstId "name") pnValueName = dbGet(pnInstId "pnValueName") pnValue = dbGet(pnInstId "pnValue") pnModel = dbGet(pnInstId "pnModel") (cond (pnModel pnFindModel(pnInstId))) ; updates model (cond (pnValueName == "*" && pnValue && pnExtTable[pnName] == 'unbound pnExtTable[pnName] = pnValue) (pnValueName && pnValue && pnExtTable[pnValueName] == 'unbound pnExtTable[pnValueName] = pnValue)) ; updates externals (cond (pnValueName (cond (substring(pnName 1 1) == "J" || pnValueName != "*" pnXExtTable[ strcat("X" pnName) ] = 1.0)))) pnInstList = cdr(pnInstList)) pnSaveExternals() pnPurge() (cond (! pnCheckp schHiCheckAndSave())) ;;optional argument is bound to nil ;; when not supplied ) ; ** procedure ** ;... pnWriteExternCir ......... Nov 20 94 sasha 1085 ;; neat prints assoc list to port ;; string-float pairs in the list are expected ;... pnPrint3 ................. Feb 12 95 sasha 789 (procedure pnPrint3(port list) l = length(list) lr = round(l/3) s = "," (for n 0 lr-1 (cond (n == lr-1 && l - 3*lr == 0 s = ";")) fprintf(port "%-8s=%8.3f,\t%-8s=%8.3f,\t%-8s=%8.3f%s\n" car(nth(3*n list)) float( cadr(nth(3*n list)) ) car(nth(3*n+1 list)) float( cadr(nth(3*n+1 list)) ) car(nth(3*n+2 list)) float( cadr(nth(3*n+2 list)) ) s)) (cond (l-3*lr == 2 fprintf(port "%-8s=%8.3f,\t%-8s=%8.3f;\n" car(nth(l-2 list)) float( cadr(nth(l-2 list)) ) car(nth(l-1 list)) float( cadr(nth(l-1 list))))) (l-3*lr == 1 fprintf(port "%-8s=%8.3f;\n" car(nth(l-1 list)) float( cadr(nth(l-1 list)))))) ) ; ** procedure ** ;... pnPrintCirLogo ........... Nov 21 94 sasha 46 ; see /home/matilda/cadence/tools/dfII/etc/skill/fnl/pscan.il ;... pnPrintCirLogo ........... Nov 21 94 sasha 32 (procedure pnGenerateHeader() thisCellId = pnGetCurrentCellId() pnProjectName = strcat(thisCellId ->libName "/" thisCellId ->cellName "/" thisCellId ->viewName) ; P.B. versionName disappeared in 4.4.3, this is commented out: ; "/" thisCellId -> versionName) pnHeaderString = strcat("{\n*************************************************\n*\tSUNY at Stony Brook RSFQ Laboratory\n" sprintf(result "*\tOwner: %s\n" getShellEnvVar("LOGNAME")) sprintf(result "*\tProject: %s\n" pnProjectName) sprintf(result "*\tCreated: %s\n" getCurrentTime()) "*************************************************\n}\n") ) ;... pnPrintCirLogo ........... Nov 29 94 sasha 0 (procedure pnWriteSiEnv() pnSiEnvFile = strcat(pnWorkingDir "/si.env") thisCellId = pnGetCurrentCellId() pnPort = outfile(pnSiEnvFile) (cond (! pnPort printf("Cannot open %s for writing!\n" pnSiEnvFile )) (t printf("Creating %s ... \n" pnSiEnvFile) fprintf(pnPort "simLibName = \"%s\"\n" thisCellId ->libName) fprintf(pnPort "simCellName = \"%s\"\n" thisCellId ->cellName) fprintf(pnPort "simViewName = \"%s\"\n" thisCellId ->viewName ) fprintf(pnPort "simSimulator = \"pscan\" \n") fprintf(pnPort "simLibPath = \"%s\"\n" (ddGetObj thisCellId ->libName)~>readpath ) close(pnPort))) ) ; ** procedure ** ;... pnWriteExternCir ......... Feb 12 95 sasha 178 (procedure pnWriteExternCir(@optional (pnHierExtList nil)) (let ( extlist ) pnGetExternals() extlist = pnExtList ; FNL (cond (pnHierExtList extlist = pnHierExtList)) ; HNL pnExtFile = strcat(pnWorkingDir "/extern.cir") pnPort = outfile(pnExtFile) (cond ( ! pnPort printf("Cannot open %s for writing!\n" pnExtFile)) (pnPort printf("Writing externals to %s ... \n" pnExtFile) fprintf(pnPort pnHeaderString) fprintf(pnPort "EXTERNAL\n") pnPrint3(pnPort extlist) fprintf(pnPort "END\n") close(pnPort))) ) ; ** let ** ) ; ** procedure ** ;... pnWriteXExternCir ........ Feb 10 95 sasha 220 (procedure pnWriteXExternCir() ;_Jan 28 97 sasha 511 ;; FNL: pnXExtTable was initialized in pnCheckModelsExternals ;; HNL: pnXExtTable was inited in pnHierNetlist and collected in pnNameFormat pnXPrefixList = list("C" "I" "J" "L" "R" "U" "K"); see pnPurge (while pnXPrefixList pnXExtTable[ strcat("X" car(pnXPrefixList)) ] = 1.0 pnXPrefixList = cdr(pnXPrefixList)) ;; Jan 29, 1997 , see pnFindModel() pnXExtTable["XIA"] = 1.0 pnXExtTable["XIB"] = 1.0 pnXExtTable["XIC"] = 1.0 pnXExtTable["XID"] = 1.0 pnXExtList = tableToList(pnXExtTable) pnXExtFile = strcat(pnWorkingDir "/xextern.cir") pnPort = outfile(pnXExtFile) (cond ( ! pnPort printf("Cannot open %s for writing!\n" pnXExtFile)) (pnPort printf("Writing X-externals to %s ... \n" pnXExtFile) fprintf(pnPort pnHeaderString) fprintf(pnPort "EXTERNAL\n") pnPrint3(pnPort pnXExtList) fprintf(pnPort "END\n") close(pnPort))) ) ; ** procedure ** ;; prints table string-string to file (procedure pnPrintTable(filename table ) pnFile = strcat(pnWorkingDir filename) pnPort = outfile(pnFile) (cond ( ! pnPort printf("Cannot open %s for writing!\n" pnFile)) ( t printf("Printing %s ... \n" pnFile) foreach(key table fprintf(pnPort "%s %s\n" key table[key])) close(pnPort))) ) ; ** procedure ** ;... pnPrintList .............. Feb 6 95 sasha 85 (procedure pnPrintList(filename alist) ;; prints a list of lists of strings to a file ;; pnPrintList() is used mostly for preparing input for other programs pnFile = strcat(pnWorkingDir filename) pnPort = outfile(pnFile) (cond ( ! pnPort printf("Cannot open %s for writing!\n" pnFile)) ( t printf("Printing %s ... \n" pnFile) (while alist line = car(alist) (while length(line) > 1 fprintf(pnPort "%s " car(line)) line = cdr(line)) fprintf(pnPort "%s\n" car(line)) alist = cdr(alist)) close(pnPort) )) ) ; ** procedure ** (procedure pnPrintAnyList(filename mode alist) ;; prints a list of lists of ANYTHING to a file ;; differs from pnPrintList in the way they handle strings: ;; pnPrintAnyList will print the quotes around strings ;; Also: differnt number of arguments: pnPrintAnyList requires mode ;; which should be either "w" or "a" ;; pnPrintAnyList() is used for preparing a reference file pnFile = strcat(pnWorkingDir filename) pnPort = outfile(pnFile mode) (cond ( ! pnPort printf("Cannot open %s for writing!\n" pnFile)) ( t printf("Printing %s ... \n" pnFile) (while alist line = car(alist) (while length(line) > 1 fprintf(pnPort "%L " car(line)) line = cdr(line)) fprintf(pnPort "%L\n" car(line)) alist = cdr(alist)) close(pnPort) )) ) ; ** procedure ** ;... pnWriteTypeCir ........... Oct 2 95 sasha 625 (procedure pnWriteTypeCir() pnTypeFile = strcat(pnWorkingDir "/type.cir") (cond ( ! isFile( pnTypeFile ) pnPort = outfile(pnTypeFile) (cond ( ! pnPort printf("Cannot open %s for writing!\n" pnTypeFile)) (t printf("Creating %s ...\n" pnTypeFile) fprintf(pnPort pnHeaderString) fprintf(pnPort "TYPE JA(IC,A)=VB(IC*XJ*A,XJ*XR*A,XJ*XR*XR*A*A);\n") fprintf(pnPort "TYPE JB(IC,A)=VB(IC*XJ*A,XJ,XJ);\n") fprintf(pnPort "TYPE JC(IC,A)=VB(IC*XJ*A,1,1);\n") ;;; Oct 2, 1995 addition: ;;; DAREA is the new global standard external with default value of 2 ;;; (see rsfq.basic nlpglobals) ;;; DAREA-2 gives missing area of the junction in um^2 ;;; DIC (Delta Ic) is the local external of the XJ5 type, ;;; the only difference is that it is additive, not multiplicative ;;; and DIC-1 gives local change in Ic in PSCAN units fprintf(pnPort "TYPE JD(IC,DIC)=RC(IC*XJ+XJ*0.16-XJ*DAREA*0.08+DIC-1,XR/IC,XC*IC);\n") fprintf(pnPort "END\n") close(pnPort))) )) ) ; ** procedure ** ;... pnWriteMakeFile .......... Sep 5 95 sasha 813 (procedure pnWriteMakeFile() thisCellId = pnGetCurrentCellId() pnMakeFile = strcat(pnWorkingDir "/Makefile") (cond ( getShellEnvVar("PSCAN") (cond ( ! isFile(pnMakeFile) && ! isFile(strcat(pnWorkingDir "/makefile")) pnPort = outfile(pnMakeFile) (cond (! pnPort printf("Cannot open %s for writing!\n" pnMakeFile )) (t printf("Creating %s ...\n" pnMakeFile) fprintf(pnPort "#######################################################\n#\tSUNY at Stony Brook RSFQ Laboratory\n#\t\t PSCAN\n#######################################################\n") fprintf(pnPort "PROJECT = %s\n" thisCellId ->cellName) fprintf(pnPort "CIRFILES = netlist.cir extern.cir xextern.cir type.cir script.cir testpatt.cir tclcowb.cir\n") fprintf(pnPort "OBJFILES = \nFORFILES =\n") fprintf(pnPort "include $(PSCAN)/pscan.makefile\n") close(pnPort))) )) ) (t printf("Note: Environment variable PSCAN is not set!\n Makefile not created.\n Recommended value of $PSCAN is /home/rsfq1/cad/pscan\n"))) ) ; ** procedure ** ;... pnCopyPscanrcTcl ......... Dec 11 94 sasha 814 (procedure pnCopyPscanrcTcl() ;_Oct 15 99 paul 211 pnPscanrcTclFile = "/.pscanrc.tcl" pnPscanrcTclTargetFile = strcat(pnWorkingDir pnPscanrcTclFile) pnPSCAN_TCL_LIB = getShellEnvVar("PSCAN_TCL_LIB") (cond ( stringp(pnPSCAN_TCL_LIB) pnPscanrcTclSourceFile = strcat(pnPSCAN_TCL_LIB pnPscanrcTclFile) (cond ( ! isFile(pnPscanrcTclTargetFile) pnCopyCommand = sprintf(result "cp %s %s " pnPscanrcTclSourceFile pnPscanrcTclTargetFile ) (cond (isFile(pnPscanrcTclSourceFile) printf("Copying %s to %s ...\n" pnPscanrcTclSourceFile pnWorkingDir) csh(pnCopyCommand)) (t printf("File %s not found!\n" pnPscanrcTclSourceFile)))))) (t printf("Note: Environment variable PSCAN_TCL_LIB is not set!\n Recommended value of $PSCAN_TCL_LIB is /home/rsfq1/cad/pscan/lib/tcl\n"))) ) ; ** procedure ** (procedure pnCopyProgramCir() ;; copies "~cdsuser/tclcowb.cir" into pnWorkingDir ;; uses pnCDSuserDir variable pnProgramCirFileName = "/tclcowb.cir" pnProgramCirSourceFile = strcat(pnCDSpersonalDir pnProgramCirFileName) pnProgramCirTargetFile = strcat(pnWorkingDir pnProgramCirFileName) (cond ( ! isFile(pnProgramCirTargetFile) pnCopyCommand = sprintf(result "cp %s %s; chmod u+rw %s " pnProgramCirSourceFile pnProgramCirTargetFile pnProgramCirTargetFile) (cond (isFile(pnProgramCirSourceFile) && isReadable(pnProgramCirSourceFile) printf("Copying %s to %s ...\n" pnProgramCirSourceFile pnProgramCirTargetFile) csh(pnCopyCommand)) (t printf("File %s not found or not readable!\n" pnProgramCirSourceFile))) )) ) ; ** procedure ** ;... pnNetlist ................ Jun 18 95 sasha 660 (procedure pnNetlist() ;_Jan 5 00 paul 514 pnFNLp = t pnHNLp = nil pnLM2CIRNLp = nil pnCheckModelsExternals(t) deInstallApp(getCurrentWindow() "Other-Schematic") schHiCheckAndSave() deInstallApp(getCurrentWindow() "Schematics") ;;; pnGenerateHeader() sets up pnHeaderString used also in pnNetlistHeader() pnGenerateHeader() pnWriteExternCir() pnWriteXExternCir() pnWriteTypeCir() pnWriteMakeFile() pnCopyPscanrcTcl() pnCopyProgramCir() simRunSimAndNetForm ->simFormSimName->value = "other" simRunSimAndNetForm ->simFormSimOtherName->value = "pscan" simRunSimAndNetForm ->simFormSimRunReadOnly->value = pnWorkingDir simRunSimAndNetForm -> simFormRunAction -> simDoSimulateAction ->value = nil simRunSimAndNetForm -> simFormRunBackground ->value = '(nil) ; simRunNetAndSim() simNetlistFileName = "netlist.cir" simNetlistHier = nil hiDisplayForm( simRunSimAndNetForm ) ) ;... pnLM2CIRNetlist .......... Jun 18 95 sasha 492 (procedure pnLM2CIRNetlist() ;; flat netlister for lm2cir pnFNLp = nil pnHNLp = nil pnLM2CIRNLp = t pnCheckModelsExternals(t) deInstallApp(getCurrentWindow() "Other-Schematic") schHiCheckAndSave() deInstallApp(getCurrentWindow() "Schematics") simRunSimAndNetForm ->simFormSimRunReadOnly->value = pnWorkingDir simRunSimAndNetForm -> simFormRunAction -> simDoSimulateAction ->value = nil simRunSimAndNetForm -> simFormRunBackground ->value = '(nil) simNetlistFileName = "netlist.spi" simNetlistHier = nil hiDisplayForm( simRunSimAndNetForm ) ) ;... pnHierNetlist ............ Jun 18 95 sasha 1767 (procedure pnHierNetlist() ;_Jan 5 00 paul 0 pnFNLp = nil pnHNLp = t pnLM2CIRNLp = nil thisCellId = pnGetCurrentCellId() pnCheckModelsExternals(t) deInstallApp(getCurrentWindow() "Other-Schematic") schHiCheckAndSave() deInstallApp(getCurrentWindow() "Schematics") ;;; pnGenerateHeader() sets up pnHeaderString used also in pnNetlistHeader() pnGenerateHeader() pnWriteTypeCir() pnWriteMakeFile() pnCopyPscanrcTcl() pnCopyProgramCir() simRunSimAndNetForm ->simFormSimName->value = "other" simRunSimAndNetForm ->simFormSimOtherName->value = "pscan" simRunSimAndNetForm ->simFormSimRunReadOnly->value = pnWorkingDir simRunSimAndNetForm -> simFormRunAction -> simDoSimulateAction ->value = nil simRunSimAndNetForm -> simFormRunBackground ->value = '(nil) ; simRunNetAndSim() pnXExtTable = makeTable("table2" 1.0) ;; all these tables pnNetlistMapTable = makeTable("table4") ;; will be updated in pnXExtMapTable = makeTable("table5" 1.0) ;;; pnNetlistMapTable[pnFlatName]=pnHierName i.e J117 -> /I1/J1 pnMacroCellsList = nil ;; this list will keep the names of all macros used ;; it does not include the top cell ;; pnMacroCellsList + pnTopCellName gives all used cells; ;; format of the cell name is ("libname" "cellname") pnCellObjectsTable = makeTable("table7") ;; collected in HNL ;;; pnCellObjectsTable[cellName] is an assoc list ;;; of pairs ("objectname" ObjCellName), it is essential for ;;; ObjCellName is a list(libName cellName) ;;; traversing the hierarchy - pnBrowseHier uses it pnNodesTable = makeTable("table10" nil) ;; collected in HNL ;;; pnNodesTable["cellname"]= assoc list of pairs ("netname" nodeslst) ;;; where nodeslist is an assoc list of pairs ("objname" "portname") ;;; it will be processed after HNL to produce the ;;; nodes.map file of the following format: ;;; /M3/M6 in /M3/M5 out simNetlistFileName = "netlist.cir" simNetlistHier = t ; we run HNL first hiDisplayForm( simRunSimAndNetForm ) ;; inits and starts HNL, it uses the ;;; "/home/matilda/cadence/tools/dfII/etc/skill/hnl/pscan.ile" file pnGetHierExternals() ;; gets the pnExtMapList and pnHierExtList pnWriteExternCir(pnHierExtList) pnGetMacroTables() ; we'll need pnExtMapList and ;;; pnPathMacroTable to get the externals right in pnFindModel ;; we should exclude from ;;pnPathMacroList all cells not requiring hSFQHDL description pnPrintList("/cells.map" pnPathMacroList) ;; used by perl script ;;; when preparing flat script ;;; before Feb 1, 1995 we called pnPurgedPathMacroList() here ;;; which is now obsolete but not deleted pnGetNodesMapList() ;; creates pnNodesMapList from pnNodesTable ;; uses pnHierCellsList, pnCellObjectsTable and pnPathMacroTable ;; and pnMacroCellsList pnPrintList("/nodes.map" pnNodesMapList) ;; used by perl script simNetlistHier = nil ; now we run FNL , nil is the default value netlist() pnWriteXExternCir() ; pnXExtTable will be updated by FNL in pnNameFormat pnPrintTable("/netlist.map" pnNetlistMapTable) ;; these 2 files are for pnPrintTable("/xextern.map" pnXExtMapTable) ;; the tcl interface pnPrintList("/extern.map" pnExtMapList) ;; for tcl interface ;;;######################################################################### ;;;!!!!!!! THIS IS THE ONLY LINE YOU !!!!!!!!!!!!!!!!!!!!!!!!!!! ;;;!!!!!!! HAVE TO COMMENT OUT IF YOU DON'T WANT !!!!!!!!!!!!!!!!!!!!!!!!!!! ;;;!!!!!!! SFQHDL VIEWS TO BE EXTRACTED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! pnExtractScripts() ;; extracts sfqhdl views ;; to files, signals a warning if a view is not found ;;;######################################################################### ;;;######################################################################### ;;;!!!!!!! THIS IS THE ONLY LINE YOU !!!!!!!!!!!!!!!!!!!!!!!!!!! ;;;!!!!!!! HAVE TO COMMENT OUT IF YOU DON'T WANT !!!!!!!!!!!!!!!!!!!!!!!!!!! ;;;!!!!!!! hSFQHDL GENERATING SCRIPT TO BE RUN AUTOMATICALLY !!!!!!!!!!!!!! pnRunhSFQHDLscript() ;;;######################################################################### ) ; ** procedure ** ;;;; for generating script we need the files "/cells.map", "/nodes.map" ;;;; and "/netlist.map" + all relevant cir scripts. ;;;; for tcl interface we need "/netlist.map", "/extern.map", "/xextern.map" ;;;; and "script.map" - this last file contains maps of rules and values ;;;; it is generated by the perl script. ;... pnRunhSFQHDLscript ....... Dec 27 94 sasha 394 (procedure pnRunhSFQHDLscript() ;; copies "~cdsuser/script.pl" into pnWorkingDir ;; and executes it ;; uses pnCDSuserDir variable (setq pnPerlScript "/script.pl") printf("Running %s .... \n" pnPerlScript) pnCopiedPerlScript = strcat(pnWorkingDir pnPerlScript) (csh sprintf(result "cd %s; cp %s%s .; chmod u+rwx %s; %s " pnWorkingDir pnCDSuserDir pnPerlScript pnCopiedPerlScript pnCopiedPerlScript)) ) ; ** procedure ** ;... pnPurgedPathMacroList .... Feb 1 95 sasha 369 (procedure pnPurgedPathMacroList() ;_Oct 15 99 paul 0 ;; we should exclude from pnPathMacroList ;; all cells not requiring hSFQHDL description ;; uses: pnPathMacroList and pnHierCellsList ;; returns: purged list ;; we are not doing it in pnBrowseHier for the sake of clarity ;; ;; As of Feb 1, 1995 this situation has changed: ;; script.pl supports hier. referneces to elements and rules ;; so that any cell can have a hSFQHDL script attached to it (let (dummy purgedList pair triplet) purgedList = nil dummy = pnPathMacroList (while dummy triplet = car(dummy) pair = cdr(triplet) (cond ( ! assoc(pair pnHierCellsList) || cadr(assoc(pair pnHierCellsList)) purgedList = cons(triplet purgedList) )) dummy = cdr(dummy)) purgedList ) ; ** let ** ) ; ** procedure ** ;... pnExtractScripts ......... Dec 27 94 sasha 0 (procedure pnExtractScripts() ;_Oct 18 99 paul 2292 (let (dummy pair lib cell libId cvId index1 index2 version path) ;; extracts sfqhdl views to files in pnWorkingDir ;; signals a warning if a view is not found ;; uses: pnMacroCellsList, pnTopCellName and ;; pnHierCellsList. First two give the names of all cells used, ;; while pnHierCellsList tells us if a particular cell ;; does not require as sript - it happens whenever a cell consists ;; exclusively of macrocells. pnAllCellsList = cons(pnTopCellName pnMacroCellsList) dummy = pnAllCellsList ;; compare with pnGetHierExternals() (while dummy pair = car(dummy) lib = car(pair) cell= cadr(pair) libId = ddGetObj(lib) (cond (libId cvId = ddGetObj( lib cell "sfqhdl" ) ;; if the "sfqhdl" cellview is not found ;; it's an error unless assoc(pair pnHierCellsList) is not nil ;; but cadr(assoc(pair pnHierCellsList)) is ;; ex.: (("ar" "DflipflopTest") t) gives pureMacroCellp = nil ;; and (("ar" "DflipflopTest") nil) gives pureMacroCellp = t ;; if a cell is not in pnHierCellsList pureMacroCellp = nil pureMacroCellp = assoc(pair pnHierCellsList) && ! cadr(assoc(pair pnHierCellsList)) (cond ( ! cvId && ! pureMacroCellp printf("WARNING: couldn't find the \"sfqhdl\" cellview for cell %s in library %s\n" cell lib) ) ( cvId ;; car(cvId->versions) gives the latest version ;;;; ;;;; P.Bunyk's patch ;;;; ; old version: ; index1 = car(cvId->versions)->primaryIndex ; index2 = car(cvId->versions)->secondaryIndex ; version = strcat( pnGetString(index1) "." pnGetString(index2) ) ; (cond (index1 == 0 && index2 == 0 ; (cond ; (dbFindOpenCellView(libId cell "sfqhdl" version) ; dmCloseCellView(libId car(cvId->versions)))) ; dmCheckin(libId cell "sfqhdl" nil nil nil nil) ; index2 = index2 + 1 ; version = strcat( pnGetString(index1) "." pnGetString(index2) ) ; )) path = strcat(pnWorkingDir "/" lib "." cell ".cir") printf("Extracting cell %s from library %s to file %s\n" cell lib path) ;; patch itself: ; dmExtract(libId cell "sfqhdl" version path) )))) (if (null (setq fpath (strcat (ddGetObj lib cell "sfqhdl" nil)~>readpath "/text.txt"))) (let ((verId (ddGetObj lib cell "sfqhdl" "" "" "r"))) (setq fpath (strcat (ddGetObj libId cell "sfqhdl" nil)~>readpath "/text.txt")) ;;; Paul's patch for his patch: ;;; Do not move (i.e. delete) checked-out views but copy: (if verId->checkOuts (progn (printf "Copying checked-out %s to %s ... \n" fpath path) (csh (strcat "/bin/cp " fpath " " path ))) (progn (printf "Moving a copy of non-checked-out %s to %s ... \n" fpath path) (csh (strcat "/bin/mv " fpath " " path )))) (ddReleaseObj verId)) (progn (printf "WARNING: you are editing \"sfqhdl\" cellview for cell \n %s in library %s right now\n extracting the current version\n" cell lib) (csh (strcat "/bin/cp " fpath " " path)) ;(printf "Copying %s to %s ... \n" fpath path) )))))) dummy = cdr(dummy)) ) ; ** let ** ) ; ** procedure ** (procedure pnGetNodesMapList() ;_Oct 15 99 paul 0 (let (path path1 path2 port1 port2 nodeName cname nodeslist objList objName objPort objCell objNumber counter) ;; creates pnNodesMapList from pnNodesTable ;; uses pnHierCellsList, pnCellObjectsTable, pnPathMacroTable ;; and pnMacroCellsList ;; the algorithm is this: ;; for every possible path in pnPathMacroTable take a cell ;; and check if it is in pnHierCellsList, if it is take all its nets using ;; pnNodesTable, for every object on every net check if it is ;; a macro cell using pnCellObjectsTable, if it's not, we take ;; another object on this net, if it is we count it find ;; its path and continue until one of the following happens: ;; 1. we find another macro on the same net - we form ;; a pnNodesMapList entry path1 port1 path2 port2 and continue - ;; if we find more than 2 macros on the same net it is an error. ;; 2. it's the only one macro on the net - we assume then ;; that the cell containing this net has a "port" with the same name ;; -- for the top cell it is not a port - it has no ports - but a named ;; net, this name will be used when generating a flat script -- ;; and generate an entry for the pnNodesMapList with pathes ;; on different levels of the hierarchy ;; 3. there are no macros on the net - we just continue. ;; we also check that top cell doesn't have ports pnNodesMapList = nil (foreach path pnPathMacroTable cname = pnPathMacroTable[path] (cond ( assoc(cname pnHierCellsList) nodeslist = pnNodesTable[cname] (while nodeslist nodeName = car( car(nodeslist) ) objList = cadr( car(nodeslist) ) objNumber = length(objList) (cond (objNumber <= 1 && path == "/" printf("!\n!\n!\n\t ERROR: Top Cell has ports!\n!\n!\n"))) counter = 0 (while objList objName = car( car(objList) ) objPort = cadr( car(objList) ) objCell = cadr( assoc(objName pnCellObjectsTable[cname]) ) (cond ( member(objCell pnMacroCellsList) && counter == 0 counter = 1 path1 = strcat(path objName "/") port1 = objPort ) ( member(objCell pnMacroCellsList) && counter == 1 counter = 2 path2 = strcat(path objName "/") port2 = objPort ) ( member(objCell pnMacroCellsList) && counter == 2 printf(" ERROR: more than 2 macros on the same net!!\n Check cell %L , node %L !!\n" cname nodeName) )) objList = cdr(objList)) ; while objList (cond (counter == 1 pnNodesMapList = cons( list(path nodeName path1 port1) pnNodesMapList ) ) (counter == 2 pnNodesMapList = cons( list(path1 port1 path2 port2) pnNodesMapList ) )) nodeslist = cdr(nodeslist)))))) ) ; ** procedure ** ;... pnGetMacroTables ......... Dec 23 94 sasha 906 (procedure pnGetMacroTables() ;_Oct 15 99 paul 0 (let (path key) ;;; this procedure gathers the pnPathMacroTable and pnMacroPathTable. ;;; pnObjectsTable[cellName]= assoc list of pairs ("objectname" ObjCellName) ;;; the idea is that using these 3 things: ;;; pnMacroCellsList, pnCellObjectsTable and pnTopCellName ;;; we should be able to get 2 tables: ;;; pnPathMacroTable["/I1/I0"]="xor" - we need this table ;;; for correcting the externals (pnValueNames) when we ;;; run the FNL, ;;; and pnMacroPathTable["xor"]=list("/I1/I0" "/I2" ...) - we ;;; could use it to get ; I guess we don't need it ;;; the flat names of elements to substitute into flat script pnPathMacroTable = makeTable("table8") pnMacroPathTable = makeTable("table9" nil) pnHierCellsList = nil ;; assoc list of lists: ((cellName isMixed)) ;;; includes the top cell ;;; hier macro cell is mixed when it contains ;;; both macros and flat objects ;;; we use pnHierCellsList when generating import-export pairs, ;;; in pnGetNodesMapList() ;;; and preparing flat script. for example, if top cell is flat ;;; or hier-mixed without script (sfqhdl cellview) we'll signal an ;;; error path = "/" ; we start from the top key = pnTopCellName pnPathMacroTable[path] = key pnPathMacroList = list( cons(path key) ) ; differs from pnPathMacroTable only ;; by format pnBrowseHier(path key) ;; most of the work is done here ) ; ** let ** ) ; ** procedure ** ;... pnBrowseHier ............. Dec 22 94 sasha 1115 (procedure pnBrowseHier(path key) ;_Oct 15 99 paul 0 ;;; gathers pnHierCellsList and pnPathMacroTable ;;; this is a recursive procedure, it takes apart ;;; the hierarchy: given a cell it takes all its objects, ;;; if the object is not a macro it takes another one, ;;; if it is, we apply this procedure to it. ;;; no logical checks are performed - they are built into dfII anyway ;;; the keys of pnCellObjectsTable are fullNames, i.e. ;;; libName-cellName pairs ;;; values of pnCellObjectsTable are pnObjectList's - ;;; their format is (("M5" ("lib" "xor"))("J6" ("rsfq.basic" "jj")) ...) ;;; so, id is a string "M5" and oname is a list ("lib" "xor") (let (lpath oname olist flatp mixedp) olist = pnCellObjectsTable[key] flatp = t ;; flatp==t && any mixedp - not hier mixedp = nil ;; flatp==nil - hier can be mixed or pure (while olist pair = car(olist) id = car(pair) oname= cadr(pair) (cond ( member(oname pnMacroCellsList) ;;; "/" is a good delimeter and FNL uses it by default ;;; hopefully, we will never have to change it lpath = strcat(path id "/") ; "/" goes into "/I1/" pnPathMacroTable[lpath] = oname pnPathMacroList = cons( cons(lpath oname) pnPathMacroList ) pnMacroPathTable[oname] = cons(lpath pnMacroPathTable[oname]) flatp = nil pnBrowseHier(lpath oname) ) (t mixedp = t)) olist = cdr(olist)) (cond ( ! assoc(key pnHierCellsList) && ! flatp pnHierCellsList = cons( list(key mixedp) pnHierCellsList)))) ) ; ** procedure ** ;;;######################################################## ;;;# ;;;# netlister formatting functions !! should be encrypted !! ;;;# ;;;# ;;;######################################################### ;... pnLineFormat ............. Jun 18 95 sasha 581 (procedure pnLineFormat(isGnded) ;_Oct 15 99 paul 0 ;; NLPElementPostamble's previous value ;; was nlpExpr("[@pnFindName] ([|UP],[|DOWN]) = [@pnFindModel]") ;; and pnFindName was ilExpr pointing to pnNameFormat(), ;; pnFindModel was ilExpr pointing to pnModelFormat() (prog ( instId formatString name model value UPnum DOWNnum) instId = fnlCurrentInst() name = pnNameFormat() model = pnModelFormat() value = cdfGetInstCDF(instId)-> pnValue ->value UPnum = fnlTermCdsNameExtName("UP") (cond (isGnded DOWNnum = "0") (t DOWNnum = fnlTermCdsNameExtName("DOWN")) ) (cond (pnFNLp || pnHNLp sprintf(formatString "%s(%s,%s) = %s" name UPnum DOWNnum model)) (pnLM2CIRNLp sprintf(formatString "%s %s %s %f" name UPnum DOWNnum value)) (t sprintf(formatString "ERROR in pnLineFormat()")) ) ; ** cond pnFNLp ** return(formatString) ) ; ** prog ** ) ; ** procedure ** (procedure pnModelFormat() ;_Oct 15 99 paul 0 (cond (pnFNLp pnFormatString = cdfGetInstCDF( fnlCurrentInst())->pnModel->value (cond (pnFormatString && substring(pnFormatString 1 1) == "'" pnFormatString = substring(pnFormatString 2))) (cond (pnFormatString pnFormatString)(t ""))) (pnHNLp pnCurrentInstId = fnlCurrentInst() pnFormatString = cdfGetInstCDF(pnCurrentInstId)->pnModel->value pnName = dbGet(pnCurrentInstId "name" ) pnPrefix = nil (cond (pnName && pnName != "" pnPrefix = substring(pnName 1 1))) (cond (pnPrefix pnName = strcat(pnPrefix fnlCurrentInstExtName ))) (cond (pnFormatString && substring(pnFormatString 1 1) == "'" pnFormatString = substring(pnFormatString 2)) (pnFormatString && pnPrefix pnFormatString = pnFindModel(nil pnName pnCurrentInstId )) (t ""))) (t "")) ; ** cond pnFNLp ** ) ; ** procedure ** ;... pnNameFormat ............. Jun 18 95 sasha 61 (procedure pnNameFormat() ;_Oct 15 99 paul 0 (cond (pnFNLp || pnLM2CIRNLp pnName = dbGet( fnlCurrentInst() "name" ) (cond (pnName pnName) (t ""))) (pnHNLp pnName = dbGet( fnlCurrentInst() "name" ) (cond (pnName && pnName != "" pnPrefix = substring(pnName 1 1) pnHierName = fnlCurrentInstCdsName() pnFlatName = strcat( pnPrefix fnlCurrentInstExtName ) pnNetlistMapTable[pnFlatName] = pnHierName pnXFlatName = strcat("X" pnFlatName ) pnXExtTable[pnXFlatName] = 1.0 pnXExtMapTable[pnXFlatName] = strcat("X@" pnHierName) pnFullName = strcat("{ " pnHierName " } " pnFlatName)) (t ""))) (t "")) ; ** cond pnFNLp ** ) ; ** procedure pnNameFormat ** ;... pnNetlistHeader .......... Dec 18 94 sasha 120 (procedure pnNetlistHeader() ;_Oct 15 99 paul 0 (cond (pnFNLp pnHeaderString ) (pnHNLp pnHeaderString ) (t "")) ) ; ** procedure ** (procedure pnNetlistFooter() ;_Oct 15 99 paul 0 ;; NLPnetlistFooter previous value was "END" (cond (pnFNLp || pnHNLp "END") (pnLM2CIRNLp pnPrintCellTerminals() ".END") ) ) ; ** procedure pnNetlistFooter ** ;... pnPrintCellTerminals ..... Jun 18 95 sasha 99 (procedure pnPrintCellTerminals() ;_Oct 15 99 paul 0 ;; used in lm2cir netlister ;; outputs terminals as phase sources (let (cellId termId sigName termNum termName tline) cellId = fnlTopCell() foreach(termId cellId~>terminals sigName = termId~>name termNum = fnlNetCdsNameExtName( sigName ) termName= strcat("P" termId~>name) sprintf(tline "%s %s 0 1.0\n" termName termNum) fnlPrint( tline )) ) ; ** let ** ) ; ** procedure ** (procedure pnCreateNetString() ;_Oct 15 99 paul 0 (cond (pnFNLp strcat("{" fnlCurrentSigPathName() "}\n")) (pnHNLp strcat("{" fnlCurrentSigPathName() "}\n")) (t "")) ) ; ** procedure pnCreateNetString ** ;;;######################################################## ;;;# ;;;# menus and stuff ;;;# ;;;# ;;;######################################################### (setq pnWorkingDir (strcat getWorkingDir() "/pscan.run")) ;... pnAddPSCANmenu ........... Feb 23 95 sasha 1088 pnMenuEnableTable = makeTable("table13" nil) ;... pnAddPSCANmenu ........... Sep 19 95 sasha 1175 (procedure pnAddPSCANmenu() ;_Jan 5 00 paul 1484 pnInitItem = hiCreateMenuItem(?name 'pnInitItem ?itemText "Initialize PSCAN Netlister" ?callback "pnInit()") pnFlatNetlistItem = hiCreateMenuItem(?name 'pnFlatNetlistItem ?itemText "FNL" ?callback "pnNetlist()") pnHierNetlistItem = hiCreateMenuItem(?name 'pnHierNetlistItem ?itemText "HNL" ?callback "pnHierNetlist()") pnLM2CIRNetlistItem = hiCreateMenuItem(?name 'pnLM2CIRNetlistItem ?itemText "lm2cir netlister" ?callback "pnLM2CIRNetlist()") pnViewWavesItem = hiCreateMenuItem(?name 'pnViewWavesItem ?itemText "Show Waveforms" ?callback "simWaveOpen()") ;;; how I found this callback - simWaveOpen(): ;;; 1. hiGetBannerMenus(hiGetCurrentWindow()) in "Other-Schmatic" mode ;;; 2. simPullDownMenu~>?? ;;; 3. simViewWavesMenuItem~>?? pnReadNewValuesItem = hiCreateMenuItem(?name 'pnReadNewValuesItem ?itemText "Read new values" ?callback "pnReadNewValues()") pnGo2Item = hiCreateMenuItem(?name 'pnGo2Item ?itemText "go 2" ?callback "pnGo2Cols()") pnPSCANMenu = hiCreatePulldownMenu('pnPSCANMenu "PSCAN" list('pnInitItem 'pnFlatNetlistItem 'pnHierNetlistItem 'pnLM2CIRNetlistItem 'pnViewWavesItem 'pnReadNewValuesItem 'pnGo2Item)) (cond ( ! pnMenuEnableTable[ hiGetCurrentWindow() ] hiDisableMenuItem( pnPSCANMenu 'pnFlatNetlistItem ) hiDisableMenuItem( pnPSCANMenu 'pnHierNetlistItem ) hiDisableMenuItem( pnPSCANMenu 'pnLM2CIRNetlistItem ) hiDisableMenuItem( pnPSCANMenu 'pnViewWavesItem ) )) hiInsertBannerMenu( hiGetCurrentWindow() 'pnPSCANMenu 100) ) ; ** procedure ** ;... pnOKInitCB ............... Jun 18 95 sasha 1448 (procedure pnOKInitCB(form "r") ;_Jan 5 00 paul 909 pnWorkingDir = form->pnWorkingDirField->value (cond ( ! isDir(pnWorkingDir) hiDisplayAppDBox( ?name 'pnWorkingDirNotFoundBox ?dboxText sprintf(result "%s directory not found!\n create it?" pnWorkingDir) ?callback "createDir(pnWorkingDir)"))) (cond ( ! isDir(pnWorkingDir) hiDisplayAppDBox( ?name 'pnParentWorkingDirNotFoundBox ?dboxText sprintf(result "%s not created!\n check if the parent directory exists\n" pnWorkingDir)))) (cond ( isDir(pnWorkingDir) hiFormUnmap(form) pnWriteSiEnv() deInstallApp(getCurrentWindow() "Other-Schematic") deInstallApp(getCurrentWindow() "Schematics") ; simInitEnvFormAction() simInitEnvOptionsForm -> simFormSimRun ->value = pnWorkingDir simInitEnvOptionsForm -> simFormSimName ->value = "other" simInitEnvOptionsForm -> simFormSimOtherName ->value = "pscan" thisCellId = pnGetCurrentCellId() simInitEnvOptionsForm -> simFormSimLibName ->value = thisCellId -> libName simInitEnvOptionsForm -> simFormSimCellName ->value= thisCellId ->cellName simInitEnvOptionsForm -> simFormSimViewName ->value= thisCellId->viewName hiDisplayForm(simInitEnvOptionsForm) (cond (! pnMenuEnableTable[ hiGetCurrentWindow() ] hiEnableMenuItem(pnPSCANMenu 'pnFlatNetlistItem ) hiEnableMenuItem(pnPSCANMenu 'pnHierNetlistItem ) hiEnableMenuItem(pnPSCANMenu 'pnLM2CIRNetlistItem ) hiEnableMenuItem(pnPSCANMenu 'pnViewWavesItem ))) pnMenuEnableTable[ hiGetCurrentWindow() ] = t )) ) ; ** procedure ** ;... pnInit ................... Sep 19 95 sasha 18083 (procedure pnInit() pnWorkingDirForm = hiCreateAppForm( ?name 'pnWorkingDirForm ?formTitle "PSCAN Netlister Initialization Form" ?callback list('pnOKInitCB nil) ?fields list( list( hiCreateStringField( ?name 'pnWorkingDirField ?prompt "PSCAN Working Directory:" ?value pnWorkingDir) 10:10 750:30 200 )) ?help "" ?unmapAfterCB t ?initialSize 800:250 ) hiDisplayForm(pnWorkingDirForm) hiMoveInsBarToEnd(pnWorkingDirForm 'pnWorkingDirField) ) ; ** procedure lmInit ** ;... pnOKReadNewValuesCB ...... Feb 8 95 sasha 1386 ;;;######################################################## ;;;# ;;;# Update of externals ;;;# ;;;# ;;;######################################################### ;... pnOKReadNewValuesCB ...... Feb 22 95 sasha 4760 (procedure pnOKReadNewValuesCB(form "r") ;_Jan 10 00 paul 8767 (let (result port ext val pair dummy dummy2 pair2 ext2 val2 lib cell lib2 cell2 extFoundp flatName cellId entry) ;;; THIS IS THE MAIN PROCEDURE RESPONSIBLE FOR EXTERNAL VALUES UPDATE ;;; works as follows: ;;; 1. pnExtList of the current (top-level) cellview is updated. ;;; Works both for FNL and HNL. ;;; 2. If some other parameters are found in pnNewValsFile then ;;; extern.map is looked for ;;; and if found hierarchical update is done. ;;; Of course, updating is done only for changed externals and all updates ;;; are documented. Externals that are not found anywhere are ignored. pnNewValsFile = form-> pnFileNameField ->value pnPerformRoundingOfCC = form-> pnRoundValuesButtonField ->value (cond ( ! isFile(pnNewValsFile) hiDisplayAppDBox( ?name 'pnNewValsFileNotFoundBox ?dboxText sprintf(result "file %s not found!" pnNewValsFile) ) ) (t ;;; we read in the values into the pnInNewExtList port = infile(pnNewValsFile) pnInNewExtList = nil while( fscanf(port "%s %f " ext val) pnInNewExtList = cons( list(ext val) pnInNewExtList ) ) close(port) ;;; pnInNewExtList is now gathered and we can start the main loop. ;;; first, we check the top-cell externals: pnGetExternals() ; gets us pnExtList thisCellId = pnGetCurrentCellId() pnTopCellId = thisCellId pnTopCellLib = pnTopCellId~>libName pnTopCellNameName = pnTopCellId~>cellName pnTopCellViewName = pnTopCellId~>viewName pnTopCellVersion = pnTopCellId~>versionName lib = thisCellId~>libName cell = thisCellId~>cellName pnOtherNewExtList = nil ; pnOtherNewExtList = pnInNewExtList - pnExtList pnExtListUpdated = nil pnUpdatesList = nil pnUpdatesRoundList = nil ;same as pnUpdatesList only with rounded vals ;;; pnUpdatesList is a list of lists of the format: ;;; (("libname" "cellname" "externalname" "oldvalue" "newvalue" "flatname")..) dummy = pnInNewExtList (while dummy pair = car(dummy) ext = car(pair) val = cadr(pair) extFoundp = nil dummy2 = pnExtList (while dummy2 pair2 = car(dummy2) ext2 = car(pair2) val2 = cadr(pair2) (cond (ext2 == ext extFoundp = t pnExtListUpdated = cons( list(ext2 val) pnExtListUpdated ) (cond ( ! suppEqual(val2 val) pnUpdatesList = cons( list(lib cell ext2 val2 val ext) pnUpdatesList ) )) )) dummy2 = cdr(dummy2)) (cond ( ! extFoundp pnOtherNewExtList = cons( list(ext val) pnOtherNewExtList ) )) dummy = cdr(dummy)) ;;; now we update individual values of elements: pnPropagateExtListToSch(thisCellId) ;;; some of the values *might* have changed due to rounding of crit. currents ;;; so we have to refresh the pnExtListUpdated dummy = pnExtListUpdated pnExtListUpdated = nil (while dummy pair = car(dummy) ext = car(pair) val = cadr(pair) extFoundp = nil dummy2 = pnUpdatesRoundList (while dummy2 entry = car(dummy2) lib2 = nth(0 entry) cell2 = nth(1 entry) ext2 = nth(2 entry) val2 = nth(4 entry) (cond (thisCellId~>libName == lib2 && thisCellId~>cellName == cell2 && ext2 == ext extFoundp = t pnExtListUpdated = cons( list(ext val2) pnExtListUpdated ))) dummy2 = cdr(dummy2)) (cond ( ! extFoundp pnExtListUpdated = cons( list(ext val) pnExtListUpdated ) )) dummy = cdr(dummy)) ;;; save the updated and *refreshed* externals: ;;; for FNL pnExtListUpdated virtually coincides with the pnExtList. ;;; it is not so for HNL, the mapped part of pnExtList will be updated later. ;;; here we just re-write it. dummy = pnExtList pnExtListTopCellUpdated = pnExtListUpdated (while dummy pair = car(dummy) ext = car(pair) (cond ( ! assoc(ext pnExtListUpdated) pnExtListTopCellUpdated = cons(pair pnExtListTopCellUpdated) )) dummy = cdr(dummy)) dbSet(thisCellId pnExtListTopCellUpdated "pnExternals") schHiCheckAndSave() ;; and that's it for FNL (top cell in HNL) ;;; pnOtherNewExtList is now collected and we can perform ;;; hierarchical update using the pnMacroCellsList and "extern.map" ;;; from the HNL ;;; first, we check if extern.map exists : pnExternMapFile = strcat(pnWorkingDir "/extern.map") (cond ( ! isFile(pnExternMapFile) pnHNLUpdatep = nil printf("file %s not found, hierarchy not updated\n" pnExternMapFile)) (t pnHNLUpdatep = hiDisplayAppDBox( ?name 'pnExternMapFileFoundBx ?dboxText sprintf(result "file %s found\n proceed with hierarchical update?" pnExternMapFile )))) (cond (pnHNLUpdatep ;;; now we read extern.map (cond ( isFile(pnExternMapFile) port = infile(pnExternMapFile) pnInExtMaplist = nil ; same as pnExtMapList, only ;;; read in from the extern.map file (while fscanf(port "%s %s %s %s" flatName lib cell ext) pnInExtMaplist = cons( list(flatName lib cell ext) pnInExtMaplist)) close(port) )) ;;; we proceed as follows: ;;; 1. find ( using pnOtherNewExtList, pnInExtMaplist and pnExternals of ;;; this cell ) what externals in what cells need updating and ;;; collect all those needing it into a table pnHierUpdateTable ;;; that has a cellId as a key and list of lists of externals ;;; as entries of the form ((external oldvalue newvalue flatname)..) pnHierUpdateTable = makeTable("table12" nil) dummy = pnOtherNewExtList (while dummy pair = car(dummy) flatName = car(pair) val = cadr(pair) entry = assoc(flatName pnInExtMaplist) ;;; if flatName =="Q14" ;;; entry might look as ("Q14" "sasha.schematic.std" "cb" "JA") (cond (entry lib = nth(1 entry) cell = nth(2 entry) ext = nth(3 entry) cellId= dbOpenCellView(lib cell "schematic" nil "a") pair2 = assoc(ext dbGet(cellId "pnExternals")) ;;; pair2 might look as ("JA" 1.96) val2 = cadr(pair2) ; val2 is the old value (cond ( val2 != nil && ! suppEqual(val2 val) pnUpdatesList = cons( list(lib cell ext val2 val flatName) pnUpdatesList ) pnHierUpdateTable[cellId] = cons( list(ext val2 val flatName) pnHierUpdateTable[cellId] ))))) dummy = cdr(dummy)) ;;; using pnHierUpdateTable we can now update all cells that need it ;;; looks like we're overdoing it but the idea is to perform ;;; updates for one cell at a time ;;; pnHierUpdateTable[cellId] for cellId ;;; is roughly same as pnInNewExtList for top cell ;;; their formats are different though (foreach cellId pnHierUpdateTable pnThisCellExtList = nil dummy = dbGet(cellId "pnExternals") (while dummy pair = car(dummy) ext = car(pair) entry = assoc(ext pnHierUpdateTable[cellId]) (cond (entry pnThisCellExtList = cons( list(ext nth(2 entry)) pnThisCellExtList)) (t pnThisCellExtList = cons( pair pnThisCellExtList ))) dummy = cdr(dummy)) pnPropagateExtListToSch(cellId) ;;; here we again do same what we done to pnExtListUpdated in FNL update: ;;; check for rounded values dummy = pnThisCellExtList pnThisCellExtList = nil (while dummy pair = car(dummy) ext = car(pair) val = cadr(pair) extFoundp = nil dummy2 = pnUpdatesRoundList (while dummy2 entry = car(dummy2) lib2 = nth(0 entry) cell2 = nth(1 entry) ext2 = nth(2 entry) val2 = nth(4 entry) (cond (cellId~>libName == lib2 && cellId~>cellName == cell2 && ext2 == ext extFoundp = t pnThisCellExtList = cons( list(ext val2) pnThisCellExtList ))) dummy2 = cdr(dummy2)) (cond ( ! extFoundp pnThisCellExtList = cons( list(ext val) pnThisCellExtList ) )) dummy = cdr(dummy)) ;;; we can save it now dbSet(cellId pnThisCellExtList "pnExternals") dbSave( cellId ) pnGetCurrentCellId() ;tunes up pnCurrentWindow geOpen( ?window pnCurrentWindow ?lib cellId~>libName ?cell cellId~>cellName ?view cellId~>viewName ;; Commented out by Paul, does not work in 4.4.3 ;; ?version cellId~>versionName ?mode "a" ) schHiCheckAndSave() );foreach cellId pnHierUpdateTable ));; cond pnHNLUpdatep geOpen( ?window pnCurrentWindow ?lib pnTopCellLib ?cell pnTopCellNameName ?view pnTopCellViewName ;; Commented out by Paul, does not work in 4.4.3 ;; ?version pnTopCellVersion ?mode "a" ) pnUpdatesList = pnUpdatesRoundList dummy = pnUpdatesList (while dummy entry = car(dummy) lib = nth(0 entry) cell = nth(1 entry) ext = nth(2 entry) val = nth(4 entry) val2 = nth(3 entry) fname = nth(5 entry) pnUpdatePrint(lib cell ext val2 val fname) dummy = cdr(dummy)) (cond (pnUpdatesList pnUpdatesList = cons( list( "Library" "Cell" "External" "Old Value" "New Value" "Flat Name" ) pnUpdatesList ) pnUpdatesList = cons( list( getCurrentTime( ) ) pnUpdatesList ) pnUpdatesList = cons( list( "*******************************************************" ) pnUpdatesList ) pnPrintAnyList("/updates.log" "a" pnUpdatesList) pnUpdatesList = nil )) ));cond isFile(pnNewValsFile), includes all FNL and HNL updates ) ; ** let ** ) ; ** procedure ** ;... pnPropagateExtListToSch .. Feb 7 95 sasha 291 (procedure pnPropagateExtListToSch(cellId) ;;; we need this procedure to update individual values on ;;; schematic from the new pnExternals property ;;; we use here the pnHierUpdate function - hier. version of pnUpdate (let (dummy entry lib cell ext val val2 fname) dummy = pnUpdatesList (while dummy entry = car(dummy) lib = nth(0 entry) cell = nth(1 entry) ext = nth(2 entry) val = nth(4 entry) val2 = nth(3 entry) fname = nth(5 entry) (cond (cellId~>libName == lib && cellId~>cellName == cell pnHierUpdate(cellId ext val val2 fname))) dummy = cdr(dummy)) ) ; ** let ** ) ; ** procedure ** (procedure pnFindClosestOfTwo(val val1 val2) ;; of val1, val2 returns one which is the closest to val (let (result) val = float(val) val1 = float(val1) val2 = float(val2) (cond (abs(val - val1) >= abs(val - val2) result = val2) (t result = val1)) result) ) ; ** procedure ** ;... pnFindClosestValue ....... Feb 12 95 sasha 235 (procedure pnFindClosestValue(val list) ;; this procedure is not effective. ;; we go from left to right through a list of increasing ;; values and stop only when the smaller number is closer ;; val1 is never greater than val2 (let (dummy result val1 val2 stop) stop = nil dummy = list (while cdr(dummy) && ! stop val1 = car(dummy) val2 = car( cdr(dummy) ) (cond (val1 == pnFindClosestOfTwo(val val1 val2) stop = t result = val1)) dummy = cdr(dummy)) (cond ( ! stop result = val2 )) result) ) ; ** procedure ** (setq pnCritCurrSet list( 1.00 1.18 1.37 1.54 1.77 1.96 2.16 2.42 2.70 2.94 )) ;... pnHierUpdate ............. Feb 9 95 sasha 1352 (procedure pnHierUpdate(cellId pnUpExtName pnUpValue pnOldValue pnFname) ;_Jan 12 00 paul 0 ;;; differs from pnUpdate in one major aspect: ;;; pnUpdate serves for updating pnValues of diff. elems with ;;; same pnValueName ;;; pnHierUpdate updates not only them but also elems with unique ;;; names for externals, i.e. cases when pnValueName == "*" ;;; Note: one unforseen possible source of errors is found: ;;; case when you have a pnValueName = "LA1" and an element LA1 with ;;; pnValueName=="*". There's no good way to fix it. ;;; If pnPerformRoundingOfCC is t (the default on the pnNewValsFileForm) ;;; then we round up all values of critical currents. ;;; Josephson junction is IDed by it's name's prefix ;;; which allows us to have different elements behaving as a jj (let (upDatep isJJp cond1 cond2 rval tmpstring) pnInstList = cellId->instances (cond ( (tmpstring = (dbSearchPropByName (ddGetObj cellId~>libName) "rsfqCritCurrVals")->value ) && stringp(tmpstring) loadstring(tmpstring) ; (print tmpstring) )) (while pnInstList pnInstId = car(pnInstList) cond1 = cdfGetInstCDF(pnInstId)->pnValueName->value == pnUpExtName cond2 = cdfGetInstCDF(pnInstId)->pnValueName->value == "*" && pnInstId->name == pnUpExtName upDatep = cond1 || cond2 isJJp = substring(pnInstId->name 1 1) == "J" && pnPerformRoundingOfCC (cond (upDatep (cond (isJJp rval = pnFindClosestValue(pnUpValue pnCritCurrSet) (cond ( ! suppEqual(rval pnUpValue) printf("Rounding value %L of external %L in cell %L, library %L to %L\n", pnUpValue, pnUpExtName, cellId->cellName, cellId->libName, rval ))) pnUpValue = rval)) dbSet(pnInstId pnUpValue "pnValue"))) pnInstList = cdr(pnInstList)); while ;;; We also collect pnUpdatesRoundList here from scratch - with ;;; actual values that were updated pnUpdatesRoundList = cons( list(cellId -> libName cellId->cellName pnUpExtName pnOldValue pnUpValue pnFname) pnUpdatesRoundList ) ) ; ** let ** ) ; ** procedure ** ;... pnUpdatePrint ............ Feb 6 95 sasha 76 (procedure pnUpdatePrint(lib cell extName valOld valNew flatName) (cond (valOld != valNew printf("External %s in lib %s, cell %s is updated from %f to %f . Flat name %s\n" extName lib cell valOld valNew flatName))) );procedure ;... pnReadNewValues .......... Sep 5 95 sasha 1122 (procedure pnReadNewValues() ;;; this procedure prompts user for ;;; file to read externals from; ;;; by default it looks for a file named ext.in in the pnWorkingDir; ;;; the format of the file is canonical: ;;; D 1.960000 ;;; to get this canonical format from local format ;;; the loc2can perl script is used pnNewValsFile = strcat(pnWorkingDir "/lextract.out") (cond ( ! isFile(pnNewValsFile) pnNewValsFile = strcat(pnWorkingDir "/ext.in") )) ;;; pnWorkingDir is always defined (cond ( ! isFile(pnNewValsFile) pnNewValsFile = strcat(pnWorkingDir "/") )) pnNewValsFileForm = hiCreateAppForm( ?name 'pnNewValsFileForm ?formTitle "New Values File Form" ?callback list('pnOKReadNewValuesCB nil) ?fields list( list( hiCreateStringField( ?name 'pnFileNameField ?prompt "File:" ?value pnNewValsFile) 10:10 500:30 50 ) list( hiCreateBooleanButton( ?name 'pnRoundValuesButtonField ?buttonText "Perform rounding of critical currents" ?callback "nil" ?value nil) 10:70 500:30 220) ) ?help "" ?unmapAfterCB t ?initialSize 800:250 ) hiDisplayForm(pnNewValsFileForm) hiMoveInsBarToEnd(pnNewValsFileForm 'pnFileNameField) ) ; ** procedure ** ;;;######################################################## ;;;# ;;;# supplementary functions ;;;# ;;;# ;;;######################################################### (procedure suppEqual(val1 val2) (let (accuracy result) accuracy = 0.00001 (cond ( abs(val1 - val2) < accuracy result = t ) (t result = nil)) result) ) ; ** procedure ** (procedure suppPrintTable(table) foreach(key table printf("key %L value %L\n" key table[key]))) (procedure suppPrintExternals() ;;; prints out pnExtList of the current celview for viewing. (let (dummy l lr s) pnGetExternals() dummy = pnExtList l = length(dummy) lr = round(l/3) s = "," (for n 0 lr-1 (cond (n == lr-1 && l - 3*lr == 0 s = ";")) printf("%-8s=%8.3f,\t%-8s=%8.3f,\t%-8s=%8.3f%s\n" car(nth(3*n dummy)) float( cadr(nth(3*n dummy)) ) car(nth(3*n+1 dummy)) float( cadr(nth(3*n+1 dummy)) ) car(nth(3*n+2 dummy)) float( cadr(nth(3*n+2 dummy)) ) s)) (cond (l-3*lr == 2 printf("%-8s=%8.3f,\t%-8s=%8.3f;\n" car(nth(l-2 dummy)) float( cadr(nth(l-2 dummy)) ) car(nth(l-1 dummy)) float( cadr(nth(l-1 dummy))))) (l-3*lr == 1 printf("%-8s=%8.3f;\n" car(nth(l-1 dummy)) float( cadr(nth(l-1 dummy)))))) ) ) ; ** procedure ** (procedure suppGetProjectName() strcat(geGetEditCellView()->libName "/" geGetEditCellView()->cellName "/" geGetEditCellView()->viewName "/" geGetEditCellView()->versionName) ) ;;;######################################################## ;;;# ;;;# Additional column of the fixed menu ;;;# ;;;# ;;;######################################################### ;;; ;;; Functions for the Additional column of the fixed menu ;;; (procedure pnInsertProjectNameDate() ;;; this proc helps to document schematics schHiCreateNoteLabel( strcat( suppGetProjectName() "\n" getCurrentTime() ) ) ) (procedure pnExplicitSetItemNum() ;;; direct gateway to the instance# property pnCounter = pnGetInstCounter() pnItemNumForm = hiCreateAppForm( ?name 'pnItemNumForm ?formTitle "Set Item Number Form" ?callback list('pnExplicitSetItemNumCB nil) ?fields list( list( hiCreateIntField( ?name 'pnItemNumField ?prompt "Set Instance Number To:" ?value pnCounter) 10:10 250:30 150 )) ?help "" ?unmapAfterCB t ?initialSize 800:250 ) hiDisplayForm(pnItemNumForm) hiMoveInsBarToEnd(pnItemNumForm 'pnItemNumField) ) ; ** procedure lmInit ** (procedure pnExplicitSetItemNumCB(form "r") pnCounter = form->pnItemNumField->value pnSetInstCounter(pnCounter) ) ;;; ;;; Icons for the Additional column of the fixed menu ;;; ;... pnMakeJJIcon ............. Sep 19 95 sasha 10254 (procedure pnMakeJJIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ ;dlAddBox(dl 0 -100:-100 100:100) dlAddPath(dl 1 2 "Round" list(-20:-20 20:20)) dlAddPath(dl 1 2 "Round" list(-20:20 20:-20)) dlAddPath(dl 1 2 "Round" list(0:33 0:-33)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow( ) dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ; ** procedure ** jjIcon = pnMakeJJIcon() (procedure pnMakeResIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Round" list(-10:15 10:15)) dlAddPath(dl 1 2 "Round" list(-10:-15 10:-15)) dlAddPath(dl 1 2 "Round" list(-10:-15 -10:15)) dlAddPath(dl 1 2 "Round" list(10:-15 10:15)) dlAddPath(dl 1 2 "Round" list(0:33 0:15)) dlAddPath(dl 1 2 "Round" list(0:-33 0:-15)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow( ) dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) resIcon = pnMakeResIcon() ;... pnMakeInd1Icon ........... Sep 19 95 sasha 1869 (procedure pnMakeInd1Icon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Extend" list(0:33 0:10)) dlAddPath(dl 1 2 "Extend" list(0:-33 0:-10)) ; half-circle dlAddPath(dl 1 2 "Truncate" list(0:10 2:10)) dlAddPath(dl 1 2 "Extend" list(3:10 7:7)) dlAddPath(dl 1 2 "Extend" list(7:7 10:3)) dlAddPath(dl 1 2 "Truncate" list(10:2 10:0)) dlAddPath(dl 1 2 "Extend" list(10:0 10:-2)) dlAddPath(dl 1 2 "Extend" list(10:-3 7:-7)) dlAddPath(dl 1 2 "Extend" list(7:-7 3:-10)) dlAddPath(dl 1 2 "Truncate" list(2:-10 0:-10)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ind1Icon = pnMakeInd1Icon() (procedure pnMakeInd2Icon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon dx) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Extend" list(0:33 0:20)) dlAddPath(dl 1 2 "Extend" list(0:-33 0:-20)) ; 1st half-circle dx = 10 dlAddPath(dl 1 2 "Truncate" list(0:10+dx 2:10+dx)) dlAddPath(dl 1 2 "Extend" list(3:10+dx 7:7+dx)) dlAddPath(dl 1 2 "Extend" list(7:7+dx 10:3+dx)) dlAddPath(dl 1 2 "Truncate" list(10:2+dx 10:0+dx)) dlAddPath(dl 1 2 "Extend" list(10:0+dx 10:-2+dx)) dlAddPath(dl 1 2 "Extend" list(10:-3+dx 7:-7+dx)) dlAddPath(dl 1 2 "Extend" list(7:-7+dx 3:-10+dx)) dlAddPath(dl 1 2 "Truncate" list(2:-10+dx 0:-10+dx)) ; 2nd half-circle dx = -10 dlAddPath(dl 1 2 "Truncate" list(0:10+dx 2:10+dx)) dlAddPath(dl 1 2 "Extend" list(3:10+dx 7:7+dx)) dlAddPath(dl 1 2 "Extend" list(7:7+dx 10:3+dx)) dlAddPath(dl 1 2 "Truncate" list(10:2+dx 10:0+dx)) dlAddPath(dl 1 2 "Extend" list(10:0+dx 10:-2+dx)) dlAddPath(dl 1 2 "Extend" list(10:-3+dx 7:-7+dx)) dlAddPath(dl 1 2 "Extend" list(7:-7+dx 3:-10+dx)) dlAddPath(dl 1 2 "Truncate" list(2:-10+dx 0:-10+dx)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ind2Icon = pnMakeInd2Icon() (procedure pnMakeInd3Icon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon dx) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Extend" list(0:33 0:30)) dlAddPath(dl 1 2 "Extend" list(0:-33 0:-30)) ; 1st half-circle dx = 20 dlAddPath(dl 1 2 "Truncate" list(0:10+dx 2:10+dx)) dlAddPath(dl 1 2 "Extend" list(3:10+dx 7:7+dx)) dlAddPath(dl 1 2 "Extend" list(7:7+dx 10:3+dx)) dlAddPath(dl 1 2 "Truncate" list(10:2+dx 10:0+dx)) dlAddPath(dl 1 2 "Extend" list(10:0+dx 10:-2+dx)) dlAddPath(dl 1 2 "Extend" list(10:-3+dx 7:-7+dx)) dlAddPath(dl 1 2 "Extend" list(7:-7+dx 3:-10+dx)) dlAddPath(dl 1 2 "Truncate" list(2:-10+dx 0:-10+dx)) ; 2nd half-circle dx = 0 dlAddPath(dl 1 2 "Truncate" list(0:10+dx 2:10+dx)) dlAddPath(dl 1 2 "Extend" list(3:10+dx 7:7+dx)) dlAddPath(dl 1 2 "Extend" list(7:7+dx 10:3+dx)) dlAddPath(dl 1 2 "Truncate" list(10:2+dx 10:0+dx)) dlAddPath(dl 1 2 "Extend" list(10:0+dx 10:-2+dx)) dlAddPath(dl 1 2 "Extend" list(10:-3+dx 7:-7+dx)) dlAddPath(dl 1 2 "Extend" list(7:-7+dx 3:-10+dx)) dlAddPath(dl 1 2 "Truncate" list(2:-10+dx 0:-10+dx)) ; 3rd half-circle dx = - 20 dlAddPath(dl 1 2 "Truncate" list(0:10+dx 2:10+dx)) dlAddPath(dl 1 2 "Extend" list(3:10+dx 7:7+dx)) dlAddPath(dl 1 2 "Extend" list(7:7+dx 10:3+dx)) dlAddPath(dl 1 2 "Truncate" list(10:2+dx 10:0+dx)) dlAddPath(dl 1 2 "Extend" list(10:0+dx 10:-2+dx)) dlAddPath(dl 1 2 "Extend" list(10:-3+dx 7:-7+dx)) dlAddPath(dl 1 2 "Extend" list(7:-7+dx 3:-10+dx)) dlAddPath(dl 1 2 "Truncate" list(2:-10+dx 0:-10+dx)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ind3Icon = pnMakeInd3Icon() (procedure pnMakeInd3qIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon dx) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Extend" list(0:33 0:30)) dlAddPath(dl 1 2 "Extend" list(0:-33 0:-30)) ; 1st half-circle dx = 20 dlAddPath(dl 1 2 "Truncate" list(0:10+dx 2:10+dx)) dlAddPath(dl 1 2 "Extend" list(3:10+dx 7:7+dx)) dlAddPath(dl 1 2 "Extend" list(7:7+dx 10:3+dx)) dlAddPath(dl 1 2 "Truncate" list(10:2+dx 10:0+dx)) dlAddPath(dl 1 2 "Extend" list(10:0+dx 10:-2+dx)) dlAddPath(dl 1 2 "Extend" list(10:-3+dx 7:-7+dx)) dlAddPath(dl 1 2 "Extend" list(7:-7+dx 3:-10+dx)) dlAddPath(dl 1 2 "Truncate" list(2:-10+dx 0:-10+dx)) ; 2nd half-circle dx = 0 dlAddPath(dl 1 2 "Truncate" list(0:10+dx 2:10+dx)) dlAddPath(dl 1 2 "Extend" list(3:10+dx 7:7+dx)) dlAddPath(dl 1 2 "Extend" list(7:7+dx 10:3+dx)) dlAddPath(dl 1 2 "Truncate" list(10:2+dx 10:0+dx)) dlAddPath(dl 1 2 "Extend" list(10:0+dx 10:-2+dx)) dlAddPath(dl 1 2 "Extend" list(10:-3+dx 7:-7+dx)) dlAddPath(dl 1 2 "Extend" list(7:-7+dx 3:-10+dx)) dlAddPath(dl 1 2 "Truncate" list(2:-10+dx 0:-10+dx)) ; 3rd half-circle dx = - 20 dlAddPath(dl 1 2 "Truncate" list(0:10+dx 2:10+dx)) dlAddPath(dl 1 2 "Extend" list(3:10+dx 7:7+dx)) dlAddPath(dl 1 2 "Extend" list(7:7+dx 10:3+dx)) dlAddPath(dl 1 2 "Truncate" list(10:2+dx 10:0+dx)) dlAddPath(dl 1 2 "Extend" list(10:0+dx 10:-2+dx)) dlAddPath(dl 1 2 "Extend" list(10:-3+dx 7:-7+dx)) dlAddPath(dl 1 2 "Extend" list(7:-7+dx 3:-10+dx)) dlAddPath(dl 1 2 "Truncate" list(2:-10+dx 0:-10+dx)) dlAddPath(dl 1 2 "Round" list(15:-20 15:20 )) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ind3qIcon = pnMakeInd3qIcon() (procedure pnMakePsrcIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon x y) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Extend" list(0:33 0:20)) dlAddPath(dl 1 2 "Extend" list(0:-33 0:-20)) ; 1st half-circle x = 2 y = 2 dlAddPath(dl 1 2 "Truncate" list(0*x:10*y 2*x:10*y)) dlAddPath(dl 1 2 "Extend" list(3*x:10*y 7*x:7*y)) dlAddPath(dl 1 2 "Extend" list(7*x:7*y 10*x:3*y)) dlAddPath(dl 1 2 "Truncate" list(10*x:2*y 10*x:0*y)) dlAddPath(dl 1 2 "Extend" list(10*x:0*y 10*x:-2*y)) dlAddPath(dl 1 2 "Extend" list(10*x:-3*y 7*x:-7*y)) dlAddPath(dl 1 2 "Extend" list(7*x:-7*y 3*x:-10*y)) dlAddPath(dl 1 2 "Truncate" list(2*x:-10*y 0*x:-10*y)) ; 2nd half-circle x = -2 y = 2 dlAddPath(dl 1 2 "Truncate" list(0*x:10*y 2*x:10*y)) dlAddPath(dl 1 2 "Extend" list(3*x:10*y 7*x:7*y)) dlAddPath(dl 1 2 "Extend" list(7*x:7*y 10*x:3*y)) dlAddPath(dl 1 2 "Truncate" list(10*x:2*y 10*x:0*y)) dlAddPath(dl 1 2 "Extend" list(10*x:0*y 10*x:-2*y)) dlAddPath(dl 1 2 "Extend" list(10*x:-3*y 7*x:-7*y)) dlAddPath(dl 1 2 "Extend" list(7*x:-7*y 3*x:-10*y)) dlAddPath(dl 1 2 "Truncate" list(2*x:-10*y 0*x:-10*y)) dlAddStrokeText(dl 1 0:0 "P" "center" "roman" 20) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) psrcIcon = pnMakePsrcIcon() (procedure pnMakeUsrcIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon x y) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Extend" list(0:33 0:20)) dlAddPath(dl 1 2 "Extend" list(0:-33 0:-20)) ; 1st half-circle x = 2 y = 2 dlAddPath(dl 1 2 "Truncate" list(0*x:10*y 2*x:10*y)) dlAddPath(dl 1 2 "Extend" list(3*x:10*y 7*x:7*y)) dlAddPath(dl 1 2 "Extend" list(7*x:7*y 10*x:3*y)) dlAddPath(dl 1 2 "Truncate" list(10*x:2*y 10*x:0*y)) dlAddPath(dl 1 2 "Extend" list(10*x:0*y 10*x:-2*y)) dlAddPath(dl 1 2 "Extend" list(10*x:-3*y 7*x:-7*y)) dlAddPath(dl 1 2 "Extend" list(7*x:-7*y 3*x:-10*y)) dlAddPath(dl 1 2 "Truncate" list(2*x:-10*y 0*x:-10*y)) ; 2nd half-circle x = -2 y = 2 dlAddPath(dl 1 2 "Truncate" list(0*x:10*y 2*x:10*y)) dlAddPath(dl 1 2 "Extend" list(3*x:10*y 7*x:7*y)) dlAddPath(dl 1 2 "Extend" list(7*x:7*y 10*x:3*y)) dlAddPath(dl 1 2 "Truncate" list(10*x:2*y 10*x:0*y)) dlAddPath(dl 1 2 "Extend" list(10*x:0*y 10*x:-2*y)) dlAddPath(dl 1 2 "Extend" list(10*x:-3*y 7*x:-7*y)) dlAddPath(dl 1 2 "Extend" list(7*x:-7*y 3*x:-10*y)) dlAddPath(dl 1 2 "Truncate" list(2*x:-10*y 0*x:-10*y)) dlAddStrokeText(dl 1 0:0 "U" "center" "roman" 20) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) usrcIcon = pnMakeUsrcIcon() (procedure pnMakeIsrcgIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Truncate" list(0:33 0:-33)) dlAddPath(dl 1 3 "Truncate" list(15:0 0:-35)) dlAddPath(dl 1 3 "Truncate" list(-15:0 0:-35)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow( ) dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ; ** procedure ** isrcgIcon = pnMakeIsrcgIcon() (procedure pnMakeGNDIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 5 "Round" list(-15:0 15:0)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow( ) dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ; ** procedure ** GNDIcon = pnMakeGNDIcon() (procedure pnMakeCapIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddPath(dl 1 2 "Round" list(0:30 0:5)) dlAddPath(dl 1 2 "Round" list(0:-30 0:-5)) dlAddPath(dl 1 2 "Round" list(-15:5 15:5)) dlAddPath(dl 1 2 "Round" list(-15:-5 15:-5)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow( ) dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ; ** procedure ** capIcon = pnMakeCapIcon() (procedure pnMakeFrextIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("gray88") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 2 colorIndex penTable) dlSetPenFillStyle( 2 "SolidFill" penTable) /* Put the objects in. */ dlAddCircle(dl 2 0:0 8) dlAddBox(dl 1 -30:30 30:-30) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow( ) dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) ; ** procedure ** frextIcon = pnMakeFrextIcon() (procedure pnMakeMuindIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon x y) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("gray88") dlSetPenColor( 2 colorIndex penTable) dlSetPenFillStyle( 2 "SolidFill" penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddBox(dl 2 -10:25 21:-25) dlAddPath(dl 1 2 "Extend" list(0:17 11:15)) dlAddPath(dl 1 2 "Extend" list(0:17 5:8)) dlAddPath(dl 1 2 "Extend" list(0:17 10:9)) dlAddPath(dl 1 2 "Truncate" list(10:9 11:0)) dlAddPath(dl 1 2 "Extend" list(0: - 17 11: - 15)) dlAddPath(dl 1 2 "Extend" list(0: - 17 5: - 8)) dlAddPath(dl 1 2 "Extend" list(0: - 17 10: - 9)) dlAddPath(dl 1 2 "Truncate" list(10: - 9 11:0)) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) muindIcon = pnMakeMuindIcon() (procedure pnMakeAddNoteIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon x y) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddStrokeText(dl 1 0:0 "doc" "center" "roman" 20) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) printDateIcon = pnMakeAddNoteIcon() (procedure pnMakeSetNumIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon x y) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddStrokeText(dl 1 0:0 " N " "center" "roman" 20) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) setNumIcon = pnMakeSetNumIcon() (procedure pnMakeNoOpIcon() ;_Jan 5 00 paul 0 (let (dl penTable colorindex w icon x y) dl = dlMakeDisplayList() penTable = dlMakePenTable(5) dlSetPenTable(dl penTable) colorIndex = hiMatchColorByName("black") dlSetPenColor( 1 colorIndex penTable) dlSetPenFillStyle( 1 "SolidFill" penTable) /* Put the objects in. */ dlAddStrokeText(dl 1 0:0 " 1 " "center" "roman" 20) /* Convert the dlist to an icon. */ icon = dlDlistToIcon(dl 30 40 hiMatchColorByName("gray88")) /* ; comment it!! and the block will be uncommented! w = hiOpenWindow() dlAttachDlistToWindow( dl w) hiSetWindowIcon( w icon) */ ;comment it!! and the block will be uncommented! icon ) ; ** let ** ) noOpIcon = pnMakeNoOpIcon() ;;; ;;; Creating the Additional column of the fixed menu ;;; procedure( pnBuildFixedMenu() let( (checkItem saveItem zoomInItem zoomOutItem stretchItem copyItem deleteItem undoItem propertyItem componentItem wireItem busItem wireNameItem pinItem cmdOptionsItem repeatItem jjItem resItem ind1Item ind2Item ind3Item ind3qItem psrcItem usrcItem isrcgItem GNDItem capItem frextItem muindItem printDateItem setNumItem noOpItem ) checkItem = hiCreateMenuItem( ?name 'schFixedMenuCheck ?itemText "Check and Save" ?itemIcon schgCheckIcon ?callback "pnCheckModelsExternals()" ) saveItem = hiCreateMenuItem( ?name 'schFixedMenuSave ?itemText "Save" ?itemIcon schgSaveIcon ?callback "schHiSaveCellView()" ) zoomInItem = hiCreateMenuItem( ?name 'schFixedMenuZoomIn ?itemText "Zoom In By 2" ?itemIcon schgZoomInBy2Icon ?callback "hiZoomRelativeScale(getCurrentWindow() 1.25)" ) zoomOutItem = hiCreateMenuItem( ?name 'schFixedMenuZoomOut ?itemText "Zoom Out By 2" ?itemIcon schgZoomOutBy2Icon ?callback "hiZoomRelativeScale(getCurrentWindow() 0.8)" ) stretchItem = hiCreateMenuItem( ?name 'schFixedMenuStretch ?itemText "Stretch" ?itemIcon schgSchStretchIcon ?callback "schHiStretch()" ) copyItem = hiCreateMenuItem( ?name 'schFixedMenuCopy ?itemText "Copy" ?itemIcon schgSchCopyIcon ?callback "schHiCopy()" ) deleteItem = hiCreateMenuItem( ?name 'schFixedMenuDelete ?itemText "Delete" ?itemIcon schgDeleteIcon ?callback "schHiDelete()" ) undoItem = hiCreateMenuItem( ?name 'schFixedMenuUndo ?itemText "Undo" ?itemIcon schgUndoIcon ?callback "hiUndo()" ) propertyItem = hiCreateMenuItem( ?name 'schFixedMenuProperty ?itemText "Property" ?itemIcon schgPropertyIcon ?callback "pnInPropForm()" ) componentItem = hiCreateMenuItem( ?name 'schFixedMenuInstance ?itemText "Instance" ?itemIcon schgInstanceIcon ?callback "pnInInstForm()" ) wireItem = hiCreateMenuItem( ?name 'schFixedMenuWire ?itemText "Wire (narrow)" ?itemIcon schgWireIcon ?callback "schHiCreateWire(0.0)" ) busItem = hiCreateMenuItem( ?name 'schFixedMenuBus ?itemText "Wire (wide)" ?itemIcon schgBusIcon ?callback "schHiCreateWire(schGetEnv(\"defWideWireWidth\"))" ) wireNameItem = hiCreateMenuItem( ?name 'schFixedMenuWireName ?itemText "Wire Name" ?itemIcon schgWireNameIcon ?callback "schHiCreateWireLabel()" ) pinItem = hiCreateMenuItem( ?name 'schFixedMenuPin ?itemText "Pin" ?itemIcon schgSchPinIcon ?callback "schHiCreatePin()" ) cmdOptionsItem = hiCreateMenuItem( ?name 'schFixedMenuCmdOptions ?itemText "Cmd Options" ?itemIcon schgCmdOptionsIcon ?callback "hiToggleEnterForm()" ) repeatItem = hiCreateMenuItem( ?name 'schFixedMenuRepeat ?itemText "Repeat" ?itemIcon schgRepeatIcon ?callback "hiRepeat()" ) jjItem = hiCreateMenuItem( ?name 'jjItem ?itemText "jj" ?itemIcon jjIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"jj\" \"symbol\")" ) resItem = hiCreateMenuItem( ?name 'resItem ?itemText "res" ?itemIcon resIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"res\" \"symbol\")" ) ind1Item = hiCreateMenuItem( ?name 'ind1Item ?itemText "ind1" ?itemIcon ind1Icon ?callback "schHiCreateInst(\"rsfq.basic\" \"ind1\" \"symbol\")" ) ind2Item = hiCreateMenuItem( ?name 'ind2Item ?itemText "ind2" ?itemIcon ind2Icon ?callback "schHiCreateInst(\"rsfq.basic\" \"ind2\" \"symbol\")" ) ind3Item = hiCreateMenuItem( ?name 'ind3Item ?itemText "ind3" ?itemIcon ind3Icon ?callback "schHiCreateInst(\"rsfq.basic\" \"ind3\" \"symbol\")" ) ind3qItem = hiCreateMenuItem( ?name 'ind3qItem ?itemText "ind3q" ?itemIcon ind3qIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"ind3q\" \"symbol\")" ) psrcItem = hiCreateMenuItem( ?name 'psrcItem ?itemText "psrc" ?itemIcon psrcIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"psrc\" \"symbol\")" ) usrcItem = hiCreateMenuItem( ?name 'usrcItem ?itemText "usrc" ?itemIcon usrcIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"usrc\" \"symbol\")" ) isrcgItem = hiCreateMenuItem( ?name 'isrcgItem ?itemText "isrcg" ?itemIcon isrcgIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"isrcg\" \"symbol\")" ) GNDItem = hiCreateMenuItem( ?name 'GNDItem ?itemText "GND" ?itemIcon GNDIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"GND\" \"symbol\")" ) frextItem = hiCreateMenuItem( ?name 'frextItem ?itemText "frext" ?itemIcon frextIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"frext\" \"symbol\")" ) capItem = hiCreateMenuItem( ?name 'capItem ?itemText "cap" ?itemIcon capIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"cap\" \"symbol\")" ) muindItem = hiCreateMenuItem( ?name 'muindItem ?itemText "muind" ?itemIcon muindIcon ?callback "schHiCreateInst(\"rsfq.basic\" \"muind\" \"symbol\")" ) printDateItem = hiCreateMenuItem( ?name 'printDateItem ?itemText "Time Stamp" ?itemIcon printDateIcon ?callback "pnInsertProjectNameDate()" ) setNumItem = hiCreateMenuItem( ?name 'setNumItem ?itemText "Set #" ?itemIcon setNumIcon ?callback "pnExplicitSetItemNum()" ) noOpItem = hiCreateMenuItem( ?name 'noOpItem ?itemText "go 1" ?itemIcon noOpIcon ?callback "schUnregisterFixedMenu(\"schematic\")" ) ; ; Note: must build a vertical fixed menu hiCreateVerticalFixedMenu( 'pnFixedMenuId list( jjItem checkItem resItem saveItem ind1Item zoomInItem ind2Item zoomOutItem ind3Item stretchItem ind3qItem copyItem psrcItem deleteItem usrcItem undoItem isrcgItem propertyItem GNDItem componentItem capItem wireItem frextItem busItem muindItem wireNameItem setNumItem pinItem printDateItem cmdOptionsItem noOpItem repeatItem ;; jjItem ;; resItem ;; ind1Item ;; ind2Item ;; ind3Item ;; ind3qItem ;; psrcItem ;; usrcItem ;; isrcgItem ;; GNDItem ;; capItem ;; frextItem ;; muindItem ;; printDateItem ;; setNumItem ;; noOpItem ) ; noOfRows noOfColumns 16 2 ) ) ; ** let ** ) ; ** procedure ** ;... pnDisableSchFixedMenu .... Sep 19 95 sasha 1370 procedure( pnDisableSchFixedMenu(menu window) hiDisableMenuItem(menu 'schFixedMenuCheck window) hiDisableMenuItem(menu 'schFixedMenuSave window) hiDisableMenuItem(menu 'schFixedMenuStretch window) hiDisableMenuItem(menu 'schFixedMenuCopy window) hiDisableMenuItem(menu 'schFixedMenuDelete window) hiDisableMenuItem(menu 'schFixedMenuUndo window) hiDisableMenuItem(menu 'schFixedMenuComponent window) hiDisableMenuItem(menu 'schFixedMenuWire window) hiDisableMenuItem(menu 'schFixedMenuBus window) hiDisableMenuItem(menu 'schFixedMenuWireName window) hiDisableMenuItem(menu 'schFixedMenuPin window) hiDisableMenuItem(menu 'jjItem window) hiDisableMenuItem(menu 'resItem window) hiDisableMenuItem(menu 'ind1Item window) hiDisableMenuItem(menu 'ind2Item window) hiDisableMenuItem(menu 'ind3Item window) hiDisableMenuItem(menu 'ind3qItem window) hiDisableMenuItem(menu 'psrcItem window) hiDisableMenuItem(menu 'usrcItem window) hiDisableMenuItem(menu 'isrcgItem window) hiDisableMenuItem(menu 'GNDItem window) hiDisableMenuItem(menu 'capItem window) hiDisableMenuItem(menu 'frextItem window) hiDisableMenuItem(menu 'muindItem window) hiDisableMenuItem(menu 'printDateItem window) hiDisableMenuItem(menu 'setNumItem window) ; hiDisableMenuItem(menu 'noOpItem window) t ) ;... pnEnableSchFixedMenu ..... Sep 19 95 sasha 1259 procedure( pnEnableSchFixedMenu(menu window) hiEnableMenuItem(menu 'schFixedMenuCheck window) hiEnableMenuItem(menu 'schFixedMenuSave window) hiEnableMenuItem(menu 'schFixedMenuStretch window) hiEnableMenuItem(menu 'schFixedMenuCopy window) hiEnableMenuItem(menu 'schFixedMenuDelete window) hiEnableMenuItem(menu 'schFixedMenuUndo window) hiEnableMenuItem(menu 'schFixedMenuInstance window) hiEnableMenuItem(menu 'schFixedMenuWire window) hiEnableMenuItem(menu 'schFixedMenuBus window) hiEnableMenuItem(menu 'schFixedMenuWireName window) hiEnableMenuItem(menu 'schFixedMenuPin window) hiEnableMenuItem(menu 'jjItem window) hiEnableMenuItem(menu 'resItem window) hiEnableMenuItem(menu 'ind1Item window) hiEnableMenuItem(menu 'ind2Item window) hiEnableMenuItem(menu 'ind3Item window) hiEnableMenuItem(menu 'ind3qItem window) hiEnableMenuItem(menu 'psrcItem window) hiEnableMenuItem(menu 'usrcItem window) hiEnableMenuItem(menu 'isrcgItem window) hiEnableMenuItem(menu 'GNDItem window) hiEnableMenuItem(menu 'capItem window) hiEnableMenuItem(menu 'frextItem window) hiEnableMenuItem(menu 'muindItem window) hiEnableMenuItem(menu 'printDateItem window) hiEnableMenuItem(menu 'setNumItem window) ; hiEnableMenuItem(menu 'noOpItem window) t ) (procedure pnGo2Cols() ;_Jan 5 00 paul 51 menu = pnBuildFixedMenu() schRegisterFixedMenu("schematic" menu 'pnDisableSchFixedMenu 'pnEnableSchFixedMenu) hiAddFixedMenu(?fixedMenu menu) ) ; ** procedure pnGo2Cols ** ; Reset schematic fixed menu to the default: ; schUnregisterFixedMenu("schematic") ; or: schiSetDefaultFixedMenus() ; encrypt("~/cadence/SKILL/PNil/pn.il" "~/cadence/SKILL/PNil/pn.ile")