Sunday, May 18, 2008

Scenario Generator

What is Scenario generator ?

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,

1. The user is expected to create an instance of the scenario generator class in their verification environment.
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

3. Hierarchical scenario generation, “Scenarios that can be described in terms of other scenarios”.

For example,

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)

The customization can include the selection of the scenario already present in the generator’s scenario_set[] and randomization of those scenarios . The final outcome of this process would be a stream of sequenced scenarios in single scenario’s item[].

Atomic Generator

What is Atomic generator ?
An atomic generator is a process of generating a single instance of random data object or transaction at a time.


Purpose :
To validate the protocol/to reach the functional coverage space, that does not depend on any specific sequence.

The vmm_atomic_gen macro can be used to automatically generate an atomic generator transactor for the user defined clas.The resulting generator class is an extension of vmm_xactor.
i.e

`vmm_atomic_gen ( class_name, class_description_string ) ==>
Creates class class_name_atomic_gen (see below)

class class_name_atomic_gen extends vmm_xactor;

The properties and methods of atomic generator are,

function new ( string instance, int stream_id = -1,
class_name_channel out_chan = null );

class_name_channel out_chan;

int unsigned stop_after_n_insts;

class_name randomized_obj;

enum { GENERATED };

enum { DONE };

virtual task inject ( class_name data, ref bit dropped );


Flow Chart which describes the internal operation of the atomic generator, This flow chart is drawn based on our understandings by working on various examples, SNUG papers and rvm/vmm manual.





Sunday, May 11, 2008

Objectives

The purpose of this blog is to have a snapshot of the detailed understandings of Atomic Generator , Scenario Generator and going ahead more on certain VMM utilities and SV constructs based on our understandings.

About Me

It's better we can say it's about us,since I and aravinda together joined CDAC -HYDERABAD to do our PG Diploma in VLSI Design and We are working in VLSI industry since more than 5 years