Hi everyone,
I am struggling with the following functions:
ciGenerateBestFitPattern
ciGenerateCascodedCurrentMirrorPattern
ciGenerateCurrentMirrorPattern
ciGenerateDiffPairPattern
ciGenerateLargeMfactorPattern
I am trying to generate modgen / matrix patterns for a given list of instances and dimensions (rows x columns)
Here is the little code I wrote to try the functions:
(inScheme
(let ((table `(
(PassiveDeviceArray ,ciGenerateBestFitPattern)
(CascodedCurrentMirror ,ciGenerateCascodedCurrentMirrorPattern)
(CurrentMirror ,ciGenerateCurrentMirrorPattern)
(DiffPair ,ciGenerateDiffPairPattern)
(LargeMfactor ,ciGenerateLargeMfactorPattern))))
(defun getSelectedInstances nil
"Return selected instances"
(setof obj (geGetSelectedSet) (equal "inst" (get obj 'objType))))
(defun instancesToDevices (instances)
"Return the list of devices from schematic INSTANCES to be used in ciCollectDeviceInfo"
(foreach mapcar inst instances (list (get inst 'name) 'inst)))
(defglobalfun abGeneratePattern (structType @optional (instances (getSelectedInstances)))
"Generate STRUCTTYPE pattern associated to schematic INSTANCES"
(letseq ((win (getCurrentWindow))
(cache (ciGetCellView ?window win))
(devices (instancesToDevices instances))
(devInfo (ciCollectDeviceInfo cache devices))
(args (ciGetStructArgs structType)))
;; Call ci pattern generation function according to struct type
((cadr (assoc structType table)) devInfo args)))
(defglobalfun abGeneratePatterns (@optional (instances (getSelectedInstances)))
"Try to generate all patterns in table for INSTANCES"
(foreach mapcan structType (mapcar car table)
(let ((pattern (errset (abGeneratePattern structType instances))))
(unless pattern (warn "%s %A" structType errset.errset))
pattern)))
);let
);inScheme
I tried (abGeneratePatterns) while selecting a simple differential pair in a schematic, it get the following warnings:
*WARNING* CascodedCurrentMirror ("symbolToString" 0 t nil ("*Error* symbolToString: argument #1 should be a symbol (type template = \"s\")" nil))
*WARNING* CurrentMirror ("symbolToString" 0 t nil ("*Error* symbolToString: argument #1 should be a symbol (type template = \"s\")" nil))
*WARNING* LargeMfactor ("ciExtractRowNumber" 0 t nil ("*Error* ciExtractRowNumber: argument #1 should be a string (type template = \"tt\")" nil))
I get patterns for the other structTypes but I cannot specify the dimensions :/
If somebody has an idea or can provide me with better documentation about those functions I'd be very happy
Cheers,
Aurel