I need to implement new infrastructure, will describe the requirements.
An associative array: key = string, value = name of sequence (string) - which represents the sequence name, which can run on a specific sequencer.
The sequences will be running on different sequencers in the system (various IPs in the SoC).
How do you suggest implementing this?
I need to write a task/function which for a given string, it takes the matching string from the associative array (sequence name) and runs it on the correct sequencer.
Though on using virtual sequencer or virtual sequence.
But not sure how to re-create the proper sequence from it’s name, and launch it on the correct sequencer.
You can use the UVM factory’s create_object_by_name() if you have the registered name of the sequence. If you have parameterized sequences, there is no registered string name, but you can create one with an associative array. It wasn’t clear if each sequence had a dedicated sequencer to run on or if the sequence here was selected when the task was called. I’m going to assume it’s passed to the task, but you could make another associative array to store the sequencers you want to select from.
Was not familiar with the UVM Factory’s “create_object_by_name”. However later in the task you used “create_object”, is it the same?
I have edited my original post, and will elaborate more.
The sequencer is not passed as an argument to the task.
It is required to support “registering of sequence and sequencer” to this component database, based on possible scenarios of a specific test.
Probably will be done before the run_phase of the test.
The component should be instantized in the ENV class.
So when monitored specific events during the simulation run, it should start one of these registered sequences, using the API functions/tasks of this component.
I provided a link to the definition of create_object_by_name but no example since it is relatively straightforward. The uvm_object_wrapper::create_object requires an extra step but accomplishes the same factory object creation. I prefer using the uvm_object_wrapper because it can be more efficient for repeated creation, and works for both parameterized and unparameterized classes. The UVM wrapper is known as a proxy object or lightweight object for the actual class you want to create.