Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12598 Discussions

Disable FPU on Arria10 SoC FPGA

Altera_Forum
Honored Contributor II
1,773 Views

Hi Support, 

 

We need to disable FPU on Arria 10 SoC FPGA. 

 

Please let us know the procedure how to disable FPU. 

 

 

 

Regards, 

Karthik.
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
487 Views

Karthik, 

all you need to do is to clear bit# 30 of the FPEXC register: 

fmrx r0, FPEXC 

bic r0, r0,# 0x40000000 

fmxr FPEXC, r0
0 Kudos
Altera_Forum
Honored Contributor II
487 Views

 

--- Quote Start ---  

Karthik, 

all you need to do is to clear bit# 30 of the FPEXC register: 

fmrx r0, FPEXC 

bic r0, r0,# 0x40000000 

fmxr FPEXC, r0 

--- Quote End ---  

 

 

 

Hi, 

 

I ran the above assembly code(assembler) and generated binary from object file, when i try to execute binary it shows segmentation fault. 

 

please let me know how to check FPU is disabled/not after running the assembly code.
0 Kudos
Altera_Forum
Honored Contributor II
487 Views

If it traps accessing the FPEXC register, it is likely because the processor is running in user mode. 

FPEXC can only be accessed in privilege mode. 

 

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/bcfhhbdd.html 

 

Regards
0 Kudos
Altera_Forum
Honored Contributor II
487 Views

 

--- Quote Start ---  

If it traps accessing the FPEXC register, it is likely because the processor is running in user mode. 

FPEXC can only be accessed in privilege mode. 

 

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0068b/bcfhhbdd.html 

 

Regards 

--- Quote End ---  

 

 

Thanks ericv. I will try it in privilege mode.
0 Kudos
Altera_Forum
Honored Contributor II
487 Views

I'm not sure about that one: 

You could also hit another roadblock if the library was built for EABI hard-float. 

EABI hard-float means float/double arguments for functions are typically passed in the FPU registers instead of the R0->R12 basic set. 

As the FPU is disabled, if my understanding is correct, and if your library is hard-float, you will get traps. 

Regards
0 Kudos
Altera_Forum
Honored Contributor II
487 Views

This will be work: 

fmrx r0, FPEXC 

bic r0, r0,# 0x40000000 

fmxr FPEXC, r0
0 Kudos
Reply