Class Reference Callbacks

several functions only available for callback macro, parametric cell macros and plot macros. More...

Member

string iPar(string parameter)
plotData * iPlot()
string pPar(string parameter)
void* iPDK_getCurrentInst()
bool iPDK_paramExist(string parameter)
string iPDK_engToSci(string s)
string iPDK_sciToEng(string s)
stringList iPDK_getParameterList()
string iPDK_getGlobalParameterValue(string parameter)
void iPDK_setGlobalParameterValue(string parameterName,string parameterValue)
string iPDK_getParameterValue(string parameter)
void iPDK_setParameterValue(string parameterName,string parameterValue)
string iPDK_getParameterHash(stringList list)
string iPDK_getParamDef(string type, string parameter)
string iPDK_getOrient()
int iPDK_isLayout()
int iPDK_isSchematic()
int iPDK_isIvPCell()
plotData * iPlot()

Detailed Description

graph LR cb(callbacks)--iPlot-->pd(plotData) sd(schematicDisplay)--setProbeMode-->pd click cb "/layoutscript/api/callbacks" click pd "/layoutscript/api/plotdata" click sd "/layoutscript/api/schematicdisplay" classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; class cb thisClas class pd,sd clas

The functions on this page exist only inside special macros: parameter formulas, component callbacks, parametric-cell macros and plot macros. They are not members of a window object; you call iPar, pPar or iPlot by those names. In the Schematic Editor a parameter value can be a formula. Set parse=true on that parameter. iPar reads a parameter of the current device; pPar reads a global parameter. A typical formula multiplies iPar(width) with iPar(weight). If a parameter option is callback=macro_name.layout, that macro runs after the value changes and can adjust related parameters or reject a range. The iPDK helpers (iPDK_getParameterValue, iPDK_setParameterValue, iPDK_getParamDef and the rest) follow the Interoperable Process Design Kit names; in a LayoutEditor C++ macro you do not pass a device id. The same iPDK names are available in a parametric-cell macro named in the layout field of a component. In probe mode a plot macro calls iPlot() to obtain the plotData that schematicDisplay setProbeMode attached.

Example:

string w = iPar("width");
string g = pPar("scale");
if (!iPDK_paramExist("length"))
 return 1;
iPDK_setParameterValue("area", iPDK_engToSci("2.5u"));
plotData *pd = iPlot();
if (pd != NULL && !pd->dataRead())
 pd->readSource();

Function Documentation


string iPar(string parameter)

Returns: the value of device parameter as a string.


plotData * iPlot()

Returns: a pointer to the plotData of the current plot macro, or NULL if this macro is not a plot macro.


string pPar(string parameter)

Returns: the value of the global parameter.


void* iPDK_getCurrentInst()

Returns: a pointer to the current component placement.


bool iPDK_paramExist(string parameter)

Returns: true if parameter exists on the current component, otherwise false.


string iPDK_engToSci(string s)

Returns: s converted from engineering notation to scientific notation.


string iPDK_sciToEng(string s)

Returns: s converted from scientific notation to engineering notation.


stringList iPDK_getParameterList()

Returns: a stringList of all parameter names of the current component.


string iPDK_getGlobalParameterValue(string parameter)

Returns: the value of the global parameter.


void iPDK_setGlobalParameterValue(string parameterName,string parameterValue)

Sets the global parameter parameterName to parameterValue.

Parameter:
parameterName name
parameterValue parameterValue

string iPDK_getParameterValue(string parameter)

Returns: the value of component parameter.


void iPDK_setParameterValue(string parameterName,string parameterValue)

Sets component parameter parameterName to parameterValue.

Parameter:
parameterName name
parameterValue parameterValue

string iPDK_getParameterHash(stringList list)

Returns: a hash of parameters. If list is empty, every parameter except the device name is hashed. If list contains names, only those parameters are hashed. The list may include devicename.


string iPDK_getParamDef(string type, string parameter)

Returns: a definition field of parameter. type may be type (returns string, int, double or choose), callback (callback macro), prompt (info field) or units (units field).

Parameter:
type mode selector
parameter parameter

string iPDK_getOrient()

Returns: always the string R0.


int iPDK_isLayout()

Returns: always 0.


int iPDK_isSchematic()

Returns: always 1.


int iPDK_isIvPCell()

Returns: always 0.


plotData * iPlot()

Returns: the plotData inside a plot macro.