Hardware interview practice
Configure two reusable agents in one environment
Design an environment with two instances of one bus agent, an optional scoreboard, and independently optional coverage subscribers.
Starting point
Question code
class dual_bus_env extends uvm_env;
bus_agent a0, a1;
bus_scoreboard sb;
endclassReviewed example
Work through one case
Input
a0 is active on vif0; a1 is passive on vif1; scoreboard enabled; coverage only on a1Expected output
both monitors publish, only a0 drives, the scoreboard sees both streams, and only cov1 samplesPer-instance configuration changes policy without modifying or duplicating the reusable agent class.
What to cover
Requirements
- Factory-create both agents with distinct instance names.
- Give each agent its own configuration and virtual interface.
- Create optional subscribers from environment configuration.
- Connect monitor analysis ports without leaking protocol details into the environment.
