Re: [vhdl-200x-ft] Generics in floating point packages

From: David Bishop <dbishop@server.vhdl.org>
Date: Sun Nov 07 2004 - 07:27:52 PST

Jim Lewis wrote:

> David,
>
>>> It would seem to make more sense if the generic
>>> package were named fphdl_pkg rather than fphdl32_pkg.
>>>
>>> Since we are stepping into the void with generic types,
>>> should we also consider using records of unconstrained
>>> arrays as the base?
>>
>> 2 basic problems with records:
>> 1: You can't have an unconstrained array in a record,
>> though the new generics get around that nicely.
>
> Like type generics and generics on packages, unconstrained
> arrays in records is proposed in fast track.

Which would require a complete redesign of these packages.

"There comes a point in every project when it becomes necessary
to shoot the Engineering staff".

I'm looking forward to being shot, or at least finished. Remember
we are getting close here.

>> 2: It doesn't look like a "number" any more. Thus it would
>> be tougher to deal with on a conceptual basis.
>>
>> I really think that I've come up with a fairly elegent solution
>> to floating and fixed point with the negative index trick. Can
>> you think of a better way?
>
> So far we agree on what happens if the range is downto, but
> do not agree on what happens when the range is to, hence,
> I have a little concern. Records would remove this, however,
> in some ways, it does not look as much like a number,
> particularly for fixed point.

This is a problem fixed point package. I can still put in a fix
so that you get an error if you use the "to" direction. Right now I
just ignore it and reverse the range, thus:
ufixed (-1 to 7) becomes ufixed (7 downto -1) internally.

In the floating point package the number is fixed because the type
definition is built into the
package with:

type fp is floating_point (fp_fraction_width downto -fp_exponent_width);

So this isn't an issue there.

-- 
NAME:     David W. Bishop           INTERNET: dbishop@vhdl.org
Received on Sun Nov 7 07:27:52 2004

This archive was generated by hypermail 2.1.8 : Sun Nov 07 2004 - 07:27:55 PST