Skip to content

Source Code Organization

Asbjørn Djupdal edited this page Nov 15, 2018 · 6 revisions

Guideline Information

Item Value
Guideline Number 9
Guideline Responsible (Name, Affiliation) Asbjørn Djupdal, NTNU
Guideline Reviewer (Name, Affiliation) Ahmed Sadek, TUD
Guideline Audience (Category) Application Developer
Guideline Expertise (Category) Toolchain Designer
Guideline Keywords (Category) Toolchain

Guideline advice

In projects involving both SW and HW, it is wise to consider how the code is organized into different source files. Done correctly, the build process will be much faster. This consideration must be done while executing the generic development process described in D4.4 chapter 1.

Insights that led to the guideline

Experience with Xilinx SDSoC led to this guideline.

Recommended implementation method of the guideline along with a solid motivation for the recommendation

It is common practice to organize source files according to functionality, and the HLS capabilities of SDSoC suggests that this is acceptable. However, rebuild times will really suffer if done without care.

Normal source code conventions still applies, but an additional convention should be adopted: Put HLS code into source files of their own. This means both HW accelerated functions and code that directly calls these functions.

The motivation is that the HLS tool will require a rebuild of the FPGA bitfile every time source files with HLS code are touched. This is very time consuming. By organizing the source files correctly, changes to the SW portion of the application will only require a recompile of the ELF file, which is usually very fast compared to rebuilding the bitfile.

Instantiation of the recommended implementation method in the reference platform

All applications will benefit from this guideline, and the TULIPP use cases are examples of this.

Evaluation of the guideline in reference applications

Build times are hugely dependent on application and build computer specifications. However, an example can give an indication of the importance of the guideline. An LKOF image processing application needs 24 minutes to be built on a typical desktop PC when touching one of the HW files. If only a SW file is touched, the application builds in 40 seconds. This demonstrates that keeping SW and HW code in separate files is important for build efficiency.

References

Review

Related guidelines

none

Clone this wiki locally