From 6e87ee5f9651d8f2fbd777f624170a1bd6c19ed7 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Mon, 21 Nov 2016 12:57:36 +0100 Subject: [PATCH] Makefile-AVR: add a target for our standard performance test. Our standard performance test is to run these three G-code files in SimulAVR and recording step pulse timings. While this certainly doesn't cover everything related to possible performance measurements, it's a good basic standard to compare code changes. Current performance: ATmega sizes '168 '328(P) '644(P) '1280 Program: 19808 bytes 139% 65% 32% 16% Data: 2191 bytes 214% 107% 54% 27% EEPROM: 32 bytes 4% 2% 2% 1% short-moves.gcode statistics: LED on occurences: 888. LED on time minimum: 308 clock cycles. LED on time maximum: 729 clock cycles. LED on time average: 317.393 clock cycles. smooth-curves.gcode statistics: LED on occurences: 23648. LED on time minimum: 308 clock cycles. LED on time maximum: 726 clock cycles. LED on time average: 354.825 clock cycles. triangle-odd.gcode statistics: LED on occurences: 1636. LED on time minimum: 308 clock cycles. LED on time maximum: 719 clock cycles. LED on time average: 336.327 clock cycles. --- Makefile-AVR | 10 +++++++++- testcases/run-in-simulavr.sh | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile-AVR b/Makefile-AVR index 231324f..12f6cbd 100644 --- a/Makefile-AVR +++ b/Makefile-AVR @@ -177,7 +177,7 @@ size: $(BUILDDIR)/$(PROGRAM).elf $(call show_size,Data,1,2,4,8) $(call show_size,EEPROM,1,2,2,4) -.PHONY: simulavr-check simulavr +.PHONY: simulavr-check simulavr performancetest simulavr-check: @if [ ! -x ../simulavr/src/simulavr ]; then \ echo "Can't find SimulAVR executable in ../simulavr/src/simulavr."; \ @@ -192,3 +192,11 @@ simulavr: $(MAKE) -f Makefile-AVR USER_CONFIG=testcases/config.h.Profiling \ MCU=atmega644 F_CPU=20000000UL all ../simulavr/src/simulavr -f build/testcases/config.h.Profiling/teacup.elf + +performancetest: + @$(MAKE) --no-print-directory -f Makefile-AVR simulavr-check + @echo "Compiling for SimulAVR and running performance tests." + $(MAKE) -f Makefile-AVR USER_CONFIG=testcases/config.h.Profiling \ + MCU=atmega644 F_CPU=20000000UL all + cd testcases && USER_CONFIG=config.h.Profiling \ + ./run-in-simulavr.sh short-moves.gcode smooth-curves.gcode triangle-odd.gcode diff --git a/testcases/run-in-simulavr.sh b/testcases/run-in-simulavr.sh index 53e6f74..b8c321e 100755 --- a/testcases/run-in-simulavr.sh +++ b/testcases/run-in-simulavr.sh @@ -36,7 +36,7 @@ mkfifo ${PIPE_OUT_FILE} || exit 1 if [ "${USER_CONFIG}" ]; then CONFIG="${USER_CONFIG}" TEACUP_ELF="${USER_CONFIG%.h}/teacup.elf" - TEACUP_ELF="../build/${TEACUP_ELF#../}" + TEACUP_ELF="../build/testcases/${TEACUP_ELF#../}" else CONFIG="../config.h" TEACUP_ELF="../build/teacup.elf"