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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [bin/] [rtlsim.sh] - Blame information for rev 202

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 73 olivier.gi
#!/bin/bash
2 2 olivier.gi
#------------------------------------------------------------------------------
3
# Copyright (C) 2001 Authors
4
#
5
# This source file may be used and distributed without restriction provided
6
# that this copyright statement is not removed from the file and that any
7
# derivative work contains the original copyright notice and the associated
8
# disclaimer.
9
#
10
# This source file is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU Lesser General Public License as published
12
# by the Free Software Foundation; either version 2.1 of the License, or
13
# (at your option) any later version.
14
#
15
# This source is distributed in the hope that it will be useful, but WITHOUT
16
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18
# License for more details.
19
#
20
# You should have received a copy of the GNU Lesser General Public License
21
# along with this source; if not, write to the Free Software Foundation,
22
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23
#
24
#------------------------------------------------------------------------------
25 202 olivier.gi
#
26 2 olivier.gi
# File Name: rtlsim.sh
27 202 olivier.gi
#
28 17 olivier.gi
# Author(s):
29
#             - Olivier Girard,    olgirard@gmail.com
30 94 olivier.gi
#             - Mihai M.,          mmihai@delajii.net
31 17 olivier.gi
#
32 2 olivier.gi
#------------------------------------------------------------------------------
33 17 olivier.gi
# $Rev: 202 $
34
# $LastChangedBy: olivier.girard $
35
# $LastChangedDate: 2015-07-01 23:13:32 +0200 (Wed, 01 Jul 2015) $
36
#------------------------------------------------------------------------------
37 2 olivier.gi
 
38
###############################################################################
39
#                            Parameter Check                                  #
40
###############################################################################
41 202 olivier.gi
EXPECTED_ARGS=5
42 2 olivier.gi
if [ $# -ne $EXPECTED_ARGS ]; then
43
  echo "ERROR    : wrong number of arguments"
44 202 olivier.gi
  echo "USAGE    : rtlsim.sh <verilog stimulus file> <memory file> <submit file>   <seed> <dma_verif>"
45
  echo "Example  : rtlsim.sh ./stimulus.v            pmem.mem      ../src/submit.f  123   NO_DMA_VERIF"
46 122 olivier.gi
  echo "OMSP_SIMULATOR env keeps simulator name iverilog/cver/verilog/ncverilog/vsim/vcs"
47 2 olivier.gi
  exit 1
48
fi
49
 
50
 
51
###############################################################################
52
#                     Check if the required files exist                       #
53
###############################################################################
54
 
55
if [ ! -e $1 ]; then
56
    echo "Verilog stimulus file $1 doesn't exist"
57
    exit 1
58
fi
59
if [ ! -e $2 ]; then
60 37 olivier.gi
    echo "Memory file $2 doesn't exist"
61 2 olivier.gi
    exit 1
62
fi
63
if [ ! -e $3 ]; then
64
    echo "Verilog submit file $3 doesn't exist"
65
    exit 1
66
fi
67
 
68
 
69
###############################################################################
70
#                         Start verilog simulation                            #
71
###############################################################################
72 65 olivier.gi
 
73 122 olivier.gi
if [ "${OMSP_SIMULATOR:-iverilog}" = iverilog ]; then
74 65 olivier.gi
 
75 94 olivier.gi
    rm -rf simv
76 202 olivier.gi
 
77 94 olivier.gi
    NODUMP=${OMSP_NODUMP-0}
78
    if [ $NODUMP -eq 1 ]
79
      then
80 202 olivier.gi
        iverilog -o simv -c $3 -D SEED=$4 -D $5 -D NODUMP
81 94 olivier.gi
      else
82 202 olivier.gi
        iverilog -o simv -c $3 -D SEED=$4 -D $5
83 94 olivier.gi
    fi
84 138 olivier.gi
 
85 202 olivier.gi
    if [ `uname -o` = "Cygwin" ]
86
    then
87
        vvp.exe ./simv
88
    else
89
        ./simv
90
    fi
91
 
92 94 olivier.gi
else
93
 
94
    NODUMP=${OMSP_NODUMP-0}
95
    if [ $NODUMP -eq 1 ] ; then
96 202 olivier.gi
       vargs="+define+SEED=$4 +define+$5 +define+NODUMP"
97 94 olivier.gi
    else
98 202 olivier.gi
       vargs="+define+SEED=$4 +define+$5"
99 94 olivier.gi
    fi
100
 
101 202 olivier.gi
   case $OMSP_SIMULATOR in
102
    cver* )
103 99 olivier.gi
       vargs="$vargs +define+VXL +define+CVER" ;;
104 94 olivier.gi
    verilog* )
105
       vargs="$vargs +define+VXL" ;;
106
    ncverilog* )
107 98 olivier.gi
       rm -rf INCA_libs
108 200 olivier.gi
       #vargs="$vargs +access+r +nclicq +ncinput+../bin/cov_ncverilog.tcl -covdut openMSP430 -covfile ../bin/cov_ncverilog.ccf -coverage all +define+TRN_FILE" ;;
109 202 olivier.gi
       vargs="$vargs +access+r +svseed=$4 +nclicq +define+TRN_FILE" ;;
110 98 olivier.gi
    vcs* )
111
       rm -rf csrc simv*
112
       vargs="$vargs -R -debug_pp +vcs+lic+wait +v2k +define+VPD_FILE" ;;
113 122 olivier.gi
    vsim* )
114 94 olivier.gi
       # Modelsim
115
       if [ -d work ]; then  vdel -all; fi
116
       vlib work
117 122 olivier.gi
       exec vlog +acc=prn -f $3 $vargs -R -c -do "run -all" ;;
118
    isim )
119
       # Xilinx simulator
120
       rm -rf fuse* isim*
121
       fuse tb_openMSP430 -prj $3 -o isim.exe -i ../../../bench/verilog/ -i ../../../rtl/verilog/ -i ../../../rtl/verilog/periph/
122
       echo "run all" > isim.tcl
123
       ./isim.exe -tclbatch isim.tcl
124
       exit
125 94 olivier.gi
   esac
126 202 olivier.gi
 
127 122 olivier.gi
   echo "Running: $OMSP_SIMULATOR -f $3 $vargs"
128
   exec $OMSP_SIMULATOR -f $3 $vargs
129 65 olivier.gi
fi

powered by: WebSVN 2.1.0

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