Forum Discussion

Chris039's avatar
Chris039
Icon for Occasional Contributor rankOccasional Contributor
3 years ago
Solved

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

https://splichal.eu/gccsphinx-final/html/gcc/extensions-to-the-c-language-family/target-builtins/altera-nios-ii-built-in-functions.html

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's avatar
    Chris039
    Icon for Occasional Contributor rankOccasional Contributor

    The below define IORD as __builtin_ldwio but how do I know what is this function __builtin_ldwio doing? I would like to know the source code for the built in function

    #define IORD(BASE, REGNUM) \
    __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)))

    The document that you have shared chapter 3.2.X lists out all the built in function available but there is no source code for each function.

  • KellyJialin_Goh's avatar
    KellyJialin_Goh
    Icon for Frequent Contributor rankFrequent Contributor

    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


  • KellyJialin_Goh's avatar
    KellyJialin_Goh
    Icon for Frequent Contributor rankFrequent Contributor

    Hi,

    I’m glad that your question has been addressed, I now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


    p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 9/10 survey.


    Thank you.

    Regards,

    Kelly Jialin, GOH