Hello,
I’m facing an error in the following driver class. It says:
Error-[MRRE] Member reference resolution error
student_src/ocp_driver.sv, 33
Member operator “.” cannot be used on object of type logic.
Expression: SCmdAccept
Source info: rx.SCmdAccept.randomize
Error-[MRRE] Member reference resolution error
student_src/ocp_driver.sv, 34
Member operator “.” cannot be used on object of type logic.
Expression: SResp
Source info: rx.SResp.randomize
These two lines are highlighted in my ocp driver code below.
Please help me in debugging this error
Thank You
class ocp_driver extends uvm_driver #(ocp_transaction);
`uvm_component_utils(ocp_driver)
virtual ocp_if ocp_vi;
function new(string name = "ocp_driver", uvm_component parent = null );
super.new(name,parent);
endfunction: new
function void connect_phase(uvm_phase phase);
if( !uvm_config_db #( virtual ocp_if )::get(null, "", "ocp_vi", ocp_vi) ) begin
`uvm_error("connect", "ocp_if not found")
end
`uvm_info("OCP_DRIVER", "connect_phase running",UVM_LOW)
endfunction: connect_phase
task run_phase(uvm_phase phase);
int assoc[*];
forever begin
ocp_transaction rx;
rx = ocp_transaction::type_id::create("rx");
`uvm_info("CPU2REG_DRIVER","run_phase:cpu2reg_transaction started", UVM_LOW)
seq_item_port.get_next_item(rx);
@(posedge ocp_vi.Clk) begin
if (ocp_vi.MCmd == 3'b001) begin
assoc[ocp_vi.MAddr] = ocp_vi.MData;
end else if (ocp_vi.MCmd == 3'b010) begin
rx.SData = assoc[ocp_vi.MAddr];
end
end
**rx.SCmdAccept.randomize() with {rx.delay > 0 && rx.delay < 5;};
rx.SResp.randomize();**
seq_item_port.item_done();
`uvm_info("OCP_DRIVER","run_phase:ocp_transaction completed",UVM_LOW)
end
endtask: run_phase
endclass: ocp_driver