URL
https://opencores.org/ocsvn/theia_gpu/theia_gpu/trunk
Subversion Repositories theia_gpu
[/] [theia_gpu/] [branches/] [beta_2.0/] [compiler/] [bin/] [theia_compile] - Rev 216
Compare with Previous | Blame | View Log
#!/bin/bashif [ -z "$THEIA_PROJECT_FOLDER" ]; thenecho "Error the environment variable THEIA_PROJECT_FOLDER was not set"exit 1fiheader_file="code_block_header.thh"#clear the output filesecho > instructions.memecho > $header_fileoffset=0vp_compile_path=$THEIA_PROJECT_FOLDER/compiler/bin/theia_vp_compilecp_compile_path=$THEIA_PROJECT_FOLDER/compiler/bin/theia_cp_compilewhile [ $# -ne 0 ]dofile_name=$1;size=$($vp_compile_path -i $file_name -hex32 | grep CodeBlockSize | cut -d ' ' -f 2)##Get rid of file extensionname=${file_name%.*}name=$(basename $name)#Convert to upper casename=$(echo $name | tr '[a-z]' '[A-Z]')#Create the include fileecho "#define " $name"_SIZE ("$size"<<20)">> $header_fileecho "#define " $name"_OFFSET" $offset >> $header_fileoffset=$(( $offset+$size ))#concatenate the code into a big filecat code.mem >> instructions.memcp_file=${file_name%.*}.cpif [ ! -f $cp_file ]; thenecho "ERROR: file not found " $cp_fileexit 1fi$cp_compile_path $cp_fileif [ "$?" != "0" ]; thenecho "ERROR: cp_compile failed for file: " $cp_file "!!!" 1>&2exit 1fishiftdone
