Uvm agent grouping rule

For example, dut has 4 ports: cs, dout, din, sclk which do SPI communication.
So they will put into spi_driver which will be put into spi_agent.

But meanwhile, dout can also act as a data ready pin which is not part of the spi protocol. In this case, what should I do? Should I create another agent which only monitors the data ready? Or just monitor that in spi_agent?

In general, what are the rules to group different ports and create a new agent for those groups?

While there are no strict rules on this - general practice and recommendation would be to group signals as per protocol. In your case - I agree handling dout inside spi_agent is the right thing to do - unless your SPI UVC is an encrypted, third party VIP.

thanks

But here I have another real-world dut, which has both i2c and spi mode.
And both modes share the same ports.

In this case, how should I group the ports?