Themen / Index / Deutsch
qqtsfloa - Check the floating point programs
Content (automatic)
Test with real hardware - user the serial
interface
qqtsfloa runs on an Atmel AVR ATmega8535. qqtstrm runs on a PC.
qqtsfloa
demonstrates and checks the usage of the assembler floating point
programs, see ../lq/_addsf3.htm.
For the check first send 'a' then the operation to test; either '+' '-'
'*' or '/'.
Then send two decimale numbers (maybe with preceding - and trailing
"E+nn" or "E-nn"
For the automatic test qqtstrm
sends first an 'h' , then the operation either '+' '-' '*' or '/', then
the numbers in hexadecimale coded.
In such an automated test qqtsfloa acts as a server, qqtstrm acts as a
client. The interface is RS232 (9600 Baud)
Test of float arithmetics in PC only
The three functions
call_addsf3()
call_mulsf3()
call_divsf3()
are used to verify the code for the floating point arithmetics by the
emulator simatmel, which interprets
the BASIC code home/cc/qq/avr/qqtsfloa/qqtsfloa.bas
A test session looks then alike this:
hjh ~ : cd home/cc/qq/avr/qqtsfloa
hjh ~/home/cc/qq/avr/qqtsfloa : make
clean
echo clean from object
clean from object
all "*.o;*.elf;*.lst;*.map;*.tmp;*.bak" rm $
echo clean done
clean done
hjh ~/home/cc/qq/avr/qqtsfloa : make
compiling special input=../../qqtsfloa.cpp output=qqtsfloa.o
avr-gcc -S -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc
-g -mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../qqtsfloa.cpp -o qqtsfloa.o.tmp
../../qqtsfloa.cpp: In function `void fun1()':
../../qqtsfloa.cpp:220: warning: converting of negative value
`-0x000000042' to `uint8_t'
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../qqtsfloa.cpp -o qqtsfloa.o
../../qqtsfloa.cpp: In function `void fun1()':
../../qqtsfloa.cpp:220: warning: converting of negative value
`-0x000000042' to `uint8_t'
compiling special input=../../../lq/_addsf3.s output=_addsf3.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../../lq/_addsf3.s -o _addsf3.o
compiling special input=../../../lq/_divsf3.s output=_divsf3.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../../lq/_divsf3.s -o _divsf3.o
compiling special input=../../../lq/_eqsf2.s output=_eqsf2.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../../lq/_eqsf2.s -o _eqsf2.o
compiling special input=../../../lq/_floatsi.s output=_floatsi.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../../lq/_floatsi.s -o _floatsi.o
compiling special input=../../../lq/_isnan.s output=_isnan.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../../lq/_isnan.s -o _isnan.o
compiling special input=../../../lq/_mulsf3.s output=_mulsf3.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../../lq/_mulsf3.s -o _mulsf3.o
compiling special input=../../../lq/_normsf3.s output=_normsf3.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../../lq/_normsf3.s -o _normsf3.o
compiling special input=../../../lq/asctofl.cpp output=asctofl.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/asctofl.cpp -o asctofl.o
compiling special input=../../../lq/asctohl.cpp output=asctohl.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/asctohl.cpp -o asctohl.o
compiling special input=../../../lq/getticks.cpp output=getticks.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/getticks.cpp -o getticks.o
compiling special input=../../../lq/infloat.cpp output=infloat.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/infloat.cpp -o infloat.o
compiling special input=../../../lq/inhex32.cpp output=inhex32.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/inhex32.cpp -o inhex32.o
compiling special input=../../../lq/inline.cpp output=inline.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/inline.cpp -o inline.o
compiling special input=../../../lq/otfloat.cpp output=otfloat.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/otfloat.cpp -o otfloat.o
compiling special input=../../../lq/othex2.cpp output=othex2.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/othex2.cpp -o othex2.o
compiling special input=../../../lq/othex1.cpp output=othex1.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/othex1.cpp -o othex1.o
compiling special input=../../../lq/otnl.cpp output=otnl.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/otnl.cpp -o otnl.o
compiling special input=../../../lq/otputs.cpp output=otputs.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/otputs.cpp -o otputs.o
compiling special input=../../../lq/otuint16.cpp output=otuint16.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/otuint16.cpp -o otuint16.o
compiling special input=../../../lq/otuint32.cpp output=otuint32.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/otuint32.cpp -o otuint32.o
compiling special input=../../../lq/tshar.cpp output=tshar.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/tshar.cpp -o tshar.o
compiling special input=../../../lq/tsser.cpp output=tsser.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/tsser.cpp -o tsser.o
compiling special input=../../../lq/sin.cpp output=sin.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/sin.cpp -o sin.o
compiling special input=../../../lq/tan.cpp output=tan.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -Wall -Os -DAVR -DNPRGPATH=2
-DF_CPU=1008136L -DBAUD=4800L
../../../lq/tan.cpp -o tan.o
compiling special input=../../../lq/fmulpow2.s output=fmulpow2.o
avr-gcc -c -I /home/hjh/home/cc/include -I /home/hjh/home/cc/avrinc -g
-mmcu=atmega32 -DNPRGPATH=2 -DF_CPU=1008136L
-DBAUD=4800L ../../../lq/fmulpow2.s -o fmulpow2.o
avr-gcc -g -mmcu=atmega32 -Wall -Wl,-Map,qqtsfloa.map -o qqtsfloa.elf
qqtsfloa.o _addsf3.o _divsf3.o _eqsf2.o _floatsi.o _isnan.o _mulsf3.o
_normsf3.o asctofl.o asctohl.o getticks.o infloat.o inhex32.o inline.o
otfloat.o othex2.o othex1.o otnl.o otputs.o otuint16.o otuint32.o
tshar.o tsser.o sin.o tan.o fmulpow2.o
avr-objdump -h -S qqtsfloa.elf > qqtsfloa.lst
avr-objcopy -j .text -j .data -O ihex qqtsfloa.elf qqtsfloa.hex
echo Makefile of qqtsfloa all done
Makefile of qqtsfloa all done
hjh ~/home/cc/qq/avr/qqtsfloa : ls
_addsf3.o inline.o
qqtsfloa.aps
qqtsfloa.map
asctofl.o _isnan.o
qqtsfloa.aws
qqtsfloa.o
asctohl.o makefile
qqtsfloa.bas
qqtsfloa.o.tmp
bluefish.sh _mulsf3.o
qqtsfloa.bas~
qqtsfloa.pnproj
default _normsf3.o
qqtsfloa.bin
qqtsfloa.pnps
_divsf3.o otfloat.o
qqtsfloa_eeprom.bin qqtsfloa.s
_eqsf2.o othex1.o
qqtsfloa_eeprom.hex qqtsfloa.srec
_floatsi.o othex2.o
qqtsfloa_eeprom.srec simbase.dbg
fmulpow2.o otnl.o
qqtsfloa.elf sin.o
getticks.o otputs.o
qqtsfloa.hex tan.o
infloat.o otuint16.o
qqtsfloa.jrn
tshar.o
inhex32.o otuint32.o
qqtsfloa.lst
tsser.o
hjh ~/home/cc/qq/avr/qqtsfloa : simatmel
qqtsfloa.lst
Memory data found from 0=0H ends at 4611=1203H
Reading qqtsfloa.hex
function f2 = test only testfun 263
function f3 = test all 3 subroutines totally
function f4 = print float r18 and r22
function f9 = Perform function 263
[call_addsf3= 273 call_mulsf3= 268
call_divsf3= 263 ]
Check divsf3
function fnc_test_add = test the case bha + bhb
--- from defs.bas :
f10 ss - perform a target single step when pressed [F10]
s1 Print all registers when press [Shift+F1]
s2 print PC and Stackpointer [Shift+F2]
a4 End debugging when press [Alt+F4]
BASIC Program held error number=1
Cmd : function f2
// Here press function Key F2
Test addsf3
Check addsf3
testcase
NaN
NaN 7FC00000
7FC00000
Executing target ... hold by breakpoint
Stopped cy=75, pc=113
used cycles= 75
result= NaN
7FC00000 expect=
NaN 7FC00000
Check addsf3
testcase -Err
NaN FFC00000
7FC00000
Executing target ... hold by breakpoint
Stopped cy=150, pc=113
used cycles= 75
result= NaN
7FC00000 expect=
NaN 7FC00000
Check addsf3
testcase
NaN
-Err 7FC00000 FFC00000
Executing target ... hold by breakpoint
Stopped cy=225, pc=113
used cycles= 75
result= NaN
7FC00000 expect=
NaN 7FC00000
Check addsf3
testcase -Err
-Err FFC00000 FFC00000
Executing target ... hold by breakpoint
Stopped cy=300, pc=113
used cycles= 75
result= NaN
7FC00000 expect=
-Err FFC00000
illegal keyword or missing lval [hr1.f = bresult]
314: hr1.f = bresult
BASIC command [hr1]
Cmd :system
system - Exit
hjh ~/home/cc/qq/avr/qqtsfloa : less qqtsfloa.log
The result logging is saved in file qqtsfloa.log - examine it!
If the logging after function f2 is too long, then abort it by the
ESCPAE-Key.
See also
../lq/_addsf3.htm - ../lq/_mulsf3.htm - ../lq/_divsf3.htm - The replacement for
the floating point programs for the ATMEL AVR Assembler (GNU gcc)
../lq/float.htm - About float
representations
../util/simatmel.htm - Simulate an
Atmel AVR
../util/simbase.htm - Simulate
processors