• 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 Scripting - Skill
  3. Using extracta to extract symbol properties in SKILL

Stats

  • State Verified Answer
  • Replies 6
  • Subscribers 18
  • Views 4907
  • Members are here 0
More Content

Using extracta to extract symbol properties in SKILL

AsbjornEdvalds
AsbjornEdvalds over 1 year ago

Hi, 

I want to extract symbol properties from the symbols used in the board, but from the library files. That is, I want to be able to verify that some properties have not changed in the library from the symbols in the board file. E.g., I have a 0805 resistor which has a "DFA_DEV_CLASS:smdr_res" and it might have changed in the library to "DFA_DEV_CLASS:smdr_small". Being able to report this would quickly make it possible to see if the symbol in the board needs to be refreshed, as doing a full refresh regularly of all components in a design is not a wanted behavior. 

I wanted to use the extracta function and ipcBeginProcess to do this bidding, but it seems that properties of symbols are not supported using extracta. Following is the relevant snippet of the code which I started writing:

extr_opt = axlDMOpenFile("ALLEGRO_TEXT", axlTempFile( t ), "w")
fprintf(extr_opt "BOARD\nDATE_MODIFIED\nDFA_DEV_CLASS\nEND\n")
fname = get_filename(extr_opt)
axlDMClose(extr_opt)

LibFile = axlDMFindFile("ALLEGRO_PACKAGE_DB" "0805" "r")
axlMsgPut("LibFile: %L" LibFile)

cid = ipcBeginProcess(lsprintf("extracta -s -q -k -r \\\"%s\\\" \\\"%s\\\" " LibFile fname))
ipcWait(cid 5 5)
result = ipcReadProcess(cid 20)
axlMsgPut("read: %L" result)

Is this something that is possible using SKILL?

I am using 17.4-2019 S035.

Thanks in advance!

  • Cancel
  • Sign in to reply
Parents
  • AsbjornEdvalds
    0 AsbjornEdvalds over 1 year ago

    No one got any ideas to how I might solve this? 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • eDave
    +1 eDave over 1 year ago in reply to AsbjornEdvalds

    Change ALLEGRO_PACKAGE_DB to ALLEGRO_DRAWING.

    I'm not sure why you would use an IPC process to do this. Why not use axlRunBatchDBProgram? This works for me:

    defun( My_extractSymProperty (draName)
    viewFile = "props.view"
    p = axlDMOpenFile("ALLEGRO_TEXT", viewFile, "w")
    fprintf(p, "BOARD\n")
    fprintf(p, "DFA_DEV_CLASS\n")
    axlDMClose(p)
    dra = axlDMFindFile("ALLEGRO_DRAWING", draName, "r")
    outFileName = "draPropTest.txt"
    sprintf(cmd, "extracta -s -q -w -r %s %s %s", dra, viewFile, outFileName)
    axlRunBatchDBProgram("extracta", cmd, ?noUnload t)
    )

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • AsbjornEdvalds
    0 AsbjornEdvalds over 1 year ago in reply to eDave

    Hi Dave, great answer as always. The ALLEGRO_DRAWING seems to have been my issue.

    My plan was to use the IPC process to be able to get the extract back to the skill program to use for more processing. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • AsbjornEdvalds
    0 AsbjornEdvalds over 1 year ago in reply to eDave

    Hi Dave, great answer as always. The ALLEGRO_DRAWING seems to have been my issue.

    My plan was to use the IPC process to be able to get the extract back to the skill program to use for more processing. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • eDave
    0 eDave over 1 year ago in reply to AsbjornEdvalds

    You might like to use something like this code in place of an IPC process:

    defun( DE_getExtractedData (extractDataFile @optional fieldNames "tg")
    let((p, ln, labels, varName, units, data, fields, structData)
    p = axlDMOpenFile("EXTRACT_OUTPUT", extractDataFile, "r")
    gets(ln, p), labels = parseString(ln, "!\n")
    unless(fieldNames, fieldNames = labels)
    varName = gensym("extract")
    evalstring(strcat("defstruct(", varName " ", buildString(fieldNames), ")"))
    gets(ln, p), units = nth(8, axlStringCSVParse(ln, t, "!"))
    while(gets(ln, p)
    data = axlStringCSVParse(ln, t, "!")
    when(car(data) == "S"
    fields = buildString(mapcar(lambda((f), strcat("?", f, " \"" nth(listnindex(labels, f), data), "\"")), fieldNames))
    structData = lconc(structData, list(evalstring(strcat("make_", varName, "(", fields, ")"))))
    )
    )
    axlDMClose(p)
    deleteFile(extractDataFile)
    list(car(structData), units)
    ))

    Hopefully the output is self explanatory.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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