Design Files and Test Bench Files - 2024.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2024-11-13
Version
2024.2 English

Because the HLS tool reuses the C test bench for RTL verification, it requires that the test bench and any associated files be denoted as test bench files when they are added to the HLS component. Files associated with the test bench are any files that are:

  • Accessed by the test bench.
  • Required for the test bench to operate correctly.

Examples of such files include the data files inA.dat and inB.dat in the example test bench. You must add these to the HLS configuration file as test bench files.

The requirement for identifying test bench files in the HLS component does not require that the design and test bench be in separate files (although separate files are recommended). To demonstrate this, a new example is defined from the same code used in Example Test Bench, except a new top-level function is defined. In this example the function sumsub_func is defined as the top-level function in the HLS component.

Tip: You can change the top-level function in the HLS configuration file by selecting the C Synthesis settings, or using the syn.top config file entry.

With the sumsub_func function defined as the top-level function, the higher-level function, hier_func becomes part of the test bench, as it is the calling function for sumsub_func. The peer-level shift_func function is also now part of the test bench, as it is a required part of the test. Even though these functions are in the same code file as the top-level sumsub_func function, they are part of the test bench.