FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
5990 Discussions

Nios Floating Point Hardware 2 and ROM usage.

Altera_Forum
Honored Contributor II
834 Views

Hi, 

 

I am trying to use the Nios Custom Instruction Floating Point Hardware 2 module, and I am targeting a MAX 10 device. 

The MAX 10 allows you to use a large portion of the flash as User Flash Memory if you disable memory initialization. Conversely, if you have memory initialization enabled, it only allows you to use 32KB. 

The Floating Point Hardware 2 module requires three ROM tables for the square root operation, which obviously needs initializing. 

 

I am contemplating modifying the FP module to comment out the square root feature. 

I am wondering how can I make sure that this change is propagated to the Nios tools, so that they know to do square root in software? 

 

Many thanks!
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
122 Views

One might ask why sqrt() uses any tables at all - especially if division isn't also using lookup tables. 

If you are generating 1 bit per clock sqrt and divide are very much the same algorythm. 

 

The C compiler used to have separate command line parameters telling it the custom opcodes for each FP operation. 

Even if it doesn't rebuilding gcc with the sqrt() instruction support removed shouldn'y be hard.
Altera_Forum
Honored Contributor II
122 Views

I managed to disable the use of the custom instruction for square root by undefining the square root macro defined by the FP custom instruction header. 

 

# include "altera_nios_custom_instr_floating_point_2.h" # undef sqrtf
Altera_Forum
Honored Contributor II
122 Views

Can I ask how did you know that the module required ROM tables - did you get an error from Quartus when compiling without RAM pre intialisation? 

What did it say? 

 

I'm wondering if other IP modules might need ROM tables and hence how we see/detect that in a Max 10 build. 

I'm sure some of the DSP IP uses ROM tables.....
Reply