More Statistics
Know your numbers: Track and report average command latency with precision!
PROBLEM STATEMENT:
In another design that requires measurement and monitoring, you need to design a module that measures and reports the average latency it takes for a certain command to be executed.
The statistics block sits in parallel to the module sending out commands and receiving responses. The following diagram shows this pictorially:

The statistics block uses a measurement interval of 256 command cycles. I.e the average latency status needs to be returned when the capturing pulse ‘meas_cap_i’ is asserted by the testbench.
One command is considered to be processed when it is sent and its response has been recieved.
The average latency computation can be rounded to the nearest lower integer (i.e floor(total_latency/256))
This is an indefinitely running block of logic.
Loading the interactive workspace...