I have this question in my mind if it is okay to do this in a testbench. I need to collect a coverage of error scenarios. One of these errors is the parity error. There's a coverpoint there that collects which bit of the command causes the parity error.
The driver gives a command with a parity error, while the monitor samples this command and passes the transaction to the coverage component. The problem is, the monitor only knows that there is a parity error but it doesn't know which bit causes the parity error. Therefore, there is no way for the coverage component to collect the error bits.
So, as a solution to this, since the driver knows which bit has the error, then I put an analysis port in the driver so that it can pass its transaction to the coverage component.
Do you think this is the right way of collecting a coverage for this scenario? Some people say that coverage should only be collected from the monitor.