Line 27... |
Line 27... |
#
|
#
|
# Author(s):
|
# Author(s):
|
# - Olivier Girard, olgirard@gmail.com
|
# - Olivier Girard, olgirard@gmail.com
|
#
|
#
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
# $Rev: 26 $
|
# $Rev: 37 $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedBy: olivier.girard $
|
# $LastChangedDate: 2009-12-19 13:25:10 +0100 (Sat, 19 Dec 2009) $
|
# $LastChangedDate: 2009-12-29 21:58:14 +0100 (Tue, 29 Dec 2009) $
|
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
|
|
###############################################################################
|
###############################################################################
|
# Parameter Check #
|
# Parameter Check #
|
###############################################################################
|
###############################################################################
|
Line 71... |
Line 71... |
|
|
###############################################################################
|
###############################################################################
|
# Cleanup #
|
# Cleanup #
|
###############################################################################
|
###############################################################################
|
echo "Cleanup..."
|
echo "Cleanup..."
|
rm -rf rom.*
|
rm -rf pmem.*
|
rm -rf stimulus.v
|
rm -rf stimulus.v
|
|
|
|
|
###############################################################################
|
###############################################################################
|
# Run simulation #
|
# Run simulation #
|
Line 88... |
Line 88... |
cd $softdir
|
cd $softdir
|
make
|
make
|
cd ../../sim/rtl_sim/run/
|
cd ../../sim/rtl_sim/run/
|
|
|
# Create links
|
# Create links
|
ln -s $elffile rom.elf
|
ln -s $elffile pmem.elf
|
ln -s $verfile stimulus.v
|
ln -s $verfile stimulus.v
|
|
|
# Make local copy of the openMSP403 configuration file and remove comments
|
# Make local copy of the openMSP403 configuration file and remove comments
|
cp $incfile ./rom.inc
|
cp $incfile ./pmem.inc
|
sed -i "/^\/\// s,.*,," rom.inc
|
sed -i "/^\/\// s,.*,," pmem.inc
|
|
|
# Get ROM size
|
# Get Program memory size
|
romsize=`grep ROM_AWIDTH rom.inc | grep -v ROM_MSB | grep -v ROM_SIZE`
|
pmemsize=`grep PMEM_AWIDTH pmem.inc | grep -v PMEM_MSB | grep -v PMEM_SIZE`
|
romsize=${romsize##* }
|
pmemsize=${pmemsize##* }
|
romsize=$((2<<$romsize))
|
pmemsize=$((2<<$pmemsize))
|
|
|
# Create IHEX file from ELF
|
# Create IHEX file from ELF
|
echo "Convert ELF file to IHEX format..."
|
echo "Convert ELF file to IHEX format..."
|
msp430-objcopy -O ihex rom.elf rom.ihex
|
msp430-objcopy -O ihex pmem.elf pmem.ihex
|
|
|
# Generate ROM memory file
|
# Generate Program memory file
|
echo "Convert IHEX file to Verilog MEMH format..."
|
echo "Convert IHEX file to Verilog MEMH format..."
|
../bin/ihex2mem.tcl -ihex rom.ihex -out rom.mem -mem_size $romsize
|
../bin/ihex2mem.tcl -ihex pmem.ihex -out pmem.mem -mem_size $pmemsize
|
|
|
# Start verilog simulation
|
# Start verilog simulation
|
echo "Start Verilog simulation..."
|
echo "Start Verilog simulation..."
|
../bin/rtlsim.sh stimulus.v rom.mem $submitfile
|
../bin/rtlsim.sh stimulus.v pmem.mem $submitfile
|
../bin/rtlsim.sh stimulus.v pmem.mem $submitfile
|
../bin/rtlsim.sh stimulus.v pmem.mem $submitfile
|