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

Subversion Repositories gpio

[/] [gpio/] [trunk/] [sim/] [rtl_sim/] [bin/] [sim.sh] - Blame information for rev 65

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 lampret
#!/bin/bash
2
 
3
#
4
# This script runs RTL and gate-level simulation using different simultion tools.
5
# Right now Cadence Verilog-XL and NCSim are supported.
6
#
7
# Author: Damjan Lampret
8
#
9
 
10
#
11
# User definitions
12
#
13
 
14
# Set simulation tool you are using (xl, ncsim, ncver)
15 12 lampret
SIMTOOL=ncsim
16 10 lampret
 
17
# Set test bench top module(s)
18
TB_TOP="tb_tasks"
19
 
20
# Set include directories
21
INCLUDE_DIRS="../../../rtl/verilog/ ../../../bench/verilog/"
22
 
23
# Set test bench files
24
BENCH_FILES="../../../bench/verilog/*.v"
25
 
26
# Set RTL source files
27
RTL_FILES="../../../rtl/verilog/*.v"
28
 
29
# Set gate-level netlist files
30
GATE_FILES="../syn/out/final_gpio.v"
31
 
32
# Set libraries (standard cell etc.)
33
LIB_FILES="/libs/Virtual_silicon/UMCL18U250D2_2.1/verilog_simulation_models/*.v"
34
 
35
# Set parameters for simulation tool
36
if [ $SIMTOOL == xl ]; then
37
        PARAM="+turbo+3 -q"
38
        for i in $INCLUDE_DIRS; do
39
                INCDIR=$INCDIR" +incdir+$i"
40
        done
41
elif [ $SIMTOOL == ncver ]; then
42
        NCVER_PARAM=""
43
        for i in $INCLUDE_DIRS; do
44
                INCDIR=$INCDIR" +incdir+$i"
45
        done
46
elif [ $SIMTOOL == ncsim ]; then
47
        NCPREP_PARAM="-UPDATE +overwrite"
48
        NCSIM_PARAM="-MESSAGES -NOCOPYRIGHT"
49
        for i in $INCLUDE_DIRS; do
50
                INCDIR=$INCDIR" +incdir+$i"
51
        done
52
else
53
        echo "$SIMTOOL is unsupported simulation tool."
54
        exit 0
55
fi
56
 
57
#
58
# Don't change anything below unless you know what you are doing
59
#
60
 
61
# Run simulation in sim directory
62 40 gorand
#cd ../sim
63 10 lampret
 
64
# Run actual simulation
65
 
66
# Cadence Verilog-XL
67
if [ $SIMTOOL == xl ]; then
68
 
69
        # RTL simulation
70
        if [ "$1" == rtl ]; then
71
                verilog $PARAM $INCDIR $BENCH_FILES $RTL_FILES
72
 
73
        # Gate-level simulation
74
        elif [ "$1" == gate ]; then
75
                verilog $PARAM $INCDIR $BENCH_FILES $GATE_FILES $LIB_FILES
76
 
77
        # Wrong parameter or no parameter
78
        else
79
                echo "Usage: $0 [rtl|gate]"
80
                exit 0
81
        fi
82
 
83
# Cadence Ncverilog
84
elif [ $SIMTOOL == ncver ]; then
85
 
86
        # RTL simulation
87
        if [ "$1" == rtl ]; then
88
                ncverilog $NCVER_PARAM $INCDIR $BENCH_FILES $RTL_FILES
89
                cp ncverilog.log ../log
90
 
91
        # Gate-level simulation
92
        elif [ "$1" == gate ]; then
93
                ncverilog $NCVER_PARAM $INCDIR $BENCH_FILES $GATE_FILES $LIB_FILES
94
                cp ncverilog.log ../log
95
 
96
        # Wrong parameter or no parameter
97
        else
98
                echo "Usage: $0 [rtl|gate]"
99
                exit 0
100
        fi
101
 
102
# Cadence Ncsim
103
elif [ $SIMTOOL == ncsim ]; then
104
 
105
        # RTL simulation
106
        if [ "$1" == rtl ]; then
107
                ncprep $NCPREP_PARAM $INCDIR $BENCH_FILES $RTL_FILES
108
                ./RUN_NC
109
 
110
        # Gate-level simulation
111
        elif [ "$1" == gate ]; then
112
                ncprep $NCPREP_PARAM $INCDIR $BENCH_FILES $GATE_FILES $LIB_FILES
113
                ./RUN_NC
114
 
115
        # Wrong parameter or no parameter
116
        else
117
                echo "Usage: $0 [rtl|gate]"
118
                exit 0
119
        fi
120
 
121
# Unsupported simulation tool
122
else
123
        echo "$SIMTOOL is unsupported simulation tool."
124
        exit 0;
125
fi

powered by: WebSVN 2.1.0

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