[meson] remove meson references from various tool

Various tools and code comments throughout the repository referenced
meson. Since meson was removed in a prior commit, this removes said
references.

Signed-off-by: Timothy Trippel <ttrippel@google.com>
diff --git a/.bazelignore b/.bazelignore
index e52c1b7..cbe86f6 100644
--- a/.bazelignore
+++ b/.bazelignore
@@ -1,6 +1,3 @@
 hw/ip/prim/util/vendor/google_verible_verilog_syntax_py
 sw/vendor/google_googletest
 util/lowrisc_misc-linters
-
-# TODO: once Meson is no longer used, remove the line below.
-build
diff --git a/.dockerignore b/.dockerignore
index 6abea64..11df7d5 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -22,9 +22,6 @@
 # FPGA splice intermediate files
 *.jou
 
-# Environment configuration (produced by Meson)
-.env
-
 # Simulation Results
 *.log
 vdCovLog/
diff --git a/.gitignore b/.gitignore
index 170b4c4..905a115 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,9 +29,6 @@
 # FPGA splice intermediate files
 *.jou
 
-# Environment configuration (produced by Meson)
-.env
-
 # Simulation Results
 *.log
 vdCovLog/
diff --git a/BUILD.bazel b/BUILD.bazel
index 2f2a037..62639b9 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -47,7 +47,7 @@
         "./**/vendor/**",
         # Rust cargo build dirs
         "./**/target/**",
-        # Meson build dirs
+        # (Old) Meson build dirs that Bazel artifacts are still copied into.
         "./build-out/**",
         "./build-bin/**",
         # fusesoc build dir
@@ -63,7 +63,7 @@
         "./**/vendor/**",
         # Rust cargo build dirs
         "./**/target/**",
-        # Meson build dirs
+        # (Old) Meson build dirs that Bazel artifacts are still copied into.
         "./build-out/**",
         "./build-bin/**",
         # fusesoc build dir
diff --git a/ci/scripts/run-english-breakfast-verilator-tests.sh b/ci/scripts/run-english-breakfast-verilator-tests.sh
index fef0ffb..8e3a1ac 100755
--- a/ci/scripts/run-english-breakfast-verilator-tests.sh
+++ b/ci/scripts/run-english-breakfast-verilator-tests.sh
@@ -15,7 +15,7 @@
 ci/bazelisk.sh clean
 
 # Build the modified EB software.
-./hw/top_englishbreakfast/util/prepare_sw.py --bazel -b
+./hw/top_englishbreakfast/util/prepare_sw.py -b
 
 # Build some other dependencies.
 ci/bazelisk.sh build //sw/host/opentitantool //hw/ip/otp_ctrl/data:img_rma
diff --git a/ci/scripts/show-env.sh b/ci/scripts/show-env.sh
index 170f5dd..4fc9d74 100755
--- a/ci/scripts/show-env.sh
+++ b/ci/scripts/show-env.sh
@@ -17,7 +17,6 @@
     rustfmt
     flake8
     ninja
-    meson
     doxygen
     verible-verilog-lint
 )
diff --git a/hw/dv/sv/sw_logger_if/sw_logger_if.sv b/hw/dv/sv/sw_logger_if/sw_logger_if.sv
index 4d1303e..823820d 100644
--- a/hw/dv/sv/sw_logger_if/sw_logger_if.sv
+++ b/hw/dv/sv/sw_logger_if/sw_logger_if.sv
@@ -101,7 +101,7 @@
   // The logger expects two files to be available in the same directory as the image -
   // <sw_name>.logs.txt: contains logs split as fields of `sw_log_t`
   // <sw_name>.rodata.txt: contains constants from the read-only sections.
-  // These are generated by `util/device_sw_utils/extract_sw_logs.py`. The meson build system
+  // These are generated by `util/device_sw_utils/extract_sw_logs.py`. The Bazel build system
   // already generates it for the 'sim_dv' build device.
   function automatic void add_sw_log_db(string sw_image);
     string sw_dir;
diff --git a/hw/top_earlgrey/dv/env/chip_env_cfg.sv b/hw/top_earlgrey/dv/env/chip_env_cfg.sv
index a5d7549..656a6c3 100644
--- a/hw/top_earlgrey/dv/env/chip_env_cfg.sv
+++ b/hw/top_earlgrey/dv/env/chip_env_cfg.sv
@@ -62,7 +62,7 @@
   // Types of SW images used in the test.
   //
   // Set via plusarg. This is the path (relative to ~sw_build_bin_dir~) upto the basename of the SW
-  // image. If the SW image is not pre-built (generated with meson), then the ~sw_build_device~ is
+  // image. If the SW image is not pre-built (generated with Bazel), then the ~sw_build_device~ is
   // suffixed to the basename to pick the correct image. The following files (extensions) with this
   // basename are expected to exist there:
   // - .elf:          embedded executable
