-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest_module_tb.tcl
56 lines (42 loc) · 2.15 KB
/
test_module_tb.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
puts {
ECSE 487 - Final Project
Modular Exponentiation Testbench
Authors : Luis Gallet, Jacob Barnett
Creation Date : 03/16/2016
Last Revision : 04/14/2016
}
proc AddWaves {} {
;#Add waves we're interested in to the Wave window
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/N_in
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/A_in
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/B_in
add wave -radix binary -position end sim:/montgomery_comparison_tb/clk_in
add wave -radix binary -position end sim:/montgomery_comparison_tb/reset_t
add wave -radix binary -position end sim:/montgomery_comparison_tb/latch_in
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/M_out
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/data_ready
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/A_temp
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/B_temp
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/N_temp
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/M_temp
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/mult_result
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/state
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/compute/mult_count
add wave -radix unsigned -position end sim:/montgomery_comparison_tb/dut/compute/div_count
}
vlib work
;# Compile components if any
;#vcom -reportprogress 300 -work work mathpack.vhd
;#vcom -reportprogress 300 -work work test_module.vhd
;#vcom -reportprogress 300 -work work test_module_tb.vhd
vcom -reportprogress 300 -work work montgomery_comparison.vhd
vcom -reportprogress 300 -work work montgomery_comparison_tb.vhd
;# Start simulation
;#vsim test_module_tb
vsim montgomery_comparison_tb
;# Add the waves
AddWaves
;# Generate a clock with 1ns period
force -deposit clk_in 0 0 ns, 1 0.5 ns -repeat 1 ns
;# Run for 50 ns
run 5050ns