dbkDeletePrefixSuffixToAllLib.il
已有 116 次阅读|
2025-6-24 13:43
|系统分类:芯片设计
procedure(dbkDeletePrefixSuffixToAllLib(
s_library s_prefix @optional (s_suffix ""))
let((libraryID src newName des s_index r_index replaced_cell)
libraryID=ddGetObj(s_library) ;Get libraryID info
replaced_cell=list()
foreach(cellname libraryID~>cells~>name ;Traverse cellname from lib
s_index=nindex(cellname s_prefix) ;obtain the position of prefix
r_index=rindex(cellname s_suffix) ;obtain the string of suffix and after suffix
src=gdmCreateSpec(s_library cellname "" "" "CDBA") ;Create a object of new cellname in CDBA
cond( ;Delete the prefix & suffix
(s_index==1 && r_index
newName=substring(cellname length(s_prefix)+1 length(cellname))
newName=substring(newName 1 length(newName)-length(s_suffix)))
(s_index==1
newName=substring(cellname length(s_prefix)+1 length(cellname)))
(r_index
newName=substring(cellname 1 length(newName)-length(s_suffix)))
);cond
if(s_index==1||r_index then
des=gdmCreateSpec(s_library newName "" "" "CDBA")
ccpRename(src des t 'CCP_EXPAND_COMANAGED 'CCP_UPDATE_DESTLIB_ONLY) ;Rename from "src" to "des"
replaced_cell=cons(sprintf(nil "%32s %-32s" cellname newName) replaced_cell)
);if
);foreach
if(replaced_cell foreach(x replaced_cell printf("%s\n" x)))
);let
);procedure
dbkDeletePrefixSuffixToAllLib("test_wangbin" "pre_" "_suf")