Skip to content

Commit 6a50c63

Browse files
authored
Merge pull request #284 from krcb197/261-introduce-the-pathological-register-set-to-the-test-flow
Add Pathological Test to the CI
2 parents f0dafe7 + 41c7647 commit 6a50c63

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

.github/workflows/action.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,47 @@ jobs:
425425
mypy autoformatted_output
426426
python -m unittest discover -s autoformatted_output
427427
428+
pathological:
429+
430+
needs:
431+
- integration_tests
432+
433+
runs-on: ubuntu-latest
434+
435+
steps:
436+
- uses: actions/checkout@v4
437+
- name: Set up Python
438+
uses: actions/setup-python@v5
439+
with:
440+
python-version: "3.13"
441+
442+
- name: Install dependencies
443+
run: |
444+
python -m pip install --upgrade pip
445+
python -m pip install .[peakrdl]
446+
python -m pip install mypy
447+
448+
- name: Prepare System RDL
449+
run: |
450+
mkdir ./pathological_test
451+
python -m tests.pathological_register_maps.pathological_rdl_builder ./pathological_test/deep.rdl deep
452+
453+
- name: build_package
454+
run: |
455+
peakrdl python ./pathological_test/deep.rdl -o ./pathological_test/ --skip_library_copy
456+
457+
- name: type check generated code
458+
run: |
459+
mypy ./pathological_test/deep/
460+
461+
- name: Run unit tests
462+
run: python -m unittest discover -s ./pathological_test/
463+
428464
#-------------------------------------------------------------------------------
429465
build:
430466
needs:
431467
- autoformating
468+
- pathological
432469

433470
name: Build source distribution
434471
runs-on: ubuntu-latest

tests/pathological_register_maps/pathalogical_rdl_builder.py renamed to tests/pathological_register_maps/pathological_rdl_builder.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
1818
The file is used for making pathological system RDL files for stress testing the tool
1919
"""
20+
import argparse
2021
import os
2122
from typing import Optional
2223
from pathlib import Path
@@ -232,7 +233,17 @@ def addrmap_generator():
232233
name_prefix='top_level_addr')
233234

234235

236+
CommandLineParser = argparse.ArgumentParser(
237+
description='Generate a pathological system RDL file to test the generator')
238+
CommandLineParser.add_argument('output_filename', type=Path,
239+
help='Filename of the systemRDL file to generate')
240+
CommandLineParser.add_argument('addrmap_name', type=str,
241+
help='Name of the top level address map')
242+
235243
if __name__ == '__main__':
236244

245+
CommandLineArgs = CommandLineParser.parse_args()
246+
237247
generator = PathologicalRDL()
238-
generator.export_code(Path('deep.rdl'), addrmap_name='deep')
248+
generator.export_code(CommandLineArgs.output_filename,
249+
addrmap_name=CommandLineArgs.addrmap_name)

0 commit comments

Comments
 (0)