** Error: …/Wr-agent-top/wr_monitor.sv(1): near “class”: syntax error, unexpected class
** Error: …/Wr-agent-top/wr_monitor.sv(2): near “endfunction”: syntax error, unexpected endfunction, expecting endtask
** Error: …/Wr-agent-top/wr_monitor.sv(2): near “endfunction”: syntax error, unexpected endfunction, expecting endtask
** Error: …/Wr-agent-top/wr_monitor.sv(2): near “endfunction”: syntax error, unexpected endfunction, expecting endtask
** Error: …/Wr-agent-top/wr_monitor.sv(15): (vlog-2164) Class or package ‘wr_monitor’ not found.
** Error: …/Wr-agent-top/wr_monitor.sv(16): ‘super.new()’ call can only be made from within a class constructor.
** Error: …/Wr-agent-top/wr_monitor.sv(17): near “endfunction”: syntax error, unexpected endfunction, expecting endtask
** Error: …/Wr-agent-top/wr_monitor.sv(20): (vlog-2164) Class or package ‘wr_monitor’ not found.
this is my code
class wr_monitor extends uvm_monitor;
`uvm_component_utils(wr_monitor)
virtual v_if.WMR_MP vif;
wr_agent_config wr_cfg;
extern function new(string name=“wr_monitor”,uvm_component parent);
extern function void build_phase (uvm_phase phase);
extern function connect_phase(uvm_phase phase);
extern task run_phase(uvm_phase phase);
extern task collect_data();
endclass
function wr_monitor:: new(string name=“wr_monitor”,uvm_component parent);
super.new(name,parent);
endfunction
//********************build_phase//
function void wr_monitor::build_phase(uvm_phase phase );
if(!uvm_config_db#(wr_agent_config)::get(this,"wr_agent_config",wr_cfg))
`uvm_fatal("CONFIG"," CANNOT GET()in wr_monitor")
super.build_phase(phase);
endfunction
//*************connect_phase//
function void wr_monitor::conneect_phase(uvm_phase phase);
vif=wr_cfg.vif;
endfunction
//********RUN_PHASE//
task wr_monitor::run_phase(uvm_phase phase);
forever
begin
collect_data();
end
endtask
//***COLLECT_DATA//
task wr_monitor::collect_data();
bit [6:0] temp_length;
write_xtn data_send;
data_send=write_xtn::type_id::create(data_send);
wait(!vif.wmr_cb.wb_int_o)
wait(vif.wmr_cb.wb_ack_o)
begin
if(vif.wmr_cb.wb_adr_i==5'h00)
begin
data_send.mosi_temp[31:0]=vif.wmr_cb.wb_dat_i; //mosi collect
end
end
wait(vif.wmr_cb.wb_int_o)
begin
wait(vif.wmr_cb.ab_ack_o)
begin
if(vif.wmr_cb.wb_adr_i==5'h00)
begin
data_send.miso_temp[31:0]=vif.wmr_cb.wb_dat_o; //miso collct
end
end
end
`uvm_info(“SPI_MASTER_MONITOR”,$sformatf(“printing from master monitor \n %s”, data_send.sprint()),UVM_MEDIUM)
endtask