OpenCores
URL https://opencores.org/ocsvn/s1_core/s1_core/trunk

Subversion Repositories s1_core

[/] [s1_core/] [trunk/] [tools/] [bin/] [compile_test] - Diff between revs 105 and 109

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 105 Rev 109
Line 4... Line 4...
# rom_harness.hex and ram_harness.hex.
# rom_harness.hex and ram_harness.hex.
#
#
# Parameter is test name without extension (e.g. to compile
# Parameter is test name without extension (e.g. to compile
# $S1_ROOT/tests/hello.c) just run "compile_test hello".
# $S1_ROOT/tests/hello.c) just run "compile_test hello".
#
#
# Note: requires sparc64-linux-gcc (see Download section on
# Note: requires sparc-linux-gnu-gcc from emdebian.org
# http://www.srisc.com).
 
 
 
if [ -z "$S1_ROOT" ]; then echo "***ERROR***: S1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi
test_var S1_ROOT
if ! [ -d "$S1_ROOT" ]; then echo "***ERROR***: directory '$S1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi
 
 
 
# Prepare the environment
# Prepare the environment
cd $S1_ROOT/tests
cd $S1_ROOT/tests
rm -f *.o *~ *.bin *.dump *.hex     # Make clean
rm -f *.o *~ *.bin *.dump *.hex     # Make clean
if ( test $# != 1 ) then
if ( test $# != 1 ) then
Line 30... Line 28...
 
 
# Compile the dumper
# Compile the dumper
gcc -o $S1_ROOT/tools/bin/dump2hex.bin $S1_ROOT/tools/src/dump2hex.c
gcc -o $S1_ROOT/tools/bin/dump2hex.bin $S1_ROOT/tools/src/dump2hex.c
 
 
# Compile the boot code
# Compile the boot code
sparc64-linux-as -ah -am -o boot/boot.bin boot/boot.s
sparc-linux-gnu-as -xarch=v9b -ah -am -o boot/boot.bin boot/boot.s
sparc64-linux-objdump -d -EB -w -z boot/boot.bin > boot/boot.dump
sparc-linux-gnu-objdump -d -EB -w -z boot/boot.bin > boot/boot.dump
grep "  " boot/boot.dump | egrep -v "file format" | dump2hex.bin > boot/rom_harness.hex
grep "  " boot/boot.dump | egrep -v "file format" | dump2hex.bin > boot/rom_harness.hex
 
 
# Compile the C test
# Compile the C test
sparc64-linux-gcc -c -O0 $1.c
sparc-linux-gnu-gcc -c -O0 $1.c
sparc64-linux-ld -Ur --script=$S1_ROOT/tools/src/linker.map -EB -o $1.bin $1.o
sparc-linux-gnu-ld -Ur --script=$S1_ROOT/tools/src/linker.map -EB -o $1.bin $1.o
sparc64-linux-objdump -d -EB -w -z $1.bin > $1.dump
sparc-linux-gnu-objdump -d -EB -w -z $1.bin > $1.dump
grep "  " $1.dump | egrep -v "file format" | dump2hex.bin > ram_harness.hex
grep "  " $1.dump | egrep -v "file format" | dump2hex.bin > ram_harness.hex
 
 
#rm -f *.o *~ *.bin *.dump           # Make clean
#rm -f *.o *~ *.bin *.dump           # Make clean
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.