In reply to antonio92m:
Regarding to the UVM-Matlab integration, it works. The predictor is working eventually succesfully!!!
However there is a number of transactions where my testbench dies. I get the following error:
** Fatal: qmw_hdl2matlab fatal: Invalid variable name X
Time: 755390 ns Scope: qmw_hdl2matlab.getIntMultiDim File: qmw/qmw_sv/questa/qmw_hdl2matlab.sv Line: 136
Break at qmw/qmw_sv/questa/qmw_hdl2matlab.sv line 136
The way I communicate with Matlab I would say it is pretty similar to the example provided.
class predictor_matlab extends predictor; //input data
// Declaration macros
`uvm_component_utils(predictor_matlab);
extern function new(string name, uvm_component parent);
extern function void build_phase(uvm_phase phase);
extern function void write(sequence_item t);
endclass: predictor_matlab
function predictor_matlab::new(string name, uvm_component parent);
super.new(name,parent);
endfunction: new
function void predictor_matlab::build_phase(uvm_phase phase);
data_out_ap = new("data_out_export",this);
void'(qmw_hdl2matlab::qmw_sendCmd("clear scr_nuevo")); //I do this to clear persistent matlab variables
endfunction : build_phase
function void predictor_matlab::write(T t);
sequence_item predicted;
string msg, cmd, cmd_rsp;
predicted = sequence_item::type_id::create("predicted");
//t is the input sequence(Transaction)
predicted.do_copy(t);
$sformat(msg, "%s",t.convert2string());
`uvm_info(get_name(),msg, UVM_HIGH);
$sformat(cmd,"X = scr_nuevo(%d,%d)",t.d_in,t.d_out);
`uvm_info(get_name(), cmd, UVM_HIGH);
// Call our MATLAB function with our transaction inputs
void'(qmw_hdl2matlab::qmw_sendCmd(cmd));
// Read the result from Matlab
qmw_hdl2matlab::getIntValue("X",predicted.d_out);
data_out_ap.write(predicted);
endfunction: write
However I would like to know why the testbench breaks with that $fatal error under certain number of transactions.
Thank you,
Antonio