Chargement…
Chargement…
The block starts a measurement on request, waits for a first rising edge, then counts system cycles until the next rising edge.
Behaviour
i_signal first passes through a two-flip-flop synchronizer and edge detector.i_start pulse is accepted while o_ready='1'.o_period_cycles contains the exact distance between the two synchronized edges.o_done pulses for one cycle with the result.g_max_period_cycles, the result saturates to that value and o_overflow pulses with o_done.The measured signal must remain low and high long enough to be observed by the system clock after synchronization. The circuit measures sampled edges, not a frequency beyond what the clock can observe.
Frequency can then be calculated with f_signal = f_clk / o_period_cycles. That division is outside this exercise.
g_max_period_cyclesi_clki_reseti_starti_signalo_readyo_doneo_overflowo_period_cycles