UVM_ANALYSIS_PORT and UVM_ANALYSIS_EXPORT

Hello all,

Please go through the template given below followed by my doubt in the same.

/MONITOR INSIDE AN AGENT/

class monitor extends uvm_monitor;
`uvm_component_utils(monitor)

ex_transaction xtn;

uvm_analysis_port#(ex_transaction)ap;

task run_phase(uvm_phase phase);
forever
begin
//collecting logic
ap.write(xtn);
end
endtask
endclass: monitor

/*SCOREBOARD INSIDE ENVIRONMENT/

class scoreboard extends uvm_scoreboard;
`uvm_component_utils(scoreboard)

ex_transaction xtn;

uvm_analysis_export#(ex_transaction)expo;

endclass: scoreboard

Here is my doubt…

For the write call made in the monitor do I need to implement the same in my scoreboard or is it implicitly taken care of(As I found write method in source file UVM_ANALYSIS_EXPORT base class) ?

You need to connect the Analysis Port of Monitor and Analysis Export of the Scoreboard in your Environment, further if you want to override(not necessary) the write method in your Scoreboard class you may do so for purpose of coverage,comparison,logger,further protocol checks.

In reply to svats:

If you do not override the write method your data will not be published from the monitor, because the base class does not know them.
BTW if your scoreboard is the last component in your analysis data chain you need a uvm_analysis_imp instead of the uvm_analysis_export. Only the imp has to implement the write method.