• 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. Add part_number to component in PCB

Stats

  • Replies 4
  • Subscribers 17
  • Views 9945
  • Members are here 0
More Content

Add part_number to component in PCB

Ejlersen
Ejlersen over 6 years ago

Hi

I'm creating a board file using SKILL with axlDBCreateComponent.

The problem is how I get a part_number assigned to the parts created with this method.

Since I create symbols and device files before creating the board data, I'm wondering if this is tied into the device file which is writted using axlWriteDeviceFile .

For some parts I've used the line below and are wondering what the empty list could containt. Documentation on this command is a bit sparse.

axlCreateDeviceFileTemplate(devicefilename "MECHANICAL" '())

Any suggestions?

Best regards

Ole

  • Cancel
  • Sign in to reply
Parents
  • eDave
    eDave over 6 years ago

    For what it's worth, here's a function that I use to create a component:

    defun( ARY_AddVscoreDogBoneSymbol (symName, loc, ang)
    let((symDef, nPins, deviceFileName, p, names, nList, n, refdes, net, sym, suff, netName, netNameOther); drcs
    symDef = axlLoadSymbol("package", symName)
    nPins = length(symDef ->pins)
    deviceFileName = strcat(symName, ".txt")
    unless(axlDMFindFile("DEVICE_MAP", symName, "r")
    p = axlDMOpenFile("DEVICE_MAP", deviceFileName, "w")
    when(p
    fprintf(p, "(DEVICE FILE: %s)\n", symName)
    fprintf(p, "PACKAGE %s\n", symName)
    fprintf(p, "CLASS IO\n")
    fprintf(p, "PINCOUNT %d\n", nPins)
    fprintf(p, "END")
    drain(p)
    axlDMClose(p)
    )
    )

    ;Delete unplaced dogbone symbols:
    axlDeleteObject(setof(c, axlDBGetDesign() ->components, Left(c ->name, 8) == "DOGBONE_" && !(c ->symbol)))

    ;caclulate the dogbone name by finding the lowest number available:
    names = axlSelectByName("COMPONENT", "dogbone_*", t) ~>name, axlClearSelSet()
    nList = sort(mapcar(lambda((cName), readstring(cadr(parseString(cName, "_")))), names), 'greaterp)
    n = (car(nList) || 0) + 1
    for(i, 1, car(nList) || 0, unless(listnindex(nList, i), n = i))
    sprintf(refdes, "DOGBONE_%d", n)

    axlDBCreateComponent(refdes, symName); Uses device file [devName].txt
    deleteFile(deviceFileName)

    ;Create the symbol:
    sym = car(axlDBCreateSymbol(refdes, loc, nil, ang))
    if(sym then
    ;Allocate unique net to each set of pins on each side and end of the dogbone:
    foreach(pin, sym ->pins
    suff = strcat(if(axlDBGetPad(pin, "PIN/TOP", "regular") ->figure then "T" else "B"), if(zerop(ang) && car(pin ->xy) < car(loc) || !zerop(ang) && cadr(pin ->xy) < cadr(loc), "L", "R"))
    netName = strcat(refdes, "_", suff)
    netNameOther = strcat(refdes, "_", Left(suff, 1), if(Right(suff, 1) == "L", "R", "L"))
    net = axlDBCreateNet(netName)
    axlDBAssignNet(pin, net)
    axlDBAddProp(pin, list("NET_SHORT", strcat(netName, ":", netNameOther)))
    )
    axlDBRefreshId(nil)
    axlDBAddProp(sym, '(("ARRAYTYPE", "VSCORE_DOGBONE"), ("fixed"), ("locked")))
    axlDBRefreshId(sym)
    else
    printf("Cannot place dogbone at %L. Remove flooding and re-try\n", loc)
    )
    sym
    ))

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Ejlersen
    Ejlersen over 6 years ago in reply to eDave

    Hi Dave

    Thanks, unfortunately not really helping. I've got no problem creating components or symbols, I'm doing that in a lot of different utilities.

    The challenge is if there is any other way than logic import to get part numbers (Part_Number) assigned to components.

    I'll have to dig more into device files in the help for third party logic, maybe its info that could be in the device file. I also got a manual device file creation function similar to yours where you basically write it from scratch, so that could be a way forward.

    Thanks for your input. If I find a solution I'll post it here.

    Best regards

    Ole

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Ejlersen
    Ejlersen over 6 years ago in reply to eDave

    Hi Dave

    Thanks, unfortunately not really helping. I've got no problem creating components or symbols, I'm doing that in a lot of different utilities.

    The challenge is if there is any other way than logic import to get part numbers (Part_Number) assigned to components.

    I'll have to dig more into device files in the help for third party logic, maybe its info that could be in the device file. I also got a manual device file creation function similar to yours where you basically write it from scratch, so that could be a way forward.

    Thanks for your input. If I find a solution I'll post it here.

    Best regards

    Ole

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

    Once the component has been created you can attach it as a property to the comp definition:

    axlDBAddProp(car(axlDBGetDesign()->compdefs) '(PART_NUMBER "test123"))

      Properties attached to component definition
        PART_NUMBER       = test123

    So this also works:
    id= axlDBCreateComponent( refdes pkgName nil nil nil)
    axlDBAddProp(id->compdef '(PART_NUMBER "test123"))

    Bram
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Ejlersen
    Ejlersen over 6 years ago in reply to B Bruekers

    Hi Bram

    Thank you so much, off course its a compdef property - why did I not think about that :-(

    Really appreciated the help.

    Best regards

    Ole

    • 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