• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Release the memory by skill

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 146
  • Views 15226
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Release the memory by skill

nidon
nidon over 12 years ago

Hi everyone,

 I write a skill code to generate a lot of pcells,but the speed of the generation become slower and slower.

And I think it may be generated large memory by the code,so how can I release these memory to improve the the speed of generation?

 

Tks a lot~

  • Cancel
Parents
  • nidon
    nidon over 12 years ago

    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()

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • nidon
    nidon over 12 years ago

    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()

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information