Hi all,
This mail summarizes the status of Mantis 3213 addressing the definition of a sampled value in assertions.
It is important to make order in the description of sampling in assertions for the following main reasons:
1. Currently not only concurrent assertion variables, but also checker arguments are sampled. There are identical rules of what is sampled and what is not. E.g., automatic variables and sequence methods are not sampled. This requires repeating the sampling rules at every place they are mentioned. The coming proposals introduce more contexts where sampling should be performed, and sampling rule duplication becomes infeasible.
2. The language in the LRM describing sampling is broken, e.g.,
"The Boolean expressions used in defining a sequence or property expression shall be evaluated over the sampled values of all variables (other than local variables as described in 16.10) and the current values of local variables and of the sequence Boolean methods triggered and matched (see 16.14.6)." <-- Automatic and free checker variables are omitted
"The change (or lack of change) is determined by comparing the sampled value of the expression from the Preponed region of the current time step with the sampled value of the expression from the Preponed region of the most recent strictly prior time step in which the clocking event occurred." <-- This is incorrect for free checker variables,
etc.
3. It is impossible to apply the function $sampled to an expression without knowing the structure of this expression because some components of this expression (e.g., automatic variables) cannot be sampled. See motivation examples here: http://www.eda-stds.org/mantis/file_download.php?file_id=4950&type=bug.
The original proposal was to modify the notion of sampling to incorporate all corner cases to assertion sampling definition. This proposal was rejected because of an abuse of the term "sampling", and it was suggested to gather all subtleties of sampling definition into one place in the LRM and to refer to this section each time the sampling in assertions is mentioned. This resulted in the proposal http://www.eda-stds.org/mantis/file_download.php?file_id=4950&type=bug. This proposal introduced a notion of a concurrent context - an evaluation context for expressions in concurrent assertions and in similar places, and a new system function $concurrent which coincides with function $sampled for everything that can be sampled, and returns a current value for everything else. As a result, the function $sampled had to be deprecated, and virtually every mention of "sampled" in the LRM was changed to "concurrent". Though virtually this was the right thing to do, the proposal failed because of the objection that the users who are used to $sampled will have to start using $concurrent though in most cases the difference between the two is not important.
As a result the proposal was rewritten, still in terms of the concurrent context instead of sampling, but instead of introducing the function $concurrent the function $sampled was redefined to return a concurrent value of its argument: http://www.eda-stds.org/mantis/file_download.php?file_id=4976&type=bug. This proposal also failed because it was found misleading that the function $sampled returned a concurrent value instead the sampled one.
The situation resulted in a deadlock since different people voted for different solutions claiming that other solutions are inacceptable. To break the deadlock we listed potential alternatives and organized a straw man poll. Below the alternatives are listed along with their advantages and drawbacks.
1. Modify sampling definition as in the original proposal: sampling means using a value from the Preponed region for most of variables, and a current value for automatic, local and active free variables, and for sequence methods: http://www.eda-stds.org/mantis/file_download.php?file_id=4982&type=bug.
Advantages:
· Almost transparent for the user. No need to change the existing code, and no need to change a coding style in the future. The terminology in the common case remains the same. The required changes to the LRM are minimal. The meaning of sampled value is modified only for those data types for which the sampling was illegal before (except for active checker free variables, but using sampling in its current definition with them should be considered as a bug).
Drawbacks:
· The meaning of a sampled may become misleading since the sampling does not always mean sampling in the Preponed region any more. Note, however, that in the current LRM sampling does not always mean sampling in the Preponed region, e.g., sampling of inputs of a clocking block in an assertions is done using #1step sampling. Sampling in covergroups is defined in a completely different way than in assertions.
2. Introduce a concept of a concurrent context - an evaluation context in concurrent assertions and in similar situations such as in checker arguments. Introduce the new system function $concurrent returning value of its argument evaluated in the concurrent context. Deprecate the system function $sampled: http://www.eda-stds.org/mantis/file_download.php?file_id=4950&type=bug.
Advantages:
· The definition of sampling remains intact.
· The semantics is clean.
Drawbacks:
· The users have to get used to the new terminology, use in their new code $concurrent instead of $sampled.
· From the user point of view introducing a new terminology may not be justified because in the vast majority of cases the existing terminology reflects their intent correctly. This solution would be ideal if it had been introduced from the beginning.
· Massive changes to the LRM.
3. Same as 2, but without deprecation of the function $sampled. E.g., $sampled(static_variable) = $concurrent(static_variable) = value of static_variable in the Preponed region. $concurrent(automatic_variable) = automatic_variable, $static(automatic_variable) is illegal.
Advantages:
· The definition of sampling remains intact.
· The semantics is clean.
· Users may continue using $sampled if they want.
Drawbacks:
· The definition of $sampled is broken and cannot be used in corner cases. Leaving $sampled in the language would encourage users to use a wrong language construct.
· The new terminology is still introduced
· Massive changes to the LRM.
4. Same as 2, but instead of introducing $concurrent modify the definition of $sampled to return the value of its argument evaluated in the concurrent context: http://www.eda-stds.org/mantis/file_download.php?file_id=4976&type=bug.
Advantages:
· The definition of sampling remains intact.
· No need to change the code in the future. $sampled remains.
Drawbacks:
· The definition of $sampled becomes confusing, as $sampled means $concurrent
· The new terminology is still introduced
· Massive changes to the LRM.
5. Same as 2, but instead of deprecating $sampled make it equivalent to $concurrent.
Advantages:
· The definition of sampling remains intact.
· No need to change the code in the future. $sampled remains.
Drawbacks:
· The definition of $sampled becomes confusing.
· The situation becomes unnatural - it suggests either to deprecate $sampled or not to introduce $concurrent.
· The new terminology is still introduced
· Massive changes to the LRM.
6. Get rid of the term "sampled", use only "concurrent" throughout the LRM, but instead of introducing $concurrent, extend the definition of $sampled as explained above.
Advantages:
· No need to change the code in the future. $sampled remains.
· Less confusion with $sampled since the term "sampling" is not used anymore.
Drawbacks:
· The new terminology is still introduced
· Massive changes to the LRM.
Below are the results of the straw man poll:
Anupam For: 1 Against: 2, 3, 4, 5, 6
Ed For: 4 Against: 3, 5
Erik For: 3
Jacob For: 1, 6, 2 Against: 3, 4, 5
Laurence For: 4 Against: 5
Manisha For: 1, 4 Against: 3, 2
Samik For: 4 Against: 3, 5
Scott For: 3 Against: 4, 5, 6
Tapan For: 1, 6 Against: 3
Tom For: 3,4, 5, 2 Against: 1
Dmitry For: 1, 2 Against: 3, 4, 5, 6
The straw man poll results show that the first option seems the most attractive. Therefore I suggest to reconsider this option. I uploaded a new version of the proposal: http://www.eda-stds.org/mantis/file_download.php?file_id=4982&type=bug. Please, let me know what you think.
Thanks,
Dmitry
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Sun May 8 03:28:01 2011
This archive was generated by hypermail 2.1.8 : Sun May 08 2011 - 03:28:16 PDT