• 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. Allegro X PCB Editor
  3. Get info from all footprints in library

Stats

  • Replies 7
  • Subscribers 160
  • Views 17388
  • Members are here 0
More Content

Get info from all footprints in library

EvanShultz
EvanShultz over 4 years ago

I would like to write a report that gives 3D mapping info for all footprints in the library. I have written a report that works fine for all footprints on a board, so I should be able to simply swap out the list of footprints on the board with a list of footprints in the library. But I'm not sure how to do that.

getDirFiles(axlOSSlash(strcat(axlGetVariable("CDS_SITE") "//footprints"))) gives me a list of all footprints in the library, but I don't know how to access the footprint properties. The board report is as simple as symdef->prop->PKGDEF_STEP_FILE (and the other 3D model properties) for each footprint on the board, but that doesn't work with a pile of PSM files sitting out on a network folder.

Does anyone know how I can access the properties of a footprint on the network? I searched the forum and didn't find anything but I may have just not used the proper search terms. Thanks in advance for any help!

  • Sign in to reply
  • Cancel
Parents
  • B Bruekers
    B Bruekers over 4 years ago

    You need to do this with the extracta tool and run it on the DRA (not PSM) files.

    create a extracta command file, eg  c:\extracta.txt

    put these lines in this file:

    BOARD
    PKGDEF_STEP_FILE
    END

    Then start the extracta command line: (perhaps you need to run this from your <cds_root>\tools\bin  directory)

    extracta -q -s -k -r "footprint.dra" "c:\extracta.txt"

    This will return the PKGDEF_STEP_FILE information.

    From SKILL you can do this with a ipcBeginProcess() and read out the return with ipcReadProcess().

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • EvanShultz
    EvanShultz over 4 years ago in reply to B Bruekers

    Thanks again for the help.

    I decided to first try just getting a simple piece of data from the command window (I'm on Windows). So I placed the following into a procedure:

    axlMsgPut("%L" axlGetVariable("cwd"))

    o_ipcHandle = ipcBeginProcess("cmd.exe")

    axlMsgPut("%L" ipcWriteProcess(o_ipcHandle "date /t"))

    axlMsgPut("%L" ipcReadProcess(o_ipcHandle 3))

    axlMsgPut("%L" ipcKillProcess(o_ipcHandle))

    That returned the following in the Allegro console:

    ipc:1

    t

    "Microsoft Windows [Version 10.0.19042.685]\r\n(c) 2020 Microsoft Corporation. All rights reserved.\r\n\r\nC:\\Data\\DATA\\Projects\\Cadence\\test\\extracta>"

    t

    So I'm talking to the Windows Command Window and getting back the introductory message along with the prompt for the path of the board file. It seems promising, but it's not sending the command I wanted and getting back the expected date info.

    From the same path in a Command Window, typing "date /t" gives me: "Thu 01/21/2021".

    I tried replacing the second line of SKILL code above with the following, as seen at community.cadence.com/.../synchronous-input-output-interprocess-communication-example-does-not-work, but that didn't do anything different.

    o_ipcHandle = ipcBeginProcess("cmd.exe" ""  'myIpcDataHandler 'myIpcErrHandler 'myIpcFinishHandler "ipc.log")

    I then tried plowing ahead with the extracta command, using this:

    axlMsgPut("%L" axlGetVariable("cwd"))

    o_ipcHandle = ipcBeginProcess("extracta.exe")

    axlMsgPut("%L" ipcWriteProcess(o_ipcHandle "extracta -q -s -k -r 1DIP14.dra extracta.txt"))

    axlMsgPut("%L" ipcReadProcess(o_ipcHandle 3))

    axlMsgPut("%L" ipcKillProcess(o_ipcHandle))

    That returns the following:

    ipc:1

    t

    "ERROR(SPMHUT-39): Error retrieving the command line switches.\r\n"

    t

    So something is happening, but my simple test didn't quite work and neither did calling the extracta program. Any tips?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • B Bruekers
    B Bruekers over 4 years ago in reply to EvanShultz

    Something like this should work:


    f_footprint = "c:/footprint.dra"
    f_extracta  = "c:/extracta.txt"
    cmd = lsprintf("extracta -q -s -k -r \\\"%s\\\" \\\"%s\\\" "  f_footprint f_extracta)
    timeout = 10
    cid = ipcBeginProcess(cmd)
    ipcWaitForProcess(cid timeout)
    result = nil
    while(str = ipcReadProcess(cid timeout), push(str result))
    result= reverse(remq(nil result))
    ipcKillProcess(cid)
    pp(result)

    Further the IPC api can be found in this help document: Cadence Interprocess Communication SKILL Reference

    Also take a look here for how to deal with special characters: https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nZpCEAU&pageName=ArticleContent

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • B Bruekers
    B Bruekers over 4 years ago in reply to EvanShultz

    Something like this should work:


    f_footprint = "c:/footprint.dra"
    f_extracta  = "c:/extracta.txt"
    cmd = lsprintf("extracta -q -s -k -r \\\"%s\\\" \\\"%s\\\" "  f_footprint f_extracta)
    timeout = 10
    cid = ipcBeginProcess(cmd)
    ipcWaitForProcess(cid timeout)
    result = nil
    while(str = ipcReadProcess(cid timeout), push(str result))
    result= reverse(remq(nil result))
    ipcKillProcess(cid)
    pp(result)

    Further the IPC api can be found in this help document: Cadence Interprocess Communication SKILL Reference

    Also take a look here for how to deal with special characters: https://support.cadence.com/apex/ArticleAttachmentPortal?id=a1Od0000000nZpCEAU&pageName=ArticleContent

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • EvanShultz
    EvanShultz over 4 years ago in reply to B Bruekers

    Thanks! That does work and all the info links are very helpful as well.

    I removed the -s command switch for extracta since one of the 3D model properties has the elements delimited with a comma and the other with a comma and space. That almost seems like it would be a bug. Anyway, having the exclamation point delimiters is helpful and I can then parse down the long string of A, J, and S records as needed. Having the exclamation point delimiters on the S record also helps to know for sure if the primary model is offset and/or rotated and also the secondary model is mapped or not. Maybe there is a better way?

    While I need to finish things off, a small prototype of the code is working over a section of our library. It's going to be a lengthy process to do this for all footprints over a network, but that's fine and to be expected. So thanks again and hopefully I can take it from here.

    Two things I'm going to have to look into:

    1. I find in the extracta documentation for <outfile> that a maximum of 24 files is supported. I don't think this affects me since I'm running extracta on only one footprint at a time. But I haven't used extracta much so I could be missing something. We'll see.

    2. There's little point in running extracta on footprints that aren't package symbols in this case since I care about 3D mapping info. Flashes and shape-based footprints and other footprints which aren't of type PACKAGE or MECHANICAL won't have 3D info mapped (I haven't seen a need to map any, anyway) and I don't want them in the report. I can either find out how to extract that info from the footprint and filter the result from extracta or perhaps see if the DRA has a complementary file with an extension of PSM or BSM. I'll figure out one of those solutions, or need to do something else, as I finish the code.

    Ahh. I searched COS for "ipcBeginProcess()" and also "interproces communication" and neither turns up that document. One would think I would get a useful documents in the results for at least one of those terms...

    On a similar note, where can I find documentation for push() and pp()? They aren't in sklangref.pdf and COS also doesn't have any useful results I can find.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • B Bruekers
    B Bruekers over 4 years ago in reply to EvanShultz

    Nice that you succeeded to parse the information. 

    I assume you only need to run this once. If so then I suggest to copy all footprint files to a local drive. This will run much faster.

    1) you can set multiple items in the extracta option file. With axlExtractToFile() you can extract data from the current database to a ascii file. For example the ODB exporter is using this to generate several files for the actual ODB converter.

    2) I understand what the issue is, you want to sort the dra file list before you start extracta. If all of your DRA files are in 1 large directory then this is impossible without using extracta (and going through each file...) Maybe you can filter the footprints by the filename?

    The pp() is a pretty print and you can find it in the 'Cadence SKILL Development Reference'. (skdevref)

    push() is a default LISP macro. In SKILL it is actually a macro that calls cons().  So it basically does the same as a cons(), but it is shorter to write up:

    strings = cons("hello" strings)

    push("hello" strings)

    Skill > isMacro('push)  --> t
    Skill > expandMacro('push("a" x))   --> car(    (x = cons("a" x)))

    So the push uses cons() and returns the first element in the list (so the item that was added to the list)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

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