diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9357e91..9cec694 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -84,6 +84,7 @@ jobs: lint_RTL: needs: docker_image name: Check RTL + if: false runs-on: ubuntu-latest container: @@ -92,7 +93,7 @@ jobs: strategy: fail-fast: false matrix: - tool: ['verilator'] + tool: ['verilator', 'slang'] steps: - name: Check out Git repository @@ -104,4 +105,4 @@ jobs: pip3 install . - name: Run lint - run: sc-gallery -lint + run: sc-gallery -lint -lint_tool ${{ matrix.tool }} diff --git a/scgallery/gallery.py b/scgallery/gallery.py index 48c7345..56b4352 100755 --- a/scgallery/gallery.py +++ b/scgallery/gallery.py @@ -485,7 +485,7 @@ def __setup_run_chip(self, chip, name, jobsuffix=None): chip.set('option', 'entrypoint', chip.design) chip.set('design', name) - def __lint(self, design): + def __lint(self, design, tool): chip = design['chip'] if not chip: @@ -494,7 +494,7 @@ def __lint(self, design): if 'lintflow' in chip.getkeys('flowgraph'): chip.schema.remove('flowgraph', 'lintflow') - chip.use(lintflow) + chip.use(lintflow, tool=tool) self.__setup_run_chip(chip, design["design"], jobsuffix="_lint") @@ -666,7 +666,7 @@ def _run_setup(design, target): def get_run_report(self): return self.__report_chips.copy() - def lint(self): + def lint(self, tool): ''' Run lint on the enabled designs. ''' @@ -676,7 +676,7 @@ def lint(self): error = False for job in self.__get_runnable_jobs(): print(job['print']) - lint_status = self.__lint(job) + lint_status = self.__lint(job, tool) if lint_status is not None: error |= not lint_status @@ -898,6 +898,11 @@ def format_list(items, prefix_len, max_len=80): action='store_true', help='Run lint only') + parser.add_argument('-lint_tool', + choices=['verilator', 'slang'], + default='verilator', + help='Tool to use for linting') + parser.add_argument('-version', action='version', version=__version__) args = parser.parse_args() @@ -951,7 +956,7 @@ def format_list(items, prefix_len, max_len=80): return 0 if args.lint: - if gallery.lint(): + if gallery.lint(args.lint_tool): return 0 return 1