Line 39... |
Line 39... |
echo "Software directory doesn't exist: $softdir"
|
echo "Software directory doesn't exist: $softdir"
|
exit 1
|
exit 1
|
fi
|
fi
|
|
|
###############################################################################
|
###############################################################################
|
|
# Compile program #
|
|
###############################################################################
|
|
echo " -----------------------------------------------"
|
|
echo "| COMPILE PROGRAM: $1"
|
|
echo " -----------------------------------------------"
|
|
echo ""
|
|
|
|
cd $softdir
|
|
make clean
|
|
make
|
|
cd ../../synthesis/xilinx
|
|
|
|
###############################################################################
|
# Update FPGA Bitstream #
|
# Update FPGA Bitstream #
|
###############################################################################
|
###############################################################################
|
|
echo ""
|
|
echo " -----------------------------------------------"
|
|
echo "| UPDATE FPGA BITSTREAM"
|
|
echo " -----------------------------------------------"
|
|
echo ""
|
|
|
cd ./WORK
|
cd ./WORK
|
|
|
# Generate memory file
|
# Generate memory file
|
|
if command -v msp430-elf-gcc >/dev/null; then
|
|
msp430-elf-objcopy -O ihex ../$elffile ./$1.ihex
|
|
else
|
msp430-objcopy -O ihex ../$elffile ./$1.ihex
|
msp430-objcopy -O ihex ../$elffile ./$1.ihex
|
|
fi
|
../scripts/ihex2mem.tcl -ihex $1.ihex -out $1.mem -mem_size 16384
|
../scripts/ihex2mem.tcl -ihex $1.ihex -out $1.mem -mem_size 16384
|
|
|
# Update bitstream
|
# Update bitstream
|
data2mem -bm ../scripts/memory.bmm -bd $1.mem -bt openMSP430_fpga.bit -o b $1.bit
|
data2mem -bm ../scripts/memory.bmm -bd $1.mem -bt openMSP430_fpga.bit -o b $1.bit
|
|
|
# Copy new bitstream in the proper directory
|
# Copy new bitstream in the proper directory
|
cp -f ./$1.bit ../bitstreams
|
cp -f ./$1.bit ../bitstreams
|
|
|
cd ../
|
cd ../
|
|
|
No newline at end of file
|
No newline at end of file
|
|
echo "New bitstream generated:"
|
|
echo " ./bitstreams/$1.bit"
|
|
echo ""
|
|
|
No newline at end of file
|
No newline at end of file
|