performance tool tuning
This commit is contained in:
parent
b3e47e9020
commit
206e5aa6d3
18
Makefile
18
Makefile
|
@ -1,5 +1,6 @@
|
||||||
# Makefile for the AVR-Crypto-Lib project
|
# Makefile for the AVR-Crypto-Lib project
|
||||||
# author: Daniel Otte
|
# author: Daniel Otte
|
||||||
|
SHELL = sh
|
||||||
|
|
||||||
BLOCK_CIPHERS :=
|
BLOCK_CIPHERS :=
|
||||||
STREAM_CIPHERS :=
|
STREAM_CIPHERS :=
|
||||||
|
@ -7,13 +8,14 @@ HASHES :=
|
||||||
MACS :=
|
MACS :=
|
||||||
PRNGS :=
|
PRNGS :=
|
||||||
ENCODINGS :=
|
ENCODINGS :=
|
||||||
|
AUX :=
|
||||||
|
|
||||||
# we use the gnu make standard library
|
# we use the gnu make standard library
|
||||||
include gmsl
|
include gmsl
|
||||||
include avr-makefile.inc
|
include avr-makefile.inc
|
||||||
include mkfiles/*.mk
|
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_OBJ = $(patsubst %,%_OBJ, $(ALGORITHMS))
|
||||||
ALGORITHMS_TEST_BIN = $(patsubst %,%_TEST_BIN, $(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)
|
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
|
define LISTING_TEMPLATE
|
||||||
|
|
|
@ -15,6 +15,8 @@ TESTPORT = /dev/ttyUSB1
|
||||||
TESTPORTBAUDR = 38400
|
TESTPORTBAUDR = 38400
|
||||||
TESTLOG_DIR = testlog/
|
TESTLOG_DIR = testlog/
|
||||||
TESTPREFIX = nessie-
|
TESTPREFIX = nessie-
|
||||||
|
SPEEDLOG_DIR = speed_log/
|
||||||
|
SPEEDPREFIX =
|
||||||
LIST_DIR = listings/
|
LIST_DIR = listings/
|
||||||
STAT_DIR = stats/
|
STAT_DIR = stats/
|
||||||
AUTOASM_DIR = autoasm/
|
AUTOASM_DIR = autoasm/
|
||||||
|
@ -35,6 +37,7 @@ SIZE = avr-size
|
||||||
READELF = readelf
|
READELF = readelf
|
||||||
RUBY = ruby
|
RUBY = ruby
|
||||||
GET_TEST = host/get_test.rb
|
GET_TEST = host/get_test.rb
|
||||||
|
GET_PERFORMANCE = host/get_performance.rb
|
||||||
MAKE = make
|
MAKE = make
|
||||||
MAKE2GRAPH = ~/bin/make2graph.rb
|
MAKE2GRAPH = ~/bin/make2graph.rb
|
||||||
TWOPI = twopi
|
TWOPI = twopi
|
||||||
|
|
|
@ -57,8 +57,11 @@ def process_hashfunction(fin, name)
|
||||||
m = lb.match(/ctx2hash \(cycles\):[\s]*([\d]*)/)
|
m = lb.match(/ctx2hash \(cycles\):[\s]*([\d]*)/)
|
||||||
convtime = m[1].to_i()
|
convtime = m[1].to_i()
|
||||||
|
|
||||||
printf("| %s || C || C || || %4d || %4d || %4d || %6d || %6d || %6.2f || %6d || || || \n|-\n" ,
|
printf("| %20s || %3s || %3s || || %4d || %4d || %4d ||" +
|
||||||
name, ctxsize, hashsize, blocksize, inittime, nextblocktime, nextblocktime.to_f/blocksize*8, lastblocktime+convtime)
|
" %6d || %6d || %7.2f || %6d || || || \n|-\n" ,
|
||||||
|
name, $lang, $lang ,ctxsize, hashsize, blocksize,
|
||||||
|
inittime, nextblocktime, nextblocktime.to_f/blocksize*8,
|
||||||
|
lastblocktime+convtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,6 +71,8 @@ $handlers["hashfunction"] = 1 #process_hashfunction
|
||||||
|
|
||||||
def process_file(fname)
|
def process_file(fname)
|
||||||
fin = File.open(fname, "r")
|
fin = File.open(fname, "r")
|
||||||
|
$lang = "asm"
|
||||||
|
$lang = "C" if fname.match(/_c.txt$/)
|
||||||
begin
|
begin
|
||||||
begin
|
begin
|
||||||
if fin.eof()
|
if fin.eof()
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
ALGO_NAME := UBI
|
ALGO_NAME := UBI
|
||||||
|
|
||||||
# comment out the following line for removement of ubi from the build process
|
# 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 \
|
$(ALGO_NAME)_OBJ := threefish_mix.o threefish256_enc_asm.o ubi256_asm.o \
|
||||||
|
|
Loading…
Reference in New Issue