• 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. Copy, edit, then save padstack

Stats

  • Replies 8
  • Subscribers 159
  • Views 16089
  • Members are here 0
More Content

Copy, edit, then save padstack

mikebystedt
mikebystedt over 11 years ago

Newbie question, 

Old timer in SKILL (IC), new to Allegro axl functionality.

 I simply want to grab an existing padStack and copy it.  Change the flash name for a specific pad on a specific layer (thermal), and save it to the new padId.  Then save it to the design.It seems to be readOnly, so I'm not able to modify any of the properties.  Any suggestions?

* I used axlCopyPadStack(), and grabbed the dbId for it, then tried to modify it to no avail.

padId = axlDBGetPad(padStack pad->layer "THERMAL")
padId->flash = flashName

Can't seem to modify it.  Also wish to pick a pin and change/swap the padstack for it.  Not sure if I will run into similar issues.  Any help here would be greatly appreciated.

Regards, Mike.

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

    Welcome to the axl world!

    Try using axlPadstackEdit. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mikebystedt
    mikebystedt over 11 years ago

    "Currently only global padstack settings are supported. Editing pad layer characteristics in not
    allowed."  (Not my typo).

     

    Looks like axlPadstackEdit only allows me to modify properties for the padstack.  I actually need to change the "flash" name of a specific thermal pad.  I have the id for the pad, but I can't modify the readOnly status to change it.

     Thanks eDave,  One of my new co-workers said you were the man to talk to if possible.  I guess you are slightly famous.

     Any other ideas?  Maybe I'm just too new and missing something here.

     Thanks, -Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mikebystedt
    mikebystedt over 11 years ago

    This isn't looking very promising.  Do I have to write a procedure to read out all of the details of an existing padStack and modify the flash names for the pad/layer before adding it using axlDBCreatePadStack()?  I was really hoping for a quick copy, then a simple change to the flash name for the new padStack.

    Is this possible?  Or do I have to do it the hard way?

    Thanks,

     -Mike 

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mikebystedt
    mikebystedt over 11 years ago

     Dave, I found this suggestion from you in another post.  Is this the only way to get the job done?  What use is axlDBCopyPadstack() if we can't modify it at all???  Very curious.  Thanks.  -Mike

    -----------------------------------------------------------------------------------------------------------------------------------

    I believe that method 1 is the only one that will work well - and it does work.

    You need to define the pads for every layer using make_axlPadStackPad and then create the padStack using axlDBCreatePadStack before using axlPadstackToDisk.

    Works for me.

    Dave

    --------------------------------------------------------------------------------------------------------------------------------------

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

    Don't worry. You can do it:

    See the below code. It does something else and contains calls to some of my private functions but it should give you a clue.

    Especially look at the  make_axlPadStackPad command.

    Cheers,

    Dave 

    defun( ReplaceNarrowSMDPads ()

     let((minPadWidth, minPadDia, dx, widthStr, diaStr, pins, psid, cuPad, suffix, newName, pads, padStruct, exts, xLen, yLen, newWidth

    layer, flash, figureSize, newPad, pinsToReplace, replaceList, p, fileName)

    minPadWidth = MM2Units(0.27)

    minPadDia = MM2Units(0.37)

    dx = MM2Units(0.025)

    pins = setof(pin, AFn_findTypeObjects("pins"), FindNarrowSMDPadsOnPin(pin, minPadWidth, minPadDia))

    foreach(pinName, unique(pins ~>name)

    psid = axlLoadPadstack(pinName)

    cuPad = axlDBGetPad(psid, "ETCH/TOP", "REGULAR")

    exts = cuPad ->bBox, xLen = BboxX2(exts) - BboxX1(exts), yLen = BboxY2(exts) - BboxY1(exts)

    newWidth = min(xLen, yLen) + dx

    sprintf(widthStr, "%d", round(ToMM(newWidth) * 101))

    diaStr = widthStr

    cond(

    (rexMatchp("^[0-9]+X[0-9]+[_]*.*$", pinName); Rect pad

    sprintf(newName, "%sX%s", car(parseString(pinName, "X")), widthStr)

    )

    (rexMatchp("^[0-9]+O[0-9]+[_]*.*$", pinName); Oval pad

    sprintf(newName, "%sO%s", car(parseString(pinName, "O")), widthStr)

    )

    (rexMatchp("^[0-9]+C[_]*.*$", pinName); BGA ball

    sprintf(newName, "%sC", diaStr)

    )

    )

    suffix = when(index(pinName, "_"), strcat("_", cadr(parseString(pinName, "_"))))

    when(suffix, newName = strcat(newName, suffix))

    unless(axlLoadPadstack(newName)

    printf("Creating new padstack: %s\n", newName)

    pads = psid ->pads

    padStruct = nil

    foreach(pad, pads

    exts = pad ->bBox

    xLen = BboxX2(exts) - BboxX1(exts)

    yLen = BboxY2(exts) - BboxY1(exts)

    unless(zerop(xLen) || zerop(yLen)

    layer = cadr(parseString(pad ->layer, "/"))

    flash = unless(pad ->flash == "", pad ->flash)

    figureSize = if(rexMatchp("^[0-9]+C[_]*.*$", pinName); BGA circle

    then list(xLen + dx, yLen + dx)

    else list(if(xLen <= yLen, xLen + dx, xLen), if(xLen <= yLen, yLen, yLen + dx))

    )

    newPad = make_axlPadStackPad(?layer layer, ?type pad ->type, ?figure pad ->figureName, ?flash flash, ?figureSize figureSize, ?offset pad ->offset)

    padStruct = cons(newPad, padStruct)

    )

    )

    axlDBCreatePadStack(newName, nil, padStruct)

    )

    pinsToReplace = setof(pin, pins, pin ->name == pinName)

    printf("Replacing %s with %s on %d pins...\n", pinName, newName, length(pinsToReplace))

    ;axlReplacePadstack(pinsToReplace, newName); This causes exploded pads and connectivity problems

    replaceList = cons(list(pinName, newName), replaceList)

    ); foreach pinName

    when(replaceList

    p = axlDMOpenFile("ALLEGRO_SCRIPT", "ReplacePadstack", "w")

    if(p then

    fileName = get_filename(p)

    fprintf(p, "setwindow pcb\n")

    fprintf(p, "generaledit\n")

    fprintf(p, "replace padstack\n")

    fprintf(p, "setwindow form.mini\n")

    foreach(pinPair, replaceList

    fprintf(p, "FORM mini oldname %s\n", car(pinPair))

    fprintf(p, "FORM mini newname %s\n", cadr(pinPair))

    fprintf(p, "FORM mini replace\n")

    fprintf(p, "fillin yes\n")

    )

    fprintf(p, "setwindow pcb\n")

    fprintf(p, "done\n")

    fprintf(p, "generaledit\n")

    drain(p)

    axlDMClose(p)

    axlShell("replay ./ReplacePadstack.scr")

    deleteFile(fileName)

      else

    axlUIConfirm("Error: Could not create Replace Padstack script file", 'error)

    )

    )

    ))

    • 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