Copyright (C) Antmicro 2023 - 2025
This repository contains a demo for dashboard generation in XLS demonstrated by two examples - a simple dashboard for a passthrough example and a more complex dashboard for a basic RLE encoder design.
The dashboard is generated from data extracted from tests or their output. To extract the data, users may use parsers provided in this repo or their custom scripts, which are responsible for extracting the information and saving it in a Dashboard JSON format. Custom parsers should read the log from stdin and write the extracted information to stdout.
The dashboard generation is done in a few steps. The whole process is controlled by the main dashboard.py script. Generating a dashboard is as follows:
- The
dashboard.pyscript is invoked with a set of parameters that specify two types of operations: parsing output of a test (-poption) or parsing output files generated by the test (-foption). The arguments contain information about the test to run, the parser to use, and the potential file from which the data should be extracted. The script parses arguments and saves them in a more convenient form internally. - The tests are then executed and parsed using the run_and_parse function from the run_and_parse.py file. For the
-poption, the parser is run on the log produced by the test, for the-foption, the parser is run on the output file created by the test. The output files are assumed to be located in$TEST_UNDECLARED_OUTPUTS_DIR, which is a default location for output files produced by Bazel tests. - The parsed data in JSON format is collected and then verified if it matches the Dashboard JSON schema. Both the verification mechanism and the schema are available in the
validate_dashboard_json.pyfile. - Next, the correct piece of information in the Dashboard JSON format is sorted and converted to a markdown file by the
json_to_markdownfunction from the Python file with the same name. - Finally, the utilities from
mkdocs_creator.pyare used to produce an HTML usingmkdocs.
Since the dashboard relies on tests, it cannot be produced on build time. To generate the dashboard, one has to provide a path to which the HTML should be saved. For example:
$ bazel run -- //xls/modules/rle:rle_dashboard -o rle_dashboard
Here is a screenshot of the RLE Dashboard:

To run example locally you need to install bazel 5.4.0 (or bazelisk, which will automatically use correct version), clang++, python3 and libtinfo5
# Download and enter xls directory
$ git clone --recursive https://github.com/antmicro/xls-dashboard
$ cd xls-dashboard
# Build xls, run rle test and produce dashboard to `rle_dashboard/`
$ bazel run -- //xls/modules/rle:rle_dashboard -o rle_dashboard/
# Open dashboard in browser
$ xdg-open rle_dashboard/index.html
# Same for passthrough example
$ bazel run -- //xls/examples:passthrough_dashboard -o passthrough_dashboard/
$ xdg-open passthrough_dashboard/index.html