How to use sequences of a parametric subsequencer

Hi,

I have a “fully parametric” OVC taking 2 parameters: NB_PINS, NB_VOLTAGES.
Here’s the sequencer for instance:

class vc_myovc_sequencer #(int NB_PINS=1, int NB_VOLTAGES=4) extends ovm_sequencer#(vc_myovc_seq_item);

    vc_myovc_config #(.NB_PINS(NB_PINS), .NB_VOLTAGES(NB_VOLTAGES)) cfg;
    
    `ovm_sequencer_param_utils_begin(vc_myovc_sequencer#(NB_PINS,NB_VOLTAGES))
        `ovm_field_object(cfg,OVM_ALL_ON)
    `ovm_sequencer_utils_end
    
    function new(string name,ovm_component parent);
        super.new(name,parent);
    endfunction : new
	
endclass : vc_myovc_sequencer

Here’s one sequence

class vc_myovc_example1_sequence extends vc_myovc_base_sequence;
    `ovm_declare_p_sequencer(vc_myovc_sequencer#(int,int))
    `ovm_object_utils(vc_myovc_example1_sequence)
..
endclass : vc_myovc_example1_swequence

I want to reuse this in a upper/top level OVC. And this is where it doesn’t work…
I have the following code:

task body();
vc_myovc_example1_swequence my_seq;

`ovm_do_on_with(
      my_seq,
      p_sequencer.myovc_sequencer,
      {param1==rail_name;}
)
endtask : body

And in the toplevel sequencer I have:
vc_myovc_sequencer #(.NB_PINS(1), .NB_VOLTAGES(4S)) myovc_sequencer;

It compiles and loads, but I get the following runtime error:

OVM_FATAL @ 0: reporter [DCLPSQ] vc_myovc_pkg.vc_myovc_base_sequence.m_set_p_sequencer ovm_test_top.sve.top_sqr.default_seq.my_seq Error casting p_sequencer, please verify that this sequence/sequence item is intended to execute on this type of sequencer

I tried everything I could think of, but I’m completely stuck… I don’t understand how to fix this.
Note that I have no problem running myovc items from toplevel. Problem is only with sequences.

Any help would be really appreciated!
Thanks in advance!