In reply to verif_learner:
Hi,
To address the dilemma between modular coverage code and non-replication of subscriber ports/code in scoreboard and coverage , I found the following two ways useful.
Way-A :
- extend the coverage class from the scoreboard class.
- define coverage in the coverage class and redefine all the write_* tasks with call to super.write_* and then add your covergroup.sample() in the write_* tasks.
- in the Env, instead of instantiating the scoreboard, u instantiate the coverage class and make port connections.
- This way you have modularity(separation) in code and no replication of ports.
Else if someone wants to stick to rudimentary and say NO to Way-A , then
Way-B :
- Make base class with analyisis ports.
- Extend scoreboard and coverage from base class.(Atleast I am saved the port declaration and New-ing)
- define coverage related stuff in coverage and scoreboarding checks in scoreboard.
- Instantiate both coverage and scoreboard in Env and make connections to monitor for both of them.
- set handle of scoreboard in uvm config_db
- In the coverage class, get scoreboard handle from config_db and that way avoid duplication of code that is already defined in scoreboard.
Regards,
nisj