Hi,
I have twiddled in my mind many different approaches to implement uvm component’s dynamical disable/enable during the test execution. Let’s take scoreboard as an example.
class example_env extends uvm_env;
example_sb scoreboards[];
example_agent agents[];
example_cfg cfg;
...
virtual function void build_phase(uvm_phase phase);
scoreboards = new[cfg.num_scoreboards]; // Define size of the scoreboard array and create the scoreboards with factory
virtual function void connect_phase(uvm_phase phase);
agents[0].analysis_port.connect(scoreboards[0].export); // Connect scoreboard with certain agent
...
endclass
In the creation phase of the testbench, user can utilize “num_scoreboards” field to say how many scoreboards are created. During the test execution, I would like to make it possible for the user to disable (and probably enable it again if needed) certain scoreboard instance, but I cannot decide the best way to do it. What do you think, what could be the best implementation style?
- set/get the component (scoreboard) instance number via config_db, or global uvm_pool or uvm_queue, and capture the inst number in the env’s run_phase?
- when instance under disable/enable (number) is communicated for env, just assign null to that particular instance, what says connect for that?
- if null assignment is no way should I implement disable/enable task inside the component (scoreboard) which halts whole scoreboard functionality?
- or create and assign “dummy” scoreboard (which doesn’t do anything) to the disabled/enabled scoreboard instance?
- or something very different?
I would be very grateful if you could share your ideas or thoughts.
-ilia