• 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 generate cells (layout view) from a txt file or csv...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 144
  • Views 15420
  • 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 generate cells (layout view) from a txt file or csv file using pcell and skill code?

jyzxyz
jyzxyz over 8 years ago

I have a pcell for device level (nmos, pmos, etc.) layout creation. I know I can input the parameters using the GUI window. But to generate many cells, it would be convenient to create a txt or csv file with different parameters. Could the experts here teach me how to read such a file and then generate as many cells (layout view) as needed using skill code?

Thank you very much!

  • Cancel
Parents
  • drdanmc
    drdanmc over 8 years ago

    for reading a text or csv file you can do something like:
    fp = infile("name_of_csv_file")
    while( gets(line, fp)
    ;; get rid of terminating new line (if needed)
    line = substring( line, 1, strlen(line)-1)
    ;; break into a list with an element for each entry
    data = parseString(line, ",")

    ;; now do stuff with data
    )

    For adding instances to a layout the basic way is:

    ;; open the layout you want to write to
    ;; "a" == append to cell
    ;; "w" == overwrite cell
    cv = dbOpenCellViewByType("mylib" "mycell" "layout" nil "a")

    ;; open (for reading) the cell you want to instantiate
    master_id = dbOpenCellViewByType("pdklib" "nmos" "layout" nil "r")
    refdes="I3" ;; some refdes (if you want to control it)
    xy=12.3:45.6 ;; x-y location
    orient = "R0" ;; other choices are "R90", "MY", etc.
    new_inst = dbCreateInstance(cv, master_id, refdes, xy, orient, 1, t)

    now you can update parameters on the newly created instance whose ID is in new_inst, for example:

    new_inst->w = 6.8
    new_inst->l = 0.8

    Read the manual part about the functions here and that should at least get you in the right area of the docs to get going.

    You may want to read this:

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000naD6EAI&pageName=ArticleContent&sq=005d0000001T3WNAA0_201729191014469

    and then read the solution that triggers callbacks that is mentioned in that article.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • drdanmc
    drdanmc over 8 years ago

    for reading a text or csv file you can do something like:
    fp = infile("name_of_csv_file")
    while( gets(line, fp)
    ;; get rid of terminating new line (if needed)
    line = substring( line, 1, strlen(line)-1)
    ;; break into a list with an element for each entry
    data = parseString(line, ",")

    ;; now do stuff with data
    )

    For adding instances to a layout the basic way is:

    ;; open the layout you want to write to
    ;; "a" == append to cell
    ;; "w" == overwrite cell
    cv = dbOpenCellViewByType("mylib" "mycell" "layout" nil "a")

    ;; open (for reading) the cell you want to instantiate
    master_id = dbOpenCellViewByType("pdklib" "nmos" "layout" nil "r")
    refdes="I3" ;; some refdes (if you want to control it)
    xy=12.3:45.6 ;; x-y location
    orient = "R0" ;; other choices are "R90", "MY", etc.
    new_inst = dbCreateInstance(cv, master_id, refdes, xy, orient, 1, t)

    now you can update parameters on the newly created instance whose ID is in new_inst, for example:

    new_inst->w = 6.8
    new_inst->l = 0.8

    Read the manual part about the functions here and that should at least get you in the right area of the docs to get going.

    You may want to read this:

    https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000naD6EAI&pageName=ArticleContent&sq=005d0000001T3WNAA0_201729191014469

    and then read the solution that triggers callbacks that is mentioned in that article.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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