rtl-buddy 2.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. rtl_buddy-2.1.4/.github/workflows/docs.yml +64 -0
  2. rtl_buddy-2.1.4/.github/workflows/publish.yml +45 -0
  3. rtl_buddy-2.1.4/.github/workflows/release-on-merge.yml +91 -0
  4. rtl_buddy-2.1.4/.gitignore +13 -0
  5. rtl_buddy-2.1.4/AGENTS.md +94 -0
  6. rtl_buddy-2.1.4/CLAUDE.md +3 -0
  7. rtl_buddy-2.1.4/CONTRIBUTORS +7 -0
  8. rtl_buddy-2.1.4/LICENSE +11 -0
  9. rtl_buddy-2.1.4/PKG-INFO +113 -0
  10. rtl_buddy-2.1.4/README.md +85 -0
  11. rtl_buddy-2.1.4/docs/agents.md +88 -0
  12. rtl_buddy-2.1.4/docs/concepts/coverage.md +122 -0
  13. rtl_buddy-2.1.4/docs/concepts/plugins.md +87 -0
  14. rtl_buddy-2.1.4/docs/concepts/regressions.md +64 -0
  15. rtl_buddy-2.1.4/docs/concepts/root-config.md +79 -0
  16. rtl_buddy-2.1.4/docs/concepts/tests.md +125 -0
  17. rtl_buddy-2.1.4/docs/index.md +27 -0
  18. rtl_buddy-2.1.4/docs/install.md +46 -0
  19. rtl_buddy-2.1.4/docs/known-issues.md +17 -0
  20. rtl_buddy-2.1.4/docs/migrations/submodule-to-uv.md +36 -0
  21. rtl_buddy-2.1.4/docs/quickstart.md +81 -0
  22. rtl_buddy-2.1.4/docs/reference/cli.md +181 -0
  23. rtl_buddy-2.1.4/docs/reference/yaml.md +220 -0
  24. rtl_buddy-2.1.4/mkdocs.yml +42 -0
  25. rtl_buddy-2.1.4/pyproject.toml +56 -0
  26. rtl_buddy-2.1.4/pytest.ini +2 -0
  27. rtl_buddy-2.1.4/scripts/gen_cli_reference.py +90 -0
  28. rtl_buddy-2.1.4/setup.cfg +4 -0
  29. rtl_buddy-2.1.4/src/rtl_buddy/__init__.py +5 -0
  30. rtl_buddy-2.1.4/src/rtl_buddy/__main__.py +18 -0
  31. rtl_buddy-2.1.4/src/rtl_buddy/config/__init__.py +17 -0
  32. rtl_buddy-2.1.4/src/rtl_buddy/config/coverage.py +41 -0
  33. rtl_buddy-2.1.4/src/rtl_buddy/config/coverview.py +54 -0
  34. rtl_buddy-2.1.4/src/rtl_buddy/config/model.py +106 -0
  35. rtl_buddy-2.1.4/src/rtl_buddy/config/platform.py +108 -0
  36. rtl_buddy-2.1.4/src/rtl_buddy/config/reg.py +84 -0
  37. rtl_buddy-2.1.4/src/rtl_buddy/config/root.py +292 -0
  38. rtl_buddy-2.1.4/src/rtl_buddy/config/rtl.py +153 -0
  39. rtl_buddy-2.1.4/src/rtl_buddy/config/suite.py +95 -0
  40. rtl_buddy-2.1.4/src/rtl_buddy/config/test.py +330 -0
  41. rtl_buddy-2.1.4/src/rtl_buddy/config/uvm.py +19 -0
  42. rtl_buddy-2.1.4/src/rtl_buddy/config/verible.py +83 -0
  43. rtl_buddy-2.1.4/src/rtl_buddy/errors.py +14 -0
  44. rtl_buddy-2.1.4/src/rtl_buddy/logging_utils.py +423 -0
  45. rtl_buddy-2.1.4/src/rtl_buddy/rtl_buddy.py +591 -0
  46. rtl_buddy-2.1.4/src/rtl_buddy/runner/__init__.py +8 -0
  47. rtl_buddy-2.1.4/src/rtl_buddy/runner/test_results.py +95 -0
  48. rtl_buddy-2.1.4/src/rtl_buddy/runner/test_runner.py +135 -0
  49. rtl_buddy-2.1.4/src/rtl_buddy/seed_mode.py +7 -0
  50. rtl_buddy-2.1.4/src/rtl_buddy/tools/__init__.py +14 -0
  51. rtl_buddy-2.1.4/src/rtl_buddy/tools/coverage.py +602 -0
  52. rtl_buddy-2.1.4/src/rtl_buddy/tools/coverview.py +764 -0
  53. rtl_buddy-2.1.4/src/rtl_buddy/tools/verible.py +79 -0
  54. rtl_buddy-2.1.4/src/rtl_buddy/tools/verilator_cov_analysis.md +489 -0
  55. rtl_buddy-2.1.4/src/rtl_buddy/tools/vlog_cov.py +1124 -0
  56. rtl_buddy-2.1.4/src/rtl_buddy/tools/vlog_filelist.py +184 -0
  57. rtl_buddy-2.1.4/src/rtl_buddy/tools/vlog_post.py +81 -0
  58. rtl_buddy-2.1.4/src/rtl_buddy/tools/vlog_sim.py +398 -0
  59. rtl_buddy-2.1.4/src/rtl_buddy.egg-info/PKG-INFO +113 -0
  60. rtl_buddy-2.1.4/src/rtl_buddy.egg-info/SOURCES.txt +66 -0
  61. rtl_buddy-2.1.4/src/rtl_buddy.egg-info/dependency_links.txt +1 -0
  62. rtl_buddy-2.1.4/src/rtl_buddy.egg-info/entry_points.txt +4 -0
  63. rtl_buddy-2.1.4/src/rtl_buddy.egg-info/requires.txt +5 -0
  64. rtl_buddy-2.1.4/src/rtl_buddy.egg-info/top_level.txt +1 -0
  65. rtl_buddy-2.1.4/tests/test_coverage_paths.py +223 -0
  66. rtl_buddy-2.1.4/tests/test_logging.py +267 -0
  67. rtl_buddy-2.1.4/tests/test_setup_failures.py +273 -0
  68. rtl_buddy-2.1.4/uv.lock +775 -0
@@ -0,0 +1,64 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'docs/**'
8
+ - 'mkdocs.yml'
9
+ - 'scripts/gen_cli_reference.py'
10
+ - 'src/rtl_buddy/**'
11
+ pull_request:
12
+ branches: [main]
13
+ paths:
14
+ - 'docs/**'
15
+ - 'mkdocs.yml'
16
+ - 'scripts/gen_cli_reference.py'
17
+ - 'src/rtl_buddy/**'
18
+
19
+ jobs:
20
+ build:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: astral-sh/setup-uv@v5
26
+ with:
27
+ enable-cache: true
28
+ cache-dependency-glob: uv.lock
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --group docs
32
+
33
+ - name: Check CLI reference is up to date
34
+ run: uv run python scripts/gen_cli_reference.py --check
35
+
36
+ - name: Build docs
37
+ run: uv run mkdocs build --strict
38
+
39
+ - name: Check site links
40
+ uses: lycheeverse/lychee-action@v2
41
+ with:
42
+ args: --offline site/**/*.html
43
+ fail: true
44
+
45
+ - name: Upload Pages artifact
46
+ if: github.event_name == 'push'
47
+ uses: actions/upload-pages-artifact@v3
48
+ with:
49
+ path: site/
50
+
51
+ deploy:
52
+ if: github.event_name == 'push'
53
+ needs: build
54
+ runs-on: ubuntu-latest
55
+ permissions:
56
+ pages: write
57
+ id-token: write
58
+ environment:
59
+ name: github-pages
60
+ url: ${{ steps.deployment.outputs.page_url }}
61
+ steps:
62
+ - name: Deploy to GitHub Pages
63
+ id: deployment
64
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,45 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ with:
13
+ fetch-depth: 0
14
+
15
+ - uses: astral-sh/setup-uv@v5
16
+ with:
17
+ enable-cache: true
18
+ cache-dependency-glob: uv.lock
19
+
20
+ - name: Build package
21
+ run: uv build
22
+
23
+ - name: Upload build artifacts
24
+ uses: actions/upload-artifact@v4
25
+ with:
26
+ name: dist
27
+ path: dist/
28
+
29
+ publish:
30
+ needs: build
31
+ runs-on: ubuntu-latest
32
+ environment:
33
+ name: pypi
34
+ url: https://pypi.org/p/rtl_buddy
35
+ permissions:
36
+ id-token: write
37
+ steps:
38
+ - name: Download build artifacts
39
+ uses: actions/download-artifact@v4
40
+ with:
41
+ name: dist
42
+ path: dist/
43
+
44
+ - name: Publish to PyPI
45
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,91 @@
1
+ name: Release on PR Merge
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ release:
11
+ if: github.event.pull_request.merged == true
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+
16
+ steps:
17
+ - name: Checkout merged commit
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+ ref: ${{ github.event.pull_request.merge_commit_sha }}
22
+
23
+ - name: Compute next version
24
+ id: version
25
+ run: |
26
+ LATEST=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
27
+ if [ -z "$LATEST" ]; then
28
+ LATEST="v0.0.0"
29
+ fi
30
+
31
+ VERSION=${LATEST#v}
32
+ MAJOR=$(echo "$VERSION" | cut -d. -f1)
33
+ MINOR=$(echo "$VERSION" | cut -d. -f2)
34
+ PATCH=$(echo "$VERSION" | cut -d. -f3)
35
+
36
+ LABELS='${{ toJson(github.event.pull_request.labels.*.name) }}'
37
+ if echo "$LABELS" | grep -qi '"version/major"'; then
38
+ NEW_TAG="v$((MAJOR + 1)).0.0"
39
+ elif echo "$LABELS" | grep -qi '"version/minor"'; then
40
+ NEW_TAG="v${MAJOR}.$((MINOR + 1)).0"
41
+ elif echo "$LABELS" | grep -qi '"version/patch"'; then
42
+ NEW_TAG="v${MAJOR}.${MINOR}.$((PATCH + 1))"
43
+ else
44
+ echo "No version label found, skipping release."
45
+ echo "new_tag=" >> "$GITHUB_OUTPUT"
46
+ exit 0
47
+ fi
48
+
49
+ echo "latest_tag=${LATEST}" >> "$GITHUB_OUTPUT"
50
+ echo "new_tag=${NEW_TAG}" >> "$GITHUB_OUTPUT"
51
+ echo "Bumping ${LATEST} -> ${NEW_TAG}"
52
+
53
+ - name: Create and push tag
54
+ if: steps.version.outputs.new_tag != ''
55
+ run: |
56
+ git config user.name "github-actions[bot]"
57
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
58
+ git tag -a "${{ steps.version.outputs.new_tag }}" \
59
+ -m "Release ${{ steps.version.outputs.new_tag }}"
60
+ git push origin "${{ steps.version.outputs.new_tag }}"
61
+
62
+ - name: Create GitHub release
63
+ if: steps.version.outputs.new_tag != ''
64
+ uses: actions/github-script@v8
65
+ env:
66
+ TAG: ${{ steps.version.outputs.new_tag }}
67
+ PREV_TAG: ${{ steps.version.outputs.latest_tag }}
68
+ PR_TITLE: ${{ github.event.pull_request.title }}
69
+ PR_NUMBER: ${{ github.event.pull_request.number }}
70
+ PR_USER: ${{ github.event.pull_request.user.login }}
71
+ SERVER_URL: ${{ github.server_url }}
72
+ REPO: ${{ github.repository }}
73
+ with:
74
+ script: |
75
+ const tag = process.env.TAG;
76
+ const prevTag = process.env.PREV_TAG;
77
+ let body = `**PR #${process.env.PR_NUMBER}** by @${process.env.PR_USER}: ${process.env.PR_TITLE}`;
78
+
79
+ if (prevTag && prevTag !== 'v0.0.0') {
80
+ body += `\n\n**Full changelog:** ${process.env.SERVER_URL}/${process.env.REPO}/compare/${prevTag}...${tag}`;
81
+ }
82
+
83
+ await github.rest.repos.createRelease({
84
+ owner: context.repo.owner,
85
+ repo: context.repo.repo,
86
+ tag_name: tag,
87
+ name: `Release ${tag}`,
88
+ body,
89
+ draft: false,
90
+ prerelease: false,
91
+ });
@@ -0,0 +1,13 @@
1
+ **egg-info
2
+ **__pycache__
3
+ **.sw?
4
+ tags
5
+ .venv
6
+ .worktrees/
7
+ # Sphinx
8
+ docs/_build/
9
+ _build/
10
+
11
+ .DS_Store
12
+ # MkDocs build output
13
+ site/
@@ -0,0 +1,94 @@
1
+ # rtl_buddy — AI Agent Guide
2
+
3
+ ## Role
4
+
5
+ This repo is the source-of-truth implementation of the `rtl_buddy` CLI.
6
+
7
+ ## Key Files
8
+
9
+ ```text
10
+ src/rtl_buddy/
11
+ ├── __main__.py # package entry point
12
+ ├── rtl_buddy.py # Typer CLI and top-level command flow
13
+ ├── logging_utils.py # log_event(), setup_logging(), console helpers
14
+ ├── errors.py # FatalRtlBuddyError, FilelistError, SetupScriptError
15
+ ├── seed_mode.py # seed handling enum
16
+ ├── config/ # YAML-backed config classes
17
+ ├── runner/test_runner.py # PRE -> COMP -> SIM -> POST execution
18
+ └── tools/ # filelist, sim, postproc, verible wrappers
19
+ ```
20
+
21
+ ## Development Rules
22
+
23
+ - Keep changes targeted. Avoid broad refactors unless the task requires them.
24
+ - Preserve CLI behavior unless intentionally changing it.
25
+ - Treat YAML config classes and runtime behavior as part of the public interface for downstream RTL projects.
26
+ - When adding or changing behavior, update downstream docs and validation assets after validating the implementation.
27
+
28
+ ## Implementation Notes
29
+
30
+ - `rtl_buddy.py` owns CLI wiring, global options, and command dispatch.
31
+ - `RootConfig` selects platform, builder, verible, and regression config from `root_config.yaml`.
32
+ - `TestRunner` drives PRE, COMPILE, SIM, and POST with early-stop support.
33
+ - `VlogSim` handles compile/sim command construction, log paths, seeds, and timeout behavior.
34
+ - `VlogFilelist` handles `.f` parsing and transformations.
35
+ - Hook scripts (`sweep`, `preproc`, `postproc`) are executed dynamically and should be treated as compatibility-sensitive APIs.
36
+
37
+ ## Validation
38
+
39
+ Typical checks:
40
+
41
+ ```bash
42
+ # from a project root that has `rtl_buddy` installed
43
+ ./venv/bin/python -m rtl_buddy regression -c regression.yaml
44
+ ./venv/bin/python -m rtl_buddy filelist test_module -c design/example_block/src/models.yaml
45
+ ./venv/bin/python -m rtl_buddy verible syntax design/example_block/src/test_module.sv
46
+
47
+ # from a suite directory
48
+ cd design/example_block/verif
49
+ ../../../venv/bin/python -m rtl_buddy test basic
50
+ ```
51
+
52
+ If validating the dev checkout directly, install this repo into the target venv and confirm with `./venv/bin/python -m rtl_buddy --version`.
53
+
54
+ ## Logging Practices
55
+
56
+ All runtime logging goes through `log_event()` in `src/rtl_buddy/logging_utils.py`. Do not use `logger.info(f"...")` directly — use `log_event(logger, level, "event.name", key=value, ...)` so that both human and machine modes produce correct output.
57
+
58
+ ### How it works
59
+
60
+ - **Human mode (default)**: `_human_message()` converts each event into a readable sentence for `rtl_buddy.log` and the console. Machine-oriented fields are not visible.
61
+ - **Machine mode (`--machine`)**: `rtl_buddy.log` is written as JSON Lines with the event name, all fields, and the human message. Console output is plain text.
62
+
63
+ ### Adding new events
64
+
65
+ 1. Choose a dotted event name following the existing convention (e.g. `compile.start`, `sim.timeout`, `suite_config.load_failed`).
66
+ 2. Call `log_event(logger, logging.<LEVEL>, "your.event", field1=val1, ...)`.
67
+ 3. If the event is logged at **WARNING or above**, add a dedicated `case` entry in `_human_message()`. Users see these messages directly, so they must be clear and actionable.
68
+ 4. DEBUG and INFO events may rely on the wildcard fallback formatter, which converts `"foo.bar"` to `"foo bar"` and appends select fields.
69
+
70
+ ### Error handling
71
+
72
+ - Fatal config/environment errors: log at `logging.ERROR`, then `raise FatalRtlBuddyError(...)`. The top-level `run()` catches these and exits with code 2.
73
+ - Per-test filelist failures: log at `logging.ERROR`, then `raise FilelistError(...)`. `TestRunner` catches these and records a `FilelistFailResults`.
74
+ - Sweep/preproc script failures: return an error string from `pre()` or `_expand_tests_with_sweep()`. The caller records a `SetupFailResults` and continues.
75
+ - Do not use `logger.critical()` — the old `ExitHandler` abort pattern has been removed.
76
+
77
+ ### Console output
78
+
79
+ - Use `emit_console_text()` for direct user-facing output (e.g. git status banner, regression directory).
80
+ - Use `render_summary()` for result tables — it writes a Rich table to the console and plain text to the log file.
81
+ - Use `task_status()` for spinners on long-running phases (compile, sim). Falls back to plain text on non-interactive terminals.
82
+
83
+ ## Required Follow-Through
84
+
85
+ After meaningful `rtl_buddy` changes:
86
+
87
+ 1. **If any CLI command, flag, or help text changed**: run `python scripts/gen_cli_reference.py` and commit the updated `docs/reference/cli.md` in the same PR. The file is committed to the repo and must stay in sync — CI will catch drift via `python scripts/gen_cli_reference.py --check`.
88
+ 2. Update any downstream agent docs if command behavior, YAML schema, version expectations, or validation notes changed.
89
+ 3. Update downstream integrations to the intended commit as needed.
90
+
91
+ ## Release Workflow
92
+
93
+ 1. Merge to `main` in this repo and tag (e.g. `v2.0.0`).
94
+ 2. Update and tag any downstream integrations that track this repo.
@@ -0,0 +1,3 @@
1
+ # rtl_buddy — Claude Code Guide
2
+
3
+ @AGENTS.md
@@ -0,0 +1,7 @@
1
+ Loh Zhi-Hern
2
+ Xie Jiacheng
3
+ Emil Goh
4
+ Damien Lim
5
+ Chai Wei Lynthia
6
+ Zubin Jain
7
+ Daniel Lim
@@ -0,0 +1,11 @@
1
+ Copyright 2024 rtl_buddy contributors
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: rtl_buddy
3
+ Version: 2.1.4
4
+ Summary: RTL Buddy is a build-system with testplan, regression, workflow support for Verilog RTL codebases.
5
+ Author: Zhi-Hern Loh, Xie Jiacheng
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: Source, https://github.com/rtl-buddy/rtl_buddy
8
+ Project-URL: Documentation, https://rtl-buddy.github.io/rtl_buddy/
9
+ Project-URL: Tracker, https://github.com/rtl-buddy/rtl_buddy/issues
10
+ Keywords: SystemVerilog,Verilog,ASIC,FPGA
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Operating System :: MacOS
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: ruamel.yaml>=0.18.15
23
+ Requires-Dist: typer>=0.19.2
24
+ Requires-Dist: click>=8.3.0
25
+ Requires-Dist: pyserde[yaml]>=0.27.0
26
+ Requires-Dist: rich>=14.0.0
27
+ Dynamic: license-file
28
+
29
+ # `rtl_buddy`
30
+
31
+ `rtl_buddy` is a CLI for running RTL tests, regressions, filelist generation, and adjacent workflow automation in Verilog and SystemVerilog projects. It is designed to work well for both humans and AI agents.
32
+
33
+ It is built to sit on top of the tools your project already uses, while giving you a cleaner, more repeatable interface for day-to-day verification work. The primary supported flows are Verilator and VCS-based compile, simulation, and regression workflows. Basic Verible command integration exists, while broader first-class Verible and PeakRDL workflows are on the roadmap.
34
+
35
+ ## Why `rtl_buddy`
36
+
37
+ `rtl_buddy` gives RTL projects a lightweight control plane for common verification tasks:
38
+
39
+ - Run a single test or a full regression from YAML config instead of ad hoc shell scripts
40
+ - Keep simulator invocation, seeds, logs, and result handling consistent across runs
41
+ - Manage filelists easily with project model definitions
42
+ - Add sweep generation, preprocessing, and postprocessing hooks without rewriting the main flow
43
+ - Export machine-readable logs that work well in CI and AI-agent-driven workflows
44
+
45
+ ## Features
46
+
47
+ - **Test and regression commands**: run one test, many tests, or whole suites with a consistent CLI
48
+ - **Randomized testing support**: create new seeds, repeat runs, and replay previous randomized iterations
49
+ - **Structured config model**: describe suites, regressions, platforms, builders, and models in readable YAML
50
+ - **Filelist generation**: build simulator-ready filelists from `models.yaml`
51
+ - **Coverage workflows**: collect, merge, summarize, and export Verilator coverage
52
+ - **Hookable execution flow**: plug in your own sweep generation, test preprocessing, and postprocessing scripts
53
+ - **Verible integration**: invoke lint, syntax, formatting, and preprocessing commands through the same project config
54
+ - **Rich outputs for humans**: displays pretty formatted for easy reading
55
+ - **Structured logging for machines**: emits JSONL logs for interpretation by CI systems, automation, and coding agents
56
+ - **Cross-project reuse**: keep one tool interface while adapting it to different RTL repo layouts and builder setups
57
+
58
+ ## Installation
59
+
60
+ `rtl_buddy` is installed into your project environment with `uv` directly from the Git repository. PyPI publication is planned but not yet available.
61
+
62
+ Prerequisites:
63
+
64
+ - Python 3.11+
65
+ - `uv`
66
+ - A simulator on `PATH`
67
+ - Verilator is the recommended open-source starting point
68
+ - VCS is also supported as a first-class flow
69
+ - Optional Verible binaries if you want to use `uv run rb verible ...`
70
+ - Optional system-level coverage tools:
71
+ - `lcov` for LCOV and HTML coverage export
72
+ - [Coverview](https://github.com/antmicro/coverview) for Coverview package generation
73
+
74
+ See [docs/install.md](docs/install.md) for the full install flow.
75
+
76
+ ## Documentation
77
+
78
+ Full documentation lives in [`docs/`](docs/), is built with MkDocs, and is intended to be published on GitHub Pages.
79
+
80
+ To preview the docs locally while developing:
81
+
82
+ ```bash
83
+ uv sync --group docs
84
+ uv run mkdocs serve
85
+ ```
86
+
87
+ Useful entry points:
88
+
89
+ - [Installation](docs/install.md)
90
+ - [Quick Start](docs/quickstart.md)
91
+ - [Coverage](docs/concepts/coverage.md)
92
+ - [CLI Reference](docs/reference/cli.md)
93
+ - [YAML Formats](docs/reference/yaml.md)
94
+
95
+ ## Quick Start
96
+
97
+ Run a test:
98
+
99
+ ```bash
100
+ uv run rb test basic
101
+ ```
102
+
103
+ Run a regression:
104
+
105
+ ```bash
106
+ uv run rb regression
107
+ ```
108
+
109
+ For full usage, see [docs/quickstart.md](docs/quickstart.md).
110
+
111
+ ## Known Issues
112
+
113
+ See [docs/known-issues.md](docs/known-issues.md).
@@ -0,0 +1,85 @@
1
+ # `rtl_buddy`
2
+
3
+ `rtl_buddy` is a CLI for running RTL tests, regressions, filelist generation, and adjacent workflow automation in Verilog and SystemVerilog projects. It is designed to work well for both humans and AI agents.
4
+
5
+ It is built to sit on top of the tools your project already uses, while giving you a cleaner, more repeatable interface for day-to-day verification work. The primary supported flows are Verilator and VCS-based compile, simulation, and regression workflows. Basic Verible command integration exists, while broader first-class Verible and PeakRDL workflows are on the roadmap.
6
+
7
+ ## Why `rtl_buddy`
8
+
9
+ `rtl_buddy` gives RTL projects a lightweight control plane for common verification tasks:
10
+
11
+ - Run a single test or a full regression from YAML config instead of ad hoc shell scripts
12
+ - Keep simulator invocation, seeds, logs, and result handling consistent across runs
13
+ - Manage filelists easily with project model definitions
14
+ - Add sweep generation, preprocessing, and postprocessing hooks without rewriting the main flow
15
+ - Export machine-readable logs that work well in CI and AI-agent-driven workflows
16
+
17
+ ## Features
18
+
19
+ - **Test and regression commands**: run one test, many tests, or whole suites with a consistent CLI
20
+ - **Randomized testing support**: create new seeds, repeat runs, and replay previous randomized iterations
21
+ - **Structured config model**: describe suites, regressions, platforms, builders, and models in readable YAML
22
+ - **Filelist generation**: build simulator-ready filelists from `models.yaml`
23
+ - **Coverage workflows**: collect, merge, summarize, and export Verilator coverage
24
+ - **Hookable execution flow**: plug in your own sweep generation, test preprocessing, and postprocessing scripts
25
+ - **Verible integration**: invoke lint, syntax, formatting, and preprocessing commands through the same project config
26
+ - **Rich outputs for humans**: displays pretty formatted for easy reading
27
+ - **Structured logging for machines**: emits JSONL logs for interpretation by CI systems, automation, and coding agents
28
+ - **Cross-project reuse**: keep one tool interface while adapting it to different RTL repo layouts and builder setups
29
+
30
+ ## Installation
31
+
32
+ `rtl_buddy` is installed into your project environment with `uv` directly from the Git repository. PyPI publication is planned but not yet available.
33
+
34
+ Prerequisites:
35
+
36
+ - Python 3.11+
37
+ - `uv`
38
+ - A simulator on `PATH`
39
+ - Verilator is the recommended open-source starting point
40
+ - VCS is also supported as a first-class flow
41
+ - Optional Verible binaries if you want to use `uv run rb verible ...`
42
+ - Optional system-level coverage tools:
43
+ - `lcov` for LCOV and HTML coverage export
44
+ - [Coverview](https://github.com/antmicro/coverview) for Coverview package generation
45
+
46
+ See [docs/install.md](docs/install.md) for the full install flow.
47
+
48
+ ## Documentation
49
+
50
+ Full documentation lives in [`docs/`](docs/), is built with MkDocs, and is intended to be published on GitHub Pages.
51
+
52
+ To preview the docs locally while developing:
53
+
54
+ ```bash
55
+ uv sync --group docs
56
+ uv run mkdocs serve
57
+ ```
58
+
59
+ Useful entry points:
60
+
61
+ - [Installation](docs/install.md)
62
+ - [Quick Start](docs/quickstart.md)
63
+ - [Coverage](docs/concepts/coverage.md)
64
+ - [CLI Reference](docs/reference/cli.md)
65
+ - [YAML Formats](docs/reference/yaml.md)
66
+
67
+ ## Quick Start
68
+
69
+ Run a test:
70
+
71
+ ```bash
72
+ uv run rb test basic
73
+ ```
74
+
75
+ Run a regression:
76
+
77
+ ```bash
78
+ uv run rb regression
79
+ ```
80
+
81
+ For full usage, see [docs/quickstart.md](docs/quickstart.md).
82
+
83
+ ## Known Issues
84
+
85
+ See [docs/known-issues.md](docs/known-issues.md).
@@ -0,0 +1,88 @@
1
+ # For Agents
2
+
3
+ This page covers how AI agents should interact with `rtl_buddy`. It describes machine mode, log formats, and the recommended validation workflow.
4
+
5
+ ## Always use machine mode
6
+
7
+ Run `rtl_buddy` with `--machine` in all agent-driven workflows:
8
+
9
+ ```bash
10
+ rtl-buddy --machine test basic
11
+ rtl-buddy --machine regression -c design/regression.yaml
12
+ ```
13
+
14
+ In machine mode:
15
+
16
+ - `rtl_buddy.log` is written as **JSON Lines** (one JSON object per line) instead of human-readable text.
17
+ - Console output switches to plain, colorless text — no Rich formatting, no spinners.
18
+ - All structured event fields (event name, status, durations, paths) are present in the log.
19
+
20
+ This makes it reliable to parse outcomes from `rtl_buddy.log` without screen-scraping.
21
+
22
+ ## Log file locations
23
+
24
+ | File | Description |
25
+ |------|-------------|
26
+ | `rtl_buddy.log` | Orchestration log; JSONL in machine mode, human-readable otherwise |
27
+ | `logs/{test_name}.log` | Simulation stdout for each test |
28
+ | `logs/{test_name}.err` | Simulation stderr for each test |
29
+ | `logs/{test_name}.randseed` | Seed used for this test run |
30
+ | `test.log` | Symlink to the most recent test's log |
31
+ | `test.err` | Symlink to the most recent test's stderr |
32
+ | `test.randseed` | Symlink to the most recent test's seed |
33
+
34
+ All files are written relative to the directory where `rtl_buddy` is invoked.
35
+
36
+ ## Machine mode log format
37
+
38
+ Each line in `rtl_buddy.log` (machine mode) is a JSON object:
39
+
40
+ ```json
41
+ {"event": "test.pass", "name": "smoke", "duration": 4.2, "seed": 31310, "msg": "smoke passed"}
42
+ {"event": "suite.summary", "passed": 3, "failed": 0, "total": 3, "msg": "3/3 passed"}
43
+ ```
44
+
45
+ Key fields:
46
+
47
+ - `event`: dotted event name identifying what happened (e.g. `test.pass`, `test.fail`, `compile.error`)
48
+ - `msg`: the human-readable message corresponding to the event
49
+ - Other fields are event-specific (name, duration, seed, exit code, etc.)
50
+
51
+ ## Recommended validation workflow
52
+
53
+ ```bash
54
+ # 1. Check rtl_buddy version
55
+ rtl-buddy --version
56
+
57
+ # 2. Dry-run: verify pre-flight config without compiling or simulating
58
+ rtl-buddy --machine test basic --early-stop pre
59
+
60
+ # 3. Run a single test
61
+ rtl-buddy --machine test basic
62
+
63
+ # 4. Check the log for outcome
64
+ grep '"event"' rtl_buddy.log | tail -5
65
+
66
+ # 5. Run a full regression
67
+ rtl-buddy --machine regression -c design/regression.yaml
68
+ ```
69
+
70
+ Use `--early-stop pre` to validate that config files, model paths, and testbench paths all resolve correctly before committing to a compile step.
71
+
72
+ ## Exit codes
73
+
74
+ | Code | Meaning |
75
+ |------|---------|
76
+ | 0 | All tests passed |
77
+ | 1 | One or more tests failed |
78
+ | 2 | Fatal configuration or environment error |
79
+
80
+ ## Version checking
81
+
82
+ Always verify the installed version before running, especially in CI or after dependency updates:
83
+
84
+ ```bash
85
+ rtl-buddy --version
86
+ ```
87
+
88
+ The version follows semantic versioning. Breaking YAML schema or CLI changes are signaled by a major version bump.