Re: [vhdl-200x] interface proposals

From: Daniel Kho <daniel.kho@gmail.com>
Date: Wed Dec 02 2015 - 17:12:56 PST
While the language specifies the higher level syntax feature of entities,
components, packages and possibly other design units to have a consistent
syntax, the same syntax cannot be applied to a record type.

For example, entities, components, and packages have syntax that looks like
the following:
entity anEntity is
    generic(...);
    port(...);
end entity anEntity;

package aPkg is
    ...
end package aPkg;

However, a record type's syntax looks like:
type aRecd is record
    ...
end record aRecd;

The "end record" is required by the language to close the syntax of the
record type. However, we begin the syntax with "type ... is record". This
syntax is different from entities, components, and packages.

If we want to have new syntax to describe a record view, but still want to
terminate the syntax with an "end record view", we therefore should not (in
my opinion) use syntax similar to entities, components, and packages. The
reason is because the record type syntax already terminates with an "end
record".

It makes sense therefore to extend the record type's syntax (and not syntax
following entities, components, etc.) to a record view. This way, we still
remain consistent with the rest of the language.
type aRecdView of aRecd is record view
    ...
end record aRecdView;

Cheers, Dan

On 1 December 2015 at 16:46, <tgingold@free.fr> wrote:

> ----- Mail original -----
> [...]
> > I think the syntax can accommodate both semantics:
> >
> >
> >     type BitRecType is
> >        generic(
> >           Size : Natural
> >        );
> >        record
> >           A : String (1 to Size);
> >           B : Std_Logic_Vector;
> >        end record BitRecType;
> >
> >     entity BitEntity is
> >        generic(
> >           Size  : Natural := 10;
> >           Width : Natural := 8
> >        );
> >        port(
> >           IP : in  BitRecType( B(Width - 1 downto 0) ) generic
> >           map(Size);
> >           OP : out BitRecType( B(Width - 1 downto 0) ) generic
> >           map(Size)
> >        );
> >     end entity BitEntity;
> >
> >
> > I think that the 'record_constraint' is syntactically differentiated
>
> The fact that there is two possible ways ('generic' and unconstrained
> elements) for the same higher level feature (specifying the size of
> elements) is not a good sign.
>
> You haven't answered my first question: is an 'instance' of a type
> with a generic part a new type or the same type ?
>
> Tristan.
>
>
Received on Wed Dec 2 17:13:28 2015

This archive was generated by hypermail 2.1.8 : Wed Dec 02 2015 - 17:14:08 PST