Design Files and Test Bench Files - 2022.1 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2022-06-07
Version
2022.1 English

Because Vitis HLS 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 Vitis HLS project. 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 Vitis HLS project as test bench files.

The requirement for identifying test bench files in a Vitis HLS project 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 Vitis HLS project.

Tip: You can change the top-level function by selecting the Project Settings command from the Flow Navigator, selecting the Synthesis settings, and specifying a new Top Function.

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.