Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20733 Discussions

Floating point custom instruction in nios2

Altera_Forum
Honored Contributor II
929 Views

To perform the floating point multiplication in the Floating Point Custom Instruction which is inbuilt, how should I pass the values from the nios code?  

Do I have to use a specific format for the numbers or use additional instructions in nios code for the floating point multiplication to be offloaded to the custom instruction hardware ?
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
191 Views

The custom instructions use the standard ieee format used by C for 'float' variables. 

If you want to use the custom instructions you need to ensure that you never use 'double' - so all constants need to be explictly marked (eg 1.5f). 

You may need to check carefully that none of the C library functions are unexpectedly called.
0 Kudos
Reply