Download GU0122 C-to-Hardware Compiler User Manual

Transcript
C-to-Hardware Compiler User Manual
5.3. Pipelining .......................................................................................................................................... 62
6. Design Patterns ............................................................................................................................................ 65
6.1. Creating an ASP ................................................................................................................................. 65
6.2. Creating a C Code Symbol and Testing it Using a Virtual Instrument .............................................................. 65
6.3. Connecting a Code Symbol to a Wishbone Master Device ........................................................................... 65
6.3.1. Connecting a Code Symbol to a Wishbone Master Peripheral ............................................................ 65
6.3.2. Connecting a Code Symbol to a Processing Core ........................................................................... 67
6.4. Connecting a Code Symbol to a Wishbone Slave Device ............................................................................ 68
6.5. Connecting a Code Symbol to a Memory ................................................................................................. 69
6.6. Connecting a C Code Symbol to a Device without Standardized Bus ............................................................. 70
6.7. Connecting two C Code Symbols ........................................................................................................... 72
6.8. Building a Dataflow Pipeline using C Code Symbols .................................................................................. 72
6.8.1. Using Multiple Code Symbols ..................................................................................................... 73
6.8.2. Using One Code Symbol ........................................................................................................... 73
6.9. Tuning the Timing of Dataflow Pipeline Stages .......................................................................................... 74
6.9.1. Splitting a Dataflow Pipeline Stage in Two Parallel Stages ................................................................. 74
6.9.2. Using Pipelined Code Symbols (Functions) ................................................................................... 76
6.10. Tuning FPGA Resource Usage ............................................................................................................ 76
7. Libraries ...................................................................................................................................................... 77
7.1. Introduction ....................................................................................................................................... 77
7.2. Library Functions ................................................................................................................................ 77
7.2.1. assert.h .................................................................................................................................. 77
7.2.2. complex.h ............................................................................................................................... 77
7.2.3. ctype.h and wctype.h ................................................................................................................ 78
7.2.4. errno.h ................................................................................................................................... 79
7.2.5. fcntl.h .................................................................................................................................... 80
7.2.6. fenv.h ..................................................................................................................................... 80
7.2.7. float.h .................................................................................................................................... 80
7.2.8. inttypes.h and stdint.h ............................................................................................................... 81
7.2.9. io.h ........................................................................................................................................ 81
7.2.10. iso646.h ............................................................................................................................... 81
7.2.11. limits.h ................................................................................................................................. 82
7.2.12. locale.h ................................................................................................................................ 82
7.2.13. malloc.h ................................................................................................................................ 82
7.2.14. math.h and tgmath.h ............................................................................................................... 82
7.2.15. setjmp.h ................................................................................................................................ 85
7.2.16. signal.h ................................................................................................................................ 86
7.2.17. stdarg.h ................................................................................................................................ 86
7.2.18. stdbool.h ............................................................................................................................... 86
7.2.19. stddef.h ................................................................................................................................ 86
7.2.20. stdint.h ................................................................................................................................. 87
7.2.21. stdio.h and wchar.h ................................................................................................................. 87
7.2.22. stdlib.h and wchar.h ................................................................................................................ 92
7.2.23. string.h and wchar.h ................................................................................................................ 94
7.2.24. time.h and wchar.h .................................................................................................................. 95
7.2.25. wchar.h ................................................................................................................................ 97
7.2.26. wctype.h ............................................................................................................................... 98
7.3. C Library Reentrancy ........................................................................................................................... 99
8. MISRA-C Rules ........................................................................................................................................... 107
8.1. MISRA-C:1998 ................................................................................................................................. 107
8.2. MISRA-C:2004 ................................................................................................................................. 110
9. CHC Report File Format ............................................................................................................................... 117
10. CHC Qualifier File Format ............................................................................................................................ 123
11. Glossary .................................................................................................................................................. 125
iv