Due to the requirement for a pre-populated look up ROM/RAM table in all versions of the Floating Point Hardware 2 component, the Nios II custom instruction for Floating point square root will fail in Max 10 designs using RAM pre-initialization configuration modes which includes "Dual Compressed Image", "Single Compressed Image" and "Single Uncompressed Image".
In these modes the flash is not big enough to support the pre-initialization of the RAM so the sqrt instruction will fail . The Quartus® II software version 15.1 and earlier may give a compilation error if FPCI2 is instantiated and memory initialization is disabled due to the configuration mode set for Max 10 or other reasons.
Error (16031): Current Internal Configuration mode does not support memory initialization or ROM. Select Internal Configuration mode with ERAM.
To work around this problem in the Quartus II software version 15.0 and earlier follow the steps below:
1) Go to fpoint2_multi_datapath.vhd and comment out the FPSqrt instantiation at line 168 to 174.
sqrt : FPSqrt port map (
x => dataa,
r => fsqrts,
clk => clk,
reset_req => reset_req,
areset => reset
);
2) Re-compile your design in Quartus II
3) Go to altera_nios_custom_instr_floating_point_2.c, located in the HAL folder of your bsp. Add “#undef sqrtf” just after where “altera_nios_custom_instr_floating_point_2.h” is included in the C code to disable the use of the sqrtf custom instruction by the software.
Code:
#include "altera_nios_custom_instr_floating_point_2.h"
#undef sqrtf
4) Re-build all application software and libraries with these changes in place.
To work around this problem in the Quartus II software version 15.0 and later follow the steps below:
1) Use the checkbox to remove the sqrt custom instruction from FPH2 in the Qsys GUI.
This problem is scheduled to be fixed in a future version of the Quartus II software.