Altera_Forum
Honored Contributor
8 years agoBest practices for verifying PWM (measuring time)...
Folks:
I am writing a testbench for a pulse-width modulator and wanted to check for several hundred different values. I figured I'd use a loop for each value, but I'm not sure of the best way to confirm (using assert) that the pulse is the correct length for each value. I was planning on just using a "wait until" and then "now - output'last_event" but I want to use the loop index in a comparison with a time value, which isn't going to work. I suppose I could use some sort of inner loop that counted the clock cycles, but that seems very clunky. I'd appreciate any recommendations or links to good resources.