If you have two signals that MUST be equal to one another all the time, and you need to write a checker for this, you can use the following..
This demonstration of the macro takes two signals as inputs and continuously calculates the delay in clock cycles between changes in those signals.
How do we calculate the distance between two trigger points of one signal?
Our bug-fighters Aleksandra Dimanić & Nemanja Stevanović show us how to implement it with two different methods!
SystemVerilog functions can have inputs and outputs. Using outputs is useful in case you want to return a queue from a function (or some other complex type), or in case you want to return two or more different variables from the function.