]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - host/performance2wiki.rb
updated Makefile
[avr-crypto-lib.git] / host / performance2wiki.rb
index 9d46dd3380887b3cb12f76fce58b710c55c827bc..cfdc3cefbed050d8242fd9b06794682385f6bd7f 100644 (file)
@@ -56,9 +56,28 @@ def process_hashfunction(fin, name)
   lb = fin.readline()
   m = lb.match(/ctx2hash \(cycles\):[\s]*([\d]*)/)
   convtime = m[1].to_i()
+  begin
+    lb = fin.readline()
+  end until m = lb.match(/init \(bytes\):[\s]*([\d]*)/)
+  initstack = m[1].to_i()
+  lb = fin.readline()
+  m = lb.match(/nextBlock \(bytes\):[\s]*([\d]*)/)
+  nextblockstack = m[1].to_i()
+  lb = fin.readline()
+  m = lb.match(/lastBlock \(bytes\):[\s]*([\d]*)/)
+  lastblockstack = m[1].to_i()
+  lb = fin.readline()
+  m = lb.match(/ctx2hash \(bytes\):[\s]*([\d]*)/)
+  convstack = m[1].to_i()
+  s1 = (initstack>nextblockstack)?initstack:nextblockstack
+  s2 = (lastblockstack>convstack)?lastblockstack:convstack
+  stack = (s1>s2)?s1:s2
   
-  printf("| %s || C || C || || %4d || %4d || %4d || %6d || %6d || %6.2f || %6d || || || \n|-\n" , 
-    name, ctxsize, hashsize, blocksize, inittime, nextblocktime, nextblocktime.to_f/blocksize*8, lastblocktime+convtime)
+  printf("| %20s || %3s || %3s || || %4d || %4d || %4d || %4d ||" +
+         " %6d || %6d || %7.2f || %6d || || || \n|-\n" , 
+        name, $lang, $lang ,ctxsize, stack, hashsize, blocksize, 
+           inittime, nextblocktime, nextblocktime.to_f/(blocksize/8),
+               lastblocktime+convtime)
 end
 
 
@@ -68,6 +87,8 @@ $handlers["hashfunction"] = 1 #process_hashfunction
 
 def process_file(fname)
   fin = File.open(fname, "r")
+  $lang = "asm"
+  $lang = "C" if fname.match(/_c.txt$/)
   begin
     begin
          if fin.eof()