[sv-ac] question about classes as local variables in properties and sequences

From: Kulshrestha, Manisha <Manisha_Kulshrestha_at_.....>
Date: Tue Jul 11 2006 - 11:41:08 PDT
Hi All,
 
I have few questions regarding usage of classes in assertions:
 
1. Currently LRM does not allow the boolean expressions in assertions to
have class as per section 17.4.1. But there is no restriction on having
a local variable as a class. So, is it allowed to have a local variable
of type class in the assertion expression ? 
 
2. Currently section 17.4.1 lists all the types which are not allowed to
be in the boolean expressions. What are the main reasons for this
restriction ? Is it mainly driven by sampling issues or there are other
issues ?
 
3. Consider the following example with a local variable of type class
(called myClass. myClass has a data member called myData):
 
sequence S;
  myClass lv;
 
(a, lv = new()) ##1 ((seq1, lv.myData = 0) or (seq2, lv.myData = 1)) ##1
(d, $display("value of myData is %b", lv.myData));
 
endsequence
 
As per LRM section 17.8, each branch of 'or' should have its own copy of
lv and assign to it. But here, there is only one 'new' on lv so both the
branches of 'or' will refer to the same local variable (because lv
behaves like a pointer).
 
Currently LRM does not clarify how copies of the variables should be
created in case of branching for classes and other objects which behave
like pointers. 
 
Any inputs ?
 
Thanks.
Manisha
 
Received on Tue Jul 11 11:41:18 2006

This archive was generated by hypermail 2.1.8 : Tue Jul 11 2006 - 11:41:27 PDT