Expression on rhs is not a class or a compatible class and hence cannot be assigned to a class handle on lhs

Hello everyone, I am trying to assign the sequencer from my agent to the sequencer in the environment and I get the next error:

Expression on rhs is not a class or a compatible class and hence cannot be assigned to a class handle on lhs.
Please make sure that lhs and rhs expressions are compatible.

The sequencer and agent are parameterized classes if it’s relevant.
I checked the `uvm_component_param_utils macro and it’s looks good and also the create of the sequencer in the agent and the parameter passing to the sequencer in the agent and to the agent itself.

Anybody has idea for what could cause this error?

In reply to morslai:

It could be the parameter override values don’t match between LHS and RHS. But without seeing any code and the actual error message, it’s difficult to answer.

In reply to dave_59:

Hello Dave,
i am getting same error as mentioned above for the below code,please suggest,thnks

ifndef AXI_AGENT_PKG define AXI_AGENT_PKG
import env_pkg::*;
class axi_agent extends uvm_agent;

`uvm_component_utils(axi_agent)
axi_sequencer m_seqr ;
axi_driver m_driver;
// axi_monitor m_monitor;
//axi_config m_config;
uvm_analysis_port #(stimulus) aport;
uvm_analysis_port #(stimulus) monitor_aport;

function new(string name,uvm_component parent);
super.new(name,parent);
monitor_aport = new(“monitor_aport”, this);
aport = new(“aport”, this);
endfunction

extern virtual function void build_phase(uvm_phase phase);
extern virtual function void connect_phase(uvm_phase phase);

endclass: axi_agent

function void axi_agent::build_phase(uvm_phase phase);
m_seqr = axi_sequencer::type_id::create(“m_seqr”,this);
m_driver = axi_driver::type_id::create(“m_driver”,this);
// m_monitor = axi_monitor::type_id::create(“m_monitor”,this);
endfunction

function void axi_agent::connect_phase(uvm_phase phase);
m_driver.seq_item_port.connect(m_seqr.seq_item_export);
//m_monitor.monitor_aport.connect(aport);
endfunction

`endif

In reply to ramankaur09:
You should show how your driver and monitor code looks like.
In your agent you have 2 analyis ports, aport and monitor_aport. Is this really your intention?

In reply to chr_sue:

Okay ,thanks for response.Here below is the error, its coming for sequencer part
can u pls suggest,thnks

Error-[SV-ICA] Illegal class assignment
“this.m_seqr = uvm_component_registry#(uvm_pkg::uvm_sequencer#(seq_pkg::stimulus,seq_pkg::stimulus),”“)::create(“m_seqr”, this, /* contxt = “\000” */);”
Expression
‘uvm_component_registry#(uvm_pkg::uvm_sequencer#(seq_pkg::stimulus,seq_pkg::stimulus),“”)::create(“m_seqr”,
this, )’ on rhs is not a class or a compatible class and hence cannot be
assigned to a class handle on lhs.
Please make sure that the lhs and rhs expressions are compatible.

In reply to chr_sue:

Okay ,thanks for response.Here below is the error, its coming for sequencer part
can u pls suggest,thnks

Error-[SV-ICA] Illegal class assignment
“this.m_seqr = uvm_component_registry#(uvm_pkg::uvm_sequencer#(seq_pkg::stimulus,seq_pkg::stimulus),”“)::create(“m_seqr”, this, /* contxt = “\000” */);”
Expression
‘uvm_component_registry#(uvm_pkg::uvm_sequencer#(seq_pkg::stimulus,seq_pkg::stimulus),“”)::create(“m_seqr”,
this, )’ on rhs is not a class or a compatible class and hence cannot be
assigned to a class handle on lhs.
Please make sure that the lhs and rhs expressions are compatible.

In reply to ramankaur09:

Please show the sequencer class code.

In reply to chr_sue:

Thanks , actually i had forgotten to register the axi_sequencer class in factory, this is the reason it was unable to map,thnks for input