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

Subversion Repositories theia_gpu

[/] [theia_gpu/] [branches/] [beta_2.0/] [compiler/] [bin/] [theia_compile] - Blame information for rev 216

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 216 diegovalve
 
2
#!/bin/bash
3
 
4
 
5
if [ -z "$THEIA_PROJECT_FOLDER" ]; then
6
        echo "Error the environment variable THEIA_PROJECT_FOLDER was not set"
7
        exit 1
8
fi
9
header_file="code_block_header.thh"
10
#clear the output files
11
echo > instructions.mem
12
echo > $header_file
13
offset=0
14
vp_compile_path=$THEIA_PROJECT_FOLDER/compiler/bin/theia_vp_compile
15
cp_compile_path=$THEIA_PROJECT_FOLDER/compiler/bin/theia_cp_compile
16
while [ $# -ne 0 ]
17
do
18
        file_name=$1;
19
        size=$($vp_compile_path -i $file_name -hex32 | grep CodeBlockSize | cut -d ' ' -f 2)
20
 
21
        ##Get rid of file extension
22
        name=${file_name%.*}
23
        name=$(basename $name)
24
        #Convert to upper case
25
        name=$(echo $name | tr '[a-z]' '[A-Z]')
26
 
27
        #Create the include file
28
        echo "#define " $name"_SIZE ("$size"<<20)">> $header_file
29
        echo "#define " $name"_OFFSET" $offset >> $header_file
30
        offset=$(( $offset+$size ))
31
 
32
        #concatenate the code into a big file
33
        cat code.mem >> instructions.mem
34
 
35
        cp_file=${file_name%.*}.cp
36
        if [ ! -f $cp_file ]; then
37
                echo "ERROR: file not found " $cp_file
38
                exit 1
39
        fi
40
        $cp_compile_path $cp_file
41
        if [ "$?" != "0" ]; then
42
                echo "ERROR: cp_compile failed for file: " $cp_file "!!!"  1>&2
43
                exit 1
44
        fi
45
 
46
shift
47
done
48
 
49
 
50
 

powered by: WebSVN 2.1.0

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