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 64

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 64 albert.wat
# Requires mipsel-linux-gcc
9 2 fafa1971
 
10 14 fafa1971
if [ -z "$M1_ROOT" ]; then echo "***ERROR***: M1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi
11
if ! [ -d "$M1_ROOT" ]; then echo "***ERROR***: directory '$M1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi
12
 
13 2 fafa1971
cd $M1_ROOT/tests
14
rm -f *.o *~ *.bin                  # Make clean
15
if ( test $# != 1 ) then
16 37 fafa1971
  echo ""
17
  echo "compile_test - Script to compile a test for the M1 Core"
18
  echo ""
19
  echo "Usage:"
20
  echo ""
21
  echo "      compile_test "
22
  echo ""
23
  echo "where parameter is the test name without extension (e.g. 'hello')."
24
  echo ""
25
  exit 1
26 2 fafa1971
fi
27
if ( ! test -e $1.c ) then
28 37 fafa1971
  echo "ERROR: Test $1.c does not exist into the tests directory!"
29
  exit 1
30 2 fafa1971
fi
31
 
32 37 fafa1971
mipsel-linux-gcc -c -O0 -msoft-float -mips1 $M1_ROOT/tests/boot/boot.s
33
mipsel-linux-gcc -c -O0 -msoft-float -mips1 $1.c
34
mipsel-linux-ld -Ur -EL -O0 -G 0 -o $1.bin boot.o $1.o
35
mipsel-linux-objdump -d -EL -w -z --disassembler-options=no-aliases,reg-names=numeric $1.bin > $1.dump
36
cat $1.dump | dump2vlog.php -q > $M1_ROOT/hdl/rtl/m1_core/m1_mmu_initial.vh
37 2 fafa1971
 
38 37 fafa1971
echo "The initial content of the instruction memory has been updated successfully!"
39
echo "Now you should run 'build_icarus' script again."
40
 
41 2 fafa1971
rm -f *.o *~ *.bin                  # Make clean
42
 

powered by: WebSVN 2.1.0

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