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

Subversion Repositories m1_core

[/] [m1_core/] [trunk/] [tools/] [bin/] [compile_test] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 fafa1971
#!/bin/bash
2
#
3
# Compile a test for the M1 and build the memory.hex file.
4
#
5
# Parameter is test name without extension (e.g. to compile
6
# $M1_ROOT/tests/hello.c) run "compile_test hello".
7
#
8
# Requires mipsel-linux-gcc (see Download section on srisc.com).
9
 
10
cd $M1_ROOT/tests
11
rm -f *.o *~ *.bin                  # Make clean
12
if ( test $# != 1 ) then
13
  echo "compile_test - Script to compile a test for the M1 Core";
14
  echo "(C) 2006 by Simply RISC";
15
  echo "Usage:";
16
  echo "      compile_test ";
17
  echo "where parameter is the test name without extension (e.g. 'hello').";
18
  exit 1;
19
fi
20
if ( ! test -e $1.c ) then
21
  echo "ERROR: Test $1.c does not exist into the tests directory!";
22
  exit 1;
23
fi
24
 
25
mipsel-linux-gcc -c -O0 -mips1 $M1_ROOT/tools/src/boot.s
26
mipsel-linux-gcc -c -O0 -mips1 $1.c
27
mipsel-linux-ld -Ur -EL -o $1.bin boot.o $1.o
28
mipsel-linux-objdump -d -EL -w -z $1.bin > $1.dump
29
cat $1.dump | dump2hex.php -q > $1.hex
30
cp -f $1.hex code.txt
31
 
32
rm -f *.o *~ *.bin                  # Make clean
33
 

powered by: WebSVN 2.1.0

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