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

Subversion Repositories versatile_mem_ctrl

[/] [versatile_mem_ctrl/] [trunk/] [sim/] [rtl_sim/] [bin/] [sim_altera.tcl] - Blame information for rev 104

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

Line No. Rev Author Line
1 15 mikaeljf
# Usage:
2
# cd /versatile_mem_ctrl/trunk/sim/rtl_sim/run/
3
# vsim -gui -do ../bin/sim_altera.tcl
4
 
5
set DESIGN_NAME "versatile_memory_controller"
6 19 mikaeljf
set WAVE_FILE ../bin/wave_ddr.do
7 15 mikaeljf
set FORCE_LIBRARY_RECOMPILE 0
8
 
9
# Quit simulation if you are running one
10
quit -sim
11
 
12
# Create and open project
13
if {[file exists ${DESIGN_NAME}_sim_altera.mpf]} {
14
project open ${DESIGN_NAME}_sim_altera
15
} else {
16
project new . ${DESIGN_NAME}_sim_altera
17
}
18
 
19
# Compile Altera libraries
20
if {![file exists altera_primitives] || $FORCE_LIBRARY_RECOMPILE} {
21
vlib altera_primitives
22
vmap altera_primitives altera_primitives
23 31 mikaeljf
#vlog -work altera_primitives /opt/altera9.1/quartus/eda/sim_lib/altera_primitives.v
24 28 mikaeljf
vcom -work altera_primitives /opt/altera9.1/quartus/eda/sim_lib/altera_primitives_components.vhd
25
vcom -work altera_primitives /opt/altera9.1/quartus/eda/sim_lib/altera_primitives.vhd
26 15 mikaeljf
}
27
if {![file exists altera_mf] || $FORCE_LIBRARY_RECOMPILE} {
28
vlib altera_mf
29
vmap altera_mf altera_mf
30 31 mikaeljf
#vlog -work altera_mf /opt/altera9.1/quartus/eda/sim_lib/altera_mf.v
31 28 mikaeljf
vcom -work altera_mf /opt/altera9.1/quartus/eda/sim_lib/altera_mf_components.vhd
32
vcom -work altera_mf /opt/altera9.1/quartus/eda/sim_lib/altera_mf.vhd
33 15 mikaeljf
}
34 28 mikaeljf
if {![file exists lpm] || $FORCE_LIBRARY_RECOMPILE} {
35
vlib lpm
36
vmap lpm lpm
37
vlog -work lpm /opt/altera9.1/quartus/eda/sim_lib/220model.v
38
}
39 15 mikaeljf
 
40
# Compile project source code
41
vlog ../../../rtl/verilog/versatile_mem_ctrl_ip.v +incdir+../../../rtl/verilog/
42
 
43
# Compile test bench source code
44
vlog ../../../bench/ddr/ddr2.v +incdir+../../../bench/ddr/
45
vlog ../../../bench/wb0_ddr.v ../../../bench/wb1_ddr.v ../../../bench/wb4_ddr.v +define+x16 ../../../bench/tb_top.v +incdir+../../../bench/
46
 
47
# Quit without asking
48
set PrefMain(forceQuit) 1
49
 
50
# Invoke the simulator
51
# -gui      Open the GUI without loading a design
52
# -novopt   Force incremental mode (pre-6.0 behavior)
53
# -L        Search library for design units instantiated from Verilog and for VHDL default component binding
54 28 mikaeljf
vsim -gui -novopt -L altera_mf -L lpm work.versatile_mem_ctrl_tb
55 15 mikaeljf
 
56
# Open waveform viewer
57
view wave -title "${DESIGN_NAME}"
58
 
59
# Open signal viewer
60
view signals
61
 
62
# Run the .do file to load signals to the waveform viewer
63 19 mikaeljf
do $WAVE_FILE
64 15 mikaeljf
 
65
# Run the simulation
66
run 330 us
67
 

powered by: WebSVN 2.1.0

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