Jump to content

passing sequence name on command line at run time

Recommended Posts

You can, but not directly. When you register a parameterized class with the factory using the the `uvm_object_param_utils macro, it does not register a string name with the factory, only by type. Therefore you can only create or override these classes by type. I see two possible options:

  • You create your own string mappings using an associate array.

    uvm_object_wrapper type_lookup_by_string[string];type_lookup_by_string = '{"myseq1_4":myseq#(1,4)::get_type(),                                        "myseq2_8":myseq#(2,8)::get_type()};...factory.create_object_by_type(type_lookup_by_string["myseq2_8"],...);
  • You register the class with the factory using the uvm_object_registry class and provide a string mapping there. See the probe class in my DVCon paper.

    class myseq #(int A, extends uvm_sequence;typedef uvm_object_registry #(myseq#(A,),$sformatf("myseq%0d_%0d",A,) type_id;...factory.create_object_by_name("myseq2_8",...);
Link to comment
Share on other sites

  • 8 years later...

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