• 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 use variable in defcell

Stats

  • Replies 9
  • Subscribers 151
  • Views 552
  • Members are here 0

how to use variable in defcell

MorrisDH
MorrisDH 1 month ago

I am open to suggestions if there is a better way to create a symbol cellview but the following is what I am using.

defcell("realCellName" defSymbol( nil ) )

It works fine for a basic symbol with no pins which is all I need. It creates a symbol cellview under the cell "realCellName".

The following does not work as expected.

cellName = "realCellName"

defcell(cellName defSymbol( nil ))

It creates a new cell named "cellName" instead of parsing the variable. Is it not possible for defcell to recognize variables?

Or maybe there is a better way to create simple symbol cellviews.

Thanks

  • Sign in to reply
  • Cancel

Top Replies

  • Andrew Beckett
    Andrew Beckett 1 month ago +1
    No, the documentation makes it clear that this must be a literal string. It's not a SKILL function - it's a definition using an s-expression within a TSG file. You could of course template it yourself…
  • Andrew Beckett
    Andrew Beckett 29 days ago in reply to MorrisDH +1
    MorrisDH said: Apparently dbOpenCellViewByType(testLibName testCellName "symbol" "schematicSymbol" "w") creates a cellview call "symbol" but it is an empty cellview Of course. Why would it do anything…
  • Andrew Beckett
    Andrew Beckett 29 days ago in reply to MorrisDH +1
    That's because you have defsymbol( nil ) . The nil is unexpected and hence incorrect. If you just have defsymbol( ) then it wouldn't have this issue. Andrew
Parents
  • Andrew Beckett
    Andrew Beckett 1 month ago

    No, the documentation makes it clear that this must be a literal string. It's not a SKILL function - it's a definition using an s-expression within a TSG file.

    You could of course template it yourself using something like this:

    let(((tsgFile "myfile.tsg") tsgPort cellName tsgTemplate)
      cellName="realCellName"
      tsgPort=outfile(tsgFile)
      tsgTemplate=`defcell(,cellName defSymbol( nil ))
      pprint(tsgTemplate tsgPort)
      newline(tsgPort)
      close(tsgPort)
      ;(tsgFile)
    )

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • MorrisDH
    MorrisDH 29 days ago in reply to Andrew Beckett

    Created this procedure based on the template. 

    procedure( makeTheSymbol(@key cellName libName)
      let(((tsgFile "myfile.tsg") tsgPort tsgTemplate)
        tsgPort=outfile(tsgFile)
        tsgTemplate=`defcell(,cellName defsymbol( nil ))
        pprint(tsgTemplate tsgPort)
        newline(tsgPort)
        close(tsgPort)
        lmOpenLib(libName)
        load(tsgFile)
      ) ; let
    ) ; procedure

    It appears to work perfectly but I do get a warning.

    *WARNING* TSG: Invalid identifier

    Is that something I should be concerned about?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • MorrisDH
    MorrisDH 29 days ago in reply to Andrew Beckett

    Created this procedure based on the template. 

    procedure( makeTheSymbol(@key cellName libName)
      let(((tsgFile "myfile.tsg") tsgPort tsgTemplate)
        tsgPort=outfile(tsgFile)
        tsgTemplate=`defcell(,cellName defsymbol( nil ))
        pprint(tsgTemplate tsgPort)
        newline(tsgPort)
        close(tsgPort)
        lmOpenLib(libName)
        load(tsgFile)
      ) ; let
    ) ; procedure

    It appears to work perfectly but I do get a warning.

    *WARNING* TSG: Invalid identifier

    Is that something I should be concerned about?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • Andrew Beckett
    Andrew Beckett 29 days ago in reply to MorrisDH

    That's because you have defsymbol( nil ) . The nil is unexpected and hence incorrect. If you just have defsymbol( ) then it wouldn't have this issue.

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • 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.

© 2026 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information