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

Subversion Repositories openmsp430

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openmsp430/trunk/core/sim/rtl_sim/bin
    from Rev 23 to Rev 33
    Reverse comparison

Rev 23 → Rev 33

/msp430sim
77,7 → 77,7
# Cleanup #
###############################################################################
echo "Cleanup..."
rm -rf rom.*
rm -rf pmem.*
rm -rf stimulus.v
 
 
89,31 → 89,31
echo " ======================================================="
 
# Create links
ln -s $asmfile rom.s43
ln -s $asmfile pmem.s43
ln -s $verfile stimulus.v
 
# Make local copy of the openMSP403 configuration file and remove comments
cp $incfile ./rom.inc
sed -i "/^\/\// s,.*,," rom.inc
cp $incfile ./pmem.inc
sed -i "/^\/\// s,.*,," pmem.inc
 
# Get ROM size
romsize=`grep ROM_AWIDTH rom.inc | grep -v ROM_MSB | grep -v ROM_SIZE`
romsize=${romsize##* }
romsize=$((2<<$romsize))
# Get Program Memory size
pmemsize=`grep PMEM_AWIDTH pmem.inc | grep -v PMEM_MSB | grep -v PMEM_SIZE`
pmemsize=${pmemsize##* }
pmemsize=$((2<<$pmemsize))
 
# Get RAM size
ramsize=`grep RAM_AWIDTH rom.inc | grep -v RAM_MSB | grep -v RAM_SIZE`
ramsize=${ramsize##* }
ramsize=$((2<<$ramsize))
# Get Data Memory size
dmemsize=`grep DMEM_AWIDTH pmem.inc | grep -v DMEM_MSB | grep -v DMEM_SIZE`
dmemsize=${dmemsize##* }
dmemsize=$((2<<$dmemsize))
 
# Compile assembler code
echo "Compile, link & generate IHEX file (ROM: $romsize B, RAM: $ramsize B)..."
../bin/asm2ihex.sh rom rom.s43 $deffile $romsize $ramsize
echo "Compile, link & generate IHEX file (Program Memory: $pmemsize B, Data Memory: $dmemsize B)..."
../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..."
../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
echo "Start Verilog simulation..."
../bin/rtlsim.sh stimulus.v rom.mem $submitfile
../bin/rtlsim.sh stimulus.v pmem.mem $submitfile
/rtlsim.sh
40,8 → 40,8
EXPECTED_ARGS=3
if [ $# -ne $EXPECTED_ARGS ]; then
echo "ERROR : wrong number of arguments"
echo "USAGE : rtlsim.sh <verilog stimulus file> <rom file> <submit file>"
echo "Example : rtlsim.sh ./stimulus.v rom.mem ../src/submit.f"
echo "USAGE : rtlsim.sh <verilog stimulus file> <memory file> <submit file>"
echo "Example : rtlsim.sh ./stimulus.v pmem.mem ../src/submit.f"
exit 1
fi
 
/template.def
3,8 → 3,8
OUTPUT_ARCH(msp:110)
MEMORY
{
text (rx) : ORIGIN = ROM_BASE, LENGTH = ROM_SIZE
data (rwx) : ORIGIN = 0x0200, LENGTH = RAM_SIZE
text (rx) : ORIGIN = PMEM_BASE, LENGTH = PMEM_SIZE
data (rwx) : ORIGIN = 0x0200, LENGTH = DMEM_SIZE
vectors (rw) : ORIGIN = 0xffe0, LENGTH = 0x20
bootloader(rx) : ORIGIN = 0x0c00, LENGTH = 1K
infomem(rx) : ORIGIN = 0x1000, LENGTH = 256
/asm2ihex.sh
40,8 → 40,8
EXPECTED_ARGS=5
if [ $# -ne $EXPECTED_ARGS ]; then
echo "ERROR : wrong number of arguments"
echo "USAGE : asm2ihex.sh <test name> <test assembler file> <definition file> <rom size> <ram size>"
echo "Example : asm2ihex.sh c-jump_jge ../src/c-jump_jge.s43 ../bin/template.def 2048 128"
echo "USAGE : asm2ihex.sh <test name> <test assembler file> <definition file> <prog mem size> <data mem size>"
echo "Example : asm2ihex.sh c-jump_jge ../src/c-jump_jge.s43 ../bin/template.def 2048 128"
exit 1
fi
 
64,14 → 64,14
# Generate the linker definition file #
###############################################################################
 
RAM_SIZE=$5
ROM_SIZE=$4
ROM_BASE=$((0x10000-$ROM_SIZE))
DMEM_SIZE=$5
PMEM_SIZE=$4
PMEM_BASE=$((0x10000-$PMEM_SIZE))
 
cp $3 ./rom.def
sed -i "s/ROM_BASE/$ROM_BASE/g" rom.def
sed -i "s/ROM_SIZE/$ROM_SIZE/g" rom.def
sed -i "s/RAM_SIZE/$RAM_SIZE/g" rom.def
cp $3 ./pmem.def
sed -i "s/PMEM_BASE/$PMEM_BASE/g" pmem.def
sed -i "s/PMEM_SIZE/$PMEM_SIZE/g" pmem.def
sed -i "s/DMEM_SIZE/$DMEM_SIZE/g" pmem.def
 
 
###############################################################################
79,5 → 79,5
###############################################################################
msp430-as -alsm $2 -o $1.o > $1.l43
msp430-objdump -xdsStr $1.o >> $1.l43
msp430-ld -T ./rom.def $1.o -o $1.elf
msp430-ld -T ./pmem.def $1.o -o $1.elf
msp430-objcopy -O ihex $1.elf $1.ihex

powered by: WebSVN 2.1.0

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