diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 1b6662ea0..2b903aa88 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -10,11 +10,11 @@ on: jobs: format: - runs-on: ubuntu-20.04 - name: Ubuntu 20.04 | format + runs-on: ubuntu-22.04 + name: Ubuntu 22.04 | format env: CI_OS_NAME: linux - CI_RUNS_ON: ubuntu-20.04 + CI_RUNS_ON: ubuntu-22.04 CI_COMMIT: ${{ github.sha }} CI_M32: 0 steps: @@ -27,14 +27,14 @@ jobs: CI_BUILD_STAGE_NAME: build run: | bash ci/ci-install.bash && - sudo apt-get install clang-format-11 yapf3 && + sudo apt-get install clang-format-14 yapf3 && git config --global user.email "action@example.com" && git config --global user.name "github action" - name: Format code run: | autoconf && ./configure && - make -j 2 format CLANGFORMAT=clang-format-11 && + make -j 2 format CLANGFORMAT=clang-format-14 && git status - name: Push run: | diff --git a/Makefile.in b/Makefile.in index 08271b047..662a57361 100644 --- a/Makefile.in +++ b/Makefile.in @@ -346,13 +346,13 @@ analyzer-include: format: clang-format yapf format-pl-exec -CLANGFORMAT = clang-format-11 +CLANGFORMAT = clang-format-14 CLANGFORMAT_FLAGS = -i CLANGFORMAT_FILES = $(CPPCHECK_CPP) $(CPPCHECK_H) $(CPPCHECK_YL) test_regress/t/*.c* test_regress/t/*.h clang-format: - @$(CLANGFORMAT) --version | egrep 11.0 > /dev/null \ - || echo "*** You are not using clang-format 11.0, indents may differ from master's ***" + @$(CLANGFORMAT) --version | egrep 14.0 > /dev/null \ + || echo "*** You are not using clang-format-14, indents may differ from master's ***" $(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES) PY_PROGRAMS = \ diff --git a/docs/guide/conf.py b/docs/guide/conf.py index 0714e50c7..fb9c66d1a 100644 --- a/docs/guide/conf.py +++ b/docs/guide/conf.py @@ -13,6 +13,7 @@ from datetime import datetime import os import re import sys + sys.path.insert(0, os.path.abspath('./_ext')) import sphinx_rtd_theme # pylint: disable=wrong-import-position, diff --git a/docs/guide/install.rst b/docs/guide/install.rst index b69517076..31d553094 100644 --- a/docs/guide/install.rst +++ b/docs/guide/install.rst @@ -124,7 +124,7 @@ Those developing Verilator itself may also want these (see internals.rst): :: - sudo apt-get install gdb graphviz cmake clang clang-format-11 gprof lcov + sudo apt-get install gdb graphviz cmake clang clang-format-14 gprof lcov sudo apt-get install yapf3 sudo pip3 install sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe cpan install Pod::Perldoc diff --git a/examples/xml_py/vl_file_copy b/examples/xml_py/vl_file_copy index 5eae927ed..1ff96328e 100755 --- a/examples/xml_py/vl_file_copy +++ b/examples/xml_py/vl_file_copy @@ -16,12 +16,13 @@ from shutil import copy2 class VlFileCopy: + def __init__( - self, - verilator_args, # presently all verilator options are passed-thru - # ideally this script would check against options mentioned in help + self, + verilator_args, # presently all verilator options are passed-thru + # ideally this script would check against options mentioned in help debug=0, - output_dir='copied'): # directory name we output file uses + output_dir='copied'): # directory name we output file uses self.debug = debug diff --git a/examples/xml_py/vl_hier_graph b/examples/xml_py/vl_hier_graph index 359bd5da2..566250226 100755 --- a/examples/xml_py/vl_hier_graph +++ b/examples/xml_py/vl_hier_graph @@ -14,12 +14,13 @@ import xml.etree.ElementTree as ET class VlHierGraph: + def __init__( - self, - verilator_args, # presently all verilator options are passed-thru - # ideally this script would check against options mentioned in help + self, + verilator_args, # presently all verilator options are passed-thru + # ideally this script would check against options mentioned in help debug=0, - output_filename='graph.dot'): # output filename + output_filename='graph.dot'): # output filename self.debug = debug self.next_vertex_number = 0 self.name_to_number = {} diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index be58390ed..56f7d5e42 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -96,7 +96,7 @@ public: *(reinterpret_cast(newp)) = activeMagic(); return newp + 8; } - static void operator delete(void* obj, size_t /*size*/)VL_MT_SAFE { + static void operator delete(void* obj, size_t /*size*/) VL_MT_SAFE { uint8_t* const oldp = (static_cast(obj)) - 8; if (VL_UNLIKELY(*(reinterpret_cast(oldp)) != activeMagic())) { VL_FATAL_MT(__FILE__, __LINE__, "", diff --git a/src/astgen b/src/astgen index c1d571ecd..dbe6968e0 100755 --- a/src/astgen +++ b/src/astgen @@ -12,6 +12,7 @@ import textwrap class Node: + def __init__(self, name, superClass, file, lineno): self._name = name self._superClass = superClass @@ -180,6 +181,7 @@ Stages = {} class Cpt: + def __init__(self): self.did_out_tree = False self.in_filename = "" diff --git a/src/verilog.l b/src/verilog.l index 46f612ef4..38adcdc84 100644 --- a/src/verilog.l +++ b/src/verilog.l @@ -24,8 +24,8 @@ // clang-format on #include "V3Number.h" -#include "V3ParseImp.h" // Defines YYTYPE; before including bison header #include "V3ParseBison.h" // Generated by bison +#include "V3ParseImp.h" // Defines YYTYPE; before including bison header #define STATE_VERILOG_RECENT S17 // State name for most recent Verilog Version diff --git a/src/verilog.y b/src/verilog.y index c2b17e25c..674f2a3a2 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -23,12 +23,12 @@ #endif // clang-format on #include "V3Ast.h" -#include "V3Global.h" #include "V3Config.h" +#include "V3Global.h" #include "V3ParseImp.h" // Defines YYTYPE; before including bison header -#include #include +#include #include #define YYERROR_VERBOSE 1 // For prior to Bison 3.6 diff --git a/test_regress/t/t_trace_two_sc.cpp b/test_regress/t/t_trace_two_sc.cpp index 118a2d0a1..99f111fe4 100644 --- a/test_regress/t/t_trace_two_sc.cpp +++ b/test_regress/t/t_trace_two_sc.cpp @@ -21,6 +21,7 @@ // General headers #include "verilated.h" + #include "systemc.h" VM_PREFIX* ap;