# Simulation script for testing stat_mod.vhd # Note: this file assumes you have held to the interface proposed # in Homework 2. # This do file also assumes your resolution is set at 1 ns # For small components, a simple force .do file allows you to easily # simulate your design. As your designs become more complex, a testbench # is usually created such that you do not have to manually force the input # signals to be as you wish. # Add waves to wave window restart -f onerror {resume} quietly WaveActivateNextPane {} 0 add wave -noupdate -divider {Stat Mod Interface} add wave -noupdate -format Logic clk add wave -noupdate -format Logic reset_l add wave -noupdate -format Logic inc_event_1 add wave -noupdate -format Logic cntr_read add wave -noupdate -format Logic event_1_num add wave -noupdate -format Logic data_strobe add wave -noupdate -format Logic cntr_data add wave -noupdate -format Logic cntr_ready TreeUpdate [SetDefaultTree] WaveRestoreCursors {{Cursor 1} {0 ns} 0} WaveRestoreZoom {0 ns} {1 us} configure wave -namecolwidth 150 configure wave -valuecolwidth 100 configure wave -justifyvalue left configure wave -signalnamewidth 0 configure wave -snapdistance 10 configure wave -datasetprefix 0 configure wave -rowmargin 4 configure wave -childrowmargin 2 configure wave -gridoffset 0 configure wave -gridperiod 1 configure wave -griddelta 40 configure wave -timeline 0 ### Force signals and run force -freeze clk 1 0, 0 {50 ns} -r 100 force -freeze reset_l 0 0 force -freeze inc_event_1 0 0 force -freeze cntr_read 0 0 force -freeze event_1_num 00000000 0 run 450 force -freeze reset_l 1 0 ## Should have to wait at least 256 clock cycles to reset counters run 30000 force -freeze inc_event_1 1 0 force -freeze event_1_num 00001111 0 run 100 force -freeze event_1_num 11110000 0 run 100 force -freeze inc_event_1 0 0 force -freeze event_1_num 00000000 0 run 600 force -freeze cntr_read 1 0 force -freeze event_1_num 00001111 0 run 100 force -freeze event_1_num 11110000 0 run 100 force -freeze cntr_read 0 0 force -freeze event_1_num 00000000 0 run 1000