[vhdl-200x-ft] Update ft25

From: John Ries <johnr_at_.....>
Date: Fri Mar 11 2005 - 10:10:45 PST
Proposal FT25 has been updated to reflect proper handling of the case
select expression not being constrained.  It also points out a dependency
between this proposal and ft22 dealing with using aggregates as choices.


-- 
-- mailto: johnr@model.com     phone: (503)685-0864
--   http://www.model.com        fax: (503)685-0921
--


IEEE 200X Fast Track Change Proposal

ID:	  FT-25

Proposer:     John Ries
email:        johnr@model.com

Status:       Open
Proposed:     05/24/04
Updated:      03/04/05
Analyzed:     
Resolved:     

Enhancement Summary:  No longing requires that one dimensional case expression have locally static subtype
Related issues:          
Relevant LRM section:    8.8

Enhancement Detail:
----------------------------
Currently the following case statement is illegal,

VARIABLE a, b, c: std_logic;

...
CASE ( a & b & c) IS
WHEN "000" => ...;
WHEN "100" => ...;
WHEN OTHERS => ...;
END CASE;

This is because of the paragraph 
"If the expression is of a one-dimensional character array type. then
the expression must be one of the following"

 omitted text

"In such a case, each choice appearing in any of the case statement
must be a locally static expression whose value is of the same length
as that of the case expression. It is an error if the element subtype
of the one-dimensional character array type is not a locally static
subtype."

As a result the code must be rewritten to use a qualified expression.
Like:


VARIABLE a, b, c: std_logic;
SUBTYPE slv3bit : std_logic_vector(0 to 2);
...
CASE slv3bit'( a & b & c) IS
WHEN "000" => ...;
WHEN "100" => ...;
WHEN OTHERS => ...;
END CASE;

Requiring the qualified expression does nothing here.
There still must be a run time check to insure that
a&b&c produces a std_logic_vector of 3 elements. 
The proposal is to strike the section:

"If the expression is of a one-dimensional character array type ..
 ...
 -- A qualified expression or type conversion whose type mark denotes a locally static subtype"

Instead the follow statement needs to be added.

If the select expression is of a one-dimesional character array type, then
all choice expressions, except the OTHERS choice, must be of the same length.
It is an error if the select expression does not evaluate to a one-dimensional
array of same length.  If the only choice is an OTHERS expression, then the
select expression can evaluate to a one-dimensional array of any length.

Because the choices, other than OTHERS, are required to be locally static
then the length check of the choices can be done at compile time. The
check on the select expression's length  can be done in many cases at
compile time or often once at elaboration time.  

There is interactions between this proposal and FT22 allowing for aggregates
to be locally static.

If the proposal for locally static composites (FT22) is accepted. We need to
handle choices that are aggregates.  The list of locally static expression in section
7.4.1 should allow aggregates as choices of a case statement only if the select expression
is
 
  - The name of an object whose subtype is locally static
  - An indexed name whose prefix is one of the members of this list and whose indexing
    expressions are locally static expressions
  - A slice name whose prefix is one of the members of this list and whose discrete range is
    a locally static discrete range
  - A function call whose return type mark denotes a locally static subtype
  - A qualified expression or type conversion whose type mark denotes a locally static subtype
  - An item in this list enclosed by parens.


Analysis: ---------------------------- 
[To be performed by the 200X Fast Track Working Group]


Resolution: ---------------------------- 
[To be performed by the 200X Fast Track Working Group]
Received on Fri Mar 11 10:15:20 2005

This archive was generated by hypermail 2.1.8 : Fri Mar 11 2005 - 10:15:45 PST