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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [xilinx_diligent_s3board/] [sim/] [rtl_sim/] [bin/] [rtlsim.sh] - Blame information for rev 94

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
#
26
# File Name: rtlsim.sh
27
#
28 16 olivier.gi
# Author(s):
29
#             - Olivier Girard,    olgirard@gmail.com
30 94 olivier.gi
#             - Mihai M.,          mmihai@delajii.net
31 16 olivier.gi
#
32 2 olivier.gi
#------------------------------------------------------------------------------
33 16 olivier.gi
# $Rev: 94 $
34
# $LastChangedBy: olivier.girard $
35
# $LastChangedDate: 2011-02-24 21:33:35 +0100 (Thu, 24 Feb 2011) $
36
#------------------------------------------------------------------------------
37 2 olivier.gi
 
38
###############################################################################
39
#                            Parameter Check                                  #
40
###############################################################################
41
EXPECTED_ARGS=3
42
if [ $# -ne $EXPECTED_ARGS ]; then
43
  echo "ERROR    : wrong number of arguments"
44 37 olivier.gi
  echo "USAGE    : rtlsim.sh <verilog stimulus file> <memory file> <submit file>"
45 94 olivier.gi
  echo "Example  : rtlsim.sh ./stimulus.v            pmem.mem      ../src/submit.f"
46
  echo "MYVLOG env keeps simulator name iverilog/cver/verilog/ncverilog"
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 94 olivier.gi
 
73
if [ "${MYVLOG:-iverilog}" = iverilog ]; then
74
 
75
    rm -rf simv
76
 
77
    NODUMP=${OMSP_NODUMP-0}
78
    if [ $NODUMP -eq 1 ]
79
      then
80
        iverilog -o simv -c $3 -D NODUMP
81
      else
82
        iverilog -o simv -c $3
83
    fi
84
 
85
    ./simv
86
else
87
 
88
    NODUMP=${OMSP_NODUMP-0}
89
    if [ $NODUMP -eq 1 ] ; then
90
       vargs="+define+NODUMP"
91
    else
92
       vargs=""
93
    fi
94
 
95
   case $MYVLOG in
96
    cver* )
97
       vargs="$vargs +define+VXL" ;;
98
    verilog* )
99
       vargs="$vargs +define+VXL" ;;
100
    ncverilog* )
101
       vargs="$vargs +access+r" ;;
102
    vsim )
103
       # Modelsim
104
       if [ -d work ]; then  vdel -all; fi
105
       vlib work
106
       exec vlog +acc=prn -f $3 $vargs -R -c -do "run -all"
107
   esac
108
 
109
   echo "Running: $MYVLOG -f $3 $vargs"
110
   exec $MYVLOG -f $3 $vargs
111
fi

powered by: WebSVN 2.1.0

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