Library Element Unit Test - 2024.2 English

Vitis Libraries

Release Date
2024-11-29
Version
2024.2 English

Each library element category comes supplied with a test harness. It is located in the L2/tests/aie/<library_element> directory. The test harness consists of JSON, C++ files, as well as a Makefile.

JSON description of the test harness, defined in L2/tests/aie/<library_element>/description.json, has been used to generate the Makefile. In addition, the description.json file defines the parameters of the test harness, e.g., a list of supported platforms.

Each Makefile uses a set of values for each of the library element parameters that are stored in in a JSON file in L2/tests/aie/<library_element>/multi_params.json. The set of parameters are combined in a form of a named test case, with default name being: test_0_tool_canary_aie. The set of parameters can be edited as required to configure the library element for your needs.

C++ files serve as an example of how to use the library element subgraph in the context of a super-graph. These test harnesses (graphs) can be found in the L2/tests/aie/<library_element>/test.hpp and L2/tests/aie/<library_element>/test.cpp file.

Although it is recommended that only L2 (graphs) library elements are instantiated directly in the user code, the kernels underlying the graphs can be found in the L1/include/aie/<library_element>.hpp and the L1/src/aie/<library_element>.cpp files.

The test harness run consists of several steps that result in a simulated and validated design. These include:

  • Input files(s) generation.
  • Validate configuration with metadata (in: L2/meta).
  • Reference model compilation and simulation, to produce the golden output.
  • Uut design compilation and simulation.
  • Output post-processing (e.g., timestamps processing to produce throughput figures). The output of the reference model ( logs/ref_output.txt ) is verified against the output of the AIE graphs (logs/uut_output.txt).
  • Status generation. On completion of the make, the logs/status_<config_details>.txt file will contain the result of compilation, simulation, and an indication of whether the reference model and AIE model outputs match. The report will also contain resource utilization and performance metrics.