[source]

Class uvm_random_stimulus

uvm_pkg::uvm_random_stimulus <T> + blocking_put_port : uvm_blocking_put_port #(T) + type_name : string + generate_stimulus() + get_object_type(): uvm_object_wrapper + get_type(): type_id + get_type_name(): string + stop_stimulus_generation(): void

Inheritance Diagram of uvm_random_stimulus

CLASS

uvm_random_stimulus #(T)

A general purpose unidirectional random stimulus class.

The uvm_random_stimulus class generates streams of T transactions. These streams may be generated by the randomize method of T, or the randomize method of one of its subclasses. The stream may go indefinitely, until terminated by a call to stop_stimulus_generation, or we may specify the maximum number of transactions to be generated.

By using inheritance, we can add directed initialization or tidy up after random stimulus generation. Simply extend the class and define the run task, calling super.run() when you want to begin the random stimulus phase of simulation.

While very useful in its own right, this component can also be used as a template for defining other stimulus generators, or it can be extended to add additional stimulus generation methods and to simplify test writing.

Parameters

Name

Default value

Description

T

uvm_transaction

Variables

Name

Type

Description

type_name

string

blocking_put_port

uvm_blocking_put_port#(uvm_transaction)

The blocking_put_port is used to send the generated stimulus to the rest of the testbench.

Typedefs

Name

Actual Type

Description

this_type

uvm_random_stimulus#(T)

Constructors

function new ( string name, uvm_component parent ) [source]

Creates a new instance of a specialization of this class. Also, displays the random state obtained from a get_randstate call. In subsequent simulations, set_randstate can be called with the same value to reproduce the same sequence of transactions.

Functions

virtual function void stop_stimulus_generation ( ) [source]

Stops the generation of stimulus. If a subclass of this method has forked additional processes, those processes will also need to be stopped in an overridden version of this method

virtual function string get_type_name ( ) [source]

Tasks

virtual function generate_stimulus ( uvm_transaction t, int max_count ) [source]

Generate up to max_count transactions of type T. If t is not specified, a default instance of T is allocated and used. If t is specified, that transaction is used when randomizing. It must be a subclass of T.

max_count is the maximum number of transactions to be

generated. A value of zero indicates no maximum

in this case, generate_stimulus will go on indefinitely unless stopped by some other process

The transactions are cloned before they are sent out over the blocking_put_port