Each library element category comes supplied with a test harness.
For AI Engine library elements, the test harness resides in the L2/tests/aie/<library_element> directory and consists of JSON and C++ files, and a Makefile.
For VSS library elements, the test harness resides in the L2/tests/vss/<library_element> directory and contains a host file, helper Python scripts, and the JSON, C++ files, and Makefiles.
The JSON description of the test harness, defined in L2/tests/<vss/aie>/<library_element>/description.json, generates the Makefile. The description.json file also defines the parameters of the test harness, for example, a list of supported platforms.
Each Makefile uses a set of values for each library element parameter, stored in a JSON file at L2/tests/aie/<library_element>/multi_params.json. The parameters are combined into a named test case — the default name is test_0_tool_canary_aie. Edit the parameters 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) reside in the L2/tests/aie/<library_element>/test.hpp and L2/tests/aie/<library_element>/test.cpp files.
For AI Engine library elements, instantiate only L2 (graphs) library elements directly in your code. The kernels underlying the graphs reside in the L1/include/aie/<library_element>.hpp and L1/src/aie/<library_element>.cpp files.
For VSS library elements, use the top-level VSS Makefile found in L2/include/vss/<library_element> as the entry point.
The test harness run consists of the following steps:
- Generate input files.
- Validate configuration with metadata (in L2/meta).
- Compile and simulate the reference model to produce the golden output.
- Compile and simulate the unit under test (UUT) design.
- Post-process output (for example, process timestamps to produce throughput figures). The reference model output (logs/ref_output.txt) is verified against the AI Engine graphs output (logs/uut_output.txt).
- Generate status. On completion, logs/status_<config_details>.txt contains the compilation and simulation result, and indicates whether the reference and AI Engine model outputs match. The report also contains resource utilization and performance metrics.