如下:
/*
Description??Update the schematics' callback.
Usage:
In CIW, load this file;
Type CallbackLib("library_name") to handle one library.
Type CallbackCell("library_name" "cell_name") to handle one cell.
*/
/*********************One library*********************************************/
procedure(CallbackLib(lib)
foreach(cellID ddGetObj(lib)->cells
cell=cellID->name
CallbackCell(lib cell) ;This function is defined below.
);end foreach cellID
printf(" ^_^ Library \"%s\" is finished. \n" lib)
);end procedure CallbackLib
/*********************One cell***********************************************/
procedure(CallbackCell(lib cell)
printf(" ^_^ Cell \"%s\" begins! \n" cell)
when(cv=dbOpenCellViewByType(lib cell "schematic" "" "a")
foreach(instID cv->instances
cdfgData=cdfGetInstCDF(instID)
/* We can add the CDF parameters here for callback. */
paramType=cdfFindParamByName(cdfgData "w")
when(paramType~>callback evalstring(paramType~>callback))
paramType=cdfFindParamByName(cdfgData "l")
when(paramType~>callback evalstring(paramType~>callback))
paramType=cdfFindParamByName(cdfgData "m")
when(paramType~>callback evalstring(paramType~>callback))
cdfUpdateInstParam(instID)
);end foreach instID
;schCheck(cv) ;check & save may output too many warnings.
dbSave(cv)
dbClose(cv)
);end when cv
);end procedure CallbackCell