[source]

Class uvm_pkg::uvm_event_base

uvm_pkg::uvm_event_base + type_name : string + cancel(): void + do_copy(): void + do_print(): void + get_num_waiters(): int + get_trigger_time(): time + get_type_name(): string + is_off(): bit + is_on(): bit + reset(): void + wait_off() + wait_on() + wait_ptrigger() + wait_trigger() uvm_pkg::uvm_event <T>

Inheritance Diagram of uvm_event_base

Copyright 2007-2010 Mentor Graphics Corporation Copyright 2007-2011 Cadence Design Systems, Inc. Copyright 2010 Synopsys, Inc. Copyright 2014 NVIDIA Corportation All Rights Reserved Worldwide

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

CLASS

uvm_event_base

The uvm_event_base class is an abstract wrapper class around the SystemVerilog event construct. It provides some additional services such as setting callbacks and maintaining the number of waiters.

Variables

Name

Type

Description

type_name

string

Constructors

new(string name = "")

Function

new

Creates a new event object.

Parameters:

name (string)

Functions

get_trigger_time()

Function

get_trigger_time

Gets the time that this event was last triggered. If the event has not been triggered, or the event has been reset, then the trigger time will be 0.

is_on()

Function

is_on

Indicates whether the event has been triggered since it was last reset.

A return of 1 indicates that the event has triggered.

is_off()

Function

is_off

Indicates whether the event has been triggered or been reset.

A return of 1 indicates that the event has not been triggered.

reset(bit wakeup = 0)

Function

reset

Resets the event to its off state. If wakeup is set, then all processes currently waiting for the event are activated before the reset.

No callbacks are called during a reset.

Parameters:

wakeup (bit)

cancel()

Function

cancel

Decrements the number of waiters on the event.

This is used if a process that is waiting on an event is disabled or activated by some other means.

get_num_waiters()

Function

get_num_waiters

Returns the number of processes waiting on the event.

get_type_name()
do_print(uvm_printer printer)
Parameters:

printer (uvm_printer)

do_copy(uvm_object rhs)
Parameters:

rhs (uvm_object)

Tasks

wait_on(bit delta = 0)

Task

wait_on

Waits for the event to be activated for the first time.

If the event has already been triggered, this task returns immediately. If delta is set, the caller will be forced to wait a single delta #0 before returning. This prevents the caller from returning before previously waiting processes have had a chance to resume.

Once an event has been triggered, it will be remain "on" until the event is reset.

Parameters:

delta (bit)

wait_off(bit delta = 0)

Task

wait_off

If the event has already triggered and is "on", this task waits for the event to be turned "off" via a call to reset.

If the event has not already been triggered, this task returns immediately. If delta is set, the caller will be forced to wait a single delta #0 before returning. This prevents the caller from returning before previously waiting processes have had a chance to resume.

Parameters:

delta (bit)

wait_trigger()

Task

wait_trigger

Waits for the event to be triggered.

If one process calls wait_trigger in the same delta as another process calls <uvm_event#(T)::trigger>, a race condition occurs. If the call to wait occurs before the trigger, this method will return in this delta. If the wait occurs after the trigger, this method will not return until the next trigger, which may never occur and thus cause deadlock.

wait_ptrigger()

Task

wait_ptrigger

Waits for a persistent trigger of the event. Unlike wait_trigger, this views the trigger as persistent within a given time-slice and thus avoids certain race conditions. If this method is called after the trigger but within the same time-slice, the caller returns immediately.