Quantcast
Channel: Cadence PCB Skill Forum
Viewing all articles
Browse latest Browse all 2182

Count via by netlist help ?

$
0
0

 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.

 


Viewing all articles
Browse latest Browse all 2182

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>