• 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. Help me with Via parameter !

Stats

  • Replies 12
  • Subscribers 159
  • Views 16155
  • Members are here 0
More Content

Help me with Via parameter !

luanvn81
luanvn81 over 13 years ago

 Hi everyone!
I have a skill file ( download from internet), I'm researching it but there are something I don't understand, so I hope evertone can help me. And here is it:
*****************************************************************
axlCmdRegister( "myCompanyViaReport" `myCompanyViaReport)
(defun myCompanyViaReport ()
; Find all of the vias in the design
allViasInDesign=list()
originalVisible=axlVisibleGet()
designName = axlCurrentDesign()
axlVisibleDesign(t)
axlShell("redisplay")
axlSetFindFilter(?enabled '(noall vias) ?onButtons '(noall vias))
allViasInDesign=axlGetSelSet(axlAddSelectAll())
axlClearSelSet()
; Open a file to work on
if(length(allViasInDesign)==0
then
axlUIConfirm("No vias in this design. Please try another design.")
else
writeOutFile = outfile("./TBL-DesignViaReport.csv" "w")
fprintf(writeOutFile strcat("Design Via Report for " designName "\n\n"))
fprintf(writeOutFile "Via Location,Via Net Name,Padstack Name,Via Start
Layer,Via End Layer\n")
; Output data for each via to the file
foreach(via allViasInDesign
viaLocation = sprintf(nil "%L:%L" car(via->xy) cadr(via->xy))
fprintf(writeOutFile strcat(viaLocation ","))
fprintf(writeOutFile strcat(via->net->name ","))
fprintf(writeOutFile strcat(via->name ","))
fprintf(writeOutFile strcat(car(via->startEnd) ","))
fprintf(writeOutFile strcat(cadr(via->startEnd) "\n"))
);end foreach via allViasInDesign
; Close the file and wrap up
fprintf(writeOutFile "END OF FILE")
close(writeOutFile)
axlVisibleSet(originalVisible)
axlShell("redisplay")
axlUIConfirm( "Report has been generated in your working directory." )
; This next line launches Excel and displays the report
axlHttp("TBL-DesignViaReport.csv")
);end if length(allViasInDesign)==0
);end defun myCompanyViaReport
********************************************************************
??????????????????
- How can I know paramerter of Vias such as ViaLocation, via net name, via name, via start layer, end layer in order to make this:
================================================================
viaLocation = sprintf(nil "%L:%L" car(via->xy) cadr(via->xy))
fprintf(writeOutFile strcat(viaLocation ","))
fprintf(writeOutFile strcat(via->net->name ","))
fprintf(writeOutFile strcat(via->name ","))
fprintf(writeOutFile strcat(car(via->startEnd) ","))
fprintf(writeOutFile strcat(cadr(via->startEnd) "\n")
================================================================

I'm using Allegro 16.3 and it seem can't run with BB via.
Tks!
Luanvn81

  • Sign in to reply
  • Cancel
  • eDave
    eDave over 13 years ago
    I tested the code. It works OK. I get a report in my working directory.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • luanvn81
    luanvn81 over 13 years ago

     Hi!

    Thank for your test!

    I have tested in 4 layer board and using through via, it's OK.  but I test with another brd and  got following error:

    E- *Error* strcat: argument #1 should be either a string or a symbol (type template = "S") - nil  and I found that one via have dummy net.So Skill file got error.

      By the way, can you explain to me some things in this Skill file:

    1/ I have changed  "axlVisibleDesign(t)" into "axlVisibleDesign(nil)" and add line  "axlVisibleLayer("etch/top" t) but program can't get via on top layer and warning "No vias in this design. Please try another design". How can I get via on top layer?

    2/  How the mark "->"  & "," in line    fprintf(writeOutFile strcat(via->net->name ",")) can be understand ?

    3/ How can I know Via properties in this skill file  in order to print to my file [Ex :fprintf(writeOutFile strcat(via->net->name ",")) ]

       Base on  Via's property  when "show element" via???

     I'm sorry , but I'm trying to learn skill myself.

    Tks.

    Luan.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 13 years ago
    Hi Luan,
     
    1/ Turn on layer "VIA CLASS/TOP"
     
    2/ I suggest you read the Skill Language User Manual. "The arrow ( -> ) operator gives you a simple way of indirectly accessing properties stored on a symbol's property list". The comma (",") is just printing the comma into the output file
     
    fprintf(writeOutFile strcat(via->net->name ",")) would be better written as fprintf(writeOutFile strcat(via->net->name || "DummyNet" ","))
     
    3/ To find all properties of a via, type via ->?? (assuming "via" is the dbid of the via you wish to know the properties of).

    I suggest that you read the available manuals. Learning Skill will be difficult without some background reading or training.

    Dave
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • luanvn81
    luanvn81 over 13 years ago

     Hi Dave!

    Thank you for your reply. I will  read the manuals clearly as your advice. 

    Can you show me one problem more?

    I wanna count via layerVP24 and Vp22 and my  code skill like below:

    ..........

     axlVisibleDesign(nil)
    axlVisibleLayer("via class/VP24" t)
    axlShell("redisplay")
    axlSetFindFilter(?enabled '(noall vias) ?onButtons '(noall vias))
    allViasInDesign=axlGetSelSet(axlAddSelectAll())
    axlClearSelSet()
    writeOutFile = outfile( "TempFile.tmp" ) ; open write tmp file
    foreach(via allViasInDesign
    viaLocation = sprintf(nil "%L:%L" car(via->xy) cadr(via->xy))
    netname=via->net->name
    if(nindex(netname "HC")!=nil then
    fprintf(writeOutFile strcat(via->name ","))
    fprintf(writeOutFile strcat(viaLocation ","))
    fprintf(writeOutFile strcat(via->net->name "\n"))
    else
    if(nindex(netname "LC")!=nil then
    ;fprintf(writeOutFile strcat("Top" " layer" ","))
    fprintf(writeOutFile strcat(via->name ","))
    fprintf(writeOutFile strcat(viaLocation ","))
    fprintf(writeOutFile strcat(via->net->name "\n"))
    else
    if(nindex(netname "GND")!=nil then
    fprintf(writeOutFile strcat(via->name ","))
    fprintf(writeOutFile strcat(viaLocation ","))
    fprintf(writeOutFile strcat(via->net->name "\n"))
    );end HC
    );end LC
    );end GND
    );end foreach

    axlVisibleDesign(nil)
    axlVisibleLayer("via class/VP22" t)
    axlShell("redisplay")
    axlSetFindFilter(?enabled '(noall vias) ?onButtons '(noall vias))
    allViasInDesign=axlGetSelSet(axlAddSelectAll())
    axlClearSelSet()
    foreach(via allViasInDesign
    viaLocation = sprintf(nil "%L:%L" car(via->xy) cadr(via->xy))
    netname=via->net->name
    if(nindex(netname "HC")!=nil then
    fprintf(writeOutFile strcat(via->name ","))
    fprintf(writeOutFile strcat(viaLocation ","))
    fprintf(writeOutFile strcat(via->net->name "\n"))
    else
    if(nindex(netname "LC")!=nil then
    fprintf(writeOutFile strcat(via->name ","))
    fprintf(writeOutFile strcat(viaLocation ","))
    fprintf(writeOutFile strcat(via->net->name "\n"))
    else
    if(nindex(netname "GND")!=nil then
    fprintf(writeOutFile strcat(via->name ","))
    fprintf(writeOutFile strcat(viaLocation ","))
    fprintf(writeOutFile strcat(via->net->name "\n"))
    );end HC
    );end LC
    );end GND
    );end foreach
    ............................

    my problem is:

    How can I write out via list of VP22 in another collumn(as below)

                    Layer Vp24                                                                    Layer Vp22

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

      Vianame    Via location   Via net name                         Vianame    Via location   Via net name

       xxxxx           xxxxxx             xxxxxx                          xxxxx           xxxxxx             xxxxxx   

       xxxxx           xxxxxx             xxxxxx                          xxxxx           xxxxxx             xxxxxx  

       xxxxx           xxxxxx             xxxxxx                          xxxxx           xxxxxx             xxxxxx  

       xxxxx           xxxxxx             xxxxxx                          xxxxx           xxxxxx             xxxxxx  

     Tks.

    Luan.

     

     

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

    Hopefully this code will get you started:

     

    subclasses = '("VP24", "VP22")

    foreach(subclass, subclasses

    viaList = stringToSymbol(strcat("viaList_", subclass))

    set(viaList, nil)

    axlVisibleDesign(nil)

    axlVisibleLayer(strcat("via class/", subclass) t)

    ;axlShell("redisplay")

    axlVisibleUpdate(t)

    axlSetFindFilter(?enabled '(noall vias) ?onButtons '(noall vias))

    allViasInSubclass = axlGetSelSet(axlAddSelectAll())

    axlClearSelSet()

    foreach(via allViasInSubclass

    netname = via ->net ->name

    when(netname && (nindex(netname "HC") || nindex(netname "LC") || nindex(netname "GND"))

    set(viaList, cons(via, eval(viaList)))

    )

    );end foreach via

    );end foreach subclass

    writeOutFile = outfile( "TempFile.tmp" ) ; open write tmp file

    foreach(sublass, subclasses

    fprintf(writeOutFile, "                                 %-49s", strcat("Layer ", sublass))

    )

    fprintf(writeOutFile, "\n\n")

    foreach(sublass, subclasses

    fprintf(writeOutFile, "----------------------------------------------------------------------------------")

    )

    fprintf(writeOutFile, "\n\n")

    foreach(sublass, subclasses

    fprintf(writeOutFile, "  Vianame                      Via location         Via net name                  ")

    )

    fprintf(writeOutFile, "\n\n")

     

    while(exists(sublass, subclasses, eval(stringToSymbol(strcat("viaList_", subclass))))

    line = ""

    foreach(sublass, subclasses

    viaList = stringToSymbol(strcat("viaList_", subclass))

    via = car(eval(viaList))

    viaLocation = sprintf(nil "%L:%L" car(via ->xy) cadr(via ->xy))

    sprintf(line, "%s%-30s %-20s %-30s", line, via ->name, viaLocation, via ->net ->name)

    set(viaList, cdr(eval(viaList)))

    )

    fprintf(writeOutFile, "%s\n", line)

    )

    close(writeOutFile) 

    • 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