Re: [vhdl-200x] Modular types

From: <tgingold@free.fr>
Date: Fri Jul 11 2014 - 09:41:17 PDT
> But if we are providing boolean and shift operators for the special
> case of modulo 2**n, then we have to do one of:
> 
> 1) restrict modular types to mod 2**n. Prohibits other legitimate
> uses.
> IMO : Just No.

Why not.

> 2) Define boolean and shift only for mod 2**n and prohibit for other
> cases. Ugly irregular language feature. IMO : No.

That's my preferred choice.  There is no obvious definition of logicals
and shift operators for not mod 2**n types.  So I suppose nobody would
use them (and we could revisit this issue at a later revision).

We have many irregular rules (shift operators are only predefined
for one-dimensional array of BIT and BOOLEAN); and I fear that
any definition of shift and logical operator for no mod 2**n would
be ugly.

> 3) Define boolean and shift only for mod 2**n and leave their
> semantics
> undefined for other cases. IMO : that would not be appropriate in
> Ada.

I agree.

> 4) Have well defined semantics for all cases, in such a way that
> efficiency and implementation burden are tolerable, and that the
> common
> 2**n case has the desired properties. IMO : this is the only
> tolerable option of the first four.

Why not, but which one ?  And how useful it would be.

> 5) Split modular types into two  : power of two, and other. IMO : too
> much complexity

We could split modular types into two using the same syntax (enumerated
types are also split into two: characters ones and the others).
No complexity here.

Strongly in favour of 2) after the Ada experience.

Regards,
Tristan.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Jul 11 09:42:02 2014

This archive was generated by hypermail 2.1.8 : Fri Jul 11 2014 - 09:42:29 PDT