• 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. Problem with updating values in Hash Table

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 11561
  • 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

Problem with updating values in Hash Table

greywanderer
greywanderer over 4 years ago

I have a parameter sweep run that needs to be parsed for data. The analysis being run is the DC operation point. I am trying to save the transistor operating points with the following function,

procedure( tranPar( trans_path result resDir)
let( (tran_pars par_list var)
par_list = list("gm" "gmb" "gds" "ids" "vgs" "vds" "vdsat" "vth" "cgs" "cgd" "cdb" "csb")
tran_pars = makeTable("atable1" 0)
foreach(val par_list
tran_pars[val] = pv(trans_path val ?result result ?resultsDir resDir)
)
)
tran_pars
)

This post-processing looks like this.

for(swp_ind 1 55
     sprintf(resDir "/scratch/transistor_checks/maestro/results/maestro/ExplorerRun.0/%d/sandbox:transistor_checks:1/psf" swp_ind)

    NM0 = tranPar( "NM0" "dcOpInfo" resDir)

    printf("%g\n" NM0["gm"])

)

For some reason the gm values dont change. Its almost as if the data structure will not change once created.

Can someone please help me understand this?

Thanks!

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 4 years ago

    When running the code (having fixed the paths to some suitable local data), I got this error:

    *Error* eval: unbound variable - tran_pars

    This is because the tran_pars at the end of the tranPar function is outside of the let - it should be with. My guess is that you'd done some earlier experiments with the code within the tranPar function and so have a global variable called tran_pars which is defined to be a table - but this global variable is not being updated.

    Having fixed the code (see below, with my local paths) it works:

    procedure( tranPar( trans_path result resDir)
      let( (tran_pars par_list var)
        par_list = list("gm" "gmb" "gds" "ids" "vgs" "vds" "vdsat" "vth" "cgs" "cgd" "cdb" "csb")
        tran_pars = makeTable("atable1" 0)
        foreach(val par_list
          tran_pars[val] = pv(trans_path val ?result result ?resultsDir resDir)
        )
        ; fixed this - the tran_pars was below the next bracket which was wrong...
        tran_pars
      )
    )
    
    ;This post-processing looks like this.
    
    for(swp_ind 1 9
         ;sprintf(resDir "/scratch/transistor_checks/maestro/results/maestro/ExplorerRun.0/%d/sandbox:transistor_checks:1/psf" swp_ind)
         sprintf(resDir "/export/home/myuser/simulation/mylib/idsmeas/maestro/results/maestro/Interactive.1/%d/mylib:idsmeas:1/psf" swp_ind)
    
        NM0 = tranPar( "M0" "dcOpInfo" resDir)
    
        printf("%g\n" NM0["gm"])
    
    )

    Here's the results:

    5.88258e-07
    3.59547e-18
    1.54604e-12
    3.94357e-06
    2.468e-17
    1.0612e-11
    1.82409e-06
    1.12653e-17
    4.84395e-12

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • greywanderer
    greywanderer over 4 years ago in reply to Andrew Beckett

    Hi Andrew,

    I did not define "tran_pars" as a global variable. And I did not see that unbound variable error. Just that the values in the hash table were not being updated. But what you say works. Thanks!

    Also agree that given that tran_pars is only defined "locally" within the scope of the "let" it is not valid to call it outside its scope. It should have given the "unbound" variable error. So its puzzling why I did not see it.

    Best Regards,

    Murthy

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • greywanderer
    greywanderer over 4 years ago in reply to Andrew Beckett

    Hi Andrew,

    I did not define "tran_pars" as a global variable. And I did not see that unbound variable error. Just that the values in the hash table were not being updated. But what you say works. Thanks!

    Also agree that given that tran_pars is only defined "locally" within the scope of the "let" it is not valid to call it outside its scope. It should have given the "unbound" variable error. So its puzzling why I did not see it.

    Best Regards,

    Murthy

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to greywanderer

    Hi Murthy,

    My guess was that you'd pasted some of the code from tranPar into the CIW to test it and unwittingly created a global variable tran_pars, or that you'd earlier written tranPar and omitted tran_pars from the let and added it later. Something like that... otherwise it would definitely have failed due to the variable being undefined.

    Anyway, glad it's working now.

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • greywanderer
    greywanderer over 4 years ago in reply to Andrew Beckett

    Is there a way to clear variables from memory in CIW? clear() and clearAll() dont seem to do it.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to greywanderer

    You can't clear all - but you can "clear" an individual variable using:

    tran_pars='unbound

    (for example). If you set the variable to the special symbol unbound, it is the same as it not being defined in the first place.

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel

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