• 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. Setting parameter values for dbCreateParamInstByMasterN...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 9481
  • 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

Setting parameter values for dbCreateParamInstByMasterName

MorrisDH
MorrisDH over 3 years ago

 > virtuoso -V
@(#)$CDS: virtuoso version 6.1.8-64b 08/17/2021 19:24 (cpgsrv12) $

Code:

procedure( swapMomcap(libName techLib)
  let( (libId cellList cvId length width)

   ; get list of cells
    libId    = ddGetObj(libName)
    cellList = libId~>cells

    foreach(cellId setof(cells libId~>cells pcreMatchp("mom" cells~>name))
      cvId = dbOpenCellViewByType(libName cellId~>name "layout" "" "a")

      ; calc w and l from existing cvId~>bBox
      length = sprintf(nil "%gu" abs(apply('difference mapcar('cadr cvId~>bBox)))-2*0.29)
      width  = sprintf(nil "%gu" abs(apply('difference mapcar('car cvId~>bBox)))-2*0.29)
      ;println(type(length)) /*
 
      ; delete existing flattened data
      geSelectAll()
      geDeleteSelSet()
      
      ; instantiate pcell
      dbCreateParamInstByMasterName(
        cvId techLib "momcap" "layout" nil
        0:0 "R0" 1
        list(
         list("l" 'string length)
         list("w" 'string width)
        )
      ) ; place new momcap*/

    ) ; foreach   

  ) ; let
) ; procedure

If I uncomment the println always indicates that the type is string. If I take the type function out and just print the return from println is, for example, "80u". However, when I run the script the pcell gets placed with both 'w' and 'l' parameters having a value of -0.58.

The code is behaving as if the calculation of width and length occured after the geSelectAll() and geDeleteSelSet()

If I run the commands one at a time in the CIW  the results are as expected. The flattened data is gone and a pcell in placed with the proper parameters.

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

    Are you sure you have the types matching what The PCell is actually expecting? Place an instance of the PCell, select it, and then do:

    foreach(mapcar param car(geGetSelSet())~>master~>superMaster~>parameters~>value list(param~>name param~>valueType param~>value))

    this will give you a list of lists with parameter name, valueType and default value. You can also check the values on the instance itself using:

    foreach(mapcar param car(geGetSelSet())~>master~>parameters~>value list(param~>name param~>valueType param~>value))

    (i.e. without the ~>superMaster).

    If you try to pass a string parameter to something that is a float, then it silently ignores the parameter. Going by the type in the CDF won't help because there's some magic conversion that goes on (I hate that, but that's the way it works).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    Are you sure you have the types matching what The PCell is actually expecting? Place an instance of the PCell, select it, and then do:

    foreach(mapcar param car(geGetSelSet())~>master~>superMaster~>parameters~>value list(param~>name param~>valueType param~>value))

    this will give you a list of lists with parameter name, valueType and default value. You can also check the values on the instance itself using:

    foreach(mapcar param car(geGetSelSet())~>master~>parameters~>value list(param~>name param~>valueType param~>value))

    (i.e. without the ~>superMaster).

    If you try to pass a string parameter to something that is a float, then it silently ignores the parameter. Going by the type in the CDF won't help because there's some magic conversion that goes on (I hate that, but that's the way it works).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • MorrisDH
    MorrisDH over 3 years ago in reply to Andrew Beckett

    foreach(mapcar param car(geGetSelSet())~>master~>superMaster~>parameters~>value list(param~>name param~>valueType param~>value))
    (("l" "string" "5u")
        ("w" "string" "5u")
    )
    foreach(mapcar param car(geGetSelSet())~>master~>parameters~>value list(param~>name param~>valueType param~>value))
    (("l" "string" "80u")
        ("w" "string" "240u")
    )

    If I use cvId = deOpenCellView instead of the dbOpenCellViewByType the procedure works. That change also requires replacing "cvId~>" with "cvId~>cellView~>" but that is OK.

    The downside is that all the cellviews are opened in a window.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to MorrisDH

    The first thing I noticed when looking at the code again is that you have this:

          ; delete existing flattened data
          geSelectAll()
          geDeleteSelSet()

    well, that's not going to work with the cellView opened using dbOpenCellViewByType() - since it's a graphics editor function and so you need a window. It will only select everything and delete all in the current window.

    Other than that, if the parameter types match, then there's no real reason from the code you've shared by dbOpenCellViewByType wouldn't work. The problem is likely to be in code you've not shared. It's possible that the bBox isn't correct of the cellView (maybe because you didn't do a dbOpenHier(cvId 32) to open to full depth - I'm guessing here.

    Also deOpenCellView() doesn't return a cellView, but a window, so it would be rather confusing to set the return value to a variable called cvId. 

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MorrisDH
    MorrisDH over 3 years ago in reply to Andrew Beckett

    I did send the entire procedure.

    Changed the pcreMatchp criteria from "mom" to "momcap_CDNS"; "mom" was a bit to open ended. I apologize for not mentioning at the outset that I was working with flattened pcells from streamed in data. But I think that eliminates any hierarchy issues.

    I think you're right that the root of the problem is using ge functions and dbOpenCellViewByType() does not provide a window.

    Feedback from designers is that they want the 'window version' anyway. They prefer to view the results before saving. So I will move forward using dbOpenCell().

    Thanks for the help. Now I know that ge functions are not suitable when there are no displayed graphics.

    Cheers,

    • 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