Jump to content

UVM virtual sequencer type cast fail from m_sequencer to p_sequencer

Recommended Posts

We encounter a simulation error as following when porting OVM to UVM:

In our testbench we use a parameter virtual sequencer which includes several sequencers, and a parameter virtual sequence which is the base class of various sub virtual sequencers.

We use `uvm_declare_p_sequencer(pcie_virtual_sequencer #(IF_PARAMS)) in the base virtual sequence(pcie_virtual_seq_base) to declear p_sequencer. But when simulation starts there is an error reported as following:

UVM_FATAL uvm_test_top.env.virtual_sequencer@@<unknown> [DCLPSQ] xxx::pcie_virtual_seq_base.m_set_p_sequencer uvm_test_top.env.virtual_sequencer.<unknown> Error casting p_sequencer, please verify that this sequence/sequence item is intended to execute on this type of sequencer

It seems the member object m_sequencer of pcie_virtual_seq_base can’t be converted to the parameter virtual sequencer pcie_virtual_sequencer.

The code is OK in OVM version. And I changed some items for UVM:

1. replace `uvm_sequencer_utils by `uvm_component_utils

2. remove `uvm_update_sequence_lib

3. replace set_config_string("*", "default_sequence".... by uvm_config_db#(uvm_object_wrapper)(..

In test case, I create a sub-sequence driverd from pcie_virtual_seq_base and use req.start() to launch tese in run_phase.

could anyone give me some advise? Thanks!

Edited by reedzhu
Link to comment
Share on other sites


you can check in the GUI the types of m_sequencer and p_sequencer and see if there is a mismatch in the parameter set. apart from this you would need to provide more details about your sequencer types/instances etc.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...