Re: [sv-bc] Partial proposal for issue #091

From: <Shalom.Bresticker@freescale.com>
Date: Mon Aug 23 2004 - 05:44:51 PDT

Hi.

I don't know about SV, but in 1364-2001, the type of expression you can
assign a parameter in a parameter declaration is more restricted than
the type of expression you can use in a module instance parameter override.

The expression used in a parameter declaration is constant_expression,
which has certain restrictions. For example, you can not use a
hierarchical reference there. However, you can in a module instance
parameter assignment. See 1364 ETF issue #272.

Shalom

On Mon, 23 Aug 2004, Jacobi, Dan wrote:

> This proposal intends to solve the first part of the problem described
> in
> <http://www.eda.org/svdb/bug_view_page.php?bug_id=0000091>
> http://www.eda.org/svdb/bug_view_page.php?bug_id=0000091
> "$typeof function as used in 23.2 is not fully supported in the BNF"
>
> Motivation
> ========
> The example in section 23.2 in the (original) SV 3.1a LRM uses the
> $typeof system function to set the default type of a type parameter:
> Example 1:
> bit [12:0] A_bus, B_bus;
> parameter type bus_t = $typeof(A_bus);
>
> Also we would like to enable the override of type parameters using the
> $typeof system function such as:
> Example 2:
> son #( .son_type_param($typeof(A_bus) ) myson (...);
>
> Section 23.2 also reads:
> "The $typeof system function returns a type derived from its argument.
> The data type returned by the
> $typeof system function may be used to assign or override a type
> parameter, or in a comparison with another
> $typeof, evaluated during elaboration."
>
> However the BNF does not enable the usage of the $typeof system function
> to assign a type parameter value as shown in example 1 (Note that it
> does permit the overriding of the type parameters as shown in example 2)
>
> The type parameter type declaration BNF reads :
>
> A.2.2.1
> parameter_declaration ::=
> parameter data_type_or_implicit list_of_param_assignments
> | parameter type list_of_type_assignments
> A.2.3
> list_of_type_assignments ::= type_assignment { , type_assignment }
> A.2.4
> type_assignment ::= type_identifier = data_type
>
>
> Note that the parameter override as shown in example 2 is enabled using
> the following rules from the BNF
>
> A.4.1.1
> ordered_parameter_assignment ::= param_expression
> named_parameter_assignment ::= . parameter_identifier ( [
> param_expression ] )
> A.8.3
> param_expression ::= mintypmax_expression | data_type
> the mintypmax_expression token eventually reduces the system function
> call rule
>
>
> Proposal
> =======
>
> Under section A.2.4
>
> REPLACE
> type_assignment ::= type_identifier = data_type
> WITH
> type_assignment ::= type_identifier = data_type
> | type_identifier = $typeof ( expression )
> | type_identifier = $typeof ( data_type )
>
> * Equal signs = parentheses () and the sequences $typeof or all in bold
>
>
> Notes
> =====
> this proposal will also enable V2K style module declarations with type
> parameters such as
> module m1 #( $typeof(A_bus) ) (input ....)
>
> and the usage of the $typeof system function to declare type parameters
> in class, program and interface declarations as well.
>
>
>
> Thanks,
> Dan Jacobi, Intel Corporation
> 972-4-8655855
>
>

-- 
Shalom Bresticker                        Shalom.Bresticker @freescale.com
Design & Reuse Methodology                           Tel: +972 9  9522268
Freescale Semiconductor Israel, Ltd.                 Fax: +972 9  9522890
POB 2208, Herzlia 46120, ISRAEL                     Cell: +972 50 5441478
  
[ ]Freescale Internal Use Only      [ ]Freescale Confidential Proprietary
Received on Mon Aug 23 05:45:02 2004

This archive was generated by hypermail 2.1.8 : Mon Aug 23 2004 - 05:45:08 PDT