RE: [vhdl-200x] A compromise about modular type, boolean operations, integers...

From: <whygee@f-cpu.org>
Date: Thu Oct 23 2014 - 06:47:13 PDT
Le 2014-10-23 09:42, Martin.J Thompson a écrit :
> Hi YG,

Hello,

> So would the syntax for part B be something like:
> 
> subtype integer4 is integer range 0 to 3
> subtype modular4 is integer modular 0 to 3
> 
> Where integer4 would trap on overflow and modular4 would wrap?

Yes, that's the direct consequence of the new proposition.

The new keyword is added to the language to specify the new behaviour,
which can/could be internally encoded in the same variable
(or record element) as the 'ascending/'descending attribute
(if it was not packed into a boolean).
So the new proposition would also create a new 'modular boolean 
attribute.

Arrays still use the existing range mechanism, which is
directly compatible with the modular version.
Just check indices against the 'low and 'high, nothing new.
But you can't define an array with a modular index.

If the range is 0 to 2^N-1, the integer can further be marked
with a corresponding (sub-)attribute that allows Boolean/Shift 
operations
(prevents trapping or warning). I can't find a suitable
attribute name, 'pow2 doesn't sound good. Any idea ?

"range" is also a composite type. A "modular" integer would provide
the 'range attribute (with a range type) just like a normal
range'd integer. It does not seem to make sense to create a "modular" 
type
that mirrors the "range" type, in this case.


Does that make sense ?

> Thanks,
> Martin
YG

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Oct 23 06:47:38 2014

This archive was generated by hypermail 2.1.8 : Thu Oct 23 2014 - 06:48:44 PDT