A scenario generator generates a stream of scenario objects, each of which is composed of an array of transaction objects.
Purpose : To validate the protocol that includes sequence of scenarios to be applied to the DUT.The vmm_scenario_gen macro can be used to automatically generate a scenario generator transactor for the user defined class.The resulting generator class is an extension of vmm_xactor. This macro would inturn generates a class_name_scenario class that extends vmm_data , a class_name_scenario_election class and an class_name_atomic_scenario class that extends the class_name_scenario class.
i.e.`vmm_scenario_gen ( class_name, class_description_string ) ==> Creates :
class_name_scenario_gen ==> Generator Class that interfaces with the remaining classes and generates the stream of transactions and puts it on to the channel.It provides a set of callbacks that can be used to access the scenario related information.class_name_scenario ==> Scenario Class to define a set of constraints that are written to control the randomization of the scenarios and the randomized scenarios are placed in the items[] present in scenario class.It provides a set of members that can be accessed for scenario-related-meta-data.
class_name_scenario_election ==>Scenario Election Class to help the generator in selecting one among the various scenarios defined.It provides a set of constraints for the selection process which can be overridden.class_name_atomic_scenario ==> Atomic Scenario Class defines a set of constraints for an atomic transaction,which forms the default transaction generated by the scenario generator.
Flowchart which describes the flow of the scenario generator,
Steps to be followed by the user,
2. Extending the base data_class_scenario class to add application specific scenario's.
3. Deploy them into the verification environment by adding the instance of derived_data_class_scenario class to the generator object's scenario_set[] array.
i.e
derived_data_class scen_object = new();
env.scen_gen.push_back(scen_object);
4. Specify the no_of_scenari_count or no_of_instance.
There are many ways to construct the scenario's depending on the application,.
1. Customized scenarios or constraints can be defined by having one or more derived classes of class_name_scenario class.Here entire scenario is constructed and it's items are delivered one by one to the output channel. It is a conventional method,straightforward.flexible and easy to extend.
2. Procedural type of scenarios is another method to create directed transactions. Here, transactions are not randomized until they are needed.This can achieved by extending the scenario's apply method.A procedural scenario may require runtime feedback information from the environment.i.e visibility over the environment or design signals
In the normal flow, Generator will call a scenario’s apply method automatically once the scenario has been selected and randomized. This functionality can be customized in hierarchical scenario generation by customizing the scenario’s _apply_ method based on the scenario’s requirements. (mean to say that scenario’s apply method in turn used to create further scenarios)

No comments:
Post a Comment