Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,375 Views

Nios II Macros in compliance with DO-178B Standards

Hello; 

I'm new to Nios II and I want to know that macros are under Nios II in compliance with DO-178B Standards? If they don't, how can i convert these macros(like IORD, IOWR etc. in "These macros are defined in the file/components/altera_nios2/HAL/inc/io.h.") like they will be in compliance with DO-178B? For example; 

How can i implement these functions under the macros on my own in c?  

 

__builtin_ldwio (((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8))))) "originally; __builtin_ldwio (__IO_CALC_ADDRESS_NATIVE ((BASE), (REGNUM)))" 

 

and the others; 

__builtin_ldbio (((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))))  

__builtin_ldbuio (((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8))))) 

__builtin_ldhio (((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))))  

__builtin_ldhuio (((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8))))) 

__builtin_stwio (((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))))  

__builtin_stbio (((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))))  

__builtin_sthio (((void *)(((alt_u8*)BASE) + ((REGNUM) * (SYSTEM_BUS_WIDTH/8)))))  

 

I couldn't found any info about that anywhere. Please, if you can give me basic and detailed answers, i will appreciate you. Thank you.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor I
96 Views

Using macros is always OK. They just expand to C code that can be reviewed on its own. What is acceptable for code review depends on what the customer and certification authority demands. For safety critical applications, macros are usually not accepted unless they are processed by a qualified pre-processor. For DO-178 we used macros and did the code review of the expanded macros as shown in the pre-processor output. Of course we have the original source files available for reference. 

 

The __builtin_* directives expand to assembler instructions. You will need to have your code reviewers examine the object code and verify that the correct translation occurred. 

 

Alternatively, I've heard some company sells a tool qualification package for the GCC pre-processor. Sorry, but I don't know who makes it or even if it is still available. 

As with everything on the net, take this advice with several grains of salt.
Reply