Connecting scoreboard with more than one monitor

I have tried to implement this method inside the UVM_SCOREBOARD. But I am getting the error of

eda link of the code : Edit code - EDA Playground

please help me to find the issue . it seems the macro is not created the write_BEFORE method inside the scoreboard.

thanks

The `uvm_analysis_imp_decl() macro defines the analysis imports in the scoreboard. If you desire multiple imports, you declare and instantiate each port with a unique name.

When you connect an analysis port, you use the ‘write’ function to send the data from the analysis port to the analysis_import. You don’t add the unique name to the write function call.

In your case, you are connecting ‘sender’ to both analysis imports, so both write functions (write, write_BEFORE will be called with the same item.

I intend to create my own write function in the scoreboard apart from the write method. what ever you mentioned its correct only and I followed the same way to create my own imp . please check this code Edit code - EDA Playground
help me to find why the error is coming even after I followed all the steps mentioned above

In your code, sender should be different.
it should be sender1.write(); sender2.write();

my intention is not use the write method . i am trying to create write_BEFORE method in the imp port using `uvm_analysis_imp_decl(_BEFORE) macro.

I dont think it will work.
send_port is a variable of type uvm_analysis_port which doesn’t have write_BEFORE method. It only has write method.

In your case, since you have multiple monitors, each monitor instances’ send_port can call their respective write method. when you are connecting it with scoreboard, you can connect it with different IMPLEMENTATION port.

it dont have the write_BEFORE method i agress . I mentioned Cleary my intention is to create one method as per here mentioned (visit my initial attachement) . if i used write method for two monitor nee to implement two same write method inside scoreboard ?