URL
https://opencores.org/ocsvn/m1_core/m1_core/trunk
Subversion Repositories m1_core
[/] [m1_core/] [trunk/] [tools/] [bin/] [compile_test] - Rev 2
Go to most recent revision | Compare with Previous | Blame | View Log
#!/bin/bash
#
# Compile a test for the M1 and build the memory.hex file.
#
# Parameter is test name without extension (e.g. to compile
# $M1_ROOT/tests/hello.c) run "compile_test hello".
#
# Requires mipsel-linux-gcc (see Download section on srisc.com).
cd $M1_ROOT/tests
rm -f *.o *~ *.bin # Make clean
if ( test $# != 1 ) then
echo "compile_test - Script to compile a test for the M1 Core";
echo "(C) 2006 by Simply RISC";
echo "Usage:";
echo " compile_test <TEST_NAME>";
echo "where parameter is the test name without extension (e.g. 'hello').";
exit 1;
fi
if ( ! test -e $1.c ) then
echo "ERROR: Test $1.c does not exist into the tests directory!";
exit 1;
fi
mipsel-linux-gcc -c -O0 -mips1 $M1_ROOT/tools/src/boot.s
mipsel-linux-gcc -c -O0 -mips1 $1.c
mipsel-linux-ld -Ur -EL -o $1.bin boot.o $1.o
mipsel-linux-objdump -d -EL -w -z $1.bin > $1.dump
cat $1.dump | dump2hex.php -q > $1.hex
cp -f $1.hex code.txt
rm -f *.o *~ *.bin # Make clean
Go to most recent revision | Compare with Previous | Blame | View Log