Ths for your reply,quek
In the fact,I have been used dbClose/dbSave and undoLimit in my code,but it seems doesn't work.And the whole code as follow:
procedure(LeeGenResdrc(parampath list_pdk)
let((gen_process num_model numbers_of_inst res_log cellId respath inres list cricut
second forth param_begin_w param_end_w param_begin_l param_end_l list_multi grid multi_num
z aaa bbb list_fingers j factor step param_add param_adda param_addb list_param_w list_l
num_l i value list_connection list_boolean num_con num_boolean num_fingers list_w
total_num num_row num_col calu value_key row beg end ref_x ref_y para counts model_list
list_pa ele_pa ele_aa list_aa ele_nw)
gen_process=hiCreateWindow(nil "text" "Generate Process File")
; hiDisplayWindow(gen_process)
; hiSetWindowName(gen_process strcat(runDir libName_gds ".log"))
num_model=length(list_pdk)
numbers_of_inst=1
res_log=strcat(ddGetObjReadPath(ddGetObj(LibName)) "/../pdk_miss.log")
miss_list=list_pdk
hiSetUndoLimit(0)
foreach(bjt list_pdk
cellId=dbOpenCellViewByType(LibName strcat(bjt "_pdk_drc_all") "layout" "maskLayout" "w")
respath=strcat(parampath bjt "/")
inres=infile(strcat(respath "cell.cdf"))
list=ncons(nil)
model_list=ncons(nil)
cricut=t
while(cricut
cricut=gets(line inres)
list=append1(list line))
close(input)
list=remove(nil list)
counts=1
foreach(para list
list_pa=parseString(para "(")
if(counts<=2 then
foreach(ele_pa list_pa
list_aa=parseString(ele_pa " ")
if(list_aa=='("cdfCreateParam") then counts++ )
if(length(list_aa)>=1 then
foreach(ele_aa list_aa
if(ele_aa=="?choices" then
list_bb=parseString(para " '(\"")
foreach(ele_nw cdr(remd(car(last(list_bb)) list_bb))
; remove the first and last element for list_bb
model_list=append1(model_list ele_nw)
) ; for
) ; if ele_aa
) ; for
) ; if
) ; if
) ; if
) ; for extract the model choices from each bjt model parameters
model_list=remove(nil model_list)
printf("%L\n" model_list)
list_multi=nil
grid=0.005u
multi_num=20
z=0
while(z<multi_num
z=z+1
aaa=sprintf(nil "%n" z)
bbb=list(aaa)
list_multi=nconc(list_multi bbb)
)
list_col=list_multi
list_row=list_multi
list_param=nil
param_num=60u
j=0
param_begin=3u
factor=10
while(j<=factor
step=float(param_num)/factor
param_add=float(param_begin)+j*step
param_adda=PasCeiling(param_add grid t)
param_addb=list(param_adda)
list_param=nconc(list_param param_addb)
j=j+1
)
list_w=list_param
list_l=list_param
num_col=length(list_col)
num_row=length(list_row)
num_w=length(list_w)
num_l=length(list_l)
num_model=length(list_pdk)
total_num=num_col*num_row*num_model
num_col=fix(sqrt(total_num))
num_row=round(total_num/num_col)
i=1
value=1
spa_cell=250
numbers_of_inst=1
foreach( model_name model_list
foreach( col_choice list_col
foreach( row_choice list_row
calu=(i-1)/num_col
key=fixp(calu)
value=(if key then calu else value)
value=float(value)
value_key=float(1)+value*num_col
row=float(round(i/num_row))
beg=1+row*num_col
end=(row+1)*num_col
ref_x=0
ref_y=0-(value-1)*spa_cell
if( i==value_key then
instId=dbCreateParamInstByMasterName(cellId target_pdk bjt "layout" get_pname(concat("bjt_list" "_" i)) 0:0 "R0" 1
list(
list("model" "string" model_name)
list("col" "string" col_choice)
list("row" "string" row_choice)
)
)
cdfGetInstCDF(instId)
rodAlign(
?alignObj rodGetObj(sprintf(nil "bjt_list_%n" i) cellId)
?alignHandle 'lowerLeft
?refPoint list(ref_x ref_y)
)
) ;end if
if( i!=value_key then
dbCreateParamInstByMasterName(cellId target_pdk bjt "layout" get_pname(concat("bjt_list" "_" i)) 0:0 "R0" 1
list(
list("model" "string" model_name)
list("col" "string" col_choice)
list("row" "string" row_choice)
)
)
rodAlign(
?alignObj rodGetObj(sprintf(nil "bjt_list_%n" i) cellId)
?alignHandle 'lowerLeft
?refObj rodGetObj(sprintf(nil "bjt_list_%n" i-1) cellId)
?refHandle 'lowerRight
?xSep 100
?maintain nil
)
) ;end if
i++
) ;end foreach
) ;end foreach
numbers_of_inst++
) ;end foreach
dbSave(cellId)
dbClose(cellId)
miss_list=remove(bjt miss_list)
setq(port outfile(res_log))
foreach(mis_res miss_list
fprintf(port "%s\n" mis_res)
)
close(port)
numbers_of_inst++
) ;end foreach
deleteFile(res_log)
file_path=strcat(ddGetObjReadPath(ddGetObj(LibName)) "/../")
hiSaveViewfile(gen_process strcat(file_path "Generate_Process_File" ".log"))
) ; let
) ; procedure
LeePdkPathCheck()