• 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. Export libraries of all DRA files in specific directory

Stats

  • Replies 14
  • Subscribers 159
  • Views 18872
  • Members are here 0
More Content

Export libraries of all DRA files in specific directory

aricbeaver
aricbeaver over 8 years ago

Hi,

I would like to use SKILL to iterate through every single DRA file in a directory and export the libraries, i.e. padstacks, shapes, etc. The reason is to verify library contents during each library commit.

Would this be the proper way to do this?

1. Get the DRA file paths using getDirFiles(<directory>)

2. Open DRA file

3. Use axlShell(<command>) to open export library form

axlShell("dlib")
axlShell("setwindow form.dlib")
axlShell("FORM dlib destination export")
axlShell("FORM dlib execute")

4. Repeat 2-3 for every other DRA file

Thx,

Aric

  • Sign in to reply
  • Cancel
  • eDave
    eDave over 8 years ago

    If you really want to do this I suggest using axlWritePackageFile. Let me know if you want some sample code.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • aricbeaver
    aricbeaver over 8 years ago
    Hey Dave,

    Thanks for the reply. Where is the reference manual for the available skill functions? I only have PCB Editor installed not the custom IC stuff. I keep reading about this "skill finder" application but it only relates to custom IC software I think.

    Yes! Some example code would be great. I found this since you mentioned the axlWritePackageFile function, looking into this now.
    community.cadence.com/.../37080

    Also, curious why you say "if you really want to do this". In my experience it is difficult to manage a collaborative version control repository of Cadence library components. Exporting the contents (padstack/shapes/etc) from the DRA seems like the best way to approach implementing a "change control committee" process.

    Thx,
    Aric
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 8 years ago
    Hi Arik, Generally to verify a library I would run a script to place symbols and then watch for errors. That said, I don't know what problems you are looking for.
    the two Skill manuals that I use most are the SKill Language reference (\doc\sklangref) and Skill language user (\doc\sklanguser). I also refer to \share\pcb\examples\skill\DOC\FUNCS for the syntax of axl functions.
    Here's a function that should help. I haven't verified that it work so it might need a few tweaks:

    defun( DE_draExportLibraries (@optional (outputFolder "./libExport"))
    let((psms, psmName, symdef, badWrites, badSymdefs, p, result)
    unless(isDir(outputFolder), createDir(outputFolder))
    if(isDir(outputFolder) then
    foreach(path, axlGetVariableList("psmpath")
    when(isDir(path), psms = lconc(psms, setof(f, getDirFiles(path), cadddr(axlDMFileParts(f)) == "psm" || cadddr(axlDMFileParts(f)) == "bsm")))
    )
    psms = unique(car(psms))
    foreach(psm, psms
    psmName = cadr(axlDMFileParts(psm))
    symdef = car(errset(axlLoadSymbol(if(lowerCase(cadddr(axlDMFileParts(psm))) == "psm" then "PACKAGE" else "MECHANICAL"), psmName)))
    if(symdef then
    unless(axlWritePackageFile(symdef, outputFolder)
    badWrites = cons(psmName, badWrites)
    )
    else
    badSymdefs = cons(psmName, badSymdefs)
    )
    )

    p = axlDMOpenFile("MISC", "ExportLibrariesReport.txt", "w")
    fprintf(p, "Bad symbol definitions:\n")
    foreach(name, badSymdefs, fprintf(p, "\t%s\n", name))
    fprintf(p, "\nBad symbol exports:\n")
    foreach(name, badWrites, fprintf(p, "\t%s\n", name))
    axlDMClose(p)

    sprintf(result, "%d bad symbol definitions, %d bad symbol definitions", length(badWrites), length(badSymdefs))
    else
    axlUIPrompt(sprintf(nil, "Error: Could not create output folder (%s)", outputFolder), 'error)
    )
    result
    ))
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • aricbeaver
    aricbeaver over 8 years ago
    Hey Dave,

    Awesome! Thanks for the free code :) I've loaded and ran that SKILL file no problem.

    Ran from a DRA: It creates an empty output directory and says "0 bad symbol definitions, 5330 bad symbol definitions".
    Ran from a BRD: It exports quite a few DRAs then crashes Allegro or is doing a long unresponsive operation

    Any advice? Sorry I'm not much help debugging the SKILL code. This is my first project where I am writing SKILL.

    Thx,
    Aric
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 8 years ago
    Hi Aric. It need to run from a board design. It may crash Allegro if the design extents are too small. Try making them huge. Otherwise, you may be finding dra problems causing Allegro to crash. The only suggestion I have for that is to print the name of each dra just before it processes so you know which symbol causes the crash.
    • 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