• Home
  • :
  • Community
  • :
  • Forums
  • :
  • Digital Implementation
  • :
  • How to pass a string variable in the addRings command?

Digital Implementation Forums

How to pass a string variable in the addRings command?

vinayelk
vinayelk 2 months ago

Hi,

I am trying to pass my metal layer information for the addRing command using some string variables. However, the console prints an error saying variable not found.

I am using the following command:

addRing -nets {VDD VSS} -type core_rings -follow core -layer {top $horzPowerLayer bottom $horzPowerLayer left $vertPowerLayer right $vertPowerLayer} -width {top 4 bottom 4 left 4 right 4 } -spacing {top 1.8 bottom 1.8 left 1.8 right 1.8} -offset {top 1.8 bottom 1.8 left 1.8 right 1.8} -center 1 -threshold 0 -jog_distance 0 -snap_wire_center_to_grid None

Following is the log that I see on the terminal:
#% Begin addRing (date=02/04 02:06:12, mem=820.9M)
#% End addRing (date=02/04 02:06:12, total cpu=0:00:00.0, real=0:00:00.0, peak res=820.9M, current mem=820.9M)
can't read "horzPowerLayer": no such variable

The variables $horzPowerLayer and $vertPowerLayer are M7 and M6 in values respectively which are read through a file. The values hold well before the addRing command is executed but they are not recognized in the command itself. Can someone please let me know the right way to pass this information? I plan to do the same for the dimensions as well so it would be helpful if you could include that in your discussion as well.

Thank You
Vinay

  • Reply
  • Cancel
  • Cancel
  • Dimo M
    Dimo M 9 days ago

    Hi Vinay,

    you are using curly brackets {} to group your argument, which disables substitution within the braces. You can use quotes "" to allow substitution:
    -layer "top $horzPowerLayer bottom $horzPowerLayer left $vertPowerLayer right $vertPowerLayer"

    You can read about grouping arguments with quotes and brackets here: 
    https://www.tcl.tk/man/tcl8.5/tutorial/Tcl3.html
    https://www.tcl.tk/man/tcl8.5/tutorial/Tcl4.html
    Dimo
    • Cancel
    • Up 0 Down
    • Reply
    • 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.