• 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. Digital Implementation
  3. commands return memory pointers

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 90
  • Views 14656
  • 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

commands return memory pointers

archive
archive over 17 years ago

When I run simple commands in the command prompt like: "set X [get_nets -of_objects $port]" I get the net I am looking for, as well as some random variable - ie: "U_global_control_rtl/sbr_efadd_o[0] 0x5500" What is the 0x5500?? That ends up being the value stored in the variable "X". Any help would be awesome!


Originally posted in cdnusers.org by mboudreaux
  • Cancel
  • archive
    archive over 17 years ago

    Forgot to mention... I am running 64bit on Linux.


    Originally posted in cdnusers.org by mboudreaux
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    "get_nets" is a CTE-TCL command. CTE-TCL commands return special pointers that other CTE-TCL commands can operate on, or collections of special pointers.

    For example, you could do something like this:

    set port [get_ports BG_scan_in_2]
    set X [get_nets -of_objects $port]
    report_property $X

    (pardon the formatting, the following table is aligned in the console but appears unaligned here in the forum):

    property | value
    -------------------------------------------------
    capacitance_max | 0.002
    capacitance_min | 0.002
    driver_pins |
    hierarchical_name | BG_scan_in_2
    has_detailed_parasitics | false
    is_dont_touch | false
    is_hierarchical | false
    load_pins |
    name | BG_scan_in_2
    object_type | net
    pin_capacitance_max | 0.002
    pin_capacitance_min | 0.002
    wire_capacitance_max | 0.000
    wire_capacitance_min | 0.000

    If you had a collection, you could iterate through each pointer in the collection with "foreach_in_collection". You can find more information on these types of commands in the FE Text Command Reference (fetxtcmdref.pdf) shipped with the software under the "Advanced Timing Tcl Scripting Commands".

    Feel free to post back if this wasn't the kind of information you were looking for, or if you have further questions in this area.

    Hope this helps,
    Bob


    Originally posted in cdnusers.org by BobD
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    In your example, the value of "X" would be something like "0x5cff" instead of the name of the net attached to BG_scan_in_2. If I were to enter your code in my FE, it would error as it would not find the properties of "0x5cff".

    Any ideas?


    Originally posted in cdnusers.org by mboudreaux
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Here is my log file cut and pasted as is:

    [DEV]encounter 4> set port [get_ports BG_scan_in_2]
    0x2
    [DEV]encounter 5> set X [get_nets -of_objects $port]
    0x3
    [DEV]encounter 6> puts $X
    0x3
    [DEV]encounter 7> report_property $X

    property | value
    -------------------------------------------------
    capacitance_max | 0.002
    capacitance_min | 0.002
    driver_pins |
    hierarchical_name | BG_scan_in_2
    has_detailed_parasitics | false
    is_dont_touch | false
    is_hierarchical | false
    load_pins |
    name | BG_scan_in_2
    object_type | net
    pin_capacitance_max | 0.002
    pin_capacitance_min | 0.002
    wire_capacitance_max | 0.000
    wire_capacitance_min | 0.000
    [DEV]encounter 8> report_property 0x3

    property | value
    -------------------------------------------------
    capacitance_max | 0.002
    capacitance_min | 0.002
    driver_pins |
    hierarchical_name | BG_scan_in_2
    has_detailed_parasitics | false
    is_dont_touch | false
    is_hierarchical | false
    load_pins |
    name | BG_scan_in_2
    object_type | net
    pin_capacitance_max | 0.002
    pin_capacitance_min | 0.002
    wire_capacitance_max | 0.000
    wire_capacitance_min | 0.000

    As you can see, whether I pass "$X" or "0x3"- report_property still works as I'd hope it would.

    Please give it a try. If it still doesn't work for you there may be some other problem conspiring against you. If that's the case, please do post back or open a service request at http://sourcelink.cadence.com.

    Thanks,
    Bob


    Originally posted in cdnusers.org by BobD
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    Your example works for me and gets the same output you get... How do I get a variable to "equal" only the associated net name to which BG_scan_in_2 is attached?


    Originally posted in cdnusers.org by mboudreaux
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • archive
    archive over 17 years ago

    I'm glad to hear that worked for you. Now that you see the list of property/value pairs output by report_property, you can set any one of the properties values to a variable using "get_property":

    [DEV]encounter 11> set net_name [get_property $X name]
    BG_scan_in_2

    [DEV]encounter 12> puts $net_name
    BG_scan_in_2

    It might be worth mentioning that there are several db access mechanisms that are available in Encounter. The mechanism you're using right now I call CTE-TCL. They're the way to go when you're interested in probing the design from a timing perspective.

    A new mechanism that debuted in our 7.1 release is called "dbGet". It provides a more SKILL-like way to probe the db. I say SKILL-like not from a syntax perspective, but in terms of the way it presents information to the user in a relational/linked manner. Here's an example of how you would do the same thing you did with CTE-TCL with dbGet:

    [DEV]encounter 20> dbGet top.terms.name
    clk reset rcc_clk {address[3]} {address[2]} {address[1]} {address[0]} {din[15]} {din[14]} {din[13]} {din[12]} {din[11]} {din[10]} {din[9]} {din[8]} {din[7]} {din[6]} {din[5]} {din[4]} {din[3]} {din[2]} {din[1]} {din[0]} digit_clk {dout[7]} {dout[6]} {dout[5]} {dout[4]} {dout[3]} {dout[2]} {dout[1]} {dout[0]} dout_flag test_mode scan_en BG_scan_in BG_scan_out BG_scan_in_2 BG_scan_out_2

    [DEV]encounter 21> dbGet top.terms.name BG_scan_in_2
    BG_scan_in_2

    [DEV]encounter 22> dbGet -p top.terms.name BG_scan_in_2
    0x15100248

    [DEV]encounter 23> set term [dbGet -p top.terms.name BG_scan_in_2]
    0x15100248

    [DEV]encounter 24> dbGet $term.?
    term: cell inOutDir isInput isOutput isScanClk isSpecial isTieHi isTieLo name net objType orient pStatus type

    [DEV]encounter 25> dbGet $term.net.name
    BG_scan_in_2

    I don't mean to confuse you with another db access mechanism- but depending on what information you're trying to get (and the eda tools you've used in the past) you might find one mechanism easier than the other. One note: hex pointers from dbGet are not interchangable with CTE-TCL hex pointers. To pass information back and forth between dbGet and CTE-TCL you need to re-get the pointer by name. Here's an example:

    From CTE-TCL to dbGet:
    [DEV]encounter 7> set port [get_ports BG_scan_in_2]
    0x6
    [DEV]encounter 8> set port_name [get_property $port hierarchical_name]
    BG_scan_in_2
    [DEV]encounter 9> dbGet top.terms.name $port_name
    BG_scan_in_2
    [DEV]encounter 10> set term [dbGet -p top.terms.name $port_name]
    0x14a91a98
    [DEV]encounter 11> dbGet $term.net.name
    BG_scan_in_2

    dbGet's usage is:
    Usage: dbGet [-d] [-p#] [-u] [-regexp] .[obj_type][{.attr_name|.?|.??|.?h} [pattern]]

    More information on dbGet is available in the soceDBAref.pdf document shipped with the software.

    Thanks,
    Bob


    Originally posted in cdnusers.org by BobD
    • Cancel
    • Vote Up 0 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