RE: [vhdl-200x-ft] Generic packages and Generic Subprograms

From: Bailey, Stephen <SBailey@model.com>
Date: Fri Dec 24 2004 - 10:04:49 PST

All,

There has been a fair amount of discussion on this subject with my name
included. So, here's my two cents:

1. I want the generic enhancements in VHDL.

2. The specific syntax is of relatively minor importance to me as long
as the syntax does not limit the functionality.

3. I do have preferences, but the important one is that we should not
make the verbosity of VHDL worse than it is. (Which is not the same as
saying that we should make it unreadable either. So, please no comments
about that ;-)

A couple of things to consider:

A. Entities are instantiated and connected statically.

B. (Generic) packages are also instantiated and used statically. But,
its subprogram contents are dynamically elaborated and shared variables
are as dynamic as they come. If we refer back to Ada, it has been many
years since I wrote Ada code, but I believe the generic clause for
packages is prior to the *package* keyword.

C. Generic subprograms are statically instantiated. But, used
dynamically (elaborated dynamically). Thus, the generics for a
subprogram are distinct from the parameters.

Perhaps the static instantiation/elaboration vs. dynamic elaboration
should be a consideration in whether the generic and parameter lists are
placed lexically one after the other? Or maybe that's too fine a point
for average users to make a mental connection.

My Bottomline:
Come up with something that works and isn't unnecessarily verbose and
I'll back it.

-Steve Bailey

> Peter,
> With the generic clause following the generic package and the
> generic clause preceding the generic procedure/function,
> seems to lead to some interesting syntax errors.
>
>
> Case 1:
> Generics on package and subprogram (no issues, baseline case)
> ------------------
>
> package a_generic_pkg is
> generic(type pkg_type) ;
>
> generic(type fun_type)
> function a_generic_fun(L: pkg_type) return fun_type ; end
> a_generic_pkg ;
>
>
> Case 2:
> Generics on package and but not on subprogram
> Issue: If leave off ";", then the generic belongs to
> the function and not the package.
> ------------------
> library ieee ;
> use std_logic_1164.all ;
> package a_generic_pkg is
> generic(type pkg_type) ;
>
> function a_generic_fun(L: pkg_type) return
> std_logic_vector ; end a_generic_pkg ;
>
>
> Case 3:
> Generics not on package and on subprogram
> Issue: If add ";", then the generic belongs to
> the package and not the function.
> ------------------
> library ieee ;
> use std_logic_1164.all ;
> package a_normal_pkg is
>
> generic(type fun_type)
> function a_generic_fun(L: fun_type) return
> std_logic_vector ; end a_normal_pkg ;
>
>
>
> At one point in time I think there was a goal to keep a
> hamming distance between correct functionality.
> Should we consider moving the generic clause for the package
> before the package like the subprogram or alternately should
> we consider moving the generic clause to after the subprogram
> declaration.
>
> Cheers,
> Jim
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Jim Lewis
> Director of Training mailto:Jim@SynthWorks.com
> SynthWorks Design Inc. http://www.SynthWorks.com
> 1-503-590-4787
>
> Expert VHDL Training for Hardware Design and Verification
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
Received on Fri Dec 24 10:04:55 2004

This archive was generated by hypermail 2.1.8 : Fri Dec 24 2004 - 10:04:58 PST