• 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. Any Way to identify double hits (Via)?

Stats

  • Replies 36
  • Subscribers 166
  • Views 40785
  • Members are here 0
More Content

Any Way to identify double hits (Via)?

Alice
Alice over 16 years ago

If  on the same net DRC, due to the stack via design. Alot of DRC will apply also.

Is there a way to identify this issue? Pls advice.

 Regards,

Alice

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

    defun( getDuplicateHoles (objs @key (tol axlMKSConvert(0.2 "mm")))
     let((obj, loc, closeObjs, dupes, p)
      while(objs
        obj = car(objs), objs = cdr(objs), loc = obj ->xy
        closeObjs = setof(o, objs, and((car(o ->startEnd) == car(obj ->startEnd) || cadr(o ->startEnd) == cadr(obj ->startEnd)), samePoint(o ->xy, loc)))
        when(closeObjs
          dupes = cons(sprintf(nil, "%s at %L clashes with %s at %L", axlPPrint(obj ->objType), obj ->xy, buildString(unique(closeObjs ~>objType), ", "), closeObjs ~>xy), dupes)
        )
      )
      if(dupes then
        p = axlDMOpenFile("MISC", "duplicateHoles.txt", "w")
        fprintf(p, "Duplicate holes:\n\n")
        foreach(dupe, dupes, fprintf(p, "%s.\n", dupe))
        axlDMClose(p)
        axlUIViewFileCreate("duplicateHoles.txt", "Duplicate holes", nil)
       else
        println("No duplicates found.")
      )
      dupes
    ))

    defun( same (x1, x2 @optional tolp, tolm)
      unless(tolp, tolp = expt(10, -2 - cadr(axlDBGetDesignUnits())))
      cond(
        (!x1 && !x2, t); Both are nil
        (!x1 || !x2, nil) ; One, and only one, is nil
        (!tolm && abs(x1 - x2) > tolp, nil)
        (tolm && x1 - x2 > tolp, nil)
        (tolm && x2 - x1 > tolm, nil)
        (t, t)
      )
    )

    defun( samePoint (pt1, pt2, @optional tolp, tolm)
      unless(tolp, tolp = expt(10, -2 - cadr(axlDBGetDesignUnits())))
      and(same(car(pt1), car(pt2), tolp, tolm), same(cadr(pt1), cadr(pt2), tolp, tolm))
    )

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Marathon
    Marathon over 16 years ago
    Hi Dave,
    Thanks for the reply. The code you provided obviously needs a list to process. I have been looking at that and am having some trouble with it.The list, I would assume would be from the xy locations from all the through hole pads and vias for a net. Each net would be processed individually instead of processing the entire xy locations for all the pads and vias from the entire design. This would report the “close holes” that we are really looking for otherwise they would have a DRC marker on them from the touching nets. Any thought on how to create the input list correctly?
    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 16 years ago

    defun( getDuplicateHoles (@optional netName)
     let((oldSetData, holeObjects)
      oldSetData = list(axlGetSelSet(), axlGetFindFilter(nil), axlGetFindFilter(t))
      axlClearSelSet()
      axlSetFindFilter(?enabled '("noall", "pins", "vias", "invisible"), ?onButtons '("noall", "pins", "vias"))
      axlAddSelectAll()
      holeObjects = setof(obj, axlGetSelSet(), obj ->isThrough)
      when(netName, holeObjects = setof(obj, holeObjects, obj ->net ->name == upperCase(netName)))
      axlSetFindFilter(?enabled cons("noall", cadr(oldSetData)) ?onButtons cons("noall", caddr(oldSetData)))
      axlSingleSelectObject(car(oldSetData))
      getDuplicateObjects(holeObjects)
    ))

    defun( getDuplicateObjects (objs @key (tol axlMKSConvert(0.2 "mm")))
     let((obj, loc, closeObjs, dupes, p)
      while(objs
        obj = car(objs), objs = cdr(objs), loc = obj ->xy
        closeObjs = setof(o, objs, and((car(o ->startEnd) == car(obj ->startEnd) || cadr(o ->startEnd) == cadr(obj ->startEnd)), samePoint(o ->xy, loc)))
        when(closeObjs
          dupes = cons(sprintf(nil, "%s at %L clashes with %s at %L", axlPPrint(obj ->objType), obj ->xy, buildString(unique(closeObjs ~>objType), ", "), closeObjs ~>xy), dupes)
        )
      )
      if(dupes then
        p = axlDMOpenFile("MISC", "duplicateHoles.txt", "w")
        fprintf(p, "Duplicate holes:\n\n")
        foreach(dupe, dupes, fprintf(p, "%s.\n", dupe))
        axlDMClose(p)
        axlUIViewFileCreate("duplicateHoles.txt", "Duplicate holes", nil)
       else
        println("No duplicates found.")
      )
      dupes
    ))

    defun( same (x1, x2 @optional tolp, tolm)
      unless(tolp, tolp = expt(10, -2 - cadr(axlDBGetDesignUnits())))
      cond(
        (!x1 && !x2, t); Both are nil
        (!x1 || !x2, nil) ; One, and only one, is nil
        (!tolm && abs(x1 - x2) > tolp, nil)
        (tolm && x1 - x2 > tolp, nil)
        (tolm && x2 - x1 > tolm, nil)
        (t, t)
      )
    )

    defun( samePoint (pt1, pt2, @optional tolp, tolm)
      unless(tolp, tolp = expt(10, -2 - cadr(axlDBGetDesignUnits())))
      and(same(car(pt1), car(pt2), tolp, tolm), same(cadr(pt1), cadr(pt2), tolp, tolm))
    )

    Someone owes me a beer!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Marathon
    Marathon over 16 years ago

    Thanks Dave! I will ship you a case. Name your brand :)

    I will look closer as to why the report only finds pins that have the exact same xy and not ones that are slightly overlapped. Vias are also not found, but it is a tremendous start!

    Much appreciated!

     

     

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 16 years ago

    Free stuff always has bugs;)

    I'd forgotten the tolerance. Here's the corrected function:

    defun( getDuplicateObjects (objs @key (tol axlMKSConvert(0.2 "mm")))
     let((obj, loc, closeObjs, dupes, p)
      while(objs
        obj = car(objs), objs = cdr(objs), loc = obj ->xy
        closeObjs = setof(o, objs, and((car(o ->startEnd) == car(obj ->startEnd) || cadr(o ->startEnd) == cadr(obj ->startEnd)), samePoint(o ->xy, loc, tol)))
        when(closeObjs
          dupes = cons(sprintf(nil, "%s at %L clashes with %s at %L", axlPPrint(obj ->objType), obj ->xy, buildString(unique(closeObjs ~>objType), ", "), closeObjs ~>xy), dupes)
        )
      )
      if(dupes then
        p = axlDMOpenFile("MISC", "duplicateHoles.txt", "w")
        fprintf(p, "Duplicate holes:\n\n")
        foreach(dupe, dupes, fprintf(p, "%s.\n", dupe))
        axlDMClose(p)
        axlUIViewFileCreate("duplicateHoles.txt", "Duplicate holes", nil)
       else
        println("No duplicates found.")
      )
      dupes
    ))

     

    • Cancel
    • Vote Up +1 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