[source]

Class uvm_barrier

uvm_pkg::uvm_barrier + type_name : string + cancel(): void + create(): uvm_object + do_copy(): void + do_print(): void + get_num_waiters(): int + get_threshold(): int + get_type_name(): string + reset(): void + set_auto_reset(): void + set_threshold(): void + wait_for()

Inheritance Diagram of uvm_barrier

The uvm_barrier class provides a multiprocess synchronization mechanism. It enables a set of processes to block until the desired number of processes get to the synchronization point, at which time all of the processes are released.

Variables

Name

Type

Description

type_name

string

Constructors

function new ( string name, int threshold ) [source]

Creates a new barrier object.

Functions

virtual function void reset ( bit wakeup ) [source]

Resets the barrier. This sets the waiter count back to zero.

The threshold is unchanged. After reset, the barrier will force processes to wait for the threshold again.

If the wakeup bit is set, any currently waiting processes will be activated.

virtual function void set_auto_reset ( bit value ) [source]

Determines if the barrier should reset itself after the threshold is reached.

The default is on, so when a barrier hits its threshold it will reset, and new processes will block until the threshold is reached again.

If auto reset is off, then once the threshold is achieved, new processes pass through without being blocked until the barrier is reset.

virtual function void set_threshold ( int threshold ) [source]

Sets the process threshold.

This determines how many processes must be waiting on the barrier before the processes may proceed.

Once the threshold is reached, all waiting processes are activated.

If threshold is set to a value less than the number of currently waiting processes, then the barrier is reset and waiting processes are activated.

virtual function int get_threshold ( ) [source]

Gets the current threshold setting for the barrier.

virtual function int get_num_waiters ( ) [source]

Returns the number of processes currently waiting at the barrier.

virtual function void cancel ( ) [source]

Decrements the waiter count by one. This is used when a process that is waiting on the barrier is killed or activated by some other means.

virtual function uvm_object create ( string name ) [source]

virtual function string get_type_name ( ) [source]

virtual function void do_print ( uvm_printer printer ) [source]

virtual function void do_copy ( uvm_object rhs ) [source]

Tasks

virtual function wait_for ( ) [source]

Waits for enough processes to reach the barrier before continuing.

The number of processes to wait for is set by the set_threshold method.