Forum Discussion
Which folder contains the source code for Nios II built in function
Hi,
In the bsp generated using Nios II, there is one file <bsp folder>/HAL/inc/io.h. You may easily find this in the hello world design.
In line below,
#define IORD(BASE, REGNUM) \
__builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)))
the IORD is defined as __builtin_ldwio function. I found the list of the built in function available in
Can you point me to the file that define the function of __builtin_ldwio?
Thanks
Hi Chris,
Sorry about the bad news. Unfortunately after consulting the engineering team, we are unable to provide the definition on how to use the built in function and the source code as it is private and confidential. However, do feel free to use the macros which is the IORD or IOWR that calls the built in function.
I will set your case to close-pending if I do not hear from you the next few days. Thank you.
Regards,
Kelly
15 Replies
- Chris039
Occasional Contributor
I am not compiling my source code using Nios Eclipse. I am compiling using gcc. I guess there is missing .c or .h file that define the function which gives me error below
- KellyJialin_Goh
Frequent Contributor
Greetings,
Is it possible for you to send your design files so that we can compile and have a look further on our side? Which version of NIOS are you using?
Thank you.
Regards,
Kelly
- Chris039
Occasional Contributor
Quartus Pro 22.2
you may find the design in Hello world example design
- KellyJialin_Goh
Frequent Contributor
Hi,
I will get back to you soon as it needs more time for investigation. May we know the version of GCC compiler that you are using?
Thank you,
Regards,
Kelly
- Chris039
Occasional Contributor
I think it doesn’t matter which gcc compiler version. It is the source file for nios built in function.
Sure, do let me know when you found the code
- KellyJialin_Goh
Frequent Contributor
Hi Chris,
Could you kindly check out this link:https://www.intel.com/content/www/us/en/support/programmable/support-resources/devices/ips-nios2-ide-tutorial.html and download the source files(any version works fine) and unzip them. Unzip once with command tar -xf on linux environement or unzip twice on Windows environment.
Regards,
Kelly
- Chris039
Occasional Contributor
Thank you for the link, Kelly
Could you point me to the files that contain the functions like __builtin_ldwio?
- KellyJialin_Goh
Frequent Contributor
Hi,
After you download the link and unzip the files, the directory to find _builtin_ldwio is : Downloads\acds-16.0.tar\acds-16.0\acds-16.0\gcc-5.2\gcc\testsuite\gcc.target\nios2 and locate to nios2-builtin-io.c .You should be able to see the source code in the file.
Thank you.
Regards,
Kelly
- KellyJialin_Goh
Frequent Contributor
Hi,
Any updates from your side?
Thank you.
Regards,
Kelly
- KellyJialin_Goh
Frequent Contributor
Hi,
Any updates from your side? Did you managed to find the file from your side?
Thank you.
Regards,
Kelly
- Chris039
Occasional Contributor
Hi Kelly,
This file use the built-in function but not defining the function. I am looking for the file that is defining the function.