Forum Discussion
Altera_Forum
Honored Contributor
10 years agothis is what my public.mk shows :
# Hardware Divider present. # setting HARDWARE_DIVIDE is false ALT_CFLAGS += -mno-hw-div # Hardware Multiplier present. # setting HARDWARE_MULTIPLY is true ALT_CFLAGS += -mhw-mul # Hardware Mulx present. # setting HARDWARE_MULX is false ALT_CFLAGS += -mno-hw-mulx ...... # Enable BSP generation to query if SOPC system floating point custom # instruction with a divider is present. If true ignores export of 'ALT_CFLAGS # += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to # public.mk if the custom instruction is found in the system. none # setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false there are no "# Hardware Floating Point Custom Instruction without Divider present. ALT_CFLAGS += -mcustom-fpu-cfg=60-1 ALT_LDFLAGS += -mcustom-fpu-cfg=60-1" in my project , the bsp editor=>settings=>advanced=>hal.make.ignore_system_derived i found the "hardware_fp_cust_inst_no_divider_present" is checked, i think maybe that is the reason, so i uncheck it, then regenerate the bsp rebuild the project, change the system.h again(the soft ware generate the "__builtin_custom_inii" again, i have to change it to "__builtin_custom_fnff" manually) then i find in objdump file: c=a*b; 1082c0: e0fffd17 ldw r3,-12(fp) 1082c4: e0bffe17 ldw r2,-8(fp) 1082c8: 1885ff32 custom 252,r2,r3,r2 1082cc: e0bfff15 stw r2,-4(fp) so problem solved! so it seems like if i want to use the floating point hardware in nios II custom instructions, i have to add the ip in Qsys=>change the bsp setting=>change the system.h why the user guide did tell me? "tt_floating_point_custom_instructions.pdf"