• 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. dbGet and playing with the database

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 92
  • Views 18384
  • 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

dbGet and playing with the database

jkang
jkang over 16 years ago

dbGet and other database operations seem like they would be very powerful tools. I'm surprised there isn't more reference material on sourcelink for how to use them. I'm slowly traversing through it using trial and error and the appendix in the Encounter Text Command Reference but I'm wondering if there are any articles out there that might be a better tutorial for working with the database inside of Encounter.

  • Cancel
  • Kari
    Kari over 16 years ago

     I'm not sure which version of the software you're using, but if it's 7.x, check out the manual called "Database Access Reference". If you're using 8.1, the section on dbGet/dbSet is now in the Text Command Reference in Chapter 43, "Basic Database Access TCL Commands". I've also posted a couple of blogs on the subject:

    Getting started with dbGet

    A dbGet Code Example

    Hope that helps,

     

    - Kari

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jkang
    jkang over 16 years ago

    Thanks Kari. I browsed through that tutorial along with the documentation and it cleared up many things. I didn't quite understand the structure of the database (pointers and what the -p option did in particular) and that threw me off.

    One specific problem I'm having atm -- and I was wondering if you could help me out -- is trying to pattern search through a list of coordinates. I want to find (and grab pointers to) rows that exist within a certain range of y locations. E.g. between 490 and 4000 and get their top and bottom boundaries. I tried:

    dbGet top.fPlan.rows.box 490

    at first just to experiment but it returned all of the boxes for every row. Is it possible to search through box coordinates?

     - Jonathan.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Kari
    Kari over 16 years ago

    Hi Jonathan,

    It's not pretty, but this is the best I could come up with:

     

    windowSelect 0 490 4000 4000 -->whatever search box you want; this will select everything in the box

    set my_rows [dbGet -p selected.objType row] --> filters out just the rows from what was selected; need -p to get the db pointer for further processing

    dbGet $my_rows.box --> returns all the row bounding boxes

     

    I'm curious to see some other solutions!

    - Kari

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • BobD
    BobD over 16 years ago

    I like your solution, Kari!  Very clever- I wouldn't have thought to leverage windowSelect like that- especially for rows.

    Here's how I would have gone about it, given the interest in getting the pointers for the rows with a certain filter criteria, and then querying coordinates about each row:

    set rowList {}
    foreach row [dbGet top.fplan.rows] {
      set box [dbGet $row.box]
      set lly [lindex [lindex $box 0] 1]
      if {$lly > 500 && $lly < 600} {
        lappend rowList $row
      }
    }

    foreach row $rowList {
      set box [dbGet $row.box]
      Puts "Top Y: [lindex [lindex $box 0] 3] Bottom Y: [lindex [lindex $box 0] 1]"
    }

    A couple of points of information I'd like to add:

    1. As you can see, it's a tad clunky to decompose a box in dbGet currently (with two lindex statements). In older style FE-TCL terms, we used commands like "dbBoxLLX" to get the lower left x coordinate of a box.  However, these functions don't work within dbGet since they support only database units and not microns. We've talked about having a similar processing command for dbGet usage but I don't recall whether that has come to fruition. I'll check and see.
    2. dbGet's filtering mechanism doesn't work with fixed point numbers in 8.1.RTM. By that I mean, you can filter on an instance name "dbGet top.inst.name *i_9371" but you can't filter on numbers like this: "dbGet top.nets.numInputTerms 15".  This is something we're working on enhancing as part of a push for more sophisticated filtering in dbGet (for example, collecting all high fanout nets with "dbGet top.nets.numInputTerms > 15" could be useful).

    Hope this helps,
    Bob

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • jkang
    jkang over 16 years ago

    Thank you both for the help. I ended up doing something similar to what Bob did. This design isn't so large that combing through the rows would cause a significant performance hit.

    Am I to understand that the only filtering mechanism available to dbGet currently is string filtering?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • BobD
    BobD over 16 years ago

    Am I to understand that the only filtering mechanism available to dbGet currently is string filtering?

    That is correct.

    I'm glad you've found dbGet useful, and thanks for participating in the forums!

    -Bob

    • 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