[sv-ec] Proposal for ERR-8 using methods in event controls


Subject: [sv-ec] Proposal for ERR-8 using methods in event controls
From: Dave Rich (David.Rich@synopsys.com)
Date: Fri Dec 12 2003 - 23:40:50 PST


In section 8.10 Event controls, REPLACE

Objects (handles) and aggregate types are not allowed.

Event control variables can include object data members, in which case the object handle is evaluated only once when the event control statement is executed. Likewise, an object data member in an event control shall block until that particular data member changes value, not when the handle to the object is modified. For example:

WITH

Event expressions must return singular values. Aggregate types may be used in an expression provided the expression reduces to a singular value. The object members or aggregate elements may be any type as long as the result of the expression is a singular value.

If the event expression is a reference to a simple object handle or
chandle variable, an event is created when a write to that variable is not equal to its previous value.

Non-virtual methods of an object handle and built-in methods or system functions for an aggregate type are allowed in event control expressions as long as the type of the return value is singular and the method is defined as a function, not a task.

Changing the value of
object data members, aggregate elements, or the size of a dynamically sized array referenced by a method or function shall cause the event expression to be re-evaluated. An implementation may cause the event expression to be re-evaluated when changing the value or size even if the members are not referenced by the method or function.

real AOR[]; // dynamic array of reals
byte stream[$]; // queue of  bytes
initial wait(AOR.size() > 0) ....; // waits for array to be allocated.
initial wait($bits(stream) > 60)...; // waits for total number of bits in stream greater than 60
Packer p = new; // Packet 1
Packet q = new; // Packet 2
initial fork
@(p.status); // Wait for status in Packet 1 to change
@ q;    // Wait for a change to handle q
# 10 p = q; // triggers @q. 
// @(p.status) now waits for status in Packet 2 to change, if not already different from Packet 1
join
-- 
--
David.Rich@Synopsys.com
Technical Marketing Consultant
http://www.SystemVerilog.org
tele:  650-584-4026
cell:  510-589-2625



This archive was generated by hypermail 2b28 : Fri Dec 12 2003 - 23:41:57 PST