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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [bin/] [msp430sim] - Diff between revs 23 and 33

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 23 Rev 33
Line 27... Line 27...
#
#
# Author(s):
# Author(s):
#             - Olivier Girard,    olgirard@gmail.com
#             - Olivier Girard,    olgirard@gmail.com
#
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# $Rev: 23 $
# $Rev: 33 $
# $LastChangedBy: olivier.girard $
# $LastChangedBy: olivier.girard $
# $LastChangedDate: 2009-08-30 18:39:26 +0200 (Sun, 30 Aug 2009) $
# $LastChangedDate: 2009-12-29 19:18:00 +0100 (Tue, 29 Dec 2009) $
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
 
 
###############################################################################
###############################################################################
#                            Parameter Check                                  #
#                            Parameter Check                                  #
###############################################################################
###############################################################################
Line 75... Line 75...
 
 
###############################################################################
###############################################################################
#                               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 87... Line 87...
echo " ======================================================="
echo " ======================================================="
echo "| Start simulation:             $1"
echo "| Start simulation:             $1"
echo " ======================================================="
echo " ======================================================="
 
 
# Create links
# Create links
ln -s $asmfile rom.s43
ln -s $asmfile pmem.s43
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))
 
 
# Get RAM size
# Get Data Memory size
ramsize=`grep RAM_AWIDTH rom.inc | grep -v RAM_MSB | grep -v RAM_SIZE`
dmemsize=`grep DMEM_AWIDTH pmem.inc | grep -v DMEM_MSB | grep -v DMEM_SIZE`
ramsize=${ramsize##* }
dmemsize=${dmemsize##* }
ramsize=$((2<<$ramsize))
dmemsize=$((2<<$dmemsize))
 
 
# Compile assembler code
# Compile assembler code
echo "Compile, link & generate IHEX file (ROM: $romsize B, RAM: $ramsize B)..."
echo "Compile, link & generate IHEX file (Program Memory: $pmemsize B, Data Memory: $dmemsize B)..."
../bin/asm2ihex.sh  rom rom.s43 $deffile $romsize $ramsize
../bin/asm2ihex.sh  pmem pmem.s43 $deffile $pmemsize $dmemsize
 
 
# 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

powered by: WebSVN 2.1.0

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