• 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. Count via by netlist help ?

Stats

  • Replies 2
  • Subscribers 159
  • Views 12898
  • Members are here 0
More Content

Count via by netlist help ?

luanvn81
luanvn81 over 13 years ago

 Hi everybody! I'm writting a skill to count number of via of net in a list nets. before I show my problem, please see my code below:

......................

 ;========Declare Subclasses==========
subclasses = '( "VP24", "VP2" )

;========Check input file==========
if(isFile("listnet.txt") then
netlist=nil
inPort = infile( "listnet.txt" )
when( inPort
while( gets( nextline inPort )
nextline = car(parseString(nextline, "\n"))
nextline = car(parseString(nextline, " "))
netlist=cons(concat(nextline),netlist)
);end while
close( inPort )
netlist=reverse(netlist)
;========== Write out file===============================================
    writeOutFile = outfile( "./Count_via_report.csv" )

;========== Format Intro for outfile ====================================
intro="Net_name,"
foreach(subclass, subclasses
    sprintf(intro,strcat(intro, " Layer_", subclass,"," ))
);end foreach
fprintf(writeOutFile, "%s\n\n",intro)

;==========format what to do for each layer and caculateing them=============================
foreach(subclass, subclasses
axlVisibleDesign(nil)
axlVisibleLayer(strcat("via class/", subclass) t)
axlVisibleUpdate(t)
axlSetFindFilter(?enabled '(noall vias) ?onButtons '(noall vias))
allViasInSubclass = axlGetSelSet(axlAddSelectAll())
axlClearSelSet()

;========Create for each net in each layer a symbol in order to count number vias of that net=========
foreach(net, netlist
    sum_net = concat(net, "_", subclass)
    set(sum_net , nil)
    sum_net  = setof(via, allViasInSubclass, via->net->name == get_pname(net))
);end foreach net
);end foreach subclass

;===========Format output data for outfile =============================
foreach(net, netlist
line = ""
  foreach(subclass, subclasses
    sum_net = concat(net, "_", subclass)
    sprintf(line, "%-30s, %-6L",line, length(eval(sum_net)) )
  );end foreach subclass
fprintf(writeOutFile, "%s %s\n", net, line)
);end foreach net of netlist

fprintf(writeOutFile "END OF FILE")
close(writeOutFile)
........................

my problem is: When i get number vias for each net by command    "setof(...... ) "  ,  sum_net is a list and having values in it. But when I recall them to display in output file , It become a symbol. 

  How can i fix it? Please help me.

Thanks !

Luan.

 

  • Sign in to reply
  • Cancel
  • Randy R
    Randy R over 13 years ago

    A few things to try:

    It looks like "net" is just text whereas get_pname() is looking for a symbol.  This may be causing the error.
    Try:  sum_net  = setof(via, allViasInSubclass, via->net->name == net)
    Then you can use length(sum_net) to get the number of vias.

    Notes:
      It looks like you'll only get the vias from the last subclass in subclasses.  Check your loops and consider how you want to get this information to the output data section.
      Also, your output data section will probably need some changes.

    Hope this helps.

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

     Hi Randy R!

     Thank for your reply,  I don't know why but when I replace  command  setof(....)  by below code, my skill works OK.

       here is my replace code : 

     foreach(net, netlist
        sumnet = concat(net, "_", subclass)
        set(sumnet, nil)
       foreach(via allViasInSubclass
         when(via->net->name == get_pname(net)
           set(sumnet, cons(via, eval(sumnet)))
        );end when
       ); end foreach via
    );end foreach net

    ................

    my output code still works without problems, I only want to try to use command setof  for this. Who can help me fix it ?

    Thank!

    Luan.

    Viet Nam.

     

    • 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