Jump to content

ovm /UVM EA to uvm1.0 conversion


Recommended Posts

I am trying convert my UVM 1.0ea code to UVM 1.0

but not sure how to convert follwoing code which is using get_sequence, get_seq_kind which are now deprecated in 1.0

task myseq::body();

uvm_sequence_base s;

s = get_sequence(get_seq_kind(“myseqâ€));

s.start();

…

endtask

They say use get_squences along with uvm_sequence library for above but not sure how to use it sensibly and not many changes

It would be great help if some one could give solution with some example code

Thanks

Link to comment
Share on other sites

Thanks,

Yes this code also works for simple example mentioned

but I guess it would be bit inefficient

I am actually looking for solution using uvm_sequence_library and get_sequnces method which is sugested by one of ovm_to_uvm migration document and replacement for get_seuence_kind and get_sequence methods

Also my requirement is bit different than mentioned example which is as follows here only one sequnence is created and would be efficient in terms of performance

task start_my_seq(string my_id,);

string seq_name;

uvm_sequence_base tmp_seq;

my_seq1 seq1;

my_seq2 seq2;

my_seq3 seq3;

case(my_id)

"run_seq1": begin name = "my_seq1" ; end

"run_seq2": begin name = "my_seq2" ; end

"run_seq3": begin name = "my_seq3" ; end

endcase

tmp_seq = sequencer.get_sequence(sequencer.get_seq_kind(name) );

case(my_id)

"run_seq1": begin $cast(seq1, tmp_seq); seq1.start(sequencer); end

"run_seq2": begin $cast(seq2, tmp_seq); seq2.start(sequencer); end

"run_seq3": begin $cast(seq,3 tmp_seq); seq.3start(sequencer); end

endcase

endtask

hi,

what about

task myseq::body();
uvm_sequence s = myseq::type_id::create("sequence");
s.start();

im assuming that "myseq" is the type and that the sequence has been registered with the name.

regards

/uwe

Link to comment
Share on other sites

hi,

the code you have has many flaws starting with extensability, type safety, length and probably more but still you could do the following:

// the code DOESNT run - it only compiles and shows 
module test85;
   import uvm_pkg::*;
   `include "uvm_macros.svh"

   task bla(uvm_object_wrapper seq);
       uvm_sequence s;
       uvm_object o = seq.create_object("seq");
       assert($cast(s,o)) else $fatal("supplied object is not a sequence");
       s.start(null);
   endtask

   class myseq extends uvm_sequence;
       `uvm_object_utils(myseq)
       function new (string name = "myseq");
           super.new(name);
       endfunction 
   endclass 

   initial begin
          bla(myseq::get_type());
   end

endmodule

i'm not sure if the double lookup ("run-seq1" -> "my-seq1" -> then type) is a good solution - i'd rather avoid the case graves, string mappings and searches

/uwe

Link to comment
Share on other sites

//sequence definitions

class myseq extends uvm_sequence #(your_item);

`uvm_object_utils(myseq)

.....

endclass

function void mytest::specific_phase(uvm_phase phase)

s = myseq::type_id::create("sequence",this);

uvm_config_seq::set(this,"seqr","default_seq",myseq);

.....

endfunction

Link to comment
Share on other sites

forgot to mention, code I sent I neither tried to compile or run any of simultator

also forgot to put "...." in between code lines

and is cut down version of large code base

I am aware of "run-seq1" -> "my-seq1"->type but have to live with it and is totally unavoidable,

I am trying to get example, solution on uvm_sequence_library and get_sequences uses

hi,

the code you have has many flaws starting with extensability, type safety, length and probably more but still you could do the following:

// the code DOESNT run - it only compiles and shows 
module test85;
    import uvm_pkg::*;
    `include "uvm_macros.svh"
    
    task bla(uvm_object_wrapper seq);
        uvm_sequence s;
        uvm_object o = seq.create_object("seq");
        assert($cast(s,o)) else $fatal("supplied object is not a sequence");
        s.start(null);
    endtask
    
    class myseq extends uvm_sequence;
        `uvm_object_utils(myseq)
        function new (string name = "myseq");
            super.new(name);
        endfunction 
    endclass 
    
    initial begin
           bla(myseq::get_type());
    end
            
endmodule

i'm not sure if the double lookup ("run-seq1" -> "my-seq1" -> then type) is a good solution - i'd rather avoid the case graves, string mappings and searches

/uwe

Link to comment
Share on other sites

Not sure how your code will work with multiple seuence type

e.g. my_seq1, my_seq2 etc. perticularly, for following

uvm_object o = seq.create_object("seq");

task "bla" might need one more argument for sequence name string

task bla(uvm_object_wrapper seq, string seq_name );

uvm_sequence s;

uvm_object o = seq.create_object(seq_name); assert($cast(s,o)) else $fatal("supplied object is not a sequence");

s.start(null);

endtask

will t

forgot to mention, code I sent I neither tried to compile or run any of simultator

also forgot to put "...." in between code lines

and is cut down version of large code base

I am aware of "run-seq1" -> "my-seq1"->type but have to live with it and is totally unavoidable,

I am trying to get example, solution on uvm_sequence_library and get_sequences uses

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.

Guest
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...