Add comprehensive test suite for PeakRDL-BusDecoder with sub-block and integration tests (#6)

* Initial plan

* Add comprehensive test suite for PeakRDL-BusDecoder

- Added tests for utility functions (clog2, is_pow2, roundup_pow2, get_indexed_path)
- Added tests for body classes (Body, ForLoopBody, IfBody, CombinationalBody, StructBody)
- Added tests for code generators (DecodeLogicGenerator, StructGenerator)
- Added tests for DesignState configuration
- Added integration tests for BusDecoderExporter
- Added tests for APB4 interface generation
- Fixed conftest to properly handle RDLCompiler and temporary files
- All 56 tests passing

Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com>

* Format test files with ruff

Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: arnavsacheti <36746504+arnavsacheti@users.noreply.github.com>
This commit is contained in:
Copilot
2025-10-23 22:26:03 -07:00
committed by GitHub
parent 2ca1ce4e27
commit 4b87556135
5 changed files with 1124 additions and 3 deletions

View File

@@ -43,10 +43,14 @@ def compile_rdl(tmp_path: Path):
try:
compiler.compile_file(tmp_file.name)
if top is not None:
return compiler.elaborate(top)
return compiler.elaborate()
root = compiler.elaborate(top)
return root.top
root = compiler.elaborate()
return root.top
except RDLCompileError:
compiler.print_messages()
# Print error messages if available
if hasattr(compiler, "print_messages"):
compiler.print_messages()
raise
return _compile