Sequence Arbritary

I am trying to put arbritary in my sequence. but the simulator i showing syntax error near p sequencer declaration.

Here is my sequence

class adder_sequence extends uvm_sequence#(adder_transaction);

`uvm_object_utils(adder_sequence)

`uvm_declare_p_sequencer(adder_sequencer)

 function new(string name = "");
  super.new(name);
 endfunction: new
  
   seq1 s1;
   seq2 s2;
   seq3 s3;

task body();

p_sequencer.set_arbitration(SEQ_ARB_RANDOM);  

repeat(5) begin
 
        fork
          `uvm_do(s1);
          `uvm_do(s2);
          `uvm_do(s3);
        join
 end

endtask

endclass

Thanks in advance

In reply to swatisatpathy10:

There is never a need to use p_sequencer. Use m_sequencer instead.

Refer to the UVM Cookbook article on Sequences/Arbitration.

In reply to cgales:

hi cgales

i include m_sequencer.set_arbitration(arb_type);
in place of p_sequencer.set_arbitration(SEQ_ARB_RANDOM);

but now i am getting this error as

Error-[IND] Identifier not declared
adder_sequence.sv, 52
Identifier ‘SEQ_ARB_RANDOM’ has not been declared yet. If this error is not
expected, please check if you have set `default_nettype to none.

In reply to swatisatpathy10:

Hi,

Error says that ‘SEQ_ARB_RANDOM’ is not a valid identifier. To check if the name is correct or not, you can go to UVM source files and grep for the text ‘SEQ_ARB_RANDOM’. Use UVM_SEQ_ARB_RANDOM.

In reply to swatisatpathy10:

I’m not sure what you want to execute randomly. Is it the 3 sequences you are starting in your fork-join or do you look for the execution of the sequence items?.
The 3 sequences are executed in random order anyway.

In reply to swatisatpathy10:

For UVM 1.1d, you should use SEQ_ARB_RANDOM. If you are (inadvertently) using UVM 1.2, then it has changed to UVM_SEQ_ARB_RANDOM.

In reply to MayurKubavat:

Hi Mayur,

Thank you for your suggestion. Now my code is working.

But i have a question that, here i am setting the sequencer, is it is mandatory to getting it by using get_sequencer method