URL
https://opencores.org/ocsvn/openmsp430/openmsp430/trunk
Subversion Repositories openmsp430
Compare Revisions
- This comparison shows the changes necessary to convert path
/openmsp430/trunk/fpga/actel_m1a3pl_dev_kit/sim
- from Rev 155 to Rev 212
- ↔ Reverse comparison
Rev 155 → Rev 212
/rtl_sim/run/run_clean
0,0 → 1,3
#!/bin/bash |
|
rm -rf INCA_libs *.log pmem.* stimulus.v *.dsn *.trn *.vcd simv |
rtl_sim/run/run_clean
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: rtl_sim/bin/msp430sim
===================================================================
--- rtl_sim/bin/msp430sim (revision 155)
+++ rtl_sim/bin/msp430sim (revision 212)
@@ -22,9 +22,9 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
#------------------------------------------------------------------------------
-#
+#
# File Name: msp430sim
-#
+#
# Author(s):
# - Olivier Girard, olgirard@gmail.com
#
@@ -100,6 +100,32 @@
echo "| Start simulation: $1"
echo " ======================================================="
+# Make local copy of the openMSP403 configuration file
+# and prepare it for MSPGCC preprocessing
+cp $incfile ./pmem.h
+sed -ie 's/`ifdef/#ifdef/g' ./pmem.h
+sed -ie 's/`else/#else/g' ./pmem.h
+sed -ie 's/`endif/#endif/g' ./pmem.h
+sed -ie 's/`define/#define/g' ./pmem.h
+sed -ie 's/`include/\/\/#include/g' ./pmem.h
+sed -ie 's/`//g' ./pmem.h
+sed -ie "s/'//g" ./pmem.h
+
+# Use MSPGCC preprocessor to extract the Program, Data
+# and Peripheral memory sizes
+if command -v msp430-elf-gcc >/dev/null; then
+ msp430-elf-gcc -E -P -x c ../bin/omsp_config.sh > pmem.sh
+else
+ msp430-gcc -E -P -x c ../bin/omsp_config.sh > pmem.sh
+fi
+
+# Source the extracted configuration file
+if [[ $(uname -s) == CYGWIN* ]];
+then
+dos2unix pmem.sh
+fi
+source pmem.sh
+
# Make C program
cd $softdir
make clean
@@ -107,7 +133,7 @@
cd ../../sim/rtl_sim/run/
# Create links
-if [ `uname -o` = "Cygwin" ]
+if [[ $(uname -s) == CYGWIN* ]];
then
cp $elffile pmem.elf
cp $verfile stimulus.v
@@ -116,26 +142,13 @@
ln -s $verfile stimulus.v
fi
-# Make local copy of the openMSP403 configuration file
-# and prepare it for MSPGCC preprocessing
-cp $incfile ./pmem.h
-sed -i 's/`ifdef/#ifdef/g' ./pmem.h
-sed -i 's/`else/#else/g' ./pmem.h
-sed -i 's/`endif/#endif/g' ./pmem.h
-sed -i 's/`define/#define/g' ./pmem.h
-sed -i 's/`//g' ./pmem.h
-sed -i "s/'//g" ./pmem.h
-
-# Use MSPGCC preprocessor to extract the Program, Data
-# and Peripheral memory sizes
-msp430-gcc -E -P -x c ../bin/omsp_config.sh > pmem.sh
-
-# Source the extracted configuration file
-source pmem.sh
-
# Create IHEX file from ELF
echo "Convert ELF file to IHEX format..."
-msp430-objcopy -O ihex pmem.elf pmem.ihex
+if command -v msp430-elf-objcopy >/dev/null; then
+ msp430-elf-objcopy -O ihex pmem.elf pmem.ihex
+else
+ msp430-objcopy -O ihex pmem.elf pmem.ihex
+fi
# Generate Program memory file
echo "Convert IHEX file to Verilog MEMH format..."
/rtl_sim/bin/rtlsim.sh
22,9 → 22,9
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
# |
#------------------------------------------------------------------------------ |
# |
# |
# File Name: rtlsim.sh |
# |
# |
# Author(s): |
# - Olivier Girard, olgirard@gmail.com |
# - Mihai M., mmihai@delajii.net |
73,7 → 73,7
if [ "${OMSP_SIMULATOR:-iverilog}" = iverilog ]; then |
|
rm -rf simv |
|
|
NODUMP=${OMSP_NODUMP-0} |
if [ $NODUMP -eq 1 ] |
then |
81,8 → 81,8
else |
iverilog -o simv -c $3 |
fi |
|
if [ `uname -o` = "Cygwin" ] |
|
if [[ $(uname -s) == CYGWIN* ]]; |
then |
vvp.exe ./simv |
else |
98,14 → 98,15
vargs="" |
fi |
|
case $OMSP_SIMULATOR in |
cver* ) |
case $OMSP_SIMULATOR in |
cver* ) |
vargs="$vargs +define+VXL +define+CVER" ;; |
verilog* ) |
vargs="$vargs +define+VXL" ;; |
ncverilog* ) |
rm -rf INCA_libs |
vargs="$vargs +access+r +nclicq +ncinput+../bin/cov_ncverilog.tcl -covdut openMSP430 -covfile ../bin/cov_ncverilog.ccf -coverage all +define+TRN_FILE" ;; |
#vargs="$vargs +access+r +nclicq +ncinput+../bin/cov_ncverilog.tcl -covdut openMSP430 -covfile ../bin/cov_ncverilog.ccf -coverage all +define+TRN_FILE" ;; |
vargs="$vargs +access+r +nclicq +define+TRN_FILE" ;; |
vcs* ) |
rm -rf csrc simv* |
vargs="$vargs -R -debug_pp +vcs+lic+wait +v2k +define+VPD_FILE" ;; |
122,7 → 123,7
./isim.exe -tclbatch isim.tcl |
exit |
esac |
|
|
echo "Running: $OMSP_SIMULATOR -f $3 $vargs" |
exec $OMSP_SIMULATOR -f $3 $vargs |
fi |