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

Subversion Repositories simu_mem

[/] [simu_mem/] [trunk/] [sim/] [rtl_sim/] [bin/] [sim.sh] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 mgeng
#!/bin/bash
2
#
3
# This script runs RTL simulation.
4
# Right now only Modelsim is supported.
5
#
6
# Author: Michael Geng
7
#
8
 
9
# Number of clock cycles you want to run the simulations
10
N_simulation_cycles=100
11
 
12
# data bus width
13
D_width=36
14
 
15
# address bus width
16
A_width=21
17
 
18
. modelsim.inc
19
 
20
if [ -z $MODEL_SIM ]; then
21
        echo "The environment variable MODEL_SIM must point to your Modelsim installation."
22
        exit 0
23
fi
24
 
25
vlib=$MODEL_SIM/win32pe/vlib
26
vcom=$MODEL_SIM/win32pe/vcom
27
vsim=$MODEL_SIM/win32pe/vsim
28
 
29
for tool in $vlib $vcom $vsim
30
do
31
        check_executable $tool
32
done
33
 
34
touch modelsim.ini
35
 
36
mkdir -p ../out
37
 
38
# map libraries
39
map std      "$MODEL_SIM/std"
40
map ieee     "$MODEL_SIM/ieee"
41
map verilog  "$MODEL_SIM/verilog"
42
map RAM      ../out/RAM
43
map misc     ../out/misc
44
map samsung  ../out/samsung
45
map test_zbt ../out/test_zbt
46
 
47
# compile
48
vcom -work ../out/misc ../../../bench/vhdl/misc/math_pkg.vhd
49
 
50
vlog +define+hc25 -work ../out/samsung ../../../bench/verilog/samsung/k7n643645m_R03.v
51
 
52
vcom -work ../out/RAM ../../../rtl/vhdl/linked_list_mem_pkg.vhd
53
vcom -work ../out/RAM ../../../rtl/vhdl/ZBT_RAM_pkg.vhd
54
vcom -work ../out/RAM ../../../rtl/vhdl/ZBT_RAM.vhd
55
 
56
vcom -work ../out/test_zbt ../../../bench/vhdl/zbt_ram/patgen_pkg.vhd
57
vcom -work ../out/test_zbt ../../../bench/vhdl/zbt_ram/patgen_entity.vhd
58
vcom -work ../out/test_zbt ../../../bench/vhdl/zbt_ram/patgen_arch_random.vhd
59
vcom -work ../out/test_zbt ../../../bench/vhdl/zbt_ram/patgen_arch_deterministic.vhd
60
vcom -work ../out/test_zbt ../../../bench/vhdl/zbt_ram/testbench.vhd
61
vcom -work ../out/test_zbt ../../../bench/vhdl/zbt_ram/testbench_random_conf.vhd
62
vcom -work ../out/test_zbt ../../../bench/vhdl/zbt_ram/testbench_deterministic_conf.vhd
63
 
64
mkdir -p ../log
65
 
66
# simulate
67
echo "Simulate with deterministic pattern"
68
vsim -l ../log/zbt_deterministic.out -c -t 100ps -GD_width=$D_width -GA_width=$A_width \
69
        -GN_simulation_cycles=$N_simulation_cycles -do "run -all ; quit ;" test_zbt.deterministic_conf
70
 
71
echo "Simulate with random pattern"
72
vsim -l ../log/zbt_random.out -c -t 100ps -GD_width=$D_width -GA_width=$A_width \
73
        -GN_simulation_cycles=$N_simulation_cycles -do "run -all ; quit ;" test_zbt.random_conf

powered by: WebSVN 2.1.0

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