Factory override question

I have an interface with several chip-selects. I have several identical agents which reference one instance of this interface.

I also have some component-level UVM environments corresponding to specific chip-select devices hanging off this daisy-chained bus.

For example, the agent in my UART environment (chipselect 3) broadcasts ALL transactions it detects on the bus, forcing my coverage collector and scoreboard to discard all non-chipselect-3 transactions. I would prefer to filter some of this further up the pipe.

Do you recommend doing a factory override of the agent’s monitor, where all non-pertinent transactions are dropped before broadcasting on the analysis port? Recall the default behavior is to broadcast everything.

OR do you recommend doing the filtering at the consumers… the scoreboard, coverage collectors etc.

In reply to bmorris:

I would avoid the factory override. But I don’t see why you would need to do that instead of a config item that chooses which selects to filter( or rather which selects to pass through)

In reply to dave_59:

But I don’t see why you would need to do that instead of a config item that chooses which selects to filter( or rather which selects to pass through)

I was just trying to make things harder than they needed to be. I got hung up on using the factory for everything. Thanks Dave

In reply to bmorris:

BTW, I meant to say I would avoid using the factory in this particular case. Sometimes using the factory too much can get in the way of using the factory later. This is where the design principle of “separation of concerns” come in to play. Keep dependencies to a minimum.

In reply to dave_59:

Understood. do you know any good articles on “separation of concerns”, or, perhaps flesh it out a bit more.

Your approach was better.

  virtual task run_phase(uvm_phase phase);
    plb_transaction txn;
    @configuration.monitor_bus.cb; // synchronize to clock
    forever begin
      configuration.monitor(txn); // wait for transaction
      if ( configuration.csel_filter[txn.CS_sel]==1 ) begin // <--- much easier
        `uvm_info(report_id,
          $sformatf("PLB Transaction detected on bus:\n%s", txn.convert2string()), UVM_DEBUG)
        ap.write(txn);
      end
      @configuration.monitor_bus.cb; // advance to next edge
    end
  endtask

In reply to bmorris: