VHDL-FastCheck is a toolkit for quickly running VHDL checks and test flows using open source tools:
It provides lightweight Python runners and Makefile helpers to automate simulation and synthesis checks for VHDL projects.
Clone this repository:
git clone https://github.com/yourusername/vhdl-fastcheck.git
cd vhdl-fastcheckTo download all the necessary dependancies and files to run the scripts, inside the vhdl-fastcheck directory run:
make envNote: You may need to restart your terminal or source your shell rc file to update your PATH.
-
Show help:
make helpPrints a summary of available Makefile targets and usage instructions.
-
Set up the environment:
make env
Downloads and installs open source tools (Yosys & GHDL) and sets up your shell environment.
-
Run all tests:
make test TARGET=<path-to-your-vhdl-project>
TARGETis the path to the directory containing your VHDL project or exercises.- Optionally, set
LIBto specify a custom standard cell library for synthesis.
python run.py <input-dir><input-dir>: Directory containing compressed archives to analyze.
- Each archive is extracted to a temporary directory.
- For each extracted directory,
make test TARGET=<dir>is run in parallel. - All
.jsonfiles produced by the tests are collected. - All JSONs are compacted into a single JSONL file for easy aggregation and analysis.
The resulting JSONL file can be found in the repository root after execution.
-
make test (or
run_tests.py):- For each subdirectory named
simorsynunder your target, runs simulation (GHDL) or synthesis (Yosys). - Simulation output: Console output from GHDL, including compile logs, testbench results, and pass/fail status for each test. Errors are clearly marked.
- Synthesis output: Console output from Yosys, including synthesis logs, resource usage, and any warnings or errors. If a standard cell library is used, timing and area reports may be included.
- At the end, a summary of all test results is printed. Errors are reported with details for debugging.
- A file named
test_results.jsonis written in the target directory, containing a summary of all results.
- For each subdirectory named
-
Python runners: Each runner prints detailed logs to the console, including which files are being processed, any dependency analysis, and the results of each simulation or synthesis step. Errors and warnings are clearly indicated.
All outputs are printed to the terminal. For more details, check the logs and error messages printed by each tool.
{
"dir": "~/myproject",
"tasks": {
"ex1/sim": {
"compile": { "ok": true },
"run": { "ok": true, "result": "PASS" }
},
"ex1/syn": {
"compile": { "ok": true },
"synth": { "ok": true, "area": 123, "timing": "OK" }
},
"ex2/sim": {
"compile": { "ok": false, "error": "Syntax error" }
}
}
}Each key in tasks is a subdirectory tested. Each value contains the results for that directory, including compile status, run/synth results, and any errors.
The script run.py automates batch testing of multiple compressed VHDL project directories:
- Extracts all compressed archives (
.zip,.tar.gz, etc.) from a specified input directory. - Runs
make test TARGET=<dir>in parallel for each extracted directory. - Collects all
.jsonresult files generated by the tests. - Compacts all JSON results into a single JSONL file in the repo root:
results-<input-dir>.jsonl.
To run batch analysis, use:
python3 run.py /path/to/the/root/dir/This will:
- Extract each archive in
/path/to/the/root/dir/to a temporary directory - Run all tests for each extracted project
- Collect the results into a single file named
results-archives.jsonlin the repository root
After completion, check the terminal output for logs and see the results-archives.jsonl file for a summary of all test results.
When running analysis (e.g., with python3 run.py <input-dir> or make test TARGET=<dir>), your input directory should be organized as follows:
<input-dir>/
├── ex1/
│ ├── sim/
│ │ ├── tb_example1.vhd
│ │ └── ...
│ └── syn/
│ ├── top_example1.vhd
│ └── ...
├── ex2/
│ ├── sim/
│ │ └── tb_example2.vhd
│ └── syn/
│ └── top_example2.vhd
└── ...
- Each subdirectory (e.g.,
ex1,ex2) represents a separate VHDL project or exercise. - Each project should contain
sim/(for simulation testbenches) and/orsyn/(for synthesis sources). - Place your VHDL files in the appropriate subfolders.
This structure is required for the automation scripts to correctly find and process your VHDL files.
src/— Python runners and helpersutils/— Make helpers for Yosys and other tooling