URL
https://opencores.org/ocsvn/s1_core/s1_core/trunk
[/] [s1_core/] [trunk/] [tools/] [bin/] [compile_test] - Blame information for rev 7
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
7 |
fafa1971 |
#!/bin/bash
|
2 |
|
|
#
|
3 |
|
|
# Compile a test for the S1 and build the memory.hex file.
|
4 |
|
|
#
|
5 |
|
|
# Parameter is test name without extension (e.g. to compile
|
6 |
|
|
# $S1_ROOT/tests/hello.c) run "compile_test hello".
|
7 |
|
|
#
|
8 |
|
|
# Notes:
|
9 |
|
|
# 1) requires sparc64-linux-gcc (see Download section on srisc.com);
|
10 |
|
|
# 2) the generated image is currently not used by simulations.
|
11 |
|
|
|
12 |
|
|
cd $S1_ROOT/tests
|
13 |
|
|
rm -f *.o *~ *.bin *.dump *.hex # Make clean
|
14 |
|
|
if ( test $# != 1 ) then
|
15 |
|
|
echo "compile_test - Script to compile a test for the S1 Core";
|
16 |
|
|
echo "(C) 2006 by Simply RISC";
|
17 |
|
|
echo "Usage:";
|
18 |
|
|
echo " compile_test ";
|
19 |
|
|
echo "where parameter is the test name without extension (e.g. 'hello').";
|
20 |
|
|
exit 1;
|
21 |
|
|
fi
|
22 |
|
|
if ( ! test -e $1.c ) then
|
23 |
|
|
echo "ERROR: Test $1.c does not exist into the tests directory!";
|
24 |
|
|
exit 1;
|
25 |
|
|
fi
|
26 |
|
|
|
27 |
|
|
sparc64-linux-g++ -c -O0 $1.c
|
28 |
|
|
sparc64-linux-ld -Ur --script=$S1_ROOT/tools/src/linker.map -EB -o $1.bin $1.o
|
29 |
|
|
sparc64-linux-objdump -d -EB -w -z $1.bin > $1.dump
|
30 |
|
|
gcc -o $S1_ROOT/tools/bin/dump2hex.bin $S1_ROOT/tools/src/dump2hex.c
|
31 |
|
|
grep " " $1.dump | egrep -v "file format" | dump2hex.bin > dump/$1_MAIN.image
|
32 |
|
|
|
33 |
|
|
rm -f *.o *~ *.bin *.dump # Make clean
|
34 |
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.