• 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. how to add txt and pin to every layout in a lib

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 142
  • Views 13206
  • 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

how to add txt and pin to every layout in a lib

Nhumai
Nhumai over 6 years ago

Hi All,

I have a code below 

The procedure addtxt is working fine for each individual cell. Now I want to run for 165 cells in my lib so I added the code on the top (7 lines on the top) but it doesn't work 

Please let me know what is wrong ? 

lib=ddGetObj("sc12tps_v1_test")
foreach(cell lib~>cells
  when(ddGetObj(lib~>name cell~>name "layout")
    design(lib~>name cell~>name "layout" "a")
    addtxt()
  )
)
procedure(addtxt()
let(()
  cvId = geGetEditCellView()
  nwShapeL =setof(obj cvId~>shapes rexMatchp("NW" obj~>layerName))
  foreach(shape nwShapeL
     llcoord = car(shape~>bBox)
;     printf("The llcoord is %L\n" llcoord)
;     printf("The xcoord is %L\n" car(llcoord))
;     printf("The ycoord is %L\n" cadr(llcoord))
     xllcoord = car(llcoord) + .04
     yllcoord = cadr(llcoord) +.04
     coord = list(xllcoord yllcoord)
;     printf("The coord is %L\n" coord)
     label = "vpb"
     txtlayer = list("NW" "drawing")
     dbCreateLabel(cvId txtlayer coord label "centerCenter" "R0" "roman" .1)
     xll = xllcoord - .02
     yll = yllcoord - .02
     xur = xllcoord + .02
     yur = yllcoord + .02
     dbCreateRect(cvId list("NW" "drawing") list(xll:yll xur:yur ))
;;;;;Now for subtap
  subShapeL =setof(obj cvId~>shapes rexMatchp("ND" obj~>layerName))
  foreach(shape subShapeL
     llcoord = car(shape~>bBox)
;     printf("The llcoord is %L\n" llcoord)
;     printf("The xcoord is %L\n" car(llcoord))
;     printf("The ycoord is %L\n" cadr(llcoord))
     xllcoord = car(llcoord) + .04
     yllcoord = cadr(llcoord) +.04
     coord = list(xllcoord yllcoord)
;     printf("The coord is %L\n" coord)
     label = "vnb"
     txtlayer = list("PW" "drawing")
     dbCreateLabel(cvId txtlayer coord label "centerCenter" "R0" "roman" .1)
     xll = xllcoord - .02
     yll = yllcoord - .02
     xur = xllcoord + .02
     yur = yllcoord + .02
     dbCreateRect(cvId list("PW" "drawing") list(xll:yll xur:yur ))
))))
thanks 
Nhumai 
  • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago

    Hi Nhumai,

    The main issue is that you are calling the design() function in your code at the top, and this is the OCEAN function to specify the design to be used in netlisting/simulation. It does not open the design and certainly does not mean that geGetEditCellView() (which you're calling in the addtxt function) will pick up the design since that returns the cellView open in the current window (and design does not open any window).

    What you should do is replace the call to design as follows:

    lib=ddGetObj("sc12tps_v1_test")
    foreach(cell lib~>cells
      when(ddGetObj(lib~>name cell~>name "layout")
        cv=dbOpenCellViewByType(lib~>name cell~>name "layout" "maskLayout" "a")
        when(cv
          addtxt(cv)
        )
      )
    )

    and change the top of the addtxt function as follows:

    procedure(addtxt(@optional (cvId geGetEditCellView()))
    let((nwShapeL coord label llcoord xllcoord yllcoord txtlayer xll yll
        xur yur subShapeL)
      nwShapeL =setof(obj cvId~>shapes rexMatchp("NW" obj~>layerName))

    Note that since you'd put (as it stood) a rather pointless let() around everything (there's no point using let if you don't specify any local variables), I put all the variables that should have been local into the let. I changed the function to accept an optional argument which is the cellView id, which defaults to the current window so you could still call it with no arguments and have it work on the current window. As you'll see, the revised code at the top passes in the cellView to work ok.

    I'd also advise changing the function name to begin with a prefix which is unique in some way (and begins with a capital letter) to avoid clashing with anyone else's addtxt function that might get created.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Nhumai
    Nhumai over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    thanks for detail advises . I follow your instructions  and it working fine now :-) 

    thanks 

    Nhumai 

    • 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