100 REM sytsum B+ program to summarize SYTIME output 24-Apr-87 101 REM 102 REM Jim Crapuchettes, Omnex Corporation 103 REM 110 gosub 1000 ! initialize all strings with file info and set counters 200 print "Processor type:"; \ input ptype$ 210 test%=test%+1% \ if test%<12% then 220 else test%=1% & \ config%=config%+1% \ if config%<9 then 220 else stop 220 ifile$=ptype$+test$(test%)+".d"+config$(config%) & \ ofile$=ptype$+test$(test%)+".s"+config$(config%) & \ print "Input file=";ifile$;" Output file=";ofile$ 230 open ifile$ for input as file 1% 240 260 ! 270 dim #3%,thdr$(7%)=64%,tval%(10000%) ! Header and binary data 280 dim c%(7000%) \ tmax%=7000% \ c8=0 \ timesum=0 \ times%=0 \ hist=50. 290 minv%=32767% \ iline%,maxv%,bigv%,bign%=0% \ print "Clearing;"; & \ c%(i%)=0% for i%=1% to tmax% 299 ! 300 print " Header;"; \ linput #1,title$ \ linput #1,cmdline$ & \ linput #1,comment$ \ linput #1,a$ 310 on error goto 410 \ close #1 ! Close sequential input & \ open ifile$ for input as file 3% \ print " Data" 320 timev%=tval%(iline%) \ iline%=iline%+1% \ if timev%<=tmax% then 330 else & print using "Trial ###,### rejected, time =###,### (max is ##,###)", & iline%,timev%,tmax% \ bign%=bign%+1% & \ if timev%<=bigv% then 370 else bigv%=timev% \ bigl%=iline% \ go to 370 330 if timev%<1% then timev%=1% 340 if timev%<=maxv% then 350 else maxv%=timev% \ maxl%=iline% 350 if timev%>=minv% then 360 else minv%=timev% \ minl%=iline% 360 c%(timev%)=c%(timev%)+1% 370 times%=times%+1% \ timesum=timesum+timev% \ if iline%=10000% & then 420 else go to 320 ! *** FOR NOW, USES EXACTLY 10,000 VALUES *** 399 ! 400 ! found end of file on input? if so, find max counts 410 if err=11% then resume 420 else on error goto 420 on error goto \ close #1% \ if times%<>0% then 440 else & print "No times found!" \ go to 9999 440 cmax%=c%(minv%) \ for i%=minv% to maxv% \ if cmax%>c%(i%) then 450 else & cmax%=c%(i%) \ imax%=i% 450 next i% ! cmax% has max counts, imax% has index of max counts 460 ! 470 ! print \ print "Output to (default is terminal): "; \ input a$ \ o%=0% 480 open ofile$ for output as file 2% \ o%=2% 490 ! 550 ! & ! now output the header info and the min, max, average and median times & ! 570 print #o%;"SYTHST: ";title$ \ print #o% & \ print #o%,ifile$;" (";cmdline$;") - ";comment$ \ print #o% 590 starv%=asc("*") \ oline%=15% ! Initialize with header and trailer count 600 csum%,lsum%=0% \ median=0 & \ for tindex%=minv% to maxv% & \ csum%=csum%+c%(tindex%) ! compute running sum & \ if median<>0 then 650 else cbin%=tindex% & \ if csum%<5001% then 650 else median=cbin% & \ if lsum%<>5000% then 650 else mediam=(lbin%+cbin%)/2 650 lsum%=csum% \ lbin%=cbin% \ next tindex% 660 print #o%,using "Sum of times = ###,###,### uSec",timesum & \ print #o%,using "Number of trials= #,###,###",times% & \ print #o%,using "Average time = #,###,###.# uSec",timesum/times% & \ print #o%,using "Median value = #,###,###.# uSec",median & \ print #o% & \ print #o%,using "First minimum = ###,### uSec, on trial ###,###", & minv%,minl% & \ print #o%,using "First maximum = ###,### uSec, on trial ###,###", & maxv%,maxl% & \ if bigv%=0% then 670 else oline%=oline%+1% \ print #o%,using & "Biggest value = ###,### uSec, on trial ###,###",bigv%,bigl%; & \ print #o%,using " (#,### values above #,###)",bign%,tmax% 670 print #o% \ print #o% ! finish with 2 blank lines 680 close #o% \ print "Lines output =";oline%;" time = ";time$(0%); & \ print " = ";time(0%);" seconds" \ print 690 go to 210 ! back for another file 700 ! 1000 rem initialization subroutine: set strings and init counters 1001 rem 1010 dim test$(11),config$(8) ! define string arrays 1020 test$(1)="n" \ test$(2)="d" \ test$(3)="g" \ test$(4)="o" & \ test$(5)="t" \ test$(6)="c" \ test$(7)="rnl" \ test$(8)="rvm" & \ test$(9)="w" \ test$(10)="l" \ test$(11)="p" 1030 config$(1)="sj" \ config$(2)="fb" \ config$(3)="f1" \ config$(4)="xm" & \ config$(5)="x1" \ config$(6)="t1" \ config$(7)="t4" \ config$(8)="t5" 1040 test%=0% \ config%=1% 1050 return 1060 ! 9999 END