Hello, I should implement a convolution operation in my scoreboard in order to verify a FIR filter. The Scoreboard is connected to an input monitor and a result monitor and it receives a 16 bit rand data every clock cycle. How can I implement the convolution? The problem is that the convolution is time dependent and I don’t manage to compare the output every clock cycle with the FIR output in result monitor. The code is the following:
class scoreboard extends uvm_subscriber #(result_transaction);
`uvm_component_utils(scoreboard);
uvm_tlm_analysis_fifo #(sequence_item) data_f;
function new (string name, uvm_component parent);
super.new(name, parent);
endfunction : new
function void build_phase(uvm_phase phase);
data_f = new ("data_f", this);
endfunction : build_phase
logic[15:0] h [0:62] = {...}
function result_transaction predict_result(sequence_item data);
result_transaction predicted;
predicted = new("predicted");
---------------------------------------
return predicted;
endfunction : predict_result
function void write(result_transaction t);
string data_str;
sequence_item data;
result_transaction predicted;
if (!data_f.try_get(data))
$fatal(1, "Missing command in self checker");
predicted = predict_result(data);
data_str = { data.convert2string(),
" ==> Actual " , t.convert2string(),
"/Predicted ",predicted.convert2string()};
if (!predicted.compare(t))
`uvm_error("SELF CHECKER", {"FAIL: ",data_str})
else
`uvm_info ("SELF CHECKER", {"PASS: ", data_str}, UVM_HIGH)
endfunction : write
endclass : scoreboard
logic[15:0] h [0:62] are the filter coefficients (16 bit) and I should implement a function predict_result in order to compare the filter response…