77 lines
No EOL
2.2 KiB
Text
77 lines
No EOL
2.2 KiB
Text
# Simulation macro
|
|
|
|
# Cleanup libraries
|
|
foreach lib [list work OSVVM] {
|
|
file delete -force -- $lib
|
|
vlib $lib
|
|
}
|
|
|
|
#.main clear
|
|
|
|
set COMMON_PATH ../../../common/0/src
|
|
set ENC_MULT ../../../encoder_multiply/0/src
|
|
set EMS_SRC ../src
|
|
set GEN_SEQ ../../../generic_sequencer/15/src
|
|
set EMUL ../../../enc_pd_emul/1/src
|
|
set OSVVM_PATH $COMMON_PATH/test/OSVVM
|
|
|
|
set WORKLIB work
|
|
|
|
vlib ./work
|
|
vmap work ./work
|
|
|
|
# Compile the UUT
|
|
vcom -2008 -work $WORKLIB $COMMON_PATH/common_pkg.vhd
|
|
vcom -2008 -work $WORKLIB $COMMON_PATH/digital_lpf.vhd
|
|
vcom -2008 -work $WORKLIB $COMMON_PATH/dpram_sclk.vhd
|
|
vcom -2008 -work $WORKLIB $COMMON_PATH/altera/alt_rw_dp_ram.vhd
|
|
vcom -2008 -work $WORKLIB $ENC_MULT/lut_divider_0.vhd
|
|
vcom -2008 -work $WORKLIB $ENC_MULT/encoder_speed_detect_0.vhd
|
|
vcom -2008 -work $WORKLIB $ENC_MULT/encoder_multiply_0.vhd
|
|
vcom -2008 -work $WORKLIB $EMS_SRC/ems_1_pkg_auto.vhd
|
|
vcom -2008 -work $WORKLIB $EMS_SRC/ems_1_csr_regs_auto.vhd
|
|
vcom -2008 -work $WORKLIB $EMS_SRC/ems_1.vhd
|
|
|
|
|
|
# Compile the constrained random related packages
|
|
vlib OSVVM
|
|
vcom -2008 -work OSVVM \
|
|
$OSVVM_PATH/RandomBasePkg.vhd \
|
|
$OSVVM_PATH/SortListPkg_int.vhd \
|
|
$OSVVM_PATH/RandomPkg.vhd \
|
|
$OSVVM_PATH/NamePkg.vhd \
|
|
$OSVVM_PATH/MessagePkg.vhd \
|
|
$OSVVM_PATH/CoveragePkg.vhd
|
|
|
|
# Compile support files
|
|
vcom -2008 -work $WORKLIB $COMMON_PATH/test/common_test_pkg.vhd
|
|
vcom -2008 -work $WORKLIB $COMMON_PATH/test/log_pkg.vhd
|
|
vcom -2008 -work $WORKLIB $COMMON_PATH//test/avalon_verify_pkg.vhd
|
|
|
|
# Add the encoder/PD emulator
|
|
vcom -2008 -work $WORKLIB $GEN_SEQ/altera/generic_seq_ram_15.vhd
|
|
vcom -2008 -work $WORKLIB $GEN_SEQ/generic_sequencer_15_pkg.vhd
|
|
vcom -2008 -work $WORKLIB $GEN_SEQ/generic_sequencer_15.vhd
|
|
vcom -2008 -work $WORKLIB $EMUL/enc_pd_emul_1_pkg.vhd
|
|
vcom -2008 -work $WORKLIB $EMUL/enc_pd_emul_1.vhd
|
|
|
|
# Compile the testbench
|
|
vcom -2008 -work $WORKLIB ./../src/test/ems_1_tb.vhd
|
|
|
|
vsim -t ps work.ems_1_tb
|
|
|
|
|
|
#add wave /ems_1_tb/*
|
|
#add wave /ems_1_tb/iEMS/*
|
|
#add wave /ems_1_tb/iEMUL/*
|
|
|
|
# remove warnings from standard numeric/arithmetic packages (speed-up simulation)
|
|
set StdArithNoWarnings 1
|
|
set NumericStdNoWarnings 1
|
|
|
|
do wave_ems.do
|
|
|
|
when -label end_of_simulation {test_completed == true} {echo "Simulation Completed"; stop ;}
|
|
run -all
|
|
|
|
#run 200 us; |