In reply to AbdulRauf1251:
Your scoreboard look strange. BTW imp stands for ‘implementation’ and not for ‘import’.
Your scoreboard should look like this:
class scoreboard extends uvm_scoreboard;
`uvm_component_utils(scoreboard)
uvm_tlm_analysis_fifo #(seq_item) fifo_Rec1;
uvm_tlm_analysis_fifo #(seq_item) fifo_Trans1;
function new(string name, uvm_component parent);
super.new(name,parent);
endfunction
function void build_phase(uvm_phase);
fifo_Rec1 = new("fifo_Rec1", this);
fifo_Trans1 = new("fifo_Trans1", this);
endfunction
task run_phase (uvm_phase phase);
seq_item Rec1;
seq_item Trans1;
thread1();
endtask
function void compare_data (input bit [31:0] indata1, indata2);
if (indata1 == indata2) begin
`uvm_info(get_type_name(), $sformatf("compare passed"), UVM_LOW)
end
else begin
`uvm_error(get_type_name(), $sformatf("compare failed with indata1 = %0h indata2 = %0h", indata1, indata2))
end
endfunction
task thread1();
forever begin
fifo_Rec1.get(Rec1);
`uvm_info(get_type_name(), $sformatf("Rec1 Received this Data: %0h", Rec1.data), UVM_MEDIUN)
fifo_Trans1.get(Trans1);
`uvm_info(get_type_name(), $sformatf("Trans1 Received this Data: %0h", Trans1.data), UVM_MEDIUM)
compare_data(Trans1.data,Rec1.data); // this function two inputs and check equality
end
endtask
endclass
Please note:
(1) You do not need to declare the suffixes
(2) a uvm_tlm_fifo is not sufficient for the analysis path. It has to be a uvm_tlm_analysis_fifo
(3) the uvm_tlm_analysis_fifo has a built-in uvm_analysis_export. You do not need a uvm_analysis_imp
(4) You do not need to implement a specific write function to put the data into the uvm_tlm_analysis_fifo
(5) a function has to have always a type