@@ -361,7 +361,7 @@
         sw_images[i] = $sformatf("%0s/%0s", sw_build_bin_dir, sw_images[i]);
       end else if ("signed" inside {sw_image_flags[i]}) begin
         // TODO: support multiple signing keys. See "signing_keys" in
-        // `sw/device/meson.build` for options.
+        // `rules/opentitan.bzl` for options.
         sw_images[i] = $sformatf("%0s/%0s_prog_%0s.test_key_0.signed",
           sw_build_bin_dir, sw_images[i], sw_build_device);
       end else begin
diff --git a/hw/top_earlgrey/dv/verilator/verilator_sim_cfg.hjson b/hw/top_earlgrey/dv/verilator/verilator_sim_cfg.hjson
index 5e3979d..27a2866 100644
--- a/hw/top_earlgrey/dv/verilator/verilator_sim_cfg.hjson
+++ b/hw/top_earlgrey/dv/verilator/verilator_sim_cfg.hjson
@@ -81,13 +81,11 @@
 
   // List of test specifications.
   //
-  // If you are adding a test that has been generated from the `sw_tests`
-  // dictionary declared in `sw/device/tests/meson.build`, the `sw_images` list
-  // below should contain `sw/device/tests/<sw_test_name>` (without any more
-  // subdirectories) because that is where the meson target is created. For
-  // example `gpio_test` is added to `sw_tests` in
-  // `sw/device/tests/sim_div/meson.build`, but the final meson targets all
-  // start with `sw/device/tests/gpio_test_`.
+  // If you are adding a test that has been generated from a Bazel
+  // `opentitan_functest` macro, you can specify the test using the path to the
+  // Bazel target. For example, if the Bazel target is:
+  // `//sw/device/tests:example_test_from_flash`, then you would specify this as
+  // `sw/device/tests/example_test_from_flash`.
   //
   // Each entry in `sw_images` is followed by an index separated with ':' which
   // is used by the testbench to know what type of image is it:
diff --git a/hw/top_englishbreakfast/util/prepare_sw.py b/hw/top_englishbreakfast/util/prepare_sw.py
index ce84bf9..d76ff44 100755
--- a/hw/top_englishbreakfast/util/prepare_sw.py
+++ b/hw/top_englishbreakfast/util/prepare_sw.py
@@ -2,7 +2,6 @@
 # Copyright lowRISC contributors.
 # Licensed under the Apache License, Version 2.0, see LICENSE for details.
 # SPDX-License-Identifier: Apache-2.0
-
 """
 Script to patch the OpenTitan tree for building english-breakfast-friendly
 software.
@@ -14,7 +13,6 @@
 import argparse
 import shutil
 import subprocess
-
 from pathlib import Path
 
 # This file is in /hw/top_.../util
@@ -74,29 +72,23 @@
         prog="prepare_sw",
         description="Script to prepare SW sources for English Breakfast",
         formatter_class=argparse.RawDescriptionHelpFormatter)
-    parser.add_argument(
-        '--build',
-        '-b',
-        default=False,
-        action='store_true',
-        help='Build ROM based on reduced design')
+    parser.add_argument('--build',
+                        '-b',
+                        default=False,
+                        action='store_true',
+                        help='Build ROM based on reduced design')
     parser.add_argument(
         '--delete-only',
         '-d',
         default=False,
         action='store_true',
-        help='Delete previously generated auto-gen files without running topgen')
-    parser.add_argument(
-        '--top',
-        '-t',
-        default='englishbreakfast',
-        type=str,
-        help='The alternative top to use')
-    parser.add_argument(
-        '--bazel',
-        default=False,
-        action='store_true',
-        help='Whether to build with Bazel instead')
+        help='Delete previously generated auto-gen files without running topgen'
+    )
+    parser.add_argument('--top',
+                        '-t',
+                        default='englishbreakfast',
+                        type=str,
+                        help='The alternative top to use')
     args = parser.parse_args()
     name = args.top
     topname = f'top_{name}'
@@ -119,50 +111,46 @@
     # Next, we need to re-run topgen in order to create all auto-generated files.
     shell_out([
         REPO_TOP / 'util/topgen.py',
-        '-t', REPO_TOP / 'hw' / topname / 'data' / f"{topname}.hjson",
-        '-o', REPO_TOP / 'hw' / topname,
+        '-t',
+        REPO_TOP / 'hw' / topname / 'data' / f"{topname}.hjson",
+        '-o',
+        REPO_TOP / 'hw' / topname,
     ])
 
     # We need to patch some files:
-    # 1. Build system files need to be pointed to the proper auto-gen files
-    #    a. If building with meson, meson.build's TOPNAME needs to be renamed.
-    #    b. If building with bazel, we overwrite the earlgrey autogen-ed files
-    #       with the englishbreakfast equivalents where they differ (i.e. any
-    #       needed ip in `hw/topname/{ip, ip_autogen}`).
+    # 1. Build system files need to be pointed to the proper auto-gen files.
+    #    Specifically, we overwrite the earlgrey autogen-ed files with the
+    #    englishbreakfast equivalents where they differ (i.e. any needed ip in
+    #    `hw/topname/{ip, ip_autogen}`).
     # 2. SW sources currently contain
     #    hardcoded references to top_earlgrey. We
     #    need to change some file and variable names in auto-generated files.
     # 3. The build system still uses some sources from the original top level.
     #    We thus need to replace those with the new sources patched in 2.
 
-    if not args.bazel:
-        print("Rewriting $REPO_TOP/meson.build's TOPNAME")
-        meson_build = (REPO_TOP / 'meson.build').read_text()
-        meson_build = meson_build.replace("TOPNAME='top_earlgrey'", f"TOPNAME='{topname}'")
-        (REPO_TOP / 'meson.build').write_text(meson_build)
-    else:
-        # Patch hjson files for Bazel
-        print("Transplanting autogen-ed hjson files")
-        REG_FILES = [
-            'ip_autogen/alert_handler/data/alert_handler.hjson',
-            'ip/clkmgr/data/autogen/clkmgr.hjson',
-            'ip/flash_ctrl/data/autogen/flash_ctrl.hjson',
-            'ip/pwrmgr/data/autogen/pwrmgr.hjson',
-            'ip/rstmgr/data/autogen/rstmgr.hjson',
-            'ip/pinmux/data/autogen/pinmux.hjson',
-            'ip_autogen/rv_plic/data/rv_plic.hjson',
-            'ip/ast/data/ast.hjson',
-            'ip/sensor_ctrl/data/sensor_ctrl.hjson',
-        ]
-        for reg_file in REG_FILES:
-            src = REPO_TOP / 'hw' / topname / reg_file
-            dst = REPO_TOP / 'hw' / 'top_earlgrey' / reg_file
-            print(f"* Copying {src} -> {dst}")
-            dst.write_text(src.read_text())
+    # Patch hjson files for Bazel
+    print("Transplanting autogen-ed hjson files")
+    REG_FILES = [
+        'ip_autogen/alert_handler/data/alert_handler.hjson',
+        'ip/clkmgr/data/autogen/clkmgr.hjson',
+        'ip/flash_ctrl/data/autogen/flash_ctrl.hjson',
+        'ip/pwrmgr/data/autogen/pwrmgr.hjson',
+        'ip/rstmgr/data/autogen/rstmgr.hjson',
+        'ip/pinmux/data/autogen/pinmux.hjson',
+        'ip_autogen/rv_plic/data/rv_plic.hjson',
+        'ip/ast/data/ast.hjson',
+        'ip/sensor_ctrl/data/sensor_ctrl.hjson',
+    ]
+    for reg_file in REG_FILES:
+        src = REPO_TOP / 'hw' / topname / reg_file
+        dst = REPO_TOP / 'hw' / 'top_earlgrey' / reg_file
+        print(f"* Copying {src} -> {dst}")
+        dst.write_text(src.read_text())
 
     for suffix in ['.c', '.h', '_memory.h', '_memory.ld']:
         old = REPO_TOP / 'hw' / topname / 'sw/autogen' / (topname + suffix)
-        new = REPO_TOP / 'hw/top_earlgrey/sw/autogen' / ('top_earlgrey' + suffix)
+        new = REPO_TOP / 'hw/top_earlgrey/sw/autogen' / ('top_earlgrey' +
+                                                         suffix)
         print(f"* {old} -> {new}")
 
         text = old.read_text()
@@ -179,13 +167,11 @@
         return
 
     # Build the software including test_rom to enable the FPGA build.
-    if args.bazel:
-        shell_out([
-            REPO_TOP / 'bazelisk.sh', 'build',
-            '--copt=-DOT_IS_ENGLISH_BREAKFAST_REDUCED_SUPPORT_FOR_INTERNAL_USE_ONLY_',
-        ] + BAZEL_BINARIES)
-    else:
-        shell_out(['ninja', '-C', REPO_TOP / 'build-out'] + BINARIES)
+    shell_out([
+        REPO_TOP / 'bazelisk.sh',
+        'build',
+        '--copt=-DOT_IS_ENGLISH_BREAKFAST_REDUCED_SUPPORT_FOR_INTERNAL_USE_ONLY_',
+    ] + BAZEL_BINARIES)
 
 
 if __name__ == "__main__":
diff --git a/python-requirements.txt b/python-requirements.txt
index bb00873..0fb826b 100644
--- a/python-requirements.txt
+++ b/python-requirements.txt
@@ -42,10 +42,6 @@
 # Dependency of sw/host/vendor/google_verible_verilog_syntax_py
 anytree
 
-# To be removed with Meson.
-# Minimum matches version in meson.build
-meson >= 0.56.2, <= 0.57.2
-
 # Development version with OT-specific changes
 git+https://github.com/lowRISC/fusesoc.git@ot-0.1
 
diff --git a/site/docs/config.toml b/site/docs/config.toml
index da0417c..3dd5429 100644
--- a/site/docs/config.toml
+++ b/site/docs/config.toml
@@ -53,7 +53,6 @@
   "/hw/vendor/.*",
   "/hw/ip_templates/.*",
   "/sw/vendor/.*",
-  "/meson.build$",
   "/opentitan-docs/",
   "/scratch/",
   "/site/.*",
diff --git a/util/export_target.sh b/util/export_target.sh
deleted file mode 100755
index d178a0b..0000000
--- a/util/export_target.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-set -e
-
-# export_target.sh is intended to be invoked by Meson, to work around Meson's
-# limitations for custom_target() (it is not possible to specify more than one
-# command) and limitations on string handling (Meson does not provide
-# standard string manipulation functions like trim_prefix()).
-#
-# This script does not use build_consts.sh, but relies on Meson to supply that
-# information.
-
-platform_bin_dir="$1"; shift
-meson_src_dir_prefix="$1"; shift
-meson_src_dir="$1"; shift
-
-target_bin_dir="$platform_bin_dir/${meson_src_dir#"$meson_src_dir_prefix"}"
-
-mkdir -p "$target_bin_dir"
-cp $@ "$target_bin_dir"
diff --git a/util/invoke_cargo.sh b/util/invoke_cargo.sh
deleted file mode 100755
index dd83006..0000000
--- a/util/invoke_cargo.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-set -e
-
-# invoke_cargo.sh is a wrapper to invoke Cargo from Meson. This is a workaround
-# solution to read the rust-toolchain file and set the the relevant environment
-# variables.
-
-CARGO="${1}"
-CARGO_FLAGS="${2}"
-CARGO_FMT_FLAG="${3}"
-export RUSTFLAGS="${4}"
-
-TOOLCHAIN_FILE="${5}"
-if [[ -f $TOOLCHAIN_FILE ]]; then
-    TOOLCHAIN="$(cat ${TOOLCHAIN_FILE})"
-fi
-
-export MESON_SOURCE_ROOT="${6}"
-export MESON_BUILD_ROOT="${7}"
-
-if [ "${CARGO_TEST}" == 1 ]; then
-    echo "CARGO TEST BUILD!"
-    "${CARGO}" fmt ${CARGO_FMT_FLAG}
-    "${CARGO}" +"${TOOLCHAIN}" test ${CARGO_FLAGS} --workspace
-    "${CARGO}" +"${TOOLCHAIN}" build ${CARGO_FLAGS}
-else
-    "${CARGO}" fmt ${CARGO_FMT_FLAG}
-    "${CARGO}" +"${TOOLCHAIN}" build ${CARGO_FLAGS}  
-fi
diff --git a/util/otbn_build.py b/util/otbn_build.py
index 23ea48a..9508b4d 100755
--- a/util/otbn_build.py
+++ b/util/otbn_build.py
@@ -43,18 +43,9 @@
 from pathlib import Path
 from typing import List, Optional, Tuple
 
-from elftools.elf.elffile import ELFFile, SymbolTableSection  # type: ignore
-
-# yapf: disable
-
-# TODO: remove with meson; bazel will set the PYTHONPATH to locate otbn tools
-otbn_tools_path = os.environ.get('OTBN_TOOLS', None)
-if otbn_tools_path:
-    sys.path.append(otbn_tools_path)
 import otbn_as
 import otbn_ld
-
-# yapf: enable
+from elftools.elf.elffile import ELFFile, SymbolTableSection  # type: ignore
 
 
 def cmd_to_str(cmd: List[str]) -> str:
@@ -82,8 +73,8 @@
     This works by writing to a temporary file (in the same directory) and then
     atomically replacing any existing destination file when done. This is
     needed if we need to run multiple otbn_build processes that generate the
-    same files in parallel (a requirement because of our current Meson-based
-    infrastructure).
+    same files in parallel (this was a requirement of our old Meson-based
+    infrastructure; it may not be needed now that we use Bazel).
 
     '''
     out_dir, out_base = os.path.split(out_file)