RE: EXTERNAL: Re: [vhdl-200x] Sizing of variables and signals from initial values

From: <ryan.w.hinton@L-3com.com>
Date: Thu Apr 25 2013 - 13:38:59 PDT
Andy:

I'm lost.  Can you provide an example?  The richer the example, the
better I will understand your suggestion.

- Ryan

-----Original Message-----
From: owner-vhdl-200x@eda.org [mailto:owner-vhdl-200x@eda.org] On Behalf
Of Jones, Andy D
Sent: Thursday, April 25, 2013 2:28 PM
To: vhdl-200x@eda.org
Subject: RE: EXTERNAL: Re: [vhdl-200x] Sizing of variables and signals
from initial values

Jim,

I am not at all in favor of target-sized function results. There are too
many areas where ambiguity will kill it anyway (as in your example). 

I prefer the general model provided by integer expressions/assignments
(and to a lesser degree, by fixed point): 

Evaluate the expression at some larger size/range such that numerical
accuracy is preserved, and then take care of any resizing/retyping only
when needed for assignment (implicitly in the case of the synthesis view
of integer assignments). If one needs to limit intermediate results'
size/range, then that must be handled explicitly (as it should be, since
accuracy is potentially compromised).

Using the integer model, a potential implementation would be to consider
an assignment statement as an infix procedure call that could be
overloaded to automatically resize/convert the RHS to match the LHS. 

For example, a package could implement mixed sfixed/ufixed operators
(and ufixed subtraction) that always return sfixed. The package could
also overload the assignment procedures to convert/resize sfixed back to
ufixed and assert numerical accuracy. 

You could even create overloads to assign integer/natural/real into
ufixed/sfixed objects, and assert accuracy while doing so.

Some current uses statically convey the LHS size/type to the RHS when
using 'others' or anonymous expressions. Maybe we can leave this static
conveyance of information in the language, such that these special
procedures retain the current capabilities.

Also, aggregate expressions must be allowed on the out port of these
procedures, otherwise LHS aggregates would not work. I'm not sure
exactly how that would be implemented; with an implicit signal/variable?

Assignment procedure implementations would also be prohibited from
containing wait statements.

This would be FAR better than target-sized results, IMHO.


Andy D Jones
Electrical Engineering
Lockheed Martin Missiles and Fire Control
Dallas TX

p.s. I just thought about the (overflow, count) ufixed idea last night
and have not been able to try it yet. 

On the other hand, ufixed subtraction appears to roll over regardless of
fixed_overflow_style. Is that a bug, or was it intended?






-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Apr 25 13:39:57 2013

This archive was generated by hypermail 2.1.8 : Thu Apr 25 2013 - 13:40:03 PDT