Home > Community > Forums > Digital Implementation > commands return memory pointers

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 commands return memory pointers 

Last post Wed, Feb 6 2008 10:30 AM by archive. 6 replies.
Started by archive 06 Feb 2008 10:30 AM. Topic has 6 replies and 1606 views
Page 1 of 1 (7 items)
Sort Posts:
  • Wed, Feb 6 2008 10:30 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    commands return memory pointers Reply

    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
    • Post Points: 0
  • Wed, Feb 6 2008 11:45 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: commands return memory pointers Reply

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


    Originally posted in cdnusers.org by mboudreaux
    • Post Points: 0
  • Wed, Feb 6 2008 12:12 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: commands return memory pointers Reply

    "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
    • Post Points: 0
  • Wed, Feb 6 2008 2:33 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: commands return memory pointers Reply

    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
    • Post Points: 0
  • Wed, Feb 6 2008 4:05 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: commands return memory pointers Reply

    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
    • Post Points: 0
  • Thu, Feb 7 2008 4:53 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: commands return memory pointers Reply

    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
    • Post Points: 0
  • Thu, Feb 7 2008 5:24 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: commands return memory pointers Reply

    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
    • Post Points: 0
Page 1 of 1 (7 items)
Sort Posts:
Started by archive at 06 Feb 2008 10:30 AM. Topic has 6 replies.