Article ID: 000085927 Content Type: Troubleshooting Last Reviewed: 04/13/2023

Why doesn't the floating-point square root Nios® II custom instruction work for certain configurations in Intel® MAX® 10 FPGAs?

Environment

  • Quartus® II Subscription Edition
  • Floating Point
  • BUILT IN - ARTICLE INTRO SECOND COMPONENT
    Description

    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 Intel® MAX® 10 FPGA 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 might give a compilation error if FPCI2 is instantiated and memory initialization is disabled due to the configuration mode set for Intel MAX 10 FPGA or other reasons.
     
    Error (16031): Current Internal Configuration mode does not support memory initialization or ROM. Select Internal Configuration mode with ERAM.

     

    Resolution

    To work around this problem in the Quartus II software version 15.0 and earlier, follow these steps:

    1. Go to fpoint2_multi_datapath.vhd and comment out the FPSqrt instantiation at lines 168 to 174.

    sqrt: FPSqrt port map (
           x      => dataa,
           r      => fsqrts,
           clk    => clk,
           reset_req    => reset_req,
           areset => reset                       
         );

    1. Re-compile your design in the Quartus II software.
    2. 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

    1. 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 this step:

    1.  Use the checkbox to remove the sqrt custom instruction from FPH2 in the Platform Designer GUI.

    This problem is fixed in the Quartus II software v16.0.

    Related Products

    This article applies to 1 products

    Intel® MAX® 10 FPGAs