Internals: Add some missing Python files to lint
This commit is contained in:
parent
44102de362
commit
3ab21332c9
31
Makefile.in
31
Makefile.in
|
|
@ -477,6 +477,12 @@ MAKE_FILES = \
|
||||||
src/Makefile*.in \
|
src/Makefile*.in \
|
||||||
test_regress/Makefile* \
|
test_regress/Makefile* \
|
||||||
|
|
||||||
|
# Perl programs
|
||||||
|
PERL_PROGRAMS = \
|
||||||
|
bin/redirect \
|
||||||
|
bin/verilator \
|
||||||
|
bin/verilator_coverage \
|
||||||
|
|
||||||
# Python programs, subject to format and lint
|
# Python programs, subject to format and lint
|
||||||
PY_PROGRAMS = \
|
PY_PROGRAMS = \
|
||||||
bin/verilator_ccache_report \
|
bin/verilator_ccache_report \
|
||||||
|
|
@ -484,25 +490,28 @@ PY_PROGRAMS = \
|
||||||
bin/verilator_gantt \
|
bin/verilator_gantt \
|
||||||
bin/verilator_includer \
|
bin/verilator_includer \
|
||||||
bin/verilator_profcfunc \
|
bin/verilator_profcfunc \
|
||||||
examples/json_py/vl_file_copy \
|
|
||||||
examples/json_py/vl_hier_graph \
|
|
||||||
docs/guide/conf.py \
|
|
||||||
docs/bin/vl_sphinx_extract \
|
docs/bin/vl_sphinx_extract \
|
||||||
docs/bin/vl_sphinx_fix \
|
docs/bin/vl_sphinx_fix \
|
||||||
src/astgen \
|
docs/guide/conf.py \
|
||||||
src/bisonpre \
|
examples/json_py/vl_file_copy \
|
||||||
src/config_rev \
|
examples/json_py/vl_hier_graph \
|
||||||
src/flexfix \
|
|
||||||
src/vlcovgen \
|
|
||||||
src/.gdbinit.py \
|
|
||||||
test_regress/*.py \
|
|
||||||
test_regress/t/*.pf \
|
|
||||||
nodist/clang_check_attributes \
|
nodist/clang_check_attributes \
|
||||||
nodist/dot_importer \
|
nodist/dot_importer \
|
||||||
nodist/fuzzer/actual_fail \
|
nodist/fuzzer/actual_fail \
|
||||||
nodist/fuzzer/generate_dictionary \
|
nodist/fuzzer/generate_dictionary \
|
||||||
nodist/install_test \
|
nodist/install_test \
|
||||||
|
nodist/lint_py_test_filter \
|
||||||
nodist/log_changes \
|
nodist/log_changes \
|
||||||
|
nodist/uvm_pkg_packer \
|
||||||
|
nodist/verilator_saif_diff \
|
||||||
|
src/.gdbinit.py \
|
||||||
|
src/astgen \
|
||||||
|
src/bisonpre \
|
||||||
|
src/config_rev \
|
||||||
|
src/flexfix \
|
||||||
|
src/vlcovgen \
|
||||||
|
test_regress/*.py \
|
||||||
|
test_regress/t/*.pf \
|
||||||
|
|
||||||
# Python files, subject to format but not lint
|
# Python files, subject to format but not lint
|
||||||
PY_FILES = \
|
PY_FILES = \
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# mypy: disallow-untyped-defs
|
# mypy: disallow-untyped-defs
|
||||||
# pylint: disable=
|
# pylint: disable=C0114,C0116
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import re
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
SUPPRESSES = [
|
SUPPRESSES = [
|
||||||
|
|
@ -14,14 +13,15 @@ SUPPRESSES = [
|
||||||
"E0602: Undefined variable 'os' (undefined-variable)",
|
"E0602: Undefined variable 'os' (undefined-variable)",
|
||||||
"E0602: Undefined variable 'glob' (undefined-variable)",
|
"E0602: Undefined variable 'glob' (undefined-variable)",
|
||||||
"W0611: Unused import vltest_bootstrap (unused-import)",
|
"W0611: Unused import vltest_bootstrap (unused-import)",
|
||||||
]
|
]
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
|
|
||||||
def process() -> None:
|
def process() -> None:
|
||||||
anymsg = False
|
anymsg = False
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
line = line.rstrip();
|
line = line.rstrip()
|
||||||
show = True
|
show = True
|
||||||
for msg in SUPPRESSES:
|
for msg in SUPPRESSES:
|
||||||
if msg in line:
|
if msg in line:
|
||||||
|
|
@ -34,6 +34,7 @@ def process() -> None:
|
||||||
if anymsg:
|
if anymsg:
|
||||||
sys.exit("%Error: See messages above")
|
sys.exit("%Error: See messages above")
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# mypy: disallow-untyped-defs
|
# mypy: disallow-untyped-defs
|
||||||
# pylint: disable=
|
# pylint: disable=C0114,C0116
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
@ -12,7 +12,7 @@ import sys
|
||||||
|
|
||||||
def process() -> None:
|
def process() -> None:
|
||||||
in_header = True
|
in_header = True
|
||||||
in_backslash = False
|
in_backslash = None
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
line = line.expandtabs(tabsize=8)
|
line = line.expandtabs(tabsize=8)
|
||||||
|
|
@ -23,9 +23,8 @@ def process() -> None:
|
||||||
if in_header:
|
if in_header:
|
||||||
if re.match(r'^//', line):
|
if re.match(r'^//', line):
|
||||||
continue
|
continue
|
||||||
else:
|
in_header = False
|
||||||
in_header = False
|
print_header()
|
||||||
print_header()
|
|
||||||
in_header = False
|
in_header = False
|
||||||
|
|
||||||
# Drop some unneeded items
|
# Drop some unneeded items
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# pylint: disable=C0114,C0115,C0116,R0902,R0903,R0912,R0915,W0719,W0718
|
# pylint: disable=C0114,C0115,C0116,C0301,R0902,R0903,R0912,R0915,W0719,W0718
|
||||||
######################################################################
|
######################################################################
|
||||||
#
|
#
|
||||||
# Copyright 2025 by Wilson Snyder. This program is free software; you
|
# Copyright 2025 by Wilson Snyder. This program is free software; you
|
||||||
|
|
@ -19,12 +19,12 @@ SIGNAL_TYPE = "SIGNAL"
|
||||||
EOF_ERROR = "Unexpected EOF"
|
EOF_ERROR = "Unexpected EOF"
|
||||||
|
|
||||||
|
|
||||||
def saif_assert(expression : bool, message : str) -> None:
|
def saif_assert(expression: bool, message: str) -> None:
|
||||||
if not expression:
|
if not expression:
|
||||||
raise Exception(message)
|
raise Exception(message)
|
||||||
|
|
||||||
|
|
||||||
def saif_error(message : str) -> None:
|
def saif_error(message: str) -> None:
|
||||||
raise Exception(message)
|
raise Exception(message)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@ class SAIFSignalBit:
|
||||||
low_time: int
|
low_time: int
|
||||||
transitions: int
|
transitions: int
|
||||||
|
|
||||||
def __init__(self, name : str):
|
def __init__(self, name: str):
|
||||||
self.name = name
|
self.name = name
|
||||||
self.high_time = 0
|
self.high_time = 0
|
||||||
self.low_time = 0
|
self.low_time = 0
|
||||||
|
|
@ -43,7 +43,7 @@ class SAIFSignalBit:
|
||||||
|
|
||||||
class SAIFInstance:
|
class SAIFInstance:
|
||||||
|
|
||||||
def __init__(self, scope_name : str):
|
def __init__(self, scope_name: str):
|
||||||
self.scope_name = scope_name
|
self.scope_name = scope_name
|
||||||
self.parent_instance = None
|
self.parent_instance = None
|
||||||
self.nets = {}
|
self.nets = {}
|
||||||
|
|
@ -52,7 +52,7 @@ class SAIFInstance:
|
||||||
|
|
||||||
class SAIFToken:
|
class SAIFToken:
|
||||||
|
|
||||||
def __init__(self, token : str):
|
def __init__(self, token: str):
|
||||||
self.token = token
|
self.token = token
|
||||||
self.type = ''
|
self.type = ''
|
||||||
self.value = ''
|
self.value = ''
|
||||||
|
|
@ -73,7 +73,7 @@ class SAIFParser:
|
||||||
self.divider = ''
|
self.divider = ''
|
||||||
self.timescale = ''
|
self.timescale = ''
|
||||||
|
|
||||||
def parse(self, saif_filename : str) -> None:
|
def parse(self, saif_filename: str) -> None:
|
||||||
file_contents = ''
|
file_contents = ''
|
||||||
with open(saif_filename, 'r', encoding="utf8") as saif_file:
|
with open(saif_filename, 'r', encoding="utf8") as saif_file:
|
||||||
content = saif_file.readlines()
|
content = saif_file.readlines()
|
||||||
|
|
@ -225,9 +225,11 @@ def compare_saif_contents(first_file: str, second_file: str) -> int:
|
||||||
return SUCCESS_CODE
|
return SUCCESS_CODE
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(allow_abbrev=False,
|
parser = argparse.ArgumentParser(
|
||||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
allow_abbrev=False,
|
||||||
description="""verilator_saif_diff checks if two SAIF files are logically-identical. It returns first encountered difference as output.
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||||
|
description=
|
||||||
|
"""verilator_saif_diff checks if two SAIF files are logically-identical. It returns first encountered difference as output.
|
||||||
Run as:
|
Run as:
|
||||||
cd $VERILATOR_ROOT
|
cd $VERILATOR_ROOT
|
||||||
nodist/code_coverage --first example.saif --second other.saif""")
|
nodist/code_coverage --first example.saif --second other.saif""")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue