Forum Discussion
Altera_Forum
Honored Contributor
10 years agoThank you mikedsouze for you answer.
Yes i'm using Floating Point Hardware 2 --- Quote Start --- i think the ci only support 18 floating point operations --- Quote End --- Yes, I think you are right. Now i tried to use the Altera Floating Point Megafunctions ( SINE, ATAN,COS) as a custom instruction. First of all, i generated the VHDL codes, then i added them as a custom instruction to the NIOS2. In the "system.h"# define macro declarations was generated for each function like this:# define alt_ci_ci_fp_atan_0(a,b) __builtin_custom_inii(alt_ci_ci_fp_atan_0_n,(a),(b))
# define alt_ci_ci_fp_atan_0_n 0x2
# define alt_ci_ci_fp_cosine_0(a) __builtin_custom_ini(alt_ci_ci_fp_cosine_0_n,(a))
# define alt_ci_ci_fp_cosine_0_n 0x1
# define alt_ci_ci_fp_sine_0(a) __builtin_custom_ini(alt_ci_ci_fp_sine_0_n,(a))
# define alt_ci_ci_fp_sine_0_n 0x3 Unfortunately, it doesn't work. I don't know if what i did is possible or not. Thanks, Best regards