Write a SystemVerilog functional coverage model ( covergroup ) to verify…
Write a SystemVerilog functional coverage model ( covergroup ) to verify a 4-location memory ( mem[3:0] ).
Model answer
To verify that all $4$ memory locations ( 0 , 1 , 2 , 3 ) have been both **written** and **read**, define a covergroup with a coverpoint for the 2-bit address ( addr ), a coverpoint for the read/write command ( rd_wr ), and their ** cross **: