Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Emulating floating point

Reply
Thread Tools

Emulating floating point

 
 
gthorpe@ee.ryerson.ca
Guest
Posts: n/a
 
      08-25-2005
Hi,

I would like to convert an algorithm that uses floating point ('real' and it's
subtypes defined by me) into a fixed point version so that the design that
uses the algorithm can be synthesize-able (the synopsys tool I am going to use
cannot synthesize 'real' and it seems no tools can do this yet).

First, I plan to make a package for a type based on std_ulogic_vector which
will store the unsigned versions of the whole and fractional part of the
corresponding 'real'. Are there already packages out there to for this type
of conversion or should I continue writing my own? If the latter, is this the
right approach/what are alternate approaches?

I will appreciate any pointers.
 
Reply With Quote
 
 
 
 
David Bishop
Guest
Posts: n/a
 
      08-25-2005
wrote:
> Hi,
>
> I would like to convert an algorithm that uses floating point ('real' and it's
> subtypes defined by me) into a fixed point version so that the design that
> uses the algorithm can be synthesize-able (the synopsys tool I am going to use
> cannot synthesize 'real' and it seems no tools can do this yet).
>
> First, I plan to make a package for a type based on std_ulogic_vector which
> will store the unsigned versions of the whole and fractional part of the
> corresponding 'real'. Are there already packages out there to for this type
> of conversion or should I continue writing my own? If the latter, is this the
> right approach/what are alternate approaches?
>
> I will appreciate any pointers.


you will find synthesizable packages for fixed and floating point at:
http://www.eda.org/vhdl-200x/vhdl-20...ges/files.html

I've had some success with Synopsys. You may need to tweek a few functions.
 
Reply With Quote
 
 
 
 
Gary Thorpe
Guest
Posts: n/a
 
      08-26-2005
David Bishop wrote:
> wrote:
>
>> Hi,
>>
>> I would like to convert an algorithm that uses floating point ('real'
>> and it's subtypes defined by me) into a fixed point version so that
>> the design that uses the algorithm can be synthesize-able (the
>> synopsys tool I am going to use cannot synthesize 'real' and it seems
>> no tools can do this yet).
>>
>> First, I plan to make a package for a type based on std_ulogic_vector
>> which will store the unsigned versions of the whole and fractional
>> part of the corresponding 'real'. Are there already packages out there
>> to for this type of conversion or should I continue writing my own? If
>> the latter, is this the right approach/what are alternate approaches?
>>
>> I will appreciate any pointers.

>
>
> you will find synthesizable packages for fixed and floating point at:
> http://www.eda.org/vhdl-200x/vhdl-20...ges/files.html
>
> I've had some success with Synopsys. You may need to tweek a few
> functions.


Thank you very much! About what time frame will the newest standard
(with these packages or related packages) be available?

I will be testing it out in the coming week, is there anywhere I
can/should send feedback?
 
Reply With Quote
 
Gary Thorpe
Guest
Posts: n/a
 
      09-01-2005
David Bishop wrote:
> wrote:
>
>> Hi,
>>
>> I would like to convert an algorithm that uses floating point ('real'
>> and it's subtypes defined by me) into a fixed point version so that
>> the design that uses the algorithm can be synthesize-able (the
>> synopsys tool I am going to use cannot synthesize 'real' and it seems
>> no tools can do this yet).
>>
>> First, I plan to make a package for a type based on std_ulogic_vector
>> which will store the unsigned versions of the whole and fractional
>> part of the corresponding 'real'. Are there already packages out there
>> to for this type of conversion or should I continue writing my own? If
>> the latter, is this the right approach/what are alternate approaches?
>>
>> I will appreciate any pointers.

>
>
> you will find synthesizable packages for fixed and floating point at:
> http://www.eda.org/vhdl-200x/vhdl-20...ges/files.html
>
> I've had some success with Synopsys. You may need to tweek a few
> functions.


I get these errors using 'ncvhdl -v93' (05.40-s00 when compiling
fixed_pkg_c.vhd:

VALUE (VALUE'range) := (others => 'U');
|
ncvhdl_p: *W,WAGNOOT (fixed_pkg_c.vhd,5865|33): OTHERS choice not
allowed in this context [7.3.2.2].
VALUE (VALUE'range) := (others => 'U');
|
ncvhdl_p: *W,WAGNOOT (fixed_pkg_c.vhd,5912|33): OTHERS choice not
allowed in this context [7.3.2.2].

[more similar errors on lines with the same problem]

I corrected these by using "VALUE := ((VALUE'range)=>'U');" instead of
the offending line. I don't know if this is helpful for the pending VHDL
standard, or even the VHDL'93 standard (could be just this tool).

I got these errors when compiling fixed_synth.vhd:

variable in1min2 : sfixed (SFixed_high(in1reg3, '*', in2reg3) downto
|
ncvhdl_p: *E,ILSGRD (fixed_synth_custom.vhd,105|49): illegal reference
of a signal (IN1REG3) during static elaboration [12.3].
variable in1min2 : sfixed (SFixed_high(in1reg3, '*', in2reg3) downto
|
ncvhdl_p: *E,ILSGRD (fixed_synth_custom.vhd,105|63): illegal reference
of a signal (IN2REG3) during static elaboration [12.3].
SFixed_low(in1reg3, '*', in2reg3));
|
ncvhdl_p: *E,ILSGRD (fixed_synth_custom.vhd,106|4: illegal reference
of a signal (IN1REG3) during static elaboration [12.3].
SFixed_low(in1reg3, '*', in2reg3));
|
ncvhdl_p: *E,ILSGRD (fixed_synth_custom.vhd,106|62): illegal reference
of a signal (IN2REG3) during static elaboration [12.3].


It seems that it doesn't like using signals to define variables: perhaps
sfixed16 could be used to get the ranges instead?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
floating point problem... floating indeed :( teeshift Ruby 2 12-01-2006 01:16 AM
converting floating point to fixed point H aka N VHDL 15 03-02-2006 02:26 PM
floating point to fixed point conversion riya1012@gmail.com C Programming 4 02-22-2006 05:56 PM
Fixed-point format for floating-point numbers Motaz Saad Java 7 11-05-2005 05:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57