#PhaseComparator testbench for phase comparator

vlog +define+SIM PC_comp_tb.v PhaseComparator.v -timescale 1ns/1ns
vsim PC_comp_tb -voptargs="+acc=prn" -t 1ns
restart -force

add wave clkuf
add wave clkur
#add wave pcomp/ffuf
#add wave pcomp/ffur
#add wave pcomp/active
#add wave pcomp/clkur_sample
add wave pwm
add wave clkactive
add wave ur_leading
add wave enable

#init
force clkuf 0
force clkur 0

#20 ns period, 50 MHz
force clkuf 0 0ns, 1 10ns -r 20
force clkur 1 0ns, 0 10ns -r 20
run 200

noforce clkur
force clkur 1 1ns, 0 11ns -r 20
run 100

noforce clkur
force clkur 1 2ns, 0 12ns -r 20
run 100

noforce clkur
force clkur 1 3ns, 0 13ns -r 20
run 100

noforce clkur
force clkur 1 4ns, 0 14ns -r 20
run 100

noforce clkur
force clkur 1 5ns, 0 15ns -r 20
run 100

noforce clkur
force clkur 1 6ns, 0 16ns -r 20
run 100

noforce clkur
force clkur 1 7ns, 0 17ns -r 20
run 100

noforce clkur
force clkur 1 8ns, 0 18ns -r 20
run 100

noforce clkur
force clkur 1 9ns, 0 19ns -r 20
run 100

noforce clkur
force clkur 0 0ns, 1 10ns -r 20
run 100

noforce clkur
force clkur 0 1ns, 1 11ns -r 20
run 100

noforce clkur
force clkur 0 2ns, 1 12ns -r 20
run 100

noforce clkur
force clkur 0 3ns, 1 13ns -r 20
run 100

noforce clkur
force clkur 0 4ns, 1 14ns -r 20
run 100

noforce clkur
force clkur 0 5ns, 1 15ns -r 20
run 100

noforce clkur
force clkur 0 6ns, 1 16ns -r 20
run 100

noforce clkur
force clkur 0 7ns, 1 17ns -r 20
run 100

noforce clkur
force clkur 0 8ns, 1 18ns -r 20
run 100

noforce clkur
force clkur 0 9ns, 1 19ns -r 20
run 100

noforce clkur
force clkur 1 0ns, 0 10ns -r 20
run 100

#run -all

wave zoom full

