It seems to me that there is no a hierachy name of a sequence.
If I want to config (using set_config_*) for a variable of a class instance inside a sequence, how can I do if I can’t get its hierachy name?
Ex:
class temp extends ovm_object;
byte a;
…
endclass
class frame_gen extends ovm_sequence #(cell_item);
temp temp_inst;
…
endclass
How can I config “a” of temp_inst inside frame_gen? Or I shouldn’t use a class instance inside a sequence?
If I have to do many things on data before sending them to driver such as framing, making delay buffer… how should I do?
Please help me!
Thanks
ctkoanh
You are right - sequences do not have a hierarchical name because they do not derive from ovm_component, and as such they have no “place” in the hierarchy. This is by design because sequences really are not structural entities - they are pure behavior.
They do not stand alone, however, and they do need to work through a structural entity in order to function. That is the job of the sequencer. Every sequence has a handle that you can get with a call to get_sequencer().
You can use this handle to call the get config functions, and use the path to the sequencer in the set config functions.
Sorry but I do not understand. Could you give me an example in which you config for an instance inside a sequence by using handle of its sequencer?
Should I put a class instance inside a sequence?
Setting control knobs in a sequencefrom the component hierarchy cannot be done directly since sequence items are not part of the hierarchy. The set_config_int configuration is only applied to objects derived from ovm_component so this mechanism cannot be used directly either.
To get this to work with sequences, the trick is to place the control variables in the sequencer - this is part of the component hierarchy so these variables can be set using either hierarchical names or the OVM configuration mechanism.
The control variables can be picked up within a sequence by using the p_sequencer handle that points to the sequencer that creates it, e.g.
Code:
max_addr = p_sequencer.max_addr;
The p_sequencer handle is created by the `ovm_sequence_utils macro and is the same type as the sequencer class so can access all of its members.
I do want to point out that you can use set_config_* for sequences it just takes a slightly different form.
For an example, I will refer you to the xbus example in these areas:
the test_lib.sv – look at the ‘test_2m_4s’ settings in the build()
the xbus_example_master_seq_lib.sv – look at the ‘loop_read_modify_write_seq’ and use of get_config_int().
The key is that the configuration ‘inst_name’ is the sequencer with the ‘field_name’ being the sequence and variable name. get_sequence_path() can be used for zeroing in all retrieving a setting.
I can make a smaller example, but this should demonstrate the idea.