Browse Source

performance tool tuning

master
bg 13 years ago
parent
commit
206e5aa6d3
  1. 18
      Makefile
  2. 21
      avr-makefile.inc
  3. 9
      host/performance2wiki.rb
  4. 2
      mkfiles/ubi.mk

18
Makefile

@ -1,5 +1,6 @@
# Makefile for the AVR-Crypto-Lib project
# author: Daniel Otte
SHELL = sh
BLOCK_CIPHERS :=
STREAM_CIPHERS :=
@ -7,13 +8,14 @@ HASHES :=
MACS :=
PRNGS :=
ENCODINGS :=
AUX :=
# we use the gnu make standard library
include gmsl
include avr-makefile.inc
include mkfiles/*.mk
ALGORITHMS = $(BLOCK_CIPHERS) $(STREAM_CIPHERS) $(HASHES) $(PRNGS) $(MACS) $(ENCODINGS)
ALGORITHMS = $(BLOCK_CIPHERS) $(STREAM_CIPHERS) $(HASHES) $(PRNGS) $(MACS) $(ENCODINGS) $(AUX)
ALGORITHMS_OBJ = $(patsubst %,%_OBJ, $(ALGORITHMS))
ALGORITHMS_TEST_BIN = $(patsubst %,%_TEST_BIN, $(ALGORITHMS))
@ -201,6 +203,20 @@ $(foreach algo, $(ALGORITHMS),$(eval $(call TESTRUN_TEMPLATE, $(algo), $(call lc
all_testrun: $(foreach algo, $(ALGORITHMS), $(algo)_TESTRUN)
#-------------------------------------------------------------------------------
define TESTSPEED_TEMPLATE
$(1)_TESTSPEED: $(1)_FLASH
@echo "[speed]: $(1)"
$(RUBY) $(GET_PERFORMANCE) $(TESTPORT) $(TESTPORTBAUDR) 8 1 performance $(SPEEDLOG_DIR)$(SPEEDPREFIX) $(2)
endef
$(foreach algo, $(ALGORITHMS),$(eval $(call TESTSPEED_TEMPLATE, $(algo), $(call lc,$(algo)) )))
all_testspeed: $(foreach algo, $(ALGORITHMS), $(algo)_TESTSPEED)
hash_testspeed: $(foreach algo, $(HASHES), $(algo)_TESTSPEED)
#-------------------------------------------------------------------------------
define LISTING_TEMPLATE

21
avr-makefile.inc

@ -15,6 +15,8 @@ TESTPORT = /dev/ttyUSB1
TESTPORTBAUDR = 38400
TESTLOG_DIR = testlog/
TESTPREFIX = nessie-
SPEEDLOG_DIR = speed_log/
SPEEDPREFIX =
LIST_DIR = listings/
STAT_DIR = stats/
AUTOASM_DIR = autoasm/
@ -29,12 +31,13 @@ override ASFLAGS = -mmcu=$(MCU_TARGET) -Wa,--gdwarf-2
SIZESTAT_FILE = sizestats.txt
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
READELF = readelf
RUBY = ruby
GET_TEST = host/get_test.rb
MAKE = make
MAKE2GRAPH = ~/bin/make2graph.rb
TWOPI = twopi
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
READELF = readelf
RUBY = ruby
GET_TEST = host/get_test.rb
GET_PERFORMANCE = host/get_performance.rb
MAKE = make
MAKE2GRAPH = ~/bin/make2graph.rb
TWOPI = twopi

9
host/performance2wiki.rb

@ -57,8 +57,11 @@ def process_hashfunction(fin, name)
m = lb.match(/ctx2hash \(cycles\):[\s]*([\d]*)/)
convtime = m[1].to_i()
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 ||" +
" %6d || %6d || %7.2f || %6d || || || \n|-\n" ,
name, $lang, $lang ,ctxsize, hashsize, blocksize,
inittime, nextblocktime, nextblocktime.to_f/blocksize*8,
lastblocktime+convtime)
end
@ -68,6 +71,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()

2
mkfiles/ubi.mk

@ -2,7 +2,7 @@
ALGO_NAME := UBI
# comment out the following line for removement of ubi from the build process
HASHES += $(ALGO_NAME)
AUX += $(ALGO_NAME)
$(ALGO_NAME)_OBJ := threefish_mix.o threefish256_enc_asm.o ubi256_asm.o \

Loading…
Cancel
Save