• 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. Access elements of symbol in skill

Stats

  • Locked Locked
  • Replies 9
  • Subscribers 143
  • Views 18721
  • 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

Access elements of symbol in skill

Sandeep4386
Sandeep4386 over 12 years ago
corModelSpec = (("/home/bin/toplevel.scs" "top_sf"))
corModelSpec is of a type symbol. How can I access only second string out from this, so that my output will be top_sf.
 
I tried rindex but it doesn't quite give the desired output.
 
param_value=rindex(strcat(corModelSpec) "t") ;
println(param_value) 
 
Output: "top_sf\"))"
I would like to get rid of brackets and double quotes from the output. Any help would be appreciated. Thanks.
 
-Sandeep 
 
  • Cancel
Parents
  • Sandeep4386
    Sandeep4386 over 11 years ago
    Hi Andrew,
    First let me give a little bit of background about the code. I have a verilogA code which writes data to a file. I use $fopen to name and open the file and $fstrobe for writing to a file. I am running sim with multiple corners and this file is generated for every corner and has extension _dat. I'm trying to figure out the way such that I can rename these files with respective corner names and design variables swept while generating the file. Below skill code will copy these files to a different directory and rename it with useful information:
     
    session = (axlGetWindowSession)
          histName = (axlGetHistoryName (axlGetCurrentHistory session ))
          rdb = (axlReadHistoryResDB histName)
          points = rdb->points()

          printf("History %s\n" histName)

          (foreach p points          
    printf("Design Point ID %d\n" p->id)
              (foreach corner (p->corners())

                 printf("\tCorner %s" corner->name)
    sprintf(corner_name "%s" corner->name)           
    i=0
     
    (foreach cparam corner->params()

                    (printf "\t\t %s = %L\n" cparam->name cparam->value)
    cparam_name=sprintf(nil "%s" cparam->name)
    Type=type(cparam->value)
    printf("%s type is %s \n" cparam_name Type)

    when(i==0
      cparam_total_new=""
    )  
    i++
    if(cparam_name!="corModelSpec" then
    sprintf(cparam_total_new strcat(cparam_total_new "_" cparam_name cparam_value))
    else
    cparam_value_modelfile=cadar(cparam->value)
      )
      )

                (foreach test (setof x p->tests() (equal x->cornerName corner->name))

                    printf("\tTest %s\n" test->name)
    sprintf(testName "%s" test->name)
                printf("\tResults dir %s\n\n" test->resultsDir)


    ;axlsession=axlGetWindowSession()
    ;sdb=axlGetMainSetupDB(axlsession)
    ;test = axlGetTest(sdb testName)
    ;toolargs = axlGetTestToolArgs(test)
    ;lib = cadr(assoc("lib" toolargs))
    ;cell = cadr(assoc("cell" toolargs))
    ;view = cadr(assoc("view" toolargs))

    sprintf(resultsDir "%s" test->resultsDir)
    sprintf(command "mkdir -p /scratch/$USER/%s" "dat_file_dir")
    system(command)
    sprintf(copyDirName "/scratch/$USER/%s/%s_%s_%s_dat" "dat_file_dir" corner_name cparam_value_modelfile cparam_total_new )
    sprintf(origDirName "%s/netlist" resultsDir)
    sprintf(command "cp %s/*_dat %s" origDirName copyDirName)
    println(command)
    system(command)
                )
              )
          )
     
    Now I have following issues with this code:
    1. It renames the file with all design variables specified in adexl, irrespective of they are being swept or not. How can I access the variables which are being swept and ignore the ones which are same throught the simulation?
    2.While moving this file to different directory, I am using directory name as /scratch/$USER/dat_file_dir, however I would like to use cellname instead of dat_file_dir here. I used following lines of code (commented out in above code) but it give me below error when I replace 'dat_file_dir' by 'cell'.
     
    ;axlsession=axlGetWindowSession()
    ;sdb=axlGetMainSetupDB(axlsession)
    ;test = axlGetTest(sdb testName)
    ;toolargs = axlGetTestToolArgs(test)
    ;lib = cadr(assoc("lib" toolargs))
    ;cell = cadr(assoc("cell" toolargs))
    ;view = cadr(assoc("view" toolargs)
     *Error* get/getq: first arg must be either symbol, list, defstruct or user type - 1005
    Any help would be appreciated. 
     
    Regards,
    Sandeep 
     
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Sandeep4386
    Sandeep4386 over 11 years ago
    Hi Andrew,
    First let me give a little bit of background about the code. I have a verilogA code which writes data to a file. I use $fopen to name and open the file and $fstrobe for writing to a file. I am running sim with multiple corners and this file is generated for every corner and has extension _dat. I'm trying to figure out the way such that I can rename these files with respective corner names and design variables swept while generating the file. Below skill code will copy these files to a different directory and rename it with useful information:
     
    session = (axlGetWindowSession)
          histName = (axlGetHistoryName (axlGetCurrentHistory session ))
          rdb = (axlReadHistoryResDB histName)
          points = rdb->points()

          printf("History %s\n" histName)

          (foreach p points          
    printf("Design Point ID %d\n" p->id)
              (foreach corner (p->corners())

                 printf("\tCorner %s" corner->name)
    sprintf(corner_name "%s" corner->name)           
    i=0
     
    (foreach cparam corner->params()

                    (printf "\t\t %s = %L\n" cparam->name cparam->value)
    cparam_name=sprintf(nil "%s" cparam->name)
    Type=type(cparam->value)
    printf("%s type is %s \n" cparam_name Type)

    when(i==0
      cparam_total_new=""
    )  
    i++
    if(cparam_name!="corModelSpec" then
    sprintf(cparam_total_new strcat(cparam_total_new "_" cparam_name cparam_value))
    else
    cparam_value_modelfile=cadar(cparam->value)
      )
      )

                (foreach test (setof x p->tests() (equal x->cornerName corner->name))

                    printf("\tTest %s\n" test->name)
    sprintf(testName "%s" test->name)
                printf("\tResults dir %s\n\n" test->resultsDir)


    ;axlsession=axlGetWindowSession()
    ;sdb=axlGetMainSetupDB(axlsession)
    ;test = axlGetTest(sdb testName)
    ;toolargs = axlGetTestToolArgs(test)
    ;lib = cadr(assoc("lib" toolargs))
    ;cell = cadr(assoc("cell" toolargs))
    ;view = cadr(assoc("view" toolargs))

    sprintf(resultsDir "%s" test->resultsDir)
    sprintf(command "mkdir -p /scratch/$USER/%s" "dat_file_dir")
    system(command)
    sprintf(copyDirName "/scratch/$USER/%s/%s_%s_%s_dat" "dat_file_dir" corner_name cparam_value_modelfile cparam_total_new )
    sprintf(origDirName "%s/netlist" resultsDir)
    sprintf(command "cp %s/*_dat %s" origDirName copyDirName)
    println(command)
    system(command)
                )
              )
          )
     
    Now I have following issues with this code:
    1. It renames the file with all design variables specified in adexl, irrespective of they are being swept or not. How can I access the variables which are being swept and ignore the ones which are same throught the simulation?
    2.While moving this file to different directory, I am using directory name as /scratch/$USER/dat_file_dir, however I would like to use cellname instead of dat_file_dir here. I used following lines of code (commented out in above code) but it give me below error when I replace 'dat_file_dir' by 'cell'.
     
    ;axlsession=axlGetWindowSession()
    ;sdb=axlGetMainSetupDB(axlsession)
    ;test = axlGetTest(sdb testName)
    ;toolargs = axlGetTestToolArgs(test)
    ;lib = cadr(assoc("lib" toolargs))
    ;cell = cadr(assoc("cell" toolargs))
    ;view = cadr(assoc("view" toolargs)
     *Error* get/getq: first arg must be either symbol, list, defstruct or user type - 1005
    Any help would be appreciated. 
     
    Regards,
    Sandeep 
     
    • 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