Re: [sv-ac] Question about reference to data defined in sequence.


Subject: Re: [sv-ac] Question about reference to data defined in sequence.
From: dudani@us04.synopsys.com
Date: Thu Feb 06 2003 - 08:18:36 PST


Hi Adam,
You have raised some good point about templates. Although it is not clear
from the LRM, there are a few points to be noted, which differentiate it
from a function/task and `define.
1) The description of template must be syntactically correct. That is, it
must follow all the syntactic rules of the statements used within the template.
2) When template is instantiated, the actual arguments are "syntactically
substituted" in the template. That is, only some syntactic entities are
allowed to be substituted. It is not a free form textual substitution, like
in a macro.
3) Syntactic entities permitted to be substituted are:
     - a bool,sequence or property name in an expression
     - sequential or boolean expressions (includes just variables)
4) After substitution, the expanded template must be semantically correct (
but does not need any parsing again)
5) Templates are named object and create a hierarchical scope

I would propose to remove the optional specification of types for the
arguments, as we do not have type names for all the allowed formal
arguments to templates.
Please let me know if I have missed anything out.
Surrendra

At 10:04 AM 2/6/2003 -0600, you wrote:

>Good morning all;
>
>
>I have had time to think more about templates and have read the rest of the
>discussion to date.
>
>I agree with Jay that templates as being talked about are more powerful
>than just
>for assertion inclusion. Scheme has a similar concept of a first class
>substitution
>facility in their language.
>
>But the fact that it is a textual substitution facility will bring up many
>more
>questions and comments of the necessity:
>
>1. Any syntax defined within the template must be compatible with the rest of
>the language. E.g defining a sequence/bool/formula must be allowed in a module
>scope, and in a procedural scope (of which declarations are restricted.)
>
>2. Generate statements are limited to module level scope - you can not
>generate
>code within a procedural context - you can generate procedural contexts
>(multiple
>always blocks, etc.)
>
>3. As a textual substitution, why then limit the language that can be
>placed in
>there? As Jay pointed out, why can't I include other code?
>
>4. The inclusion of procedural statements within a template, must now be
>supported
>in a module scope. Similarly, clocked block declarations must be supported
>in all
>procedural scopes.
>
>5. To date all textual substitition is explicitly defined. You must have
>the "`" mark
>in front of text to indicate substitution. The template substutution is
>not so marked.
>While this does not create problems, it is a difference from the current
>tradition.
>
>I will go back to Scheme and review their facilities - I brought this up
>when generate
>statements were discussed for 1364-2001.
>
> THanks.
>
> Adam Krolnik
> Verification Mgr.
> LSI Logic Corp.
> Plano TX. 75074
>

**********************************************
Surrendra A. Dudani
Synopsys, Inc.
377 Simarano Drive
Suite 300
Marlboro, MA 01752

Tel: 508-263-8072
Fax: 508-263-8123
email: dudani@synopsys.com
**********************************************



This archive was generated by hypermail 2b28 : Thu Feb 06 2003 - 08:20:04 PST