diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a9c16ac089d..4ee379d9c69 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -220,8 +220,8 @@ jobs:
config_file: ${{ env.verible_config }}
extra_args: "--waiver_files=verible_waiver"
- otbn_standalone_tests:
- name: Run OTBN smoke Test
+ acc_standalone_tests:
+ name: Run ACC smoke Test
needs: quick_lint
runs-on:
group: zerorisc-none
@@ -246,15 +246,15 @@ jobs:
python3 --version
fusesoc --version
verilator --version
- - name: OTBN ISS test
- run: make -C hw/ip/otbn/dv/otbnsim test
+ - name: ACC ISS test
+ run: make -C hw/ip/acc/dv/accsim test
- name: OBTN smoke test
- run: ./hw/ip/otbn/dv/smoke/run_smoke.sh
+ run: ./hw/ip/acc/dv/smoke/run_smoke.sh
- name: Assemble & link code snippets
- run: make -C hw/ip/otbn/util asm-check
+ run: make -C hw/ip/acc/util asm-check
- otbn_crypto_tests:
- name: Run OTBN crypto tests
+ acc_crypto_tests:
+ name: Run ACC crypto tests
needs: quick_lint
runs-on:
group: zerorisc-none
@@ -267,7 +267,7 @@ jobs:
- name: Prepare environment
uses: ./.github/actions/prepare-env
- name: Execute tests
- run: ./bazelisk.sh test --test_tag_filters=-nightly //sw/otbn/crypto/...
+ run: ./bazelisk.sh test --test_tag_filters=-nightly //sw/acc/crypto/...
verilator_earlgrey:
name: Verilated Earl Grey
@@ -358,12 +358,12 @@ jobs:
#
# 1. `//hw/...` is out of scope.
# 2. `//quality/...` is tested by the lint jobs.
- # 3. `//sw/otbn/crypto/...` is tested by the OTBN job.
+ # 3. `//sw/acc/crypto/...` is tested by the ACC job.
# 4. `//third_party/...` which is not our code.
printf "%s\n" \
"-//hw/..." \
"-//quality/..." \
- "-//sw/otbn/crypto/..." \
+ "-//sw/acc/crypto/..." \
"-//third_party/..." \
>> "$target_pattern_file"
# Exclude anything that requires a bitstream splice.
diff --git a/.github/workflows/zr-ci.yml b/.github/workflows/zr-ci.yml
new file mode 100644
index 00000000000..a1e620bd628
--- /dev/null
+++ b/.github/workflows/zr-ci.yml
@@ -0,0 +1,589 @@
+# Copyright lowRISC contributors (OpenTitan project).
+# Licensed under the Apache License, Version 2.0, see LICENSE for details.
+# SPDX-License-Identifier: Apache-2.0
+#
+# Copyright zeroRISC Inc.
+# Confidential information of zeroRISC Inc. All rights reserved.
+
+name: zeroRISC CI
+on:
+ pull_request:
+ branches-ignore:
+ - "backport-*"
+ - "gh-readonly-queue/**"
+ tags:
+ - "*"
+ merge_group:
+ types:
+ - checks_requested
+ workflow_call:
+
+permissions:
+ contents: read
+ # Needed for workload identity federation
+ id-token: write
+ # Needed for reviewdog (verible linter)
+ pull-requests: write
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+env:
+ VIVADO_VERSION: "2024.1"
+ # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases
+ TOOLCHAIN_VERSION: 20220210-1
+
+jobs:
+ quick_lint:
+ name: Lint (quick)
+ runs-on:
+ group: zerorisc-none
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Required so we can lint commit messages.
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Show environment
+ run: ./ci/scripts/show-env.sh
+ - name: License headers
+ run: ./ci/scripts/check-licence-headers.sh "$GITHUB_BASE_REF"
+ if: ${{ github.event_name == 'pull_request' }}
+ - name: Executable bits
+ run: ./ci/scripts/exec-check.sh
+ - name: Non-ASCII characters
+ run: ./ci/scripts/check-ascii.sh
+ - name: Check Bazel build graph
+ run: ./bazelisk.sh build --nobuild //...
+ - name: Python (flake8)
+ run: ./ci/scripts/python-lint.sh "$GITHUB_BASE_REF"
+ if: ${{ github.event_name == 'pull_request' }}
+ - name: Python (mypy)
+ run: ./ci/scripts/mypy.sh
+ - name: Python (ruff)
+ run: ruff check
+ - name: Validate testplans with schema
+ run: ./ci/scripts/validate_testplans.sh
+ - name: C/C++ formatting
+ run: ./bazelisk.sh test //quality:clang_format_check
+ - name: Rust formatting
+ run: ./bazelisk.sh test //quality:rustfmt_check
+ - name: Shellcheck
+ run: ./bazelisk.sh test //quality:shellcheck_check
+ - name: Header guards
+ run: ./ci/scripts/include-guard.sh "$GITHUB_BASE_REF"
+ if: ${{ github.event_name == 'pull_request' }}
+ - name: Trailing whitespace
+ run: ./ci/scripts/whitespace.sh "$GITHUB_BASE_REF"
+ if: ${{ github.event_name == 'pull_request' }}
+ - name: Broken links
+ run: ./ci/scripts/check-links.sh
+ - name: Generated documentation
+ run: ./ci/scripts/check-cmdgen.sh
+ - name: Lock files
+ run: ./ci/scripts/check-lock-files.sh
+
+ slow_lint:
+ name: Lint (slow)
+ runs-on:
+ group: zerorisc-none
+ needs: quick_lint
+ if: ${{ github.event_name != 'merge_group' }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Bitstream cache requires all commits.
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ with:
+ install-verible: true
+ - name: Countermeasures implemented (earlgrey)
+ run: ./ci/scripts/check-countermeasures.sh earlgrey
+ - name: Countermeasures implemented (englishbreakfast)
+ run: ./ci/scripts/check-countermeasures.sh englishbreakfast
+ - name: Bazel test suite tags
+ run: ./ci/scripts/check_bazel_test_suites.py
+ continue-on-error: true
+ # See #21973: disabled until Verilator tags are fixed.
+ # - name: Check Bazel tags
+ # run: ./ci/scripts/check-bazel-tags.sh
+ # continue-on-error: true
+ - name: Banned Bazel rules
+ run: ./ci/scripts/check-bazel-banned-rules.sh
+ - name: Bazel target names
+ run: ./ci/scripts/check_bazel_target_names.py
+ - name: DV software images
+ run: ./ci/scripts/check_dv_sw_images.sh
+ continue-on-error: true
+ # zR: Currently commented out because it expects an upstream status report
+ # to exist for the current (internal) commit.
+ #- name: Build documentation
+ # run: ./ci/scripts/build-docs.sh
+ - name: Generated files
+ run: ./ci/scripts/check-generated.sh
+ env:
+ OT_DESTRUCTIVE: 1 # Required by the script to clean up.
+ - name: Buildifier
+ run: ./bazelisk.sh test //quality:buildifier_check
+ - name: Vendored files
+ run: ./ci/scripts/check-vendoring.sh
+ - name: Verible RTL
+ run: ./ci/scripts/verible-lint.sh rtl earlgrey
+ - name: Verible DV
+ run: ./ci/scripts/verible-lint.sh dv earlgrey
+ - name: Verible FPV
+ run: ./ci/scripts/verible-lint.sh fpv earlgrey
+ - name: Validate alert classification for Earl Grey
+ run: ./ci/scripts/validate_alert_classification.py hw/top_earlgrey/ip_autogen/alert_handler/data/top_earlgrey_alert_handler.ipconfig.hjson "$(realpath hw/top_earlgrey/data/otp/otp_ctrl_img_owner_sw_cfg.hjson)"
+ - name: Validate alert classification for Darjeeling
+ run: ./ci/scripts/validate_alert_classification.py hw/top_darjeeling/ip_autogen/alert_handler/data/top_darjeeling_alert_handler.ipconfig.hjson "$(realpath hw/top_darjeeling/data/otp/otp_ctrl_img_owner_sw_cfg.hjson)"
+
+ dependency-licenses:
+ name: Check software dependency licenses
+ runs-on:
+ group: zerorisc-none
+ needs: quick_lint
+ steps:
+ - uses: actions/checkout@v4
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Check Python licenses
+ run: |
+ ALLOWED=(
+ 'apache'
+ 'Apache 2.0'
+ 'Apache-2.0'
+ 'Apache Software License'
+ 'BSD'
+ 'BSD-3-Clause'
+ 'BSD License'
+ '3-Clause BSD License'
+ 'Freeware'
+ 'GNU Lesser General Public License v2 or later (LGPLv2+)'
+ 'GNU Lesser General Public License v3 (LGPLv3)'
+ 'GNU Library or Lesser General Public License (LGPL)'
+ 'MIT'
+ 'MIT License'
+ 'Mozilla Public License 2.0 (MPL 2.0)'
+ 'Public Domain'
+ 'Python Software Foundation License'
+ 'UNKNOWN'
+ '3-Clause BSD License'
+ )
+ ALLOWED_SEMI=${ALLOWED[0]}
+ for lic in "${ALLOWED[@]}"; do
+ ALLOWED_SEMI="$ALLOWED_SEMI;$lic"
+ done;
+ pip-licenses --allow-only "$ALLOWED_SEMI"
+ - name: Install cargo
+ run: |
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
+ echo "~/.cargo/bin" >> "$GITHUB_PATH"
+ - name: Check Rust licenses
+ run: |
+ cargo install cargo-deny --version 0.18.4
+ cargo deny --all-features --manifest-path third_party/rust/Cargo.toml check licenses
+ cargo deny --all-features --manifest-path third_party/tock/Cargo.toml check licenses
+
+ build_docs:
+ name: Build documentation
+ runs-on:
+ group: zerorisc-none
+ needs: quick_lint
+ if: ${{ github.event_name != 'merge_group' }}
+ env:
+ BUCKET: gold-hybrid-255313-prod
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Bitstream cache requires all commits.
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Build documentation
+ run: util/site/build-docs.sh build
+ - name: Upload files as artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: docs
+ path: build-site/
+ overwrite: true
+
+ verible_lint:
+ name: Verible lint
+ runs-on:
+ group: zerorisc-none
+ needs: quick_lint
+ if: ${{ github.event_name == 'pull_request' }}
+ env:
+ verible_config: hw/lint/tools/veriblelint/lowrisc-styleguide.rules.verible_lint
+ verible_version: v0.0-3430-g060bde0f
+ steps:
+ - uses: actions/checkout@v4
+ - name: Prepare Verible config
+ run: |
+ echo "Concatenating Verible waivers"
+ find . -type f -name '*.vbl' -exec cat {} \; >> verible_waiver
+
+ echo "::group::Verible config"
+ cat "$verible_config"
+ echo "::endgroup::"
+
+ echo "::group::Verible waiver"
+ cat "verible_waiver"
+ echo "::endgroup::"
+ - name: Install Verible
+ uses: ./.github/actions/third_party/verible
+ with:
+ verible_version: ${{ env.verible_version }}
+ - name: Run Verible linter with reviewdog
+ shell: bash
+ env:
+ INPUT_CONFIG_FILE: ${{ env.verible_config }}
+ INPUT_EXTRA_ARGS: '--waiver_files=verible_waiver'
+ INPUT_EXTENSIONS: ''
+ INPUT_FAIL_ON_ERROR: 'false'
+ INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ INPUT_LOG_FILE: 'verible-verilog-lint.log'
+ INPUT_PATHS: '.'
+ INPUT_REVIEWDOG_REPORTER: 'github-pr-check'
+ INPUT_SUGGEST_FIXES: 'false'
+ run: ./.github/actions/third_party/verible/entrypoint.sh
+ - name: Upload Verible linter log
+ uses: actions/upload-artifact@v4
+ with:
+ name: verible-linter
+ path: 'verible-verilog-lint.log'
+
+ acc_standalone_tests:
+ name: Run ACC smoke Test
+ needs: quick_lint
+ runs-on:
+ group: zerorisc-none
+ if: ${{ github.event_name != 'merge_group' }}
+ timeout-minutes: 10
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Bitstream cache requires all commits.
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Install toolchain
+ run: |
+ TOOLCHAIN_PATH=/tools/riscv
+ sudo util/get-toolchain.py \
+ --install-dir="$TOOLCHAIN_PATH" \
+ --release-version="$TOOLCHAIN_VERSION" \
+ --update
+ echo "$TOOLCHAIN_PATH/bin" >> $GITHUB_PATH
+ - name: Display environment
+ run: |
+ python3 --version
+ fusesoc --version
+ verilator --version
+ - name: ACC ISS test
+ run: make -C hw/ip/acc/dv/accsim test
+ - name: OBTN smoke test
+ run: ./hw/ip/acc/dv/smoke/run_smoke.sh
+ - name: Assemble & link code snippets
+ run: make -C hw/ip/acc/util asm-check
+
+ acc_crypto_tests:
+ name: Run ACC crypto tests
+ needs: quick_lint
+ runs-on:
+ group: zerorisc-none
+ if: ${{ github.event_name != 'merge_group' }}
+ timeout-minutes: 60
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Bitstream cache requires all commits.
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Execute tests
+ run: ./bazelisk.sh test --test_tag_filters=-nightly //sw/acc/crypto/...
+
+ verilator_earlgrey:
+ name: Verilated Earl Grey
+ runs-on:
+ group: zerorisc-large
+ needs: quick_lint
+ if: ${{ github.event_name != 'merge_group' }}
+ timeout-minutes: 240
+ steps:
+ - uses: actions/checkout@v4
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Run fast Verilator tests
+ run: ./ci/scripts/run-verilator-tests.sh
+ - name: Publish Bazel test results
+ uses: ./.github/actions/publish-bazel-test-results
+ if: ${{ !cancelled() }}
+ with:
+ artifact-name: verilator_earlgrey-test-results
+
+ chip_earlgrey_cw310_hyperdebug:
+ name: Earl Grey for CW310 Hyperdebug
+ needs: quick_lint
+ if: github.event_name == 'pull_request'
+ uses: ./.github/workflows/bitstream.yml
+ secrets: inherit
+ with:
+ top_name: earlgrey
+ design_suffix: cw310_hyperdebug
+ vivado_version: '2024.1'
+
+ chip_earlgrey_cw340:
+ name: Earl Grey for CW340
+ needs: quick_lint
+ if: github.event_name == 'pull_request'
+ uses: ./.github/workflows/bitstream.yml
+ secrets: inherit
+ with:
+ top_name: earlgrey
+ design_suffix: cw340
+
+ # Hyper310 FPGA jobs
+ execute_tests_hyper310:
+ name: Hyper310 Tests
+ needs: chip_earlgrey_cw310_hyperdebug
+ uses: ./.github/workflows/hyper310-pr.yml
+ if: ${{ github.event_name != 'merge_group' }}
+ secrets: inherit
+ with:
+ bitstream: chip_earlgrey_cw310_hyperdebug
+
+ # CW340 FPGA jobs
+ execute_tests_cw340:
+ name: CW340 Tests
+ needs: chip_earlgrey_cw340
+ uses: ./.github/workflows/cw340-pr.yml
+ if: ${{ github.event_name != 'merge_group' }}
+ secrets: inherit
+ with:
+ bitstream: chip_earlgrey_cw340
+
+ sw_build_test:
+ name: Build and test software
+ runs-on:
+ group: zerorisc-large
+ timeout-minutes: 120
+ needs: quick_lint
+ if: ${{ github.event_name != 'merge_group' }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Required for bitstream cache to work.
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Check Bazel build graph
+ run: |
+ # Test the graph with both an empty and filled bitstream cache.
+ ./ci/scripts/test-empty-bitstream-cache.sh
+ ./bazelisk.sh build --nobuild //...
+ - name: Select software targets
+ run: |
+ target_pattern_file="$(mktemp)"
+ echo "target_pattern_file=${target_pattern_file}" >> "$GITHUB_ENV"
+
+ # Start with building the whole graph.
+ echo '//...' > "$target_pattern_file"
+ # Exclude some targets:
+ #
+ # 1. `//hw/...` is out of scope.
+ # 2. `//quality/...` is tested by the lint jobs.
+ # 3. `//sw/acc/crypto/...` is tested by the ACC job.
+ # 4. `//third_party/...` which is not our code.
+ printf "%s\n" \
+ "-//hw/..." \
+ "-//quality/..." \
+ "-//sw/acc/crypto/..." \
+ "-//third_party/..." \
+ >> "$target_pattern_file"
+ # Exclude anything that requires a bitstream splice.
+ ./bazelisk.sh cquery \
+ --noinclude_aspects \
+ --output=starlark \
+ --starlark:expr='"-{}".format(target.label)' \
+ --define DISABLE_VERILATOR_BUILD=true \
+ -- "rdeps(//..., kind(bitstream_splice, //...))" \
+ >> "$target_pattern_file"
+ - name: Build software targets
+ run: |
+ # Build everything we selected, excluding some tags.
+ ./bazelisk.sh build \
+ --build_tests_only=false \
+ --define DISABLE_VERILATOR_BUILD=true \
+ --test_tag_filters=-broken,-cw310,-verilator,-dv \
+ --target_pattern_file="$target_pattern_file"
+ - name: Run software unit tests
+ run: |
+ ./bazelisk.sh test \
+ --build_tests_only=false \
+ --test_output=errors \
+ --define DISABLE_VERILATOR_BUILD=true \
+ --test_tag_filters=-broken,-cw310,-verilator,-dv,-silicon \
+ --target_pattern_file="$target_pattern_file"
+ - name: Publish Bazel test results
+ uses: ./.github/actions/publish-bazel-test-results
+ if: ${{ !cancelled() }}
+ with:
+ artifact-name: sw_build_test-test-results
+ - name: Check for unrunnable tests
+ run: ./ci/scripts/check-unrunnable-tests.sh
+ continue-on-error: true
+
+ dj_sw_build_test:
+ name: Build and test Darjeeling software
+ runs-on:
+ group: zerorisc-large
+ timeout-minutes: 120
+ needs: quick_lint
+ if: ${{ github.event_name != 'merge_group' }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Required for bitstream cache to work.
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Check Bazel build graph
+ run: |
+ # Test the graph with both an empty and filled bitstream cache.
+ ./ci/scripts/test-empty-bitstream-cache.sh
+ ./bazelisk.sh build --nobuild --//hw/top=darjeeling //...
+ - name: Build software targets
+ run: |
+ # Compile some selected targets
+ ./bazelisk.sh build \
+ --build_tests_only=false \
+ --//hw/top=darjeeling \
+ //sw/device/tests/...
+
+ qemu_smoketest:
+ name: QEMU smoketest
+ runs-on:
+ group: zerorisc-none
+ needs: quick_lint
+ if: ${{ github.event_name != 'merge_group' }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Prepare environment
+ uses: ./.github/actions/prepare-env
+ - name: Execute QEMU smoketest
+ run: |
+ ./bazelisk.sh test //sw/device/tests:rom_exit_immediately_sim_qemu_base
+
+ qemu_local_dev_test:
+ name: Test QEMU local development override
+ runs-on: ubuntu-22.04
+ needs: quick_lint
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ path: opentitan
+ - name: Prepare environment
+ uses: ./opentitan/.github/actions/prepare-env
+ with:
+ working-directory: opentitan
+ - uses: actions/checkout@v4
+ with:
+ repository: lowRISC/qemu
+ ref: v9.2.0-2025-02-11
+ fetch-depth: 0
+ path: qemu
+ - name: Check that overrides works
+ run: |
+ # The following packages are required to build QEMU.
+ sudo apt-get install -y ninja-build libpixman-1-dev libglib2.0-dev
+ # We need to symlink the BUILD file and create an empty REPO file.
+ ln -s $PWD/opentitan/third_party/qemu/BUILD.qemu_opentitan.bazel qemu/BUILD.bazel
+ touch qemu/REPO.bazel
+ # Just make sure all expected targets are there after building.
+ opentitan/bazelisk.sh build --override_repository="+qemu+qemu_opentitan_src=$PWD/qemu/" //third_party/qemu/...
+ - name: Upload error logs
+ if: failure()
+ uses: actions/upload-artifact@v4
+ with:
+ name: qemu-override-build-logs
+ path: qemu/build/*.log
+
+ # We would like to gate PR on quick lint and merge queue on bitstream caching.
+ # GitHub requires a single job name to be used for branch protection rule, so we use 2 jobs with
+ # conditional names so the non-skipped ones woud be called "Merge blocker".
+ #
+ # TODO: Enable these once `cache_bitstreams` is re-enabled.
+ #
+ # merge_blocker_pr:
+ # name: Merge blocker${{ github.event_name != 'pull_request' && ' (skipped)' || '' }}
+ # runs-on: ubuntu-latest
+ # needs: quick_lint
+ # if: ${{ !cancelled() && github.event_name == 'pull_request' }}
+ # steps:
+ # - name: Complete
+ # run: ${{ needs.quick_lint.result == 'success' }}
+ #
+ # merge_blocker_merge:
+ # name: Merge blocker${{ github.event_name != 'merge_group' && ' (skipped)' || '' }}
+ # runs-on: ubuntu-latest
+ # needs: cache_bitstreams
+ # if: ${{ !cancelled() && github.event_name == 'merge_group' }}
+ # steps:
+ # - name: Complete
+ # run: ${{ needs.cache_bitstreams.result == 'success' }}
+
+# Hardware DV tests
+ dvsim-multitop:
+ name: Multitop quick DVSim tests
+ needs: quick_lint
+ uses: ./.github/workflows/dv-multitop.yml
+ secrets: inherit
+ with:
+ run-type: "quick"
+ item: "smoke"
+ priority: 10
+
+ dvsim-earlgrey:
+ name: Earlgrey quick DVSim tests
+ needs: quick_lint
+ uses: ./.github/workflows/dv-earlgrey.yml
+ secrets: inherit
+ with:
+ run-type: "quick"
+ item: "smoke"
+ priority: 10
+
+ dvsim-earlgrey-report:
+ name: Earlgrey quick DVSim report
+ needs: [dvsim-multitop, dvsim-earlgrey]
+ uses: ./.github/workflows/dv-report.yml
+ secrets: inherit
+ with:
+ run-type: "quick"
+ top-name: "earlgrey"
+ hjson: hw/top_earlgrey/dv/top_earlgrey_sim_cfgs.hjson
+ item: "smoke"
+
+ dvsim-darjeeling:
+ name: Darjeeling quick DVSim tests
+ needs: quick_lint
+ uses: ./.github/workflows/dv-darjeeling.yml
+ secrets: inherit
+ with:
+ run-type: "quick"
+ item: "smoke"
+ priority: 10
+
+ dvsim-darjeeling-report:
+ name: Darjeeling quick DVSim report
+ needs: [dvsim-multitop, dvsim-darjeeling]
+ uses: ./.github/workflows/dv-report.yml
+ secrets: inherit
+ with:
+ run-type: "quick"
+ top-name: "darjeeling"
+ hjson: hw/top_darjeeling/dv/top_darjeeling_sim_cfgs.hjson
+ item: "smoke"
diff --git a/BLOCKFILE b/BLOCKFILE
index ba11f0f5059..9d5044a070d 100644
--- a/BLOCKFILE
+++ b/BLOCKFILE
@@ -46,7 +46,7 @@ hw/ip/i2c/rtl/*
hw/ip/keymgr/rtl/*
hw/ip/kmac/rtl/*
hw/ip/lc_ctrl/rtl/*
-hw/ip/otbn/rtl/*
+hw/ip/acc/rtl/*
hw/ip/otp_ctrl/rtl/*
hw/ip/otp_macro/rtl/*
hw/ip/pattgen/rtl/*
@@ -86,7 +86,7 @@ hw/ip/hmac/data/hmac.hjson
hw/ip/rv_dm/data/rv_dm.hjson
hw/ip/kmac/data/kmac.hjson
hw/ip/sysrst_ctrl/data/sysrst_ctrl.hjson
-hw/ip/otbn/data/otbn.hjson
+hw/ip/acc/data/acc.hjson
hw/ip/otp_macro/data/otp_macro.hjson
hw/ip/entropy_src/data/entropy_src.hjson
hw/ip/aes/data/aes.hjson
diff --git a/bench/collect_stats.sh b/bench/collect_stats.sh
index f70d4f96bde..6af3319edcc 100755
--- a/bench/collect_stats.sh
+++ b/bench/collect_stats.sh
@@ -18,8 +18,8 @@ echo "./bazelisk.sh test $bzlpath"
./bazelisk.sh test $bzlpath
# Collect the test logs for each target.
-echo "Collecting logs for all otbn_autogen_sim_test targets..."
-targets=$(./bazelisk.sh query "kind(otbn_autogen_sim_test, $bzlpath)")
+echo "Collecting logs for all acc_autogen_sim_test targets..."
+targets=$(./bazelisk.sh query "kind(acc_autogen_sim_test, $bzlpath)")
for target in $targets
do
shortname=$(echo $target | cut -d ":" -f 2)
@@ -29,7 +29,7 @@ do
if grep -q "cycles" $logfile; then
cp -f $logfile $statsfile
else
- echo "Target $shortname does not appear to include execution statistics. Is the 'stats' parameter set in the otbn_autogen_sim_test rule?"
+ echo "Target $shortname does not appear to include execution statistics. Is the 'stats' parameter set in the acc_autogen_sim_test rule?"
exit 1
fi
done
diff --git a/ci/scripts/check_dv_sw_images.py b/ci/scripts/check_dv_sw_images.py
index aa289a977ec..60d6cf2f017 100755
--- a/ci/scripts/check_dv_sw_images.py
+++ b/ci/scripts/check_dv_sw_images.py
@@ -26,7 +26,7 @@ class SwType(Enum):
ROM = 0 # Ibex SW - first stage boot ROM.
TEST_SLOT_A = 1 # Ibex SW - test SW in (flash) slot A.
TEST_SLOT_B = 2 # Ibex SW - test SW in (flash) slot B.
- OTBN = 3 # Otbn SW
+ ACC = 3 # Acc SW
OTP = 4 # Customized OTP image
DEBUG = 5 # Debug SW - injected into SRAM.
diff --git a/ci/scripts/mypy.sh b/ci/scripts/mypy.sh
index 50bf9c305b4..950970220fd 100755
--- a/ci/scripts/mypy.sh
+++ b/ci/scripts/mypy.sh
@@ -8,9 +8,9 @@
set -e
dirs_with_lint_makefile=(
- hw/ip/otbn/dv/rig
- hw/ip/otbn/dv/otbnsim
- hw/ip/otbn/util
+ hw/ip/acc/dv/rig
+ hw/ip/acc/dv/accsim
+ hw/ip/acc/util
hw/ip/rom_ctrl/util
util/reggen
)
diff --git a/ci/scripts/run-verilator-tests.sh b/ci/scripts/run-verilator-tests.sh
index ebefcdd6d0f..eac0b3b88b7 100755
--- a/ci/scripts/run-verilator-tests.sh
+++ b/ci/scripts/run-verilator-tests.sh
@@ -19,8 +19,8 @@ set -e
//sw/device/tests:aes_smoketest_sim_verilator \
//sw/device/tests:uart_smoketest_sim_verilator \
//sw/device/tests:crt_test_sim_verilator \
- //sw/device/tests:otbn_randomness_test_sim_verilator \
- //sw/device/tests:otbn_irq_test_sim_verilator \
+ //sw/device/tests:acc_randomness_test_sim_verilator \
+ //sw/device/tests:acc_irq_test_sim_verilator \
//sw/device/tests:kmac_mode_cshake_test_sim_verilator \
//sw/device/tests:kmac_mode_kmac_test_sim_verilator \
//sw/device/tests:flash_ctrl_test_sim_verilator \
diff --git a/hw/BUILD b/hw/BUILD
index 600fa80dac0..a1119f29fe2 100644
--- a/hw/BUILD
+++ b/hw/BUILD
@@ -99,7 +99,7 @@ fusesoc_build(
cores = [
":cores",
],
- data = ["//hw/ip/otbn:rtl_files"],
+ data = ["//hw/ip/acc:rtl_files"],
make_options = ":make_options",
output_groups = opentitan_select_top_attr("top_verilator_binary"),
systems = opentitan_select_top_attr("top_verilator_core"),
diff --git a/hw/Makefile b/hw/Makefile
index 34dc545fc5f..7fc6d3a498b 100644
--- a/hw/Makefile
+++ b/hw/Makefile
@@ -33,7 +33,7 @@ IPS ?= aes \
kmac \
lc_ctrl \
mbx \
- otbn \
+ acc \
otp_macro \
pattgen \
pwm \
diff --git a/hw/bitstream/vivado/BUILD b/hw/bitstream/vivado/BUILD
index f8a7c9c66ef..4cb00c1ea17 100644
--- a/hw/bitstream/vivado/BUILD
+++ b/hw/bitstream/vivado/BUILD
@@ -46,7 +46,7 @@ fusesoc_build(
_OTP_RMA,
],
cores = ["//hw:cores"],
- data = ["//hw/ip/otbn:rtl_files"],
+ data = ["//hw/ip/acc:rtl_files"],
flags = [
"--BootRomInitFile=" + _CW310_TESTROM_PATH,
"--OtpMacroMemInitFile=" + _OTP_RMA_PATH,
@@ -87,7 +87,7 @@ fusesoc_build(
_OTP_RMA,
],
cores = ["//hw:cores"],
- data = ["//hw/ip/otbn:rtl_files"],
+ data = ["//hw/ip/acc:rtl_files"],
flags = [
"--BootRomInitFile=" + _CW310_TESTROM_PATH,
"--OtpMacroMemInitFile=" + _OTP_RMA_PATH,
@@ -128,7 +128,7 @@ fusesoc_build(
_OTP_RMA,
],
cores = ["//hw:cores"],
- data = ["//hw/ip/otbn:rtl_files"],
+ data = ["//hw/ip/acc:rtl_files"],
flags = [
"--BootRomInitFile=" + _CW340_TESTROM_PATH,
"--OtpMacroMemInitFile=" + _OTP_RMA_PATH,
diff --git a/hw/doc/cores.md b/hw/doc/cores.md
index 68b5a62e9fd..dcbe1368d5c 100644
--- a/hw/doc/cores.md
+++ b/hw/doc/cores.md
@@ -4,6 +4,6 @@ Cores in OpenTitan are processing units that can run programs.
Currently, there are two cores in OpenTitan:
* [Ibex](../top_earlgrey/ip_autogen/rv_core_ibex/README.md) (RV32IMCB)
-* [OTBN](../ip/otbn/README.md) (programmable coprocessor for asymmetric cryptographic algorithms, 256-bit datapath)
+* [ACC](../ip/acc/README.md) (programmable coprocessor for asymmetric cryptographic algorithms, 256-bit datapath)
Since cores are the interface between hardware and software, please also consult the [software resources](../../sw/README.md).
diff --git a/hw/dv/sv/kmac_app_agent/kmac_app_agent_pkg.sv b/hw/dv/sv/kmac_app_agent/kmac_app_agent_pkg.sv
index 9e763b6ddc8..a83e36e7ca7 100644
--- a/hw/dv/sv/kmac_app_agent/kmac_app_agent_pkg.sv
+++ b/hw/dv/sv/kmac_app_agent/kmac_app_agent_pkg.sv
@@ -24,7 +24,7 @@ package kmac_app_agent_pkg;
AppKeymgr,
AppLc,
AppRom,
- AppOtbn
+ AppAcc
} kmac_app_e;
// Create enum to determine size for NUM_APP_INTF
diff --git a/hw/dv/sv/kmac_app_agent/kmac_app_intf.sv b/hw/dv/sv/kmac_app_agent/kmac_app_intf.sv
index ec23c17093b..35ba003de59 100644
--- a/hw/dv/sv/kmac_app_agent/kmac_app_intf.sv
+++ b/hw/dv/sv/kmac_app_agent/kmac_app_intf.sv
@@ -29,7 +29,7 @@ interface kmac_app_intf (input clk, input rst_n);
wire hold_tmp;
logic next_d;
logic hold_d;
- logic otbn_start_d, otbn_start;
+ logic acc_start_d, acc_start;
logic [3:0] per_ctr_d, per_ctr;
logic [3:0] max_per;
@@ -42,9 +42,9 @@ interface kmac_app_intf (input clk, input rst_n);
StStart,
StWait,
StNext
- } otbn_state_e;
+ } acc_state_e;
- otbn_state_e otbn_state_d, otbn_state;
+ acc_state_e acc_state_d, acc_state;
// all the host pins are handled by push_pull driver, only include clk and rst here
clocking host_cb @(posedge clk);
@@ -85,12 +85,12 @@ interface kmac_app_intf (input clk, input rst_n);
// The following fsm is temporary for driving next/hold in the interface
// It should be removed once the restructuring of the sequencer/driver is complete
- // Hold is asserted 1'b1 at the start of the OTBN app req and returns to 1'b0 after last rsp
+ // Hold is asserted 1'b1 at the start of the ACC app req and returns to 1'b0 after last rsp
// Hold is asserted 1'b0 on the cycle immediately following last rsp_done
// Combinational decode of the state
always_comb begin
- otbn_state_d = otbn_state;
- otbn_start_d = otbn_start;
+ acc_state_d = acc_state;
+ acc_start_d = acc_start;
// Set next/hold default
hold_d = 1'b0;
@@ -99,12 +99,12 @@ interface kmac_app_intf (input clk, input rst_n);
// Default the counters
per_ctr_d = '0;
- unique case (otbn_state)
+ unique case (acc_state)
// Set hold at start of req
StIdle: begin
- if (otbn_start) begin
- otbn_state_d = StWait;
+ if (acc_start) begin
+ acc_state_d = StWait;
hold_d = 1'b1;
end
end
@@ -112,11 +112,11 @@ interface kmac_app_intf (input clk, input rst_n);
// Wait until first rsp to determine if more are needed
// Counters are constrained in kmac_app_host_seq
StWait: begin
- if (otbn_start) begin
+ if (acc_start) begin
hold_d = 1'b1;
per_ctr_d = per_ctr;
if (rsp_done == 1'b1) begin
- otbn_state_d = StNext;
+ acc_state_d = StNext;
per_ctr_d = per_ctr + 1'b1;
if ((per_ctr + 1) < max_per) begin
next_d = 1'b1;
@@ -130,18 +130,18 @@ interface kmac_app_intf (input clk, input rst_n);
// Next should only be high for a single clock cycle
// If response has reached total word len end FSM cycle
StNext: begin
- if (otbn_start) begin
+ if (acc_start) begin
hold_d = 1'b1;
next_d = 1'b0;
per_ctr_d = per_ctr;
if (per_ctr == max_per) begin
- otbn_state_d = StIdle;
- otbn_start_d = 1'b0;
+ acc_state_d = StIdle;
+ acc_start_d = 1'b0;
per_ctr_d = '0;
hold_d = 1'b0;
end else begin
if (rsp_done == 1'b0) begin
- otbn_state_d = StWait;
+ acc_state_d = StWait;
end
end
end
@@ -155,17 +155,17 @@ interface kmac_app_intf (input clk, input rst_n);
// Register the state
always_ff @(posedge clk) begin
if (!rst_n) begin
- otbn_state <= StIdle;
+ acc_state <= StIdle;
hold <= 1'b0;
next <= 1'b0;
per_ctr <= 1'b0;
- otbn_start <= 1'b0;
+ acc_start <= 1'b0;
end else begin
- otbn_state <= otbn_state_d;
+ acc_state <= acc_state_d;
hold <= hold_d;
next <= next_d;
per_ctr <= per_ctr_d;
- otbn_start <= otbn_start_d;
+ acc_start <= acc_start_d;
end
end
diff --git a/hw/dv/sv/kmac_app_agent/seq_lib/kmac_app_host_seq.sv b/hw/dv/sv/kmac_app_agent/seq_lib/kmac_app_host_seq.sv
index 0aecdc719df..b88bb38b5a5 100644
--- a/hw/dv/sv/kmac_app_agent/seq_lib/kmac_app_host_seq.sv
+++ b/hw/dv/sv/kmac_app_agent/seq_lib/kmac_app_host_seq.sv
@@ -50,7 +50,7 @@ class kmac_app_host_seq extends kmac_app_base_seq;
endfunction
- // Send the OTBN-specific header word
+ // Send the ACC-specific header word
virtual task send_header();
// Create the CFG msg req with only first byte valid
@@ -82,9 +82,9 @@ class kmac_app_host_seq extends kmac_app_base_seq;
init_msg_size_bytes = msg_size_bytes;
- // If mode is OTBN send CFG
- if (mode == AppOtbn) begin
- cfg.vif.otbn_start = 1'b1;
+ // If mode is ACC send CFG
+ if (mode == AppAcc) begin
+ cfg.vif.acc_start = 1'b1;
cfg.vif.max_per = max_digest_word;
send_header();
end
diff --git a/hw/formal/tools/vcformal/fpv.tcl b/hw/formal/tools/vcformal/fpv.tcl
index 145cb1e8ee4..e449a7931e2 100644
--- a/hw/formal/tools/vcformal/fpv.tcl
+++ b/hw/formal/tools/vcformal/fpv.tcl
@@ -135,7 +135,7 @@ if {$env(DUT_TOP) == "aes"} {
create_reset rst_ni -sense low
create_clock clk_edn_i -period 100
create_reset rst_edn_ni -sense low
-} elseif {$env(DUT_TOP) == "otbn"} {
+} elseif {$env(DUT_TOP) == "acc"} {
create_clock clk_i -period 100
create_reset rst_ni -sense low
create_clock clk_edn_i -period 100
diff --git a/hw/ip/BUILD b/hw/ip/BUILD
index b527f0870b1..547f6f74a18 100644
--- a/hw/ip/BUILD
+++ b/hw/ip/BUILD
@@ -14,6 +14,7 @@ filegroup(
"*/README.md",
],
) + [
+ "//hw/ip/acc:rtl_files",
"//hw/ip/adc_ctrl:rtl_files",
"//hw/ip/aes:rtl_files",
"//hw/ip/aon_timer:rtl_files",
@@ -28,7 +29,6 @@ filegroup(
"//hw/ip/kmac:rtl_files",
"//hw/ip/lc_ctrl:rtl_files",
"//hw/ip/mbx:rtl_files",
- "//hw/ip/otbn:rtl_files",
"//hw/ip/otp_ctrl:rtl_files",
"//hw/ip/otp_macro:rtl_files",
"//hw/ip/pattgen:rtl_files",
@@ -61,6 +61,7 @@ filegroup(
filegroup(
name = "doc_files",
srcs = glob(["**/*.md"]) + [
+ "//hw/ip/acc:doc_files",
"//hw/ip/adc_ctrl:doc_files",
"//hw/ip/aes:doc_files",
"//hw/ip/aon_timer:doc_files",
@@ -76,7 +77,6 @@ filegroup(
"//hw/ip/kmac:doc_files",
"//hw/ip/lc_ctrl:doc_files",
"//hw/ip/mbx:doc_files",
- "//hw/ip/otbn:doc_files",
"//hw/ip/pattgen:doc_files",
"//hw/ip/prim:doc_files",
"//hw/ip/rom_ctrl:doc_files",
diff --git a/hw/ip/README.md b/hw/ip/README.md
index 9b5acdaa23d..78a9f231015 100644
--- a/hw/ip/README.md
+++ b/hw/ip/README.md
@@ -4,6 +4,7 @@
| HW Block | Brief Summary |
|------------------|-----------------------------------------------------------------------------------------------------------------------------------|
+| [`acc`] | Programmable coprocessor for asymmetric cryptography with SCA and FI countermeasures |
| [`adc_ctrl`] | Low-power controller for a dual-channel ADC with filtering and debouncing capability |
| [`aes`] | AES encryption and decryption engine with SCA and FI countermeasures |
| [`aon_timer`] | Wakeup and watchdog timers running on a low-power, always-on clock |
@@ -19,7 +20,6 @@
| [`kmac`] | Accelerator for Keccak-based keyed hash message authentication code and SHA-3 hash functions; with SCA and FI countermeasures |
| [`lc_ctrl`] | Manages device life cycle states and transitions, and controls key manager, flash, OTP, and debug access |
| [`mbx`] | DOE mailbox for use as an integrated OpenTitan communication channel. |
-| [`otbn`] | Programmable coprocessor for asymmetric cryptography with SCA and FI countermeasures |
| [`otp_macro`] | OTP macro simulation model and CSR block |
| [`pattgen`] | Transmission of short time-dependent data patterns on two clock-parallel output channels |
| [`rom_ctrl`] | Interfaces scrambled boot ROM with system bus and KMAC for initial health check after reset |
@@ -36,6 +36,7 @@
+[`acc`]: ./acc/README.md
[`adc_ctrl`]: ./adc_ctrl/README.md
[`aes`]: ./aes/README.md
[`aon_timer`]: ./aon_timer/README.md
@@ -51,7 +52,6 @@
[`kmac`]: ./kmac/README.md
[`lc_ctrl`]: ./lc_ctrl/README.md
[`mbx`]: ./mbx/README.md
-[`otbn`]: ./otbn/README.md
[`otp_macro`]: ./otp_macro/README.md
[`pattgen`]: ./pattgen/README.md
[`rom_ctrl`]: ./rom_ctrl/README.md
diff --git a/hw/ip/otbn/.flake8 b/hw/ip/acc/.flake8
similarity index 100%
rename from hw/ip/otbn/.flake8
rename to hw/ip/acc/.flake8
diff --git a/hw/ip/otbn/BUILD b/hw/ip/acc/BUILD
similarity index 86%
rename from hw/ip/otbn/BUILD
rename to hw/ip/acc/BUILD
index 196399fb04b..f84a16a2e44 100644
--- a/hw/ip/otbn/BUILD
+++ b/hw/ip/acc/BUILD
@@ -14,7 +14,7 @@ filegroup(
"README.md",
],
) + [
- "//hw/ip/otbn/data:all_files",
+ "//hw/ip/acc/data:all_files",
],
)
@@ -24,6 +24,6 @@ filegroup(
"**/*.md",
"**/*.svg",
]) + [
- "//hw/ip/otbn/dv/otbnsim:doc_files",
+ "//hw/ip/acc/dv/accsim:doc_files",
],
)
diff --git a/hw/ip/otbn/README.md b/hw/ip/acc/README.md
similarity index 72%
rename from hw/ip/otbn/README.md
rename to hw/ip/acc/README.md
index 94506869248..bfd297cd481 100644
--- a/hw/ip/otbn/README.md
+++ b/hw/ip/acc/README.md
@@ -1,22 +1,17 @@
-# OpenTitan Big Number Accelerator (OTBN) Technical Specification
+# Asymmetric Cryptographic Coprocessor (ACC) Technical Specification
-[`otbn`](https://reports.opentitan.org/hw/ip/otbn/dv/uvm/latest/report.html):
-
-
-
-
# Overview
-This document specifies functionality of the OpenTitan Big Number Accelerator, or OTBN.
-OTBN is a coprocessor for asymmetric cryptographic operations like RSA or Elliptic Curve Cryptography (ECC).
+This document specifies functionality of the Asymmetric Cryptographic Coprocessor, or ACC.
+ACC is a fork from the OpenTitan Bignum Accelerator (OTBN).
-This module conforms to the [Comportable guideline for peripheral functionality](../../../doc/contributing/hw/comportability/README.md).
-See that document for integration overview within the broader top level system.
+ACC follows the [comportability guidelines for peripheral functionality](../../../doc/contributing/hw/comportability/README.md).
+Refer to the guidelines for an integration overview within a broader top level system.
## Features
-* Processor optimized for wide integer arithmetic
+* Processor optimized for wide integer and vector arithmetic
* 32b wide control path with 32 32b wide registers
* 256b wide data path with 32 256b wide registers
* Full control-flow support with conditional branch and unconditional jump instructions, hardware loops, and hardware-managed call/return stacks.
@@ -25,30 +20,31 @@ See that document for integration overview within the broader top level system.
## Description
-OTBN is a processor, specialized for the execution of security-sensitive asymmetric (public-key) cryptography code, such as RSA or ECC.
-Such algorithms are dominated by wide integer arithmetic, which are supported by OTBN's 256b wide data path, registers, and instructions which operate these wide data words.
+ACC is a processor, specialized for the execution of security-sensitive asymmetric (public-key) cryptography code, such as RSA or ECC.
+Such algorithms are dominated by wide integer arithmetic, which are supported by ACC's 256b wide data path, registers, and instructions which operate these wide data words.
On the other hand, the control flow is clearly separated from the data, and reduced to a minimum to avoid data leakage.
-The data OTBN processes is security-sensitive, and the processor design centers around that.
+The data ACC processes is security-sensitive, and the processor design centers around that.
The design is kept as simple as possible to reduce the attack surface and aid verification and testing.
For example, no interrupts or exceptions are included in the design, and all instructions are designed to be executable within a single cycle.
-OTBN is designed as a self-contained co-processor with its own instruction and data memory, which is accessible as a bus device.
+ACC is designed as a self-contained co-processor with its own instruction and data memory, which is accessible as a bus device.
## Compatibility
-OTBN is not designed to be compatible with other cryptographic accelerators.
-It received some inspiration from assembly code available from the [Chromium EC project](https://chromium.googlesource.com/chromiumos/platform/ec/),
+ACC is not designed to be compatible with other cryptographic accelerators, with the only exception being [KMAC](../kmac/README.md).
+There is a custom interface connection between KMAC and ACC for accelerating hash based post quantum cryptographic algorithms.
+ACC received some inspiration from assembly code available from the [Chromium EC project](https://chromium.googlesource.com/chromiumos/platform/ec/),
which has been formally verified within the [Fiat Crypto project](http://adam.chlipala.net/papers/FiatCryptoSP19/FiatCryptoSP19.pdf).
# Instruction Set
-OTBN is a processor with a custom instruction set.
+ACC is a processor with a custom instruction set.
The full ISA description can be found in our [ISA manual](./doc/isa.md).
The instruction set is split into two groups:
* The **base instruction subset** operates on the 32b General Purpose Registers (GPRs).
- Its instructions are used for the control flow of a OTBN application.
+ Its instructions are used for the control flow of an ACC application.
The base instructions are inspired by RISC-V's RV32I instruction set, but not compatible with it.
* The **big number instruction subset** operates on 256b Wide Data Registers (WDRs).
Its instructions are used for data processing.
@@ -57,7 +53,7 @@ The instruction set is split into two groups:
### General Purpose Registers (GPRs)
-OTBN has 32 General Purpose Registers (GPRs), each of which is 32b wide.
+ACC has 32 General Purpose Registers (GPRs), each of which is 32b wide.
The GPRs are defined in line with RV32I and are mainly used for control flow.
They are accessed through the base instruction subset.
GPRs aren't used by the main data path; this operates on the [Wide Data Registers](#wide-data-registers-wdrs), a separate register file, controlled by the big number instructions.
@@ -81,16 +77,16 @@ Access to the [call stack](#call-stack)
-Note: Currently, OTBN has no "standard calling convention," and GPRs other than `x0` and `x1` can be used for any purpose.
+Note: Currently, ACC has no "standard calling convention," and GPRs other than `x0` and `x1` can be used for any purpose.
If a calling convention is needed at some point, it is expected to be aligned with the RISC-V standard calling conventions, and the roles assigned to registers in that convention.
Even without a agreed-on calling convention, software authors are encouraged to follow the RISC-V calling convention where it makes sense.
For example, good choices for temporary registers are `x6`, `x7`, `x28`, `x29`, `x30`, and `x31`.
### Call Stack
-OTBN has an in-built call stack which is accessed through the `x1` GPR.
+ACC has a built-in call stack which is accessed through the `x1` GPR.
This is intended to be used as a return address stack, containing return addresses for the current stack of function calls.
-See the documentation for {{#otbn-insn-ref JAL}} and {{#otbn-insn-ref JALR}} for a description of how to use it for this purpose.
+See the documentation for {{#acc-insn-ref JAL}} and {{#acc-insn-ref JALR}} for a description of how to use it for this purpose.
The call stack has a maximum depth of 8 elements.
Each instruction that reads from `x1` pops a single element from the stack.
@@ -105,13 +101,13 @@ Providing the stack has at least one element, this is allowed, even if the stack
Control and Status Registers (CSRs) are 32b wide registers used for "special" purposes, as detailed in their description;
they are not related to the GPRs.
-CSRs can be accessed through dedicated instructions, {{#otbn-insn-ref CSRRS}} and {{#otbn-insn-ref CSRRW}}.
+CSRs can be accessed through dedicated instructions, {{#acc-insn-ref CSRRS}} and {{#acc-insn-ref CSRRW}}.
Writes to read-only (RO) registers are ignored; they do not signal an error.
-All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is written to [`CMD.start`](doc/registers.md#cmd)).
+All read-write (RW) CSRs are set to 0 when ACC starts an operation (when 1 is written to [`CMD.start`](doc/registers.md#cmd)).
-
-
+
@@ -194,7 +190,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
| RW |
MOD0 |
- Bits [31:0] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [31:0] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
|
@@ -203,7 +199,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
RW |
MOD1 |
- Bits [63:32] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [63:32] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
|
@@ -212,7 +208,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
RW |
MOD2 |
- Bits [95:64] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [95:64] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
|
@@ -221,7 +217,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
RW |
MOD3 |
- Bits [127:96] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [127:96] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
|
@@ -230,7 +226,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
RW |
MOD4 |
- Bits [159:128] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [159:128] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
|
@@ -239,7 +235,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
RW |
MOD5 |
- Bits [191:160] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [191:160] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
|
@@ -248,7 +244,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
RW |
MOD6 |
- Bits [223:192] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [223:192] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
|
@@ -257,7 +253,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
RW |
MOD7 |
- Bits [255:224] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [255:224] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
|
@@ -317,7 +313,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
Primarily intended to be used for key generation.
The number is sourced from the EDN via a single-entry cache.
- Reads when the cache is empty will cause OTBN to be stalled until a new random number is fetched from the EDN.
+ Reads when the cache is empty will cause ACC to be stalled until a new random number is fetched from the EDN.
@@ -340,7 +336,7 @@ All read-write (RW) CSRs are set to 0 when OTBN starts an operation (when 1 is w
### Wide Data Registers (WDRs)
-In addition to the 32b wide GPRs, OTBN has a second "wide" register file, which is used by the big number instruction subset.
+In addition to the 32b wide GPRs, ACC has a second "wide" register file, which is used by the big number instruction subset.
This register file consists of NWDR = 32 Wide Data Registers (WDRs).
Each WDR is WLEN = 256b wide.
@@ -357,15 +353,15 @@ GPRs are accessible from the base instruction subset, and WDRs are accessible fr
### Wide Special Purpose Registers (WSRs)
-OTBN has 256b Wide Special purpose Registers (WSRs).
+ACC has 256b Wide Special purpose Registers (WSRs).
These are analogous to the 32b CSRs, but are used by big number instructions.
-They can be accessed with the {{#otbn-insn-ref BN.WSRR}} and {{#otbn-insn-ref BN.WSRW}} instructions.
+They can be accessed with the {{#acc-insn-ref BN.WSRR}} and {{#acc-insn-ref BN.WSRW}} instructions.
Writes to read-only (RO) registers are ignored; they do not signal an error.
-All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is written to [`CMD.start`](doc/registers.md#cmd)).
+All read-write (RW) WSRs are set to 0 when ACC starts an operation (when 1 is written to [`CMD.start`](doc/registers.md#cmd)).
-
-
+
@@ -381,7 +377,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
| RW |
MOD |
- The modulus used by the {{#otbn-insn-ref BN.ADDM}} and {{#otbn-insn-ref BN.SUBM}} instructions.
+ The modulus used by the {{#acc-insn-ref BN.ADDM}} and {{#acc-insn-ref BN.SUBM}} instructions.
This WSR is also visible as CSRs `MOD0` through to `MOD7`.
|
@@ -394,7 +390,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
Primarily intended to be used for key generation.
The number is sourced from the EDN via a single-entry cache.
- Reads when the cache is empty will cause OTBN to be stalled until a new random number is fetched from the EDN.
+ Reads when the cache is empty will cause ACC to be stalled until a new random number is fetched from the EDN.
@@ -415,7 +411,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
| RW |
ACC |
- The accumulator register used by the {{#otbn-insn-ref BN.MULQACC}} instruction.
+ The accumulator register used by the {{#acc-insn-ref BN.MULQACC}} instruction.
|
@@ -423,7 +419,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
| RW |
ACCH |
- The high bits of the accumulator register used by the {{#otbn-insn-ref BN.MULV}} instruction.
+ The high bits of the accumulator register used by the {{#acc-insn-ref BN.MULV}} instruction.
|
@@ -431,7 +427,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
| RO |
KEY_S0_L |
- Bits [255:0] of share 0 of the 384b OTBN sideload key provided by the [Key Manager](../keymgr/README.md).
+ Bits [255:0] of share 0 of the 384b ACC sideload key provided by the [Key Manager](../keymgr/README.md).
A `KEY_INVALID` software error is raised on read if the Key Manager has not provided a valid key.
|
@@ -442,7 +438,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
KEY_S0_H |
Bits [255:128] of this register are always zero.
- Bits [127:0] contain bits [383:256] of share 0 of the 384b OTBN sideload key provided by the [Key Manager](../keymgr/README.md).
+ Bits [127:0] contain bits [383:256] of share 0 of the 384b ACC sideload key provided by the [Key Manager](../keymgr/README.md).
A `KEY_INVALID` software error is raised on read if the Key Manager has not provided a valid key.
|
@@ -452,7 +448,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
RO |
KEY_S1_L |
- Bits [255:0] of share 1 of the 384b OTBN sideload key provided by the [Key Manager](../keymgr/README.md).
+ Bits [255:0] of share 1 of the 384b ACC sideload key provided by the [Key Manager](../keymgr/README.md).
A `KEY_INVALID` software error is raised on read if the Key Manager has not provided a valid key.
|
@@ -463,7 +459,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
KEY_S1_H |
Bits [255:128] of this register are always zero.
- Bits [127:0] contain bits [383:256] of share 1 of the 384b OTBN sideload key provided by the [Key Manager](../keymgr/README.md).
+ Bits [127:0] contain bits [383:256] of share 1 of the 384b ACC sideload key provided by the [Key Manager](../keymgr/README.md).
A `KEY_INVALID` software error is raised on read if the Key Manager has not provided a valid key.
|
@@ -501,7 +497,7 @@ All read-write (RW) WSRs are set to 0 when OTBN starts an operation (when 1 is w
### Flags
-In addition to the wide register file, OTBN maintains global state in two groups of flags for the use by wide integer operations.
+In addition to the wide register file, ACC maintains global state in two groups of flags for the use by wide integer operations.
Flag groups are named Flag Group 0 (`FG0`), and Flag Group 1 (`FG1`).
Each group consists of four flags.
Each flag is a single bit.
@@ -522,31 +518,31 @@ The `M`, `L`, and `Z` flags are determined based on the result of the operation
### Loop Stack
-OTBN has two instructions for hardware-assisted loops: {{#otbn-insn-ref LOOP}} and {{#otbn-insn-ref LOOPI}}.
+ACC has two instructions for hardware-assisted loops: {{#acc-insn-ref LOOP}} and {{#acc-insn-ref LOOPI}}.
Both use the same state for tracking control flow.
This is a stack of tuples containing a loop count, start address and end address.
The stack has a maximum depth of eight and the top of the stack is the current loop.
# Security Features
-OTBN is a security co-processor.
+ACC is a security co-processor.
It contains various security features and is hardened against side-channel analysis and fault injection attacks.
-The following sections describe the high-level security features of OTBN.
+The following sections describe the high-level security features of ACC.
Refer to the [Design Details](#design-details) section for a more in-depth description.
## Data Integrity Protection
-OTBN's data integrity protection is designed to protect the data stored and processed within OTBN from modifications through physical attacks.
+ACC's data integrity protection is designed to protect the data stored and processed within ACC from modifications through physical attacks.
-Data in OTBN travels along a data path which includes the data memory (DMEM), the load-store-unit (LSU), the register files (GPR and WDR), and the execution units.
-Whenever possible, data transmitted or stored within OTBN is protected with an integrity protection code which guarantees the detection of at least three modified bits per 32 bit word.
+Data in ACC travels along a data path which includes the data memory (DMEM), the load-store-unit (LSU), the register files (GPR and WDR), and the execution units.
+Whenever possible, data transmitted or stored within ACC is protected with an integrity protection code which guarantees the detection of at least three modified bits per 32 bit word.
Additionally, instructions and data stored in the instruction and data memory, respectively, are scrambled with a lightweight, non-cryptographically-secure cipher.
Refer to the [Data Integrity Protection](./doc/theory_of_operation.md#data-integrity-protection) section for details of how the data integrity protections are implemented.
## Secure Wipe
-OTBN provides a mechanism to securely wipe all state it stores, including the instruction memory.
+ACC provides a mechanism to securely wipe all state it stores, including the instruction memory.
The full secure wipe mechanism is split into three parts:
- [Data memory secure wipe](./doc/theory_of_operation.md#data-memory-dmem-secure-wipe)
@@ -556,8 +552,8 @@ The full secure wipe mechanism is split into three parts:
A secure wipe is performed automatically in certain situations, or can be requested manually by the host software.
The full secure wipe is automatically initiated as a local reaction to a fatal error.
In addition, it can be triggered by the [Life Cycle Controller](../lc_ctrl/README.md) before RMA entry using the `lc_rma_req/ack` interface.
-In both cases OTBN enters the locked state afterwards and needs to be reset.
-A secure wipe of only the internal state is performed after reset, whenever an OTBN operation is complete, and after a recoverable error.
+In both cases ACC enters the locked state afterwards and needs to be reset.
+A secure wipe of only the internal state is performed after reset, whenever an ACC operation is complete, and after a recoverable error.
Finally, host software can manually trigger the data memory and instruction memory secure wipe operations by issuing an appropriate
[command](./doc/theory_of_operation.md#operations-and-commands).
@@ -565,29 +561,29 @@ Refer to the [Secure Wipe](./doc/theory_of_operation.md#secure-wipe) section for
## Instruction Counter
-In order to detect and mitigate fault injection attacks on the OTBN, the host CPU can read the number of executed instructions from [`INSN_CNT`](doc/registers.md#insn_cnt) and verify whether it matches the expectation.
-The host CPU can clear the instruction counter when OTBN is not running.
+In order to detect and mitigate fault injection attacks on the ACC, the host CPU can read the number of executed instructions from [`INSN_CNT`](doc/registers.md#insn_cnt) and verify whether it matches the expectation.
+The host CPU can clear the instruction counter when ACC is not running.
Writing any value to [`INSN_CNT`](doc/registers.md#insn_cnt) clears this register to zero.
-Write attempts while OTBN is running are ignored.
+Write attempts while ACC is running are ignored.
## Key Sideloading
-OTBN software can make use of a single 384b wide key provided by the [Key Manager](../keymgr/README.md), which is made available in two shares.
-The key is passed through a dedicated connection between the Key Manager and OTBN to avoid exposing it to other components.
+ACC software can make use of a single 384b wide key provided by the [Key Manager](../keymgr/README.md), which is made available in two shares.
+The key is passed through a dedicated connection between the Key Manager and ACC to avoid exposing it to other components.
Software can access the first share of the key through the [`KEY_S0_L`](#key-s0-l) and [`KEY_S0_H`](#key-s0-h) WSRs, and the second share of the key through the [`KEY_S1_L`](#key-s1-l) and [`KEY_S1_H`](#key-s1-h) WSRs.
-It is up to host software to configure the Key Manager so that it provides the right key to OTBN at the start of the operation, and to remove the key again once the operation on OTBN has completed.
-A `KEY_INVALID` software error is raised if OTBN software accesses any of the `KEY_*` WSRs when the Key Manager has not presented a key.
+It is up to host software to configure the Key Manager so that it provides the right key to ACC at the start of the operation, and to remove the key again once the operation on ACC has completed.
+A `KEY_INVALID` software error is raised if ACC software accesses any of the `KEY_*` WSRs when the Key Manager has not presented a key.
## Blanking
-To reduce side channel leakage OTBN employs a blanking technique on certain control and data paths.
+To reduce side channel leakage ACC employs a blanking technique on certain control and data paths.
When a path is blanked it is forced to 0 (by ANDing the path with a blanking signal) preventing sensitive data bits producing a power signature via that path where that path isn't needed for the current instruction.
Blanking controls all come directly from flops to prevent glitches in decode logic reducing the effectiveness of the blanking.
These control signals are determined in the [prefetch stage](#instruction-prefetch) via pre-decode logic.
Full decoding is still performed in the execution stage with the full decode results checked against the pre-decode blanking control.
-If the full decode disagrees with the pre-decode OTBN raises a `BAD_INTERNAL_STATE` fatal error.
+If the full decode disagrees with the pre-decode ACC raises a `BAD_INTERNAL_STATE` fatal error.
Blanking is applied in the following locations:
diff --git a/hw/ip/otbn/otbn.core b/hw/ip/acc/acc.core
similarity index 70%
rename from hw/ip/otbn/otbn.core
rename to hw/ip/acc/acc.core
index 5929892d76d..924cc06b36a 100644
--- a/hw/ip/otbn/otbn.core
+++ b/hw/ip/acc/acc.core
@@ -3,8 +3,8 @@ CAPI=2:
# Copyright zeroRISC Inc.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
-name: "lowrisc:ip:otbn:0.1"
-description: "OpenTitan Big Number Accelerator (OTBN)"
+name: "lowrisc:ip:acc:0.1"
+description: "OpenTitan Big Number Accelerator (ACC)"
filesets:
files_rtl_core:
@@ -22,31 +22,31 @@ filesets:
- lowrisc:ip:keymgr_pkg
- lowrisc:ip:edn_pkg
- lowrisc:ip:kmac_pkg
- - lowrisc:ip:otbn_pkg
+ - lowrisc:ip:acc_pkg
- lowrisc:prim:onehot_check
files:
- - rtl/otbn_controller.sv
- - rtl/otbn_decoder.sv
- - rtl/otbn_predecode.sv
- - rtl/otbn_instruction_fetch.sv
- - rtl/otbn_rf_base.sv
- - rtl/otbn_rf_bignum.sv
- - rtl/otbn_rf_base_ff.sv
- - rtl/otbn_rf_bignum_ff.sv
- - rtl/otbn_rf_base_fpga.sv
- - rtl/otbn_rf_bignum_fpga.sv
- - rtl/otbn_lsu.sv
- - rtl/otbn_alu_base.sv
- - rtl/otbn_alu_bignum.sv
- - rtl/otbn_mac_bignum.sv
+ - rtl/acc_controller.sv
+ - rtl/acc_decoder.sv
+ - rtl/acc_predecode.sv
+ - rtl/acc_instruction_fetch.sv
+ - rtl/acc_rf_base.sv
+ - rtl/acc_rf_bignum.sv
+ - rtl/acc_rf_base_ff.sv
+ - rtl/acc_rf_bignum_ff.sv
+ - rtl/acc_rf_base_fpga.sv
+ - rtl/acc_rf_bignum_fpga.sv
+ - rtl/acc_lsu.sv
+ - rtl/acc_alu_base.sv
+ - rtl/acc_alu_bignum.sv
+ - rtl/acc_mac_bignum.sv
- rtl/bn_vec_core/unified_mul.sv
- - rtl/bn_vec_core/otbn_bignum_mul.sv
+ - rtl/bn_vec_core/acc_bignum_mul.sv
- rtl/bn_vec_core/buffer_bit.sv
- - rtl/otbn_loop_controller.sv
- - rtl/otbn_stack.sv
- - rtl/otbn_rnd.sv
- - rtl/otbn_start_stop_control.sv
- - rtl/otbn_core.sv
+ - rtl/acc_loop_controller.sv
+ - rtl/acc_stack.sv
+ - rtl/acc_rnd.sv
+ - rtl/acc_start_stop_control.sv
+ - rtl/acc_core.sv
file_type: systemVerilogSource
files_rtl_top:
@@ -59,12 +59,12 @@ filesets:
- lowrisc:prim:lc_sync
- lowrisc:ip:edn_pkg
- lowrisc:prim:edn_req
- - lowrisc:ip:otbn_pkg
+ - lowrisc:ip:acc_pkg
- lowrisc:ip:otp_ctrl_pkg
files:
- - rtl/otbn_reg_top.sv
- - rtl/otbn_scramble_ctrl.sv
- - rtl/otbn.sv
+ - rtl/acc_reg_top.sv
+ - rtl/acc_scramble_ctrl.sv
+ - rtl/acc.sv
file_type: systemVerilogSource
files_verilator_waiver:
@@ -73,7 +73,7 @@ filesets:
- lowrisc:lint:common
- lowrisc:lint:comportable
files:
- - lint/otbn.vlt
+ - lint/acc.vlt
file_type: vlt
files_ascentlint_waiver:
@@ -82,7 +82,7 @@ filesets:
- lowrisc:lint:common
- lowrisc:lint:comportable
files:
- - lint/otbn.waiver
+ - lint/acc.waiver
file_type: waiver
parameters:
@@ -97,7 +97,7 @@ targets:
- tool_ascentlint ? (files_ascentlint_waiver)
- files_rtl_core
- files_rtl_top
- toplevel: otbn
+ toplevel: acc
lint:
<<: *default_target
@@ -113,7 +113,7 @@ targets:
lint-core:
filesets:
- files_rtl_core
- toplevel: otbn_core
+ toplevel: acc_core
default_tool: verilator
parameters:
- SYNTHESIS=true
diff --git a/hw/ip/otbn/otbn_pkg.core b/hw/ip/acc/acc_pkg.core
similarity index 75%
rename from hw/ip/otbn/otbn_pkg.core
rename to hw/ip/acc/acc_pkg.core
index 5fe055107af..3dcdf755192 100644
--- a/hw/ip/otbn/otbn_pkg.core
+++ b/hw/ip/acc/acc_pkg.core
@@ -2,8 +2,8 @@ CAPI=2:
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
-name: "lowrisc:ip:otbn_pkg:0.1"
-description: "Constants used by OTBN"
+name: "lowrisc:ip:acc_pkg:0.1"
+description: "Constants used by ACC"
filesets:
files_pkg:
@@ -11,8 +11,8 @@ filesets:
- lowrisc:prim:assert
- lowrisc:ip:otp_ctrl_pkg
files:
- - rtl/otbn_reg_pkg.sv
- - rtl/otbn_pkg.sv
+ - rtl/acc_reg_pkg.sv
+ - rtl/acc_pkg.sv
file_type: systemVerilogSource
targets:
diff --git a/hw/ip/otbn/data/BUILD b/hw/ip/acc/data/BUILD
similarity index 100%
rename from hw/ip/otbn/data/BUILD
rename to hw/ip/acc/data/BUILD
diff --git a/hw/ip/otbn/data/otbn.hjson b/hw/ip/acc/data/acc.hjson
similarity index 83%
rename from hw/ip/otbn/data/otbn.hjson
rename to hw/ip/acc/data/acc.hjson
index 47adee42c14..dd8fcb3349f 100644
--- a/hw/ip/otbn/data/otbn.hjson
+++ b/hw/ip/acc/data/acc.hjson
@@ -4,17 +4,17 @@
// Modified by Authors of "Towards ML-KEM & ML-DSA on OpenTitan" (https://eprint.iacr.org/2024/1192)
// Copyright "Towards ML-KEM & ML-DSA on OpenTitan" Authors
{
- name: "otbn",
+ name: "acc",
human_name: "OpenTitan Big Number Accelerator",
one_line_desc: "Programmable coprocessor for asymmetric cryptography with SCA and FI countermeasures",
one_paragraph_desc: '''
- OpenTitan Big Number Accelerator (OTBN) is a programmable coprocessor for asymmetric cryptographic algorithms such as RSA or elliptic curve cryptography (ECC).
- Such algorithms are dominated by wide integer arithmetic, which are executed on OTBN's 256-bit-wide data path.
- The data OTBN processes is often security sensitive, and OTBN is designed to reduce the attack surface by
+ OpenTitan Big Number Accelerator (ACC) is a programmable coprocessor for asymmetric cryptographic algorithms such as RSA or elliptic curve cryptography (ECC).
+ Such algorithms are dominated by wide integer arithmetic, which are executed on ACC's 256-bit-wide data path.
+ The data ACC processes is often security sensitive, and ACC is designed to reduce the attack surface by
(1) keeping the instruction set and the processor design as simple as possible to aid verification,
(2) minimizing control flow and clearly separating it from data flow,
- (3) limiting OTBN's instruction fetch and data memory accesses to separate, dedicated on-chip memories,
- (4) giving OTBN software direct access to cryptographically secure random numbers,
+ (3) limiting ACC's instruction fetch and data memory accesses to separate, dedicated on-chip memories,
+ (4) giving ACC software direct access to cryptographically secure random numbers,
and (5) implementing various hardware countermeasures to deter side-channel analysis (SCA) and fault injection (FI) attacks.
'''
// Unique comportable IP identifier defined under KNOWN_CIP_IDS in the regtool.
@@ -22,7 +22,7 @@
design_spec: "../doc",
dv_doc: "../doc/dv",
hw_checklist: "../doc/checklist",
- sw_checklist: "/sw/device/lib/dif/dif_otbn"
+ sw_checklist: "/sw/device/lib/dif/dif_acc"
revisions: [
{
version: "0.1.0",
@@ -55,19 +55,19 @@
{ name: "Stub",
type: "bit",
default: "0",
- desc: "Stub out the core of Otbn logic"
+ desc: "Stub out the core of Acc logic"
local: "false",
expose: "true"
},
{ name: "RegFile",
- type: "otbn_pkg::regfile_e",
- default: "otbn_pkg::RegFileFF",
- desc: "Selection of the register file implementation. See otbn_pkg.sv."
+ type: "acc_pkg::regfile_e",
+ default: "acc_pkg::RegFileFF",
+ desc: "Selection of the register file implementation. See acc_pkg.sv."
local: "false",
expose: "true"
},
{ name: "RndCnstUrndPrngSeed",
- type: "otbn_pkg::urnd_prng_seed_t",
+ type: "acc_pkg::urnd_prng_seed_t",
desc: '''
Default seed of the PRNG used for URND.
'''
@@ -96,23 +96,23 @@
local: "false"
expose: "true"
}
- { name: "RndCnstOtbnKey",
- type: "otp_ctrl_pkg::otbn_key_t",
+ { name: "RndCnstAccKey",
+ type: "otp_ctrl_pkg::acc_key_t",
desc: '''
Compile-time random reset value for IMem/DMem scrambling key.
'''
randcount: "128",
randtype: "data"
},
- { name: "RndCnstOtbnNonce",
- type: "otp_ctrl_pkg::otbn_nonce_t",
+ { name: "RndCnstAccNonce",
+ type: "otp_ctrl_pkg::acc_nonce_t",
desc: '''
Compile-time random reset value for IMem/DMem scrambling nonce.
'''
randcount: "64",
randtype: "data"
},
- { name: "OtbnPQCEn",
+ { name: "AccPQCEn",
type: "bit",
default: "0",
desc: '''
@@ -124,7 +124,7 @@
]
interrupt_list: [
{ name: "done"
- desc: "OTBN has completed the operation."
+ desc: "ACC has completed the operation."
}
]
alert_list: [
@@ -138,9 +138,9 @@
inter_signal_list: [
// Key request to OTP
- { struct: "otbn_otp_key"
+ { struct: "acc_otp_key"
type: "req_rsp"
- name: "otbn_otp_key"
+ name: "acc_otp_key"
act: "req"
default: "'0"
package: "otp_ctrl_pkg"
@@ -169,7 +169,7 @@
package: "kmac_pkg"
},
- // OTBN is not performing any operation and can be clock/power-gated.
+ // ACC is not performing any operation and can be clock/power-gated.
{ name: "idle",
type: "uni",
struct: "mubi4",
@@ -231,7 +231,7 @@
},
// Key sideload
- { struct: "otbn_key_req"
+ { struct: "acc_key_req"
type: "uni"
name: "keymgr_key"
act: "rcv"
@@ -240,27 +240,27 @@
],
features: [
{
- name: "OTBN.ISA"
+ name: "ACC.ISA"
desc: '''
- OTBN implements a custom ISA based on RV32I. It is split into base (32-bit) and bignum
+ ACC implements a custom ISA based on RV32I. It is split into base (32-bit) and bignum
(256-bit) parts. There is a separate register file for each.
''',
- name: "OTBN.RANDOM"
+ name: "ACC.RANDOM"
desc: '''
- OTBN has a connection to the EDN allowing it to receive 256-bits of entropy.
+ ACC has a connection to the EDN allowing it to receive 256-bits of entropy.
'''
- name: "OTBN.KEYMGR"
+ name: "ACC.KEYMGR"
desc: '''
- OTBN has a connection to the keymgr and it can receive key material from it.
+ ACC has a connection to the keymgr and it can receive key material from it.
'''
- name: "OTBN.SECUREWIPE"
+ name: "ACC.SECUREWIPE"
desc: '''
- OTBN has a secure wipe facility that can target the internal state as well as the
+ ACC has a secure wipe facility that can target the internal state as well as the
instruction and data memories.
'''
- name: "OTBN.MEM_SCRAMBLE"
+ name: "ACC.MEM_SCRAMBLE"
desc: '''
- OTBN scrambles its instruction and data memories using keys received from OTP.
+ ACC scrambles its instruction and data memories using keys received from OTP.
'''
}
]
@@ -271,13 +271,13 @@
{ name: "DATA.MEM.INTEGRITY",
desc: '''
Dmem is protected with ECC integrity.
- This is carried through to OTBN's register file.
+ This is carried through to ACC's register file.
'''
}
{ name: "INSTRUCTION.MEM.INTEGRITY",
desc: '''
Imem is protected with ECC integrity.
- This is carried through into OTBN's execute stage.
+ This is carried through into ACC's execute stage.
'''
}
{ name: "BUS.INTEGRITY",
@@ -371,10 +371,10 @@
}
{ name: "START_STOP_CTRL.STATE.CONSISTENCY"
desc: '''
- The secure wipe handshake between otbn_controller and
- otbn_start_stop_control uses a level-based req/ack interface. At the
- otbn_controller end, there is a check for unexpected acks. In
- otbn_start_stop_control, there is a check for secure wipe requests when
+ The secure wipe handshake between acc_controller and
+ acc_start_stop_control uses a level-based req/ack interface. At the
+ acc_controller end, there is a check for unexpected acks. In
+ acc_start_stop_control, there is a check for secure wipe requests when
we aren't in a state that allows it, and also a check for if the
request drops at an unexpected time.
'''
@@ -393,8 +393,8 @@
}
{ name: "DATA_REG_SW.SEC_WIPE"
desc: '''
- Securely wipe programmer visible OTBN register (GPRs, WDRs, CSRs, WSRs) state with random data.
- Initiated after reset, at the end of any OTBN operation, upon recoverable and fatal errors, and before RMA entry.
+ Securely wipe programmer visible ACC register (GPRs, WDRs, CSRs, WSRs) state with random data.
+ Initiated after reset, at the end of any ACC operation, upon recoverable and fatal errors, and before RMA entry.
'''
}
{ name: "WRITE.MEM.INTEGRITY"
@@ -407,7 +407,7 @@
}
{ name: "CTRL_FLOW.SCA"
desc: '''
- OTBN architecture does not have any data dependent timing behaviour
+ ACC architecture does not have any data dependent timing behaviour
'''
}
{ name: "DATA.MEM.SW_NOACCESS"
@@ -434,13 +434,13 @@
desc: '''
Command Register
- A command initiates an OTBN operation. While performing the operation,
- OTBN is busy; the !!STATUS register reflects that.
+ A command initiates an ACC operation. While performing the operation,
+ ACC is busy; the !!STATUS register reflects that.
All operations signal their completion by raising the done
interrupt; alternatively, software may poll the !!STATUS register.
- Writes are ignored if OTBN is not idle.
+ Writes are ignored if ACC is not idle.
Unrecognized commands are ignored.
''',
swaccess: "wo",
@@ -484,13 +484,13 @@
When set software errors produce fatal errors, rather than
recoverable errors.
- Writes are ignored if OTBN is not idle.
+ Writes are ignored if ACC is not idle.
'''
}
],
tags: [
// Don't write this register in the automated CSR tests, because those
- // tests are not aware whether OTBN is idle or not. If OTBN is not idle,
+ // tests are not aware whether ACC is idle or not. If ACC is not idle,
// it ignores the write and the test would fail.
"excl:CsrAllTests:CsrExclWrite"
]
@@ -504,26 +504,26 @@
name: "status",
resval: "0x04",
// Note: Keep the list of status codes in sync with status_e in
- // otbn_pkg.sv.
+ // acc_pkg.sv.
desc: '''
- Indicates the current operational state OTBN is in.
+ Indicates the current operational state ACC is in.
All BUSY values represent an operation started by a write to the
!!CMD register.
| Value | Name | Description |
|:------|:-------------------|:------------------------------------------------------|
- | 0x00 | IDLE | OTBN is idle: it is not performing any action. |
- | 0x01 | BUSY_EXECUTE | OTBN is busy executing software. |
- | 0x02 | BUSY_SEC_WIPE_DMEM | OTBN is busy securely wiping the data memory. |
- | 0x03 | BUSY_SEC_WIPE_IMEM | OTBN is busy securely wiping the instruction memory. |
- | 0x04 | BUSY_SEC_WIPE_INT | OTBN is busy securely wiping the internal state. |
- | 0xFF | LOCKED | OTBN is locked as reaction to a fatal error, and must be reset to unlock it again. See also the section "Reaction to Fatal Errors". |
+ | 0x00 | IDLE | ACC is idle: it is not performing any action. |
+ | 0x01 | BUSY_EXECUTE | ACC is busy executing software. |
+ | 0x02 | BUSY_SEC_WIPE_DMEM | ACC is busy securely wiping the data memory. |
+ | 0x03 | BUSY_SEC_WIPE_IMEM | ACC is busy securely wiping the instruction memory. |
+ | 0x04 | BUSY_SEC_WIPE_INT | ACC is busy securely wiping the internal state. |
+ | 0xFF | LOCKED | ACC is locked as reaction to a fatal error, and must be reset to unlock it again. See also the section "Reaction to Fatal Errors". |
'''
tags: [
// Exclude this field from the automated CSR tests. The register model does not know
- // OTBN automatically transitions from the reset state to `IDLE` as it completes the
+ // ACC automatically transitions from the reset state to `IDLE` as it completes the
// initial secure wipe of the internal state.
"excl:CsrAllTests:CsrExclAll"
]
@@ -539,8 +539,8 @@
Refer to the "List of Errors" section for a detailed description of the
errors.
- The host CPU can clear this register when OTBN is not running,
- by writing any value. Write attempts while OTBN is running are ignored.
+ The host CPU can clear this register when ACC is not running,
+ by writing any value. Write attempts while ACC is running are ignored.
''',
swaccess: "rw",
hwaccess: "hrw",
@@ -644,8 +644,8 @@
Fatal Alert Cause Register
Describes any errors that led to a fatal alert.
- A fatal error puts OTBN in locked state; the value of this register
- does not change until OTBN is reset.
+ A fatal error puts ACC in locked state; the value of this register
+ does not change until ACC is reset.
Refer to the "List of Errors" section for a detailed description of the
errors.
@@ -708,10 +708,10 @@
this register remains at 0. Instructions triggering an error do not
count towards the total.
- Always reads as 0 if OTBN is locked.
+ Always reads as 0 if ACC is locked.
- The host CPU can clear this register when OTBN is not running,
- by writing any value. Write attempts while OTBN is running are ignored.
+ The host CPU can clear this register when ACC is not running,
+ by writing any value. Write attempts while ACC is running are ignored.
''',
swaccess: "rw",
hwaccess: "hrw",
@@ -773,11 +773,11 @@
Instruction Memory Access
The instruction memory may only be accessed through this window
- while OTBN is idle.
+ while ACC is idle.
- If OTBN is busy or locked, read accesses return 0 and write accesses
+ If ACC is busy or locked, read accesses return 0 and write accesses
are ignored.
- If OTBN is busy, any access additionally triggers an
+ If ACC is busy, any access additionally triggers an
ILLEGAL_BUS_ACCESS fatal error.
'''
}
@@ -796,12 +796,12 @@
desc: '''
Data Memory Access
- The data memory may only be accessed through this window while OTBN
+ The data memory may only be accessed through this window while ACC
is idle.
- If OTBN is busy or locked, read accesses return 0 and write accesses
+ If ACC is busy or locked, read accesses return 0 and write accesses
are ignored.
- If OTBN is busy, any access additionally triggers an
+ If ACC is busy, any access additionally triggers an
ILLEGAL_BUS_ACCESS fatal error.
Note that DMEM is actually 4kiB in size, but only the first 3kiB of
diff --git a/hw/ip/otbn/data/otbn.ld.tpl b/hw/ip/acc/data/acc.ld.tpl
similarity index 87%
rename from hw/ip/otbn/data/otbn.ld.tpl
rename to hw/ip/acc/data/acc.ld.tpl
index b4d0cd308f7..3f3e2a2a292 100644
--- a/hw/ip/otbn/data/otbn.ld.tpl
+++ b/hw/ip/acc/data/acc.ld.tpl
@@ -3,11 +3,11 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
- OTBN has a pure Harvard architecture, with instruction and data
+ ACC has a pure Harvard architecture, with instruction and data
memory both starting at address 0.
- This linker script template is interpolated by otbn_ld.py after it gets
- the LMAs and memory sizes from otbn.hjson.
+ This linker script template is interpolated by acc_ld.py after it gets
+ the LMAs and memory sizes from acc.hjson.
*/
MEMORY
@@ -20,7 +20,7 @@ MEMORY
LMA addresses (for VMAs in imem/dmem, respectively)
Note that the DMEM load region is the first 3kiB of DMEM itself,
- to model the fact that OTBN can write to the whole region but
+ to model the fact that ACC can write to the whole region but
only the first 3kiB are bus-accessible.
*/
imem_load (rw) : ORIGIN = ${imem_lma}, LENGTH = ${imem_length}
diff --git a/hw/ip/otbn/data/otbn_sec_cm_testplan.hjson b/hw/ip/acc/data/acc_sec_cm_testplan.hjson
similarity index 80%
rename from hw/ip/otbn/data/otbn_sec_cm_testplan.hjson
rename to hw/ip/acc/data/acc_sec_cm_testplan.hjson
index 534c7e7b2f2..6ca6bfdced8 100644
--- a/hw/ip/otbn/data/otbn_sec_cm_testplan.hjson
+++ b/hw/ip/acc/data/acc_sec_cm_testplan.hjson
@@ -12,7 +12,7 @@
// make further manual updates.
//
// These countermeasures and their descriptions can be found here:
-// .../otbn/data/otbn.hjson
+// .../acc/data/acc.hjson
//
// It is possible that the testing of some of these countermeasures may already
// be covered as a testpoint in a different testplan. This duplication is ok -
@@ -20,7 +20,7 @@
// to the testpoints below using the `tests` key.
//
// Please ensure that this testplan is imported in:
-// .../otbn/data/otbn_testplan.hjson
+// .../acc/data/acc_testplan.hjson
{
testpoints: [
{
@@ -31,25 +31,25 @@
Hence there is no need to have a directed test for this countermeasure.
'''
stage: V2S
- tests: ["otbn_smoke"]
+ tests: ["acc_smoke"]
}
{
name: sec_cm_data_mem_integrity
desc: '''Verify the countermeasure(s) DATA.MEM.INTEGRITY.
- Run an OTBN program multiple times and corrupt the DMEM while the OTBN
+ Run an ACC program multiple times and corrupt the DMEM while the ACC
is still running.
'''
stage: V2S
- tests: ["otbn_dmem_err"]
+ tests: ["acc_dmem_err"]
}
{
name: sec_cm_instruction_mem_integrity
desc: '''Verify the countermeasure(s) INSTRUCTION.MEM.INTEGRITY.
- Run an OTBN program multiple times and corrupt the IMEM while the OTBN
+ Run an ACC program multiple times and corrupt the IMEM while the ACC
is still running.
'''
stage: V2S
- tests: ["otbn_imem_err"]
+ tests: ["acc_imem_err"]
}
{
name: sec_cm_bus_integrity
@@ -57,16 +57,16 @@
This entry is covered by tl_access_test.
'''
stage: V2S
- tests: ["otbn_tl_intg_err"]
+ tests: ["acc_tl_intg_err"]
}
{
name: sec_cm_controller_fsm_global_esc
desc: '''Verify the countermeasure(s) CONTROLLER.FSM.GLOBAL_ESC.
- Run an OTBN program, drive lc_escalate_en_i port randomly to
- see global escalation locking up OTBN.
+ Run an ACC program, drive lc_escalate_en_i port randomly to
+ see global escalation locking up ACC.
'''
stage: V2S
- tests: ["otbn_escalate"]
+ tests: ["acc_escalate"]
}
{
name: sec_cm_controller_fsm_local_esc
@@ -75,13 +75,13 @@
1. IMEM/DMEM error tests to see local escalation related with integrity Checking
2. Zero state URND test to see local escalation regarding a URND value of all zeros
3. Illegal memory access test to see local escalation while having illegal read and
- write accesses to the IMEM when the OTBN is busy.
- 4. Bad internal state errors that are triggered by otbn_sec_cm test will also cause
+ write accesses to the IMEM when the ACC is busy.
+ 4. Bad internal state errors that are triggered by acc_sec_cm test will also cause
local escalation to the locked state.
'''
stage: V2S
- tests: ["otbn_imem_err", "otbn_dmem_err", "otbn_zero_state_err_urnd", "otbn_illegal_mem_acc",
- "otbn_sec_cm"]
+ tests: ["acc_imem_err", "acc_dmem_err", "acc_zero_state_err_urnd", "acc_illegal_mem_acc",
+ "acc_sec_cm"]
}
{
name: sec_cm_controller_fsm_sparse
@@ -89,7 +89,7 @@
This countermeasure is verified with a standardized test.
'''
stage: V2S
- tests: ["otbn_sec_cm"]
+ tests: ["acc_sec_cm"]
}
{
name: sec_cm_scramble_key_sideload
@@ -100,7 +100,7 @@
scramble key by SW.
'''
stage: V2S
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
name: sec_cm_scramble_ctrl_fsm_local_esc
@@ -109,13 +109,13 @@
1. IMEM/DMEM error tests to see local escalation related with integrity Checking
2. Zero state URND test to see local escalation regarding a URND value of all zeros
3. Illegal memory access test to see local escalation while having illegal read and
- write accesses to the IMEM when the OTBN is busy.
- 4. Bad internal state errors that are triggered by otbn_sec_cm test will also cause
+ write accesses to the IMEM when the ACC is busy.
+ 4. Bad internal state errors that are triggered by acc_sec_cm test will also cause
local escalation to the locked state.
'''
stage: V2S
- tests: ["otbn_imem_err", "otbn_dmem_err", "otbn_zero_state_err_urnd", "otbn_illegal_mem_acc",
- "otbn_sec_cm"]
+ tests: ["acc_imem_err", "acc_dmem_err", "acc_zero_state_err_urnd", "acc_illegal_mem_acc",
+ "acc_sec_cm"]
}
{
name: sec_cm_scramble_ctrl_fsm_sparse
@@ -123,16 +123,16 @@
This countermeasure is verified with a standardized test.
'''
stage: V2S
- tests: ["otbn_sec_cm"]
+ tests: ["acc_sec_cm"]
}
{
name: sec_cm_start_stop_ctrl_fsm_global_esc
desc: '''Verify the countermeasure(s) START_STOP_CTRL.FSM.GLOBAL_ESC.
- Run an OTBN program, drive lc_escalate_en_i port randomly to
- see global escalation locking up the start-stop control FSM in OTBN.
+ Run an ACC program, drive lc_escalate_en_i port randomly to
+ see global escalation locking up the start-stop control FSM in ACC.
'''
stage: V2S
- tests: ["otbn_escalate"]
+ tests: ["acc_escalate"]
}
{
name: sec_cm_start_stop_ctrl_fsm_local_esc
@@ -141,12 +141,12 @@
1. IMEM/DMEM error tests to see local escalation related with integrity Checking
2. Zero state URND test to see local escalation regarding a URND value of all zeros
3. Illegal memory access test to see local escalation while having illegal read and
- write accesses to the IMEM when the OTBN is busy.
- 4. Bad internal state errors that are triggered by otbn_sec_cm test will also cause
+ write accesses to the IMEM when the ACC is busy.
+ 4. Bad internal state errors that are triggered by acc_sec_cm test will also cause
local escalation to the locked state.
'''
stage: V2S
- tests: ["otbn_imem_err", "otbn_dmem_err", "otbn_zero_state_err_urnd", "otbn_illegal_mem_acc", "otbn_sec_cm"]
+ tests: ["acc_imem_err", "acc_dmem_err", "acc_zero_state_err_urnd", "acc_illegal_mem_acc", "acc_sec_cm"]
}
{
name: sec_cm_start_stop_ctrl_fsm_sparse
@@ -154,16 +154,16 @@
This countermeasure is verified with a standardized test.
'''
stage: V2S
- tests: ["otbn_sec_cm"]
+ tests: ["acc_sec_cm"]
}
{
name: sec_cm_data_reg_sw_sca
desc: '''Verify the countermeasure(s) DATA_REG_SW.SCA.
Since this is related with unused parts of the datapath not changing throughout
- an OTBN run this security countermeasure is verified with assertions.
+ an ACC run this security countermeasure is verified with assertions.
'''
stage: V2S
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
name: sec_cm_ctrl_redun
@@ -173,7 +173,7 @@
Possible control flow paths are listed in the countermeasure description.
'''
stage: V2S
- tests: ["otbn_ctrl_redun"]
+ tests: ["acc_ctrl_redun"]
}
{
name: sec_cm_pc_ctrl_flow_redun
@@ -183,7 +183,7 @@
predecoder and decoder that results with a fatal error.
'''
stage: V2S
- tests: ["otbn_pc_ctrl_flow_redun"]
+ tests: ["acc_pc_ctrl_flow_redun"]
}
{
name: sec_cm_rnd_bus_consistency
@@ -192,7 +192,7 @@
word of the received RND data.
'''
stage: V2S
- tests: ["otbn_rnd_sec_cm"]
+ tests: ["acc_rnd_sec_cm"]
}
{
name: sec_cm_rnd_rng_digest
@@ -201,13 +201,13 @@
Expect to trigger RND_REP_CHK_FAIL recoverable error for repeated EDN words.
'''
stage: V2S
- tests: ["otbn_rnd_sec_cm"]
+ tests: ["acc_rnd_sec_cm"]
}
{
name: sec_cm_rf_base_data_reg_sw_integrity
desc: "Verify the countermeasure(s) RF_BASE.DATA_REG_SW.INTEGRITY."
stage: V2S
- tests: ["otbn_rf_base_intg_err"]
+ tests: ["acc_rf_base_intg_err"]
}
{
name: sec_cm_rf_base_data_reg_sw_glitch_detect
@@ -215,7 +215,7 @@
This countermeasure is verified with a standardized test.
'''
stage: V2S
- tests: ["otbn_sec_cm"]
+ tests: ["acc_sec_cm"]
}
{
name: sec_cm_stack_wr_ptr_ctr_redun
@@ -223,13 +223,13 @@
This countermeasure is verified with a standardized test.
'''
stage: V2S
- tests: ["otbn_sec_cm"]
+ tests: ["acc_sec_cm"]
}
{
name: sec_cm_rf_bignum_data_reg_sw_integrity
desc: "Verify the countermeasure(s) RF_BIGNUM.DATA_REG_SW.INTEGRITY."
stage: V2S
- tests: ["otbn_rf_bignum_intg_err"]
+ tests: ["acc_rf_bignum_intg_err"]
}
{
name: sec_cm_rf_bignum_data_reg_sw_glitch_detect
@@ -237,7 +237,7 @@
This countermeasure is verified with a standardized test.
'''
stage: V2S
- tests: ["otbn_sec_cm"]
+ tests: ["acc_sec_cm"]
}
{
name: sec_cm_loop_stack_ctr_redun
@@ -245,7 +245,7 @@
This countermeasure is verified with a standardized test.
'''
stage: V2S
- tests: ["otbn_sec_cm"]
+ tests: ["acc_sec_cm"]
}
{
name: sec_cm_loop_stack_addr_integrity
@@ -254,7 +254,7 @@
related with integrity failure.
'''
stage: V2S
- tests: ["otbn_stack_addr_integ_chk"]
+ tests: ["acc_stack_addr_integ_chk"]
}
{
name: sec_cm_call_stack_addr_integrity
@@ -263,7 +263,7 @@
related with integrity failure.
'''
stage: V2S
- tests: ["otbn_stack_addr_integ_chk"]
+ tests: ["acc_stack_addr_integ_chk"]
}
{
name: sec_cm_start_stop_ctrl_state_consistency
@@ -273,7 +273,7 @@
status.
'''
stage: V2S
- tests: ["otbn_sec_wipe_err"]
+ tests: ["acc_sec_wipe_err"]
}
{
name: sec_cm_data_mem_sec_wipe
@@ -283,7 +283,7 @@
Related assertions: DmemSecWipeRequiresUrndKey_A and DmemSecWipeRequiresOtpKey_A
'''
stage: V2S
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
name: sec_cm_instruction_mem_sec_wipe
@@ -293,46 +293,46 @@
Related assertions: ImemSecWipeRequiresUrndKey_A and ImemSecWipeRequiresOtpKey_A
'''
stage: V2S
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
name: sec_cm_data_reg_sw_sec_wipe
desc: '''Verify the countermeasure(s) DATA_REG_SW.SEC_WIPE.
- Golden model of OTBN in Python models secure wiping cycle accurately. So in every
+ Golden model of ACC in Python models secure wiping cycle accurately. So in every
test at least one internal secure wipe because of exiting a reset. Hence there
is no need for a specific test.
'''
stage: V2S
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
name: sec_cm_write_mem_integrity
desc: '''Verify the countermeasure(s) WRITE.MEM.INTEGRITY.
DV environment calculates CRC values independently from RTL with every memory write
- over the bus and than calculates it with the design. otbn_multi does not use backdoor
+ over the bus and than calculates it with the design. acc_multi does not use backdoor
writes to memory so it's guaranteed to see CRC checking for IMEM and DMEM there.
'''
stage: V2S
- tests: ["otbn_multi"]
+ tests: ["acc_multi"]
}
{
name: sec_cm_ctrl_flow_count
desc: '''Verify the countermeasure(s) CTRL_FLOW.COUNT.
- Golden model of OTBN in Python models instruction counter register cycle accurately.
+ Golden model of ACC in Python models instruction counter register cycle accurately.
So in every test there is a comparison between model instruction counter value and
design instruction counter value. Hence there is no need for a specific test.
'''
stage: V2S
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
name: sec_cm_ctrl_flow_sca
desc: '''Verify the countermeasure(s) CTRL_FLOW.SCA.
Since this is related with unused parts of the control path not changing
- throughout an OTBN run this security countermeasure is verified with assertions.
+ throughout an ACC run this security countermeasure is verified with assertions.
'''
stage: V2S
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
name: sec_cm_data_mem_sw_noaccess
@@ -341,20 +341,20 @@
DMEM. Expected result is a error response from the TLUL bus.
'''
stage: V2S
- tests: ["otbn_sw_no_acc"]
+ tests: ["acc_sw_no_acc"]
}
{
name: sec_cm_key_sideload
desc: '''Verify the countermeasure(s) KEY.SIDELOAD.
- DV environment cannot verify the architectural choice of having sideloaded keys. OTBN
+ DV environment cannot verify the architectural choice of having sideloaded keys. ACC
on top using this architecture, also raises an error in the case of invalid sideload keys.
Invalid sideload keys are allowed in the sideload key sequence fifty percent of the
- time by default. In that scenario OTBN would generate a KEY_INVALID recoverable software error.
- This happens test agnostic so otbn_single is mapped to represent an OTBN run in general.
+ time by default. In that scenario ACC would generate a KEY_INVALID recoverable software error.
+ This happens test agnostic so acc_single is mapped to represent an ACC run in general.
'''
stage: V2S
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
name: sec_cm_tlul_fifo_ctr_redun
diff --git a/hw/ip/otbn/data/otbn_testplan.hjson b/hw/ip/acc/data/acc_testplan.hjson
similarity index 80%
rename from hw/ip/otbn/data/otbn_testplan.hjson
rename to hw/ip/acc/data/acc_testplan.hjson
index 95dad5cb0db..d75ff6d0b3b 100644
--- a/hw/ip/otbn/data/otbn_testplan.hjson
+++ b/hw/ip/acc/data/acc_testplan.hjson
@@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
{
- name: "otbn"
+ name: "acc"
import_testplans: ["hw/dv/tools/dvsim/testplans/csr_testplan.hjson",
"hw/dv/tools/dvsim/testplans/mem_testplan.hjson",
"hw/dv/tools/dvsim/testplans/alert_test_testplan.hjson",
@@ -12,28 +12,28 @@
"hw/dv/tools/dvsim/testplans/passthru_mem_intg_testplan.hjson",
"hw/dv/tools/dvsim/testplans/sec_cm_fsm_testplan.hjson",
"hw/dv/tools/dvsim/testplans/sec_cm_count_testplan.hjson",
- "otbn_sec_cm_testplan.hjson"]
+ "acc_sec_cm_testplan.hjson"]
testpoints: [
{
name: smoke
desc: '''
Smoke test, running a single fixed binary
- This runs the binary from otbn/dv/smoke/smoke_test.s, which is
+ This runs the binary from acc/dv/smoke/smoke_test.s, which is
designed to check most of the implemented instructions. The
unchanging binary should mean this basic test is particularly
appropriate for CI.
'''
stage: V1
- tests: ["otbn_smoke"]
+ tests: ["acc_smoke"]
}
{
name: single_binary
desc: '''
Run a single randomly-chosen binary
- This test drives the main bulk of OTBN testing. It picks a random
+ This test drives the main bulk of ACC testing. It picks a random
binary from a pre-generated set and runs it, comparing against the
model. We'll run this with a large number of seeds and use
functional coverage to track when verification of the internals of
@@ -44,7 +44,7 @@
'''
stage: V1
- tests: ["otbn_single"]
+ tests: ["acc_single"]
}
{
@@ -60,7 +60,7 @@
'''
stage: V2
- tests: ["otbn_reset"]
+ tests: ["acc_reset"]
}
{
@@ -71,12 +71,12 @@
These are directed tests, designed to exhaustively trigger all the
cases where a single instruction execution can fail for more than
one reason. Since each of these instructions causes the operation
- to fail, we have to run an OTBN operation for each. To do this, we
+ to fail, we have to run an ACC operation for each. To do this, we
compile and run all the binaries in a collection of ISS unit tests.
We have coverage points to ensure we see every event we expect.
'''
stage: V2
- tests: ["otbn_multi_err"]
+ tests: ["acc_multi_err"]
}
{
@@ -85,7 +85,7 @@
Inject ECC errors into DMEM and IMEM and expect an alert
'''
stage: V2S
- tests: ["otbn_imem_err", "otbn_dmem_err"]
+ tests: ["acc_imem_err", "acc_dmem_err"]
}
{
name: internal_integrity
@@ -93,10 +93,10 @@
Corrupt internal state and expect an alert
'''
stage: V2S
- tests: ["otbn_alu_bignum_mod_err",
- "otbn_controller_ispr_rdata_err",
- "otbn_mac_bignum_acc_err",
- "otbn_urnd_err"]
+ tests: ["acc_alu_bignum_mod_err",
+ "acc_controller_ispr_rdata_err",
+ "acc_mac_bignum_acc_err",
+ "acc_urnd_err"]
}
{
name: back_to_back
@@ -109,7 +109,7 @@
'''
stage: V2
- tests: ["otbn_multi"]
+ tests: ["acc_multi"]
}
{
name: stress_all
@@ -117,7 +117,7 @@
Run assorted sequences back-to-back.
'''
stage: V2
- tests: ["otbn_stress_all"]
+ tests: ["acc_stress_all"]
}
{
name: lc_escalation
@@ -125,7 +125,7 @@
Trigger the life cycle escalation input.
'''
stage: V2
- tests: ["otbn_escalate"]
+ tests: ["acc_escalate"]
}
{
name: zero_state_err_urnd
@@ -134,7 +134,7 @@
Check that fatal error is asserted.
'''
stage: V2
- tests: ["otbn_zero_state_err_urnd"]
+ tests: ["acc_zero_state_err_urnd"]
}
{
name: illegal_bus_access
@@ -143,7 +143,7 @@
ILLEGAL_BUS_ACCESS. Check that *mem_rdata_bus pins are at 0 when reads are done
'''
stage: V2S
- tests: ["otbn_illegal_mem_acc"]
+ tests: ["acc_illegal_mem_acc"]
}
{
name: sw_errs_fatal_chk
@@ -152,33 +152,33 @@
When set software errors produce fatal errors, rather than recoverable errors.
'''
stage: V2
- tests: ["otbn_sw_errs_fatal_chk"]
+ tests: ["acc_sw_errs_fatal_chk"]
}
{
- name: otbn_mem_gnt_acc_err
+ name: acc_mem_gnt_acc_err
desc: '''
Trigger a fault to cause the IMEM/DMEM grant signal to be false when req is asserted.
This in turn should cause dmem_missed_gnt/imem_missed_gnt to get asserted resulting
in a fatal alert (a bad_internal_state fatal error).
'''
stage: V2S
- tests: ["otbn_mem_gnt_acc_err"]
+ tests: ["acc_mem_gnt_acc_err"]
}
{
- name: otbn_non_sec_partial_wipe
+ name: acc_non_sec_partial_wipe
desc: '''
See a local wipe signal be raised when a secure wipe is not running. When this happens, we
expect the RTL to stop with a fatal alert. The signals tracked are:
- - sec_wipe_mod_urnd_i in otbn_alu_bignum
- - sec_wipe_zero_i in otbn_controller
- - sec_wipe_base in otbn_core
- - sec_wipe_wdr_q in otbn_core
- - sec_wipe_stack_reset_i in otbn_rf_base
+ - sec_wipe_mod_urnd_i in acc_alu_bignum
+ - sec_wipe_zero_i in acc_controller
+ - sec_wipe_base in acc_core
+ - sec_wipe_wdr_q in acc_core
+ - sec_wipe_stack_reset_i in acc_rf_base
'''
stage: V2S
- tests: ["otbn_partial_wipe"]
+ tests: ["acc_partial_wipe"]
}
]
}
diff --git a/hw/ip/otbn/data/base-insns.yml b/hw/ip/acc/data/base-insns.yml
similarity index 95%
rename from hw/ip/otbn/data/base-insns.yml
rename to hw/ip/acc/data/base-insns.yml
index f661946fa90..eb66d05b11b 100644
--- a/hw/ip/otbn/data/base-insns.yml
+++ b/hw/ip/acc/data/base-insns.yml
@@ -373,7 +373,7 @@
doc: |
The JAL instruction has the same behavior as in RV32I, jumping by the given offset and writing `PC+4` as a link address to the destination register.
- OTBN has a hardware managed call stack, accessed through `x1`, which should be used when calling subroutines.
+ ACC has a hardware managed call stack, accessed through `x1`, which should be used when calling subroutines.
Do so by using `x1` as the link register: `jal x1, `.
errs:
- *grd-call-stack
@@ -394,7 +394,7 @@
doc: |
The JALR instruction has the same behavior as in RV32I, jumping by ` + ` and writing `PC+4` as a link address to the destination register.
- OTBN has a hardware managed call stack, accessed through `x1`, which should be used when calling and returning from subroutines.
+ ACC has a hardware managed call stack, accessed through `x1`, which should be used when calling and returning from subroutines.
To return from a subroutine, use `jalr x0, x1, 0`.
This pops a link address from the call stack and branches to it.
To call a subroutine through a function pointer, use `jalr x1, , 0`.
@@ -587,12 +587,12 @@
The number of instructions in the loop is given in the `bodysize` immediate.
The `LOOP` instruction doesn't support a zero iteration count.
- If the value in `grs` is zero, OTBN stops, setting bit `loop` in `ERR_BITS`.
+ If the value in `grs` is zero, ACC stops, setting bit `loop` in `ERR_BITS`.
Starting a loop pushes an entry on to the [loop stack](../#loop-stack).
- If the stack is already full, OTBN stops, setting bit `loop` in `ERR_BITS`.
+ If the stack is already full, ACC stops, setting bit `loop` in `ERR_BITS`.
`LOOP`, `LOOPI`, jump and branch instructions are all permitted inside a loop but may not appear as the last instruction in a loop.
- OTBN will stop on that instruction, setting bit `loop` in `ERR_BITS`.
+ ACC will stop on that instruction, setting bit `loop` in `ERR_BITS`.
For more information on how to correctly use `LOOP` see [loop nesting](programmers_guide.md#loop-nesting).
errs:
@@ -619,12 +619,12 @@
The number of instructions in the loop is given in the `bodysize` immediate.
The `LOOPI` instruction doesn't support a zero iteration count.
- If the value of `iterations` is zero, OTBN stops with the `ErrCodeLoop` error.
+ If the value of `iterations` is zero, ACC stops with the `ErrCodeLoop` error.
Starting a loop pushes an entry on to the [loop stack](../#loop-stack).
- If the stack is already full, OTBN stops, setting bit `loop` in `ERR_BITS`.
+ If the stack is already full, ACC stops, setting bit `loop` in `ERR_BITS`.
`LOOP`, `LOOPI`, jump and branch instructions are all permitted inside a loop but may not appear as the last instruction in a loop.
- OTBN will stop on that instruction, setting bit `loop` in `ERR_BITS`.
+ ACC will stop on that instruction, setting bit `loop` in `ERR_BITS`.
For more information on how to correctly use `LOOPI` see [loop nesting](programmers_guide.md#loop-nesting).
encoding:
@@ -675,7 +675,7 @@
# Implement the de-facto UNIMP RISC-V instruction alias according to
# https://github.com/riscv/riscv-asm-manual/blob/master/riscv-asm.md
-# OTBN does not support the cycle CSR (0xC00), hence the illegal instruction
+# ACC does not support the cycle CSR (0xC00), hence the illegal instruction
# exception stems from the missing CSR instead of writing to a read-only, but
# the end result is the same.
- mnemonic: unimp
diff --git a/hw/ip/otbn/data/bignum-insns.yml b/hw/ip/acc/data/bignum-insns.yml
similarity index 99%
rename from hw/ip/otbn/data/bignum-insns.yml
rename to hw/ip/acc/data/bignum-insns.yml
index 1c4ecb9f10c..f6abc22fe43 100644
--- a/hw/ip/otbn/data/bignum-insns.yml
+++ b/hw/ip/acc/data/bignum-insns.yml
@@ -3,7 +3,7 @@
# Modified by Authors of "Towards ML-KEM & ML-DSA on OpenTitan" (https://eprint.iacr.org/2024/1192).
# Copyright "Towards ML-KEM & ML-DSA on OpenTitan" Authors.
# Modified by Ruben Niederhagen and Hoang Nguyen Hien Pham - authors of
-# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for OTBN"
+# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for ACC"
# (https://eprint.iacr.org/2025/2028).
# Copyright Ruben Niederhagen and Hoang Nguyen Hien Pham.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
diff --git a/hw/ip/otbn/data/csr.yml b/hw/ip/acc/data/csr.yml
similarity index 77%
rename from hw/ip/otbn/data/csr.yml
rename to hw/ip/acc/data/csr.yml
index 20f0d5c128f..4a38369ac4d 100644
--- a/hw/ip/otbn/data/csr.yml
+++ b/hw/ip/acc/data/csr.yml
@@ -46,49 +46,49 @@
- name: mod0
address: 0x7d0
doc: |
- Bits [31:0] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [31:0] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
- name: mod1
address: 0x7d1
doc: |
- Bits [63:32] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [63:32] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
- name: mod2
address: 0x7d2
doc: |
- Bits [95:64] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [95:64] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
- name: mod3
address: 0x7d3
doc: |
- Bits [127:96] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [127:96] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
- name: mod4
address: 0x7d4
doc: |
- Bits [159:128] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [159:128] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
- name: mod5
address: 0x7d5
doc: |
- Bits [191:160] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [191:160] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
- name: mod6
address: 0x7d6
doc: |
- Bits [223:192] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [223:192] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
- name: mod7
address: 0x7d7
doc: |
- Bits [255:224] of the modulus operand, used in the {{#otbn-insn-ref BN.ADDM}}/{{#otbn-insn-ref BN.SUBM}} instructions.
+ Bits [255:224] of the modulus operand, used in the {{#acc-insn-ref BN.ADDM}}/{{#acc-insn-ref BN.SUBM}} instructions.
This CSR is mapped to the MOD WSR.
- name: rnd_prefetch
@@ -135,7 +135,7 @@
Primarily intended to be used for key generation.
The number is sourced from the EDN via a single-entry cache.
- Reads when the cache is empty will cause OTBN to be stalled until a new random number is fetched from the EDN.
+ Reads when the cache is empty will cause ACC to be stalled until a new random number is fetched from the EDN.
- name: urnd
address: 0xfc1
diff --git a/hw/ip/otbn/data/enc-schemes.yml b/hw/ip/acc/data/enc-schemes.yml
similarity index 97%
rename from hw/ip/otbn/data/enc-schemes.yml
rename to hw/ip/acc/data/enc-schemes.yml
index b7ab10490dd..d0c6087bc57 100644
--- a/hw/ip/otbn/data/enc-schemes.yml
+++ b/hw/ip/acc/data/enc-schemes.yml
@@ -4,12 +4,12 @@
# Modified by Authors of "Towards ML-KEM & ML-DSA on OpenTitan" (https://eprint.iacr.org/2024/1192).
# Copyright "Towards ML-KEM & ML-DSA on OpenTitan" Authors.
# Modified by Ruben Niederhagen and Hoang Nguyen Hien Pham - authors of
-# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for OTBN"
+# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for ACC"
# (https://eprint.iacr.org/2025/2028)
# Copyright Ruben Niederhagen and Hoang Nguyen Hien Pham.
-# Instruction encoding schemes for OTBN
+# Instruction encoding schemes for ACC
#
# These are used by the instructions in insns.yml. A scheme defines the mapping
# between instruction operands and bits in the encoding. A scheme names zero or
@@ -163,7 +163,7 @@ custom4:
parents:
- rv(opcode=b11111)
-# A partial scheme for custom instructions with opcode b11111
+# A partial scheme for custom instructions with opcode b10010
custom5:
parents:
- rv(opcode=b10010)
@@ -187,7 +187,7 @@ wdr3:
wrs2: 24-20
wrs1: 19-15
-# A partial scheme for instructions that take two source WDRs and produce a
+# A partial scheme for instructions that take one source WDR and produce a
# dest WDR.
wdr2:
parents:
diff --git a/hw/ip/otbn/data/insns.yml b/hw/ip/acc/data/insns.yml
similarity index 99%
rename from hw/ip/otbn/data/insns.yml
rename to hw/ip/acc/data/insns.yml
index 4a0152450df..14b3354b521 100644
--- a/hw/ip/otbn/data/insns.yml
+++ b/hw/ip/acc/data/insns.yml
@@ -223,7 +223,7 @@ insn-groups:
- key: base
title: Base Instruction Subset
doc: |
- The base instruction set of OTBN is a limited 32b instruction set.
+ The base instruction set of ACC is a limited 32b instruction set.
It is used together with the 32b wide General Purpose Register file.
The primary use of the base instruction set is the control flow in applications.
diff --git a/hw/ip/otbn/data/wsr.yml b/hw/ip/acc/data/wsr.yml
similarity index 72%
rename from hw/ip/otbn/data/wsr.yml
rename to hw/ip/acc/data/wsr.yml
index 89874c76e4e..c96db43481e 100644
--- a/hw/ip/otbn/data/wsr.yml
+++ b/hw/ip/acc/data/wsr.yml
@@ -1,7 +1,7 @@
# Copyright lowRISC contributors (OpenTitan project).
# Copyright zeroRISC Inc.
# Modified by Ruben Niederhagen and Hoang Nguyen Hien Pham - authors of
-# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for OTBN"
+# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for ACC"
# (https://eprint.iacr.org/2025/2028).
# Copyright Ruben Niederhagen and Hoang Nguyen Hien Pham.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
@@ -10,7 +10,7 @@
- name: mod
address: 0
doc: |
- The modulus used by the {{#otbn-insn-ref BN.ADDM}} and {{#otbn-insn-ref BN.SUBM}} instructions.
+ The modulus used by the {{#acc-insn-ref BN.ADDM}} and {{#acc-insn-ref BN.SUBM}} instructions.
This WSR is also visible as CSRs `MOD0` through to `MOD7`.
- name: rnd
@@ -21,7 +21,7 @@
Primarily intended to be used for key generation.
The number is sourced from the EDN via a single-entry cache.
- Reads when the cache is empty will cause OTBN to be stalled until a new random number is fetched from the EDN.
+ Reads when the cache is empty will cause ACC to be stalled until a new random number is fetched from the EDN.
- name: urnd
address: 2
@@ -37,18 +37,18 @@
- name: acc
address: 3
doc: |
- The accumulator register used by the {{#otbn-insn-ref BN.MULQACC}} instruction.
+ The accumulator register used by the {{#acc-insn-ref BN.MULQACC}} instruction.
- name: acch
address: 11
doc: |
- The high bits of the accumulator register used by the {{#otbn-insn-ref BN.MULV}} instruction.
+ The high bits of the accumulator register used by the {{#acc-insn-ref BN.MULV}} instruction.
- name: key_s0_l
address: 4
read-only: true
doc: |
- Bits [255:0] of share 0 of the 384b OTBN sideload key provided by the [Key Manager](../keymgr/README.md).
+ Bits [255:0] of share 0 of the 384b ACC sideload key provided by the [Key Manager](../keymgr/README.md).
A `KEY_INVALID` software error is raised on read if the Key Manager has not provided a valid key.
@@ -57,7 +57,7 @@
read-only: true
doc: |
Bits [255:128] of this register are always zero.
- Bits [127:0] contain bits [383:256] of share 0 of the 384b OTBN sideload key provided by the [Key Manager](../keymgr/README.md).
+ Bits [127:0] contain bits [383:256] of share 0 of the 384b ACC sideload key provided by the [Key Manager](../keymgr/README.md).
A `KEY_INVALID` software error is raised on read if the Key Manager has not provided a valid key.
@@ -65,7 +65,7 @@
address: 6
read-only: true
doc: |
- Bits [255:0] of share 1 of the 384b OTBN sideload key provided by the [Key Manager](../keymgr/README.md).
+ Bits [255:0] of share 1 of the 384b ACC sideload key provided by the [Key Manager](../keymgr/README.md).
A `KEY_INVALID` software error is raised on read if the Key Manager has not provided a valid key.
@@ -74,7 +74,7 @@
read-only: true
doc: |
Bits [255:128] of this register are always zero.
- Bits [127:0] contain bits [383:256] of share 1 of the 384b OTBN sideload key provided by the [Key Manager](../keymgr/README.md).
+ Bits [127:0] contain bits [383:256] of share 1 of the 384b ACC sideload key provided by the [Key Manager](../keymgr/README.md).
A `KEY_INVALID` software error is raised on read if the Key Manager has not provided a valid key.
diff --git a/hw/ip/otbn/defs.bzl b/hw/ip/acc/defs.bzl
similarity index 72%
rename from hw/ip/otbn/defs.bzl
rename to hw/ip/acc/defs.bzl
index 0b78d924d4d..0faf5a1aa07 100644
--- a/hw/ip/otbn/defs.bzl
+++ b/hw/ip/acc/defs.bzl
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0
load("//rules/opentitan:hw.bzl", "opentitan_ip")
-OTBN = opentitan_ip(
- name = "otbn",
- hjson = "//hw/ip/otbn/data:otbn.hjson",
+ACC = opentitan_ip(
+ name = "acc",
+ hjson = "//hw/ip/acc/data:acc.hjson",
)
diff --git a/hw/ip/otbn/doc/otbn_blockarch.svg b/hw/ip/acc/doc/acc_blockarch.svg
similarity index 99%
rename from hw/ip/otbn/doc/otbn_blockarch.svg
rename to hw/ip/acc/doc/acc_blockarch.svg
index db1f970bfbd..0f2b2d9e86e 100644
--- a/hw/ip/otbn/doc/otbn_blockarch.svg
+++ b/hw/ip/acc/doc/acc_blockarch.svg
@@ -4,7 +4,7 @@
viewBox="0 0 1076.6736 886.2356"
stroke-miterlimit="10"
id="svg2383"
- sodipodi:docname="otbn_blockarch.svg"
+ sodipodi:docname="acc_blockarch.svg"
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
width="1076.6736"
height="886.2356"
@@ -769,7 +769,7 @@
sodipodi:role="line"
id="tspan25041"
x="21.057205"
- y="72.174202">otbn_otp_key_o
+ y="72.174202">acc_otp_key_o
otbn_otp_key_i
+ y="34.174198">acc_otp_key_i
OTBN Core
+ style="stroke-width:1.92105">ACC Core
OTBN Sideload Key Interface
+ style="font-size:8px">ACC Sideload Key Interface
Big Number Accelerator - OTBN
+ id="tspan3807">Number Accelerator - ACC
> 63` would do something like the below diagram:

@@ -128,7 +128,7 @@ Note that `bn.rshi` can work as a more typical right-shift by setting the high r
### Shifted operands
-Many bignum instructions on OTBN include a shift argument.
+Many bignum instructions on ACC include a shift argument.
For example, to compute `w1 + (w2 << 32)`, you can simply write:
```armasm
bn.add w3, w1, w2 << 32
@@ -150,8 +150,8 @@ Specifically, that means the following instructions:
- `bn.or` : bitwise or
- `bn.xor` : bitwise xor
-This shift argument makes manipulating sub-parts of words on OTBN concise and ergonomic.
-For example, here is how you can flip the endianness of each 32-bit word in a 256-bit word in 7 instructions (taken directly from our OTBN SHA-256 implementation):
+This shift argument makes manipulating sub-parts of words on ACC concise and ergonomic.
+For example, here is how you can flip the endianness of each 32-bit word in a 256-bit word in 7 instructions (taken directly from our ACC SHA-256 implementation):
```armasm
/**
* Flip the bytes in each 32-bit word of a 256-bit value.
@@ -185,19 +185,32 @@ bswap32_w23:
ret
```
+### Vector operations
+
+To accelerate the lattice-based cryptography ML-KEM and ML-DSA algorithms, ACC has vectorized variants of several bignum instructions.
+Specifically, the following instructions operate on vectors:
+- `bn.addv` : vector add
+- `bn.subv` : vector subtract
+- `bn.shv` : vector shift
+- `bn.trn` : vector transpose
+- `bn.mulv` : vector multiply and accumulate
+- `bn.mulv.l` : vector multiply and accumulate with lane index
+
+For a more detailed overview of the instruction encodings, see the [ISA guide](isa.md).
+
## Implementation process
-At a high level, the process for developing code on OTBN looks something like this:
+At a high level, the process for developing code on ACC looks something like this:
-
+
-OTBN-simulator tests usually function as a quick check or as unit tests for internal routines, so they are most useful for quick feedback on changes.
+ACC-simulator tests usually function as a quick check or as unit tests for internal routines, so they are most useful for quick feedback on changes.
Ibex-side tests are more useful for running large or randomized test suites on completed programs, which helps to find bugs in corner cases.
Finally, [SCA analysis](#sca-methodology) can run on either whole programs or small, sensitive subroutines, and helps to determine whether defenses against power and EM side-channels are working.
## An example program
-This is an entire, standalone OTBN program that computes `(a + b << 16) mod m`, where `a`, `b` and `m` are all up to 256 bits (and `a, b < m`):
+This is an entire, standalone ACC program that computes `(a + b << 16) mod m`, where `a`, `b` and `m` are all up to 256 bits (and `a, b < m`):
```armasm
.section .text.start
main:
@@ -266,12 +279,12 @@ Some notes to help explain the code above:
- The first argument to `loopi` is the number of iterations, and the second is the number of instructions in the loop body
- `.bss` marks data memory that is not initialized; the program would still work if we used `.data`, but the binary would be bigger because Ibex would store a bunch of placeholder zeroes
-To see all current OTBN programs from the OpenTitan codebase, see the [sw/otbn](https://github.com/lowRISC/opentitan/tree/master/sw/otbn) directory.
+To see all current ACC programs from the codebase, see the `sw/acc/` directory.
The `crypto/` subdirectory contains code we use in production, while the `code-snippets` subdirectory contains small example programs.
## Performance
-Here are some cycle counts from OTBN programs!
+Here are some cycle counts from ACC programs!
Look below for instructions on how to reproduce these benchmarks.
| Operation | Cycles | Commit | Target | Constant time |
@@ -293,106 +306,104 @@ Look below for instructions on how to reproduce these benchmarks.
A few notes:
-- Because some OTBN code is still under development, these cycle counts are expected to change a bit as we optimize the code and add hardening countermeasures against fault injection and power/EM side-channel attacks.
-- Some of these benchmarks include significant overhead from these countermeasures (for example, we run the inner loop of P-256 scalar multiplication 320 times instead of 256), but in OpenTitan's threat model the price is worthwhile.
-- For non-constant-time code, due to the nature of the OTBN benchmarks, it is currently difficult to run multiple tests, so the numbers above reflect only one test each and should be treated as a rough estimate.
+- Because some ACC code is still under development, these cycle counts are expected to change a bit as we optimize the code and add hardening countermeasures against fault injection and power/EM side-channel attacks.
+- Some of these benchmarks include significant overhead from these countermeasures (for example, we run the inner loop of P-256 scalar multiplication 320 times instead of 256), but in the current threat model the price is worthwhile.
+- For non-constant-time code, due to the nature of the ACC benchmarks, it is currently difficult to run multiple tests, so the numbers above reflect only one test each and should be treated as a rough estimate.
### Benchmark reproduction
-To reproduce these benchmarks yourself, checkout the specified commit from OpenTitan, then run the OTBN simulator directly on the specified programs.
+To reproduce these benchmarks yourself, checkout the specified commit, then run the ACC simulator directly on the specified programs.
#### Step 1: Build the tests.
-To build the tests with Bazel, run `bazel build //sw/otbn/crypto/tests:`, e.g. `bazel build //sw/otbn/crypto/tests:p256_ecdsa_verify_test`.
-Then you'll need to find the `.elf` file that Bazel generates; for me this is e.g. `bazel-out/k8-fastbuild-ST-2cc462681f62/bin/sw/otbn/crypto/tests/p256_ecdsa_verify_test.elf`.
+To build the tests with Bazel, run `bazel build //sw/acc/crypto/tests:`, e.g. `bazel build //sw/acc/crypto/tests:p256_ecdsa_verify_test`.
+Then you'll need to find the `.elf` file that Bazel generates; for me this is e.g. `bazel-out/k8-fastbuild-ST-2cc462681f62/bin/sw/acc/crypto/tests/p256_ecdsa_verify_test.elf`.
You can find the path for yours by running:
```
-bazel aquery 'outputs(".*.elf", //sw/otbn/crypto/tests:p256_ecdsa_verify_test)' | grep 'Outputs'
+bazel aquery 'outputs(".*.elf", //sw/acc/crypto/tests:p256_ecdsa_verify_test)' | grep 'Outputs'
```
-Alternatively, you can build the tests manually with `otbn_as.py` and `otbn_ld.py`, as described in the [OTBN development guide](developing_otbn.md#build-otbn-software).
-In this case you won't need to dig around for the `.elf` file, but you will need to look at `sw/otbn/crypto/tests/BUILD` to see which assembly files need to be included in each target.
+Alternatively, you can build the tests manually with `acc_as.py` and `acc_ld.py`, as described in the [ACC development guide](developing_acc.md#build-acc-software).
+In this case you won't need to dig around for the `.elf` file, but you will need to look at `sw/acc/crypto/tests/BUILD` to see which assembly files need to be included in each target.
#### Step 2: Run the simulator.
-Once you have the `.elf` file, either from Bazel or from the manual build process, run `hw/ip/dv/otbnsim/standalone.py --dump-stats - path/to/test.elf` to get a nice printout with the cycle counts plus other statistics.
-See the [OTBN development guide](developing_otbn.md#run-the-python-simulator) for more information about using the OTBN simulator.
+Once you have the `.elf` file, either from Bazel or from the manual build process, run `hw/ip/dv/accsim/standalone.py --dump-stats - path/to/test.elf` to get a nice printout with the cycle counts plus other statistics.
+See the [ACC development guide](developing_acc.md#run-the-python-simulator) for more information about using the ACC simulator.
## SCA methodology
-Current code for side channel analysis (SCA) on OTBN is in the [sw/device/sca](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/sw/device/sca) directory.
+Current code for side channel analysis (SCA) on ACC is in the [sw/device/sca](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/sw/device/sca) directory.
The main focus of this code is analysis of power/EM side channels.
For timing side channels, we use [static analysis scripts](#static-checks) instead.
This code runs on Ibex and communicates with scripts from the [ot-sca](https://github.com/lowRISC/ot-sca) repository.
-Typically, the SCA code uses a binary entrypoint to the OTBN program that has more degrees of freedom than the one intended for production code.
-For example, ECDSA-P256 has the entrypoint [p256_ecdsa](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/sw/otbn/crypto/p256_ecdsa.s) for production code, and [p256_ecdsa_sca](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/sw/otbn/crypto/p256_ecdsa_sca.s) for side channel analysis.
+Typically, the SCA code uses a binary entrypoint to the ACC program that has more degrees of freedom than the one intended for production code.
+For example, ECDSA-P256 has the entrypoint [p256_ecdsa](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/sw/acc/crypto/p256_ecdsa.s) for production code, and [p256_ecdsa_sca](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/sw/acc/crypto/p256_ecdsa_sca.s) for side channel analysis.
They call the same underlying library, but the SCA-specific entrypoint allows the caller to select the per-signature secret value `k`, which is always randomly generated in the production-code version.
We can then determine if information about `k` is leaking by trying different known values and seeing if values of `k` that are similar in a certain way have similarities in their traces.
For example, during development we were able to fix a bug in our original implementation that leaked information about the number of leading zeroes in `k`.
## Modeling and formal methods
-OTBN is well-suited to modeling because of its relatively simple ISA (52 instructions) and predictable timing behavior.
-This means we can easily simulate OTBN's behavior in software and in formal methods tools.
+ACC is well-suited to modeling because of its relatively simple ISA and predictable timing behavior.
+This means we can easily simulate ACC's behavior in software and in formal methods tools.
### Machine-readable instruction specifications
-OTBN instructions are recorded in [YAML files](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/hw/ip/otbn/data/bignum-insns.yml) that include syntax, encoding, and information-flow data.
-The OTBN [ISA documentation](isa.md), assembler, simulation tools, and static checkers all read these files.
+ACC instructions are recorded in [YAML files](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/hw/ip/acc/data/bignum-insns.yml) that include syntax, encoding, and information-flow data.
+The ACC [ISA documentation](isa.md), assembler, simulation tools, and static checkers all read these files.
-### OTBN simulator
+### ACC simulator
-The OTBN simulator is a Python model of OTBN that is regularly tested against the exact behavior of the SystemVerilog implementation.
-Both software and hardware engineers on OpenTitan use it for debugging.
-Detailed information on the OTBN simulator can be found [here](developing_otbn.md#run-the-python-simulator), but the highlights are:
+The ACC simulator is a Python model of ACC that is regularly tested against the exact behavior of the SystemVerilog implementation.
+Both software and hardware engineers use it for debugging.
+Detailed information on the ACC simulator can be found [here](developing_acc.md#run-the-python-simulator), but the highlights are:
- cycle-by-cycle printouts for instructions and updates to registers/flags/memory
-- much faster than simulating OTBN in Verilator
+- much faster than simulating ACC in Verilator
-A typical workflow when developing for OTBN is to write both the program itself and a few self-contained tests that can run on the simulator.
+A typical workflow when developing for ACC is to write both the program itself and a few self-contained tests that can run on the simulator.
If the tests fail, then the cycle-by-cycle printouts help to determine what went wrong.
-The simulator is also a good way to get accurate OTBN cycle counts.
+The simulator is also a good way to get accurate ACC cycle counts.
-You can see the current OTBN simulator tests under [sw/otbn/crypto/tests](https://github.com/lowRISC/opentitan/tree/master/sw/otbn/crypto/tests).
+You can see the current ACC simulator tests under [sw/acc/crypto/tests](https://github.com/lowRISC/opentitan/tree/master/sw/acc/crypto/tests).
### Formal methods
-OTBN is a large part of the reason OpenTitan has a long history of successful formal-methods collaborations.
+ACC is a large part of the reason for a long history of successful formal-methods collaborations.
-For example, the OTBN program we use for RSA signature verification in secure boot is [formally verified](https://www.andrew.cmu.edu/user/bparno/papers/galapagos.pdf) in Dafny/Vale.
-The authors of the paper created a system called Galápagos, in which a proven-correct low-level implementation can be instantiated for different architectures, including OTBN.
+For example, the ACC program we use for RSA signature verification in secure boot is [formally verified](https://www.andrew.cmu.edu/user/bparno/papers/galapagos.pdf) in Dafny/Vale.
+The authors of the paper created a system called Galápagos, in which a proven-correct low-level implementation can be instantiated for different architectures, including ACC.
For RSA, they proved that the low-level implementation was equivalent to modular exponentiation, i.e. that it indeed computed `(sig ^ e) mod n`, where `sig` is the signature and `(n, e)` is the RSA public key.
-We use their OTBN code in production silicon.
+Their ACC code is used in production silicon.
There is no performance hit from the verified code, and since it is burned into hardware ROM it is essential that this code is correct.
-We are also pursuing other ongoing collaborations in formal methods, including adding OTBN to the Jasmin compiler.
-In the meantime, we occasionally prove small and particularly tricky parts of programs against simplified OTBN models in Coq, such as [here](https://github.com/lowRISC/opentitan/pull/19768).
+We are also pursuing other ongoing collaborations in formal methods, including adding ACC to the Jasmin compiler.
+In the meantime, we occasionally prove small and particularly tricky parts of programs against simplified ACC models in Coq, such as [here](https://github.com/lowRISC/opentitan/pull/19768).
### Static checks
-Building on top of the OTBN simulator, we also have Python tools that model OTBN's control flow and statically:
-- [check](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/hw/ip/otbn/util/check_const_time.py) if an OTBN program or function is constant-time relative to secrets
-- [print](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/hw/ip/otbn/util/analyze_information_flow.py) out the information-flow graph for OTBN functions
-- [determine](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/hw/ip/otbn/util/get_instruction_count_range.py) the minimum and maximum possible instruction count for a program
+Building on top of the ACC simulator, we also have Python tools that model ACC's control flow and statically:
+- [check](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/hw/ip/acc/util/check_const_time.py) if an ACC program or function is constant-time relative to secrets
+- [print](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/hw/ip/acc/util/analyze_information_flow.py) out the information-flow graph for ACC functions
+- [determine](https://github.com/lowRISC/opentitan/blob/7528f848214589e837ce3b0dacac8385c458b772/hw/ip/acc/util/get_instruction_count_range.py) the minimum and maximum possible instruction count for a program
Some of these have Bazel build integration.
-For example, many OTBN functions have a Bazel build target like this that runs the constant-time checker in CI:
+For example, many ACC functions have a Bazel build target like this that runs the constant-time checker in CI:
```
-otbn_consttime_test(
+acc_consttime_test(
name = "p256_base_mult_consttime",
subroutine = "p256_base_mult",
deps = [
- "//sw/otbn/crypto:p256_ecdsa",
+ "//sw/acc/crypto:p256_ecdsa",
],
)
```
## Future Ideas
-For future versions of OTBN, we are considering:
-- ISA extensions and more memory to support lattice-based cryptography
-- A direct interface from OTBN to the [KMAC][kmac] hardware block, which would allow OTBN to directly run SHA-3 and SHAKE functions
-- More isolation from Ibex, including potentially giving OTBN its own ROM so that Ibex doesn't need to load secrets into it
+For future versions of ACC, we are considering:
+- More isolation from Ibex, including potentially giving ACC its own ROM so that Ibex doesn't need to load secrets into it
[kmac]: ../../../../hw/ip/kmac/README.md
[keymgr]: ../../../../hw/ip/keymgr/README.md
diff --git a/hw/ip/otbn/doc/otbn_operation.svg b/hw/ip/acc/doc/acc_operation.svg
similarity index 100%
rename from hw/ip/otbn/doc/otbn_operation.svg
rename to hw/ip/acc/doc/acc_operation.svg
diff --git a/hw/ip/otbn/doc/otbn_operational_states.svg b/hw/ip/acc/doc/acc_operational_states.svg
similarity index 99%
rename from hw/ip/otbn/doc/otbn_operational_states.svg
rename to hw/ip/acc/doc/acc_operational_states.svg
index d5890af9c1f..9f54901ee8e 100644
--- a/hw/ip/otbn/doc/otbn_operational_states.svg
+++ b/hw/ip/acc/doc/acc_operational_states.svg
@@ -7,7 +7,7 @@
stroke-linecap="square"
stroke-miterlimit="10"
id="svg119"
- sodipodi:docname="otbn_operational_states.svg"
+ sodipodi:docname="acc_operational_states.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
diff --git a/hw/ip/otbn/doc/checklist.md b/hw/ip/acc/doc/checklist.md
similarity index 96%
rename from hw/ip/otbn/doc/checklist.md
rename to hw/ip/acc/doc/checklist.md
index e1581849c80..a2e443dedde 100644
--- a/hw/ip/otbn/doc/checklist.md
+++ b/hw/ip/acc/doc/checklist.md
@@ -1,6 +1,6 @@
-# OTBN Checklist
+# ACC Checklist
-This checklist is for [Hardware Stage](../../../../doc/project_governance/development_stages.md) transitions for the [OTBN peripheral.](../README.md)
+This checklist is for [Hardware Stage](../../../../doc/project_governance/development_stages.md) transitions for the [ACC peripheral.](../README.md)
All checklist items refer to the content in the [Checklist.](../../../../doc/project_governance/checklist/README.md)
## Design Checklist
@@ -9,7 +9,7 @@ All checklist items refer to the content in the [Checklist.](../../../../doc/pro
Type | Item | Resolution | Note/Collaterals
--------------|--------------------------------|-------------|------------------
-Documentation | [SPEC_COMPLETE][] | Done | [OTBN Design Spec](../README.md). The specification is feature-complete, we were able to successfully run larger chunks of crypto code with the described feature set. At the same time, the specification has (known and unknown) issues, such as incomplete or buggy descriptions of individual instructions. These issues are being worked on as they are discovered while the design is in the D1 stage.
+Documentation | [SPEC_COMPLETE][] | Done | [ACC Design Spec](../README.md). The specification is feature-complete, we were able to successfully run larger chunks of crypto code with the described feature set. At the same time, the specification has (known and unknown) issues, such as incomplete or buggy descriptions of individual instructions. These issues are being worked on as they are discovered while the design is in the D1 stage.
Documentation | [CSR_DEFINED][] | Done |
RTL | [CLKRST_CONNECTED][] | Done |
RTL | [IP_TOP][] | Done |
@@ -33,7 +33,7 @@ Code Quality | [LINT_SETUP][] | Done |
Type | Item | Resolution | Note/Collaterals
--------------|---------------------------|-------------|------------------
-Documentation | [NEW_FEATURES][] | Done | New features are [Key Sideload](https://www.github.com/lowrisc/opentitan/pull/8650), [Private OTBN DMem](https://www.github.com/lowrisc/opentitan/pull/8890), [XoShiRo PRNG](https://www.github.com/lowrisc/opentitan/pull/7944) and [Prefetch Stage](https://www.github.com/lowrisc/opentitan/issues/8898)
+Documentation | [NEW_FEATURES][] | Done | New features are [Key Sideload](https://www.github.com/lowrisc/opentitan/pull/8650), [Private ACC DMem](https://www.github.com/lowrisc/opentitan/pull/8890), [XoShiRo PRNG](https://www.github.com/lowrisc/opentitan/pull/7944) and [Prefetch Stage](https://www.github.com/lowrisc/opentitan/issues/8898)
Documentation | [BLOCK_DIAGRAM][] | Done |
Documentation | [DOC_INTERFACE][] | Done |
Documentation | [DOC_INTEGRATION_GUIDE][] | Waived | This checklist item has been added retrospectively.
@@ -123,8 +123,8 @@ Review | Signoff date | Not Started |
Type | Item | Resolution | Note/Collaterals
--------------|---------------------------------------|-------------|------------------
-Documentation | [DV_DOC_DRAFT_COMPLETED][] | Done | [OTBN DV document](../dv/README.md)
-Documentation | [TESTPLAN_COMPLETED][] | Done | [OTBN Testplan](../dv/README.md#testplan)
+Documentation | [DV_DOC_DRAFT_COMPLETED][] | Done | [ACC DV document](../dv/README.md)
+Documentation | [TESTPLAN_COMPLETED][] | Done | [ACC Testplan](../dv/README.md#testplan)
Testbench | [TB_TOP_CREATED][] | Done |
Testbench | [PRELIMINARY_ASSERTION_CHECKS_ADDED][]| Done |
Testbench | [SIM_TB_ENV_CREATED][] | Done |
diff --git a/hw/ip/acc/doc/developing_acc.md b/hw/ip/acc/doc/developing_acc.md
new file mode 100644
index 00000000000..c39162da819
--- /dev/null
+++ b/hw/ip/acc/doc/developing_acc.md
@@ -0,0 +1,111 @@
+# Asymmetric Cryptographic Coprocessor (ACC)
+
+This directory contains the implementation of the Asymmetric Cryptographic Coprocessor (ACC).
+ACC is a coprocessor for asymmetric cryptographic operations like RSA or Elliptic Curve Cryptography (ECC).
+
+See [here](../README.md) for documentation on the current version of ACC; documentation matching the code in this directory can be found in the `doc` directory.
+
+ACC is under active development.
+Please ask questions and report issues through the [GitHub issue tracker](https://github.com/lowRISC/opentitan/issues).
+
+## Develop ACC
+
+### Build ACC software
+
+An assembler, linker and disassembler for ACC can be found in `hw/ip/acc/util` (For more details about these tools see the [user guide](../../../../doc/contributing/sw/acc_sw.md)).
+
+These tools are wrappers around a RISC-V and binutils toolchain so one must be available.
+The toolchain can be installed with the [`util/get-toolchain.py`](../../../../util/get-toolchain.py) script.
+Simply call the script from `$REPO_TOP` and make sure to select the correct architecture.
+
+When the toolchain is installed, the `acc_as.py` and `acc_ld.py` can be used to build .elf files for use with simulations.
+They work similarly to binutils programs they wrap.
+
+```
+hw/ip/acc/util/acc_as.py -o prog_bin/prog.o prog.s
+hw/ip/acc/util/acc_ld.py -o prog_bin/prog.elf prog_bin/prog.o
+```
+
+Will assemble and link `prog.s` resulting in `prog_bin/prog.elf` that can be run directly on the ISS or the standalone RTL simulation.
+
+### Work with the ISA
+
+The instruction set is described in machine readable form in `data/insns.yml`.
+This is parsed by Python code in `util/insn_yaml.py`, which runs various basic checks on the data.
+The binutils-based toolchain described above uses this information.
+Other users include:
+
+ - `util/yaml_to_doc.py`: Generates a Markdown snippet which is included in the ACC specification.
+
+ - `dv/rig/acc-rig`: A random instruction generator for ACC. See dv/rig/README.md for further information.
+
+### Run the Python simulator
+The quickest way to run an ACC-only program is to use the Python simulator.
+First, generate a `.elf.` file either using the usual build process or by manually running `acc_as.py` and `acc_ld.py` as shown above.
+Then, from `$REPO_TOP`:
+```console
+$ hw/ip/acc/dv/accsim/standalone.py -t path/to/prog.elf
+```
+
+### Run the standalone RTL simulation
+A standalone environment to run ACC alone in Verilator is included.
+Build it with `fusesoc` as follows:
+
+```sh
+fusesoc --cores-root=. run --target=sim --setup --build lowrisc:ip:acc_top_sim
+```
+
+It includes functionality to set the initial Dmem and Imem contents from a .elf file.
+The start address is hard coded to 0.
+Modify the `ImemStartAddr` parameter in `./dv/verilator/acc_top_sim.sv` to change this.
+A .elf (see above for build instructions) can be loaded and run as follows:
+
+```sh
+./build/lowrisc_ip_acc_top_sim_0.1/sim-verilator/Vacc_top_sim \
+ --load-elf=prog_bin/prog.elf
+```
+
+The simulation automatically halts on an `ecall` instruction and prints the final register values.
+The ISS is run in parallel and final register and memory state will be cross-checked.
+
+Tracing functionality is available in the `Vacc_top_sim` binary.
+To obtain a full .fst wave trace pass the `-t` flag.
+To get an instruction level trace pass the `--acc-trace-file=trace.log` argument.
+The instruction trace format is documented in `hw/ip/acc/dv/tracer`.
+
+To run several auto-generated binaries against the Verilated RTL, use the script at `dv/verilator/run-some.py`.
+For example,
+
+```sh
+hw/ip/acc/dv/verilator/run-some.py --size=1500 --count=50 X
+```
+
+will generate and run 50 binaries, each of which will execute up to 1500 instructions when run.
+The generated binaries, a Verilated model and the output from running them can all be found in the directory called `X`.
+
+### Run the smoke test
+
+A smoke test which exercises some functionality of ACC can be found, together with its expected outputs (in the form of final register values), in `./hw/ip/acc/dv/smoke`.
+The test can be run using a script.
+
+```sh
+hw/ip/acc/dv/smoke/run_smoke.sh
+```
+
+This will build the standalone simulation, build the smoke test binary, run it and check the results are as expected.
+
+### Run the ISS on its own
+
+There are currently two versions of the ISS and they can be found in `dv/accsim`.
+The easiest to use is `dv/accsim/standalone.py`.
+This takes an ACC binary as an ELF file (as produced by the standard linker script for `acc_ld.py`) and can dump the resulting DMEM if given the `--dmem-dump` argument.
+To see an instruction trace, pass the `--verbose` flag.
+
+There is also `dv/accsim/accsim.py`.
+This takes flat binary files with the contents of IMEM and DMEM and, when finished, generates a cycle count and dumps DMEM contents.
+This is used to implement the model inside of simulation, but is probably not very convenient for command-line use otherwise.
+
+## Test the ISS
+
+The ISS has a simple test suite, which runs various instructions and makes sure they behave as expected.
+You can find the tests in `dv/accsim/test` and can run them with `make -C dv/accsim test`.
diff --git a/hw/ip/otbn/doc/interfaces.md b/hw/ip/acc/doc/interfaces.md
similarity index 57%
rename from hw/ip/otbn/doc/interfaces.md
rename to hw/ip/acc/doc/interfaces.md
index 12ff597b8b1..73b8d6964ae 100644
--- a/hw/ip/otbn/doc/interfaces.md
+++ b/hw/ip/acc/doc/interfaces.md
@@ -1,7 +1,7 @@
# Hardware Interfaces
-
-Referring to the [Comportable guideline for peripheral device functionality](https://opentitan.org/book/doc/contributing/hw/comportability), the module **`otbn`** has the following hardware interfaces defined
+
+Referring to the [Comportable guideline for peripheral device functionality](https://opentitan.org/book/doc/contributing/hw/comportability), the module **`acc`** has the following hardware interfaces defined
- Primary Clock: **`clk_i`**
- Other Clocks: **`clk_edn_i`**, **`clk_otp_i`**
- Bus Device Interfaces (TL-UL): **`tl`**
@@ -12,7 +12,7 @@ Referring to the [Comportable guideline for peripheral device functionality](htt
| Port Name | Package::Struct | Type | Act | Width | Description |
|:-----------------|:--------------------------------|:--------|:------|--------:|:--------------|
-| otbn_otp_key | otp_ctrl_pkg::otbn_otp_key | req_rsp | req | 1 | |
+| acc_otp_key | otp_ctrl_pkg::acc_otp_key | req_rsp | req | 1 | |
| edn_rnd | edn_pkg::edn | req_rsp | req | 1 | |
| edn_urnd | edn_pkg::edn | req_rsp | req | 1 | |
| kmac_data | kmac_pkg::app | req_rsp | req | 1 | |
@@ -24,14 +24,14 @@ Referring to the [Comportable guideline for peripheral device functionality](htt
| lc_escalate_en | lc_ctrl_pkg::lc_tx | uni | rcv | 1 | |
| lc_rma_req | lc_ctrl_pkg::lc_tx | uni | rcv | 1 | |
| lc_rma_ack | lc_ctrl_pkg::lc_tx | uni | req | 1 | |
-| keymgr_key | keymgr_pkg::otbn_key_req | uni | rcv | 1 | |
+| keymgr_key | keymgr_pkg::acc_key_req | uni | rcv | 1 | |
| tl | tlul_pkg::tl | req_rsp | rsp | 1 | |
## Interrupts
-| Interrupt Name | Type | Description |
-|:-----------------|:-------|:----------------------------------|
-| done | Event | OTBN has completed the operation. |
+| Interrupt Name | Type | Description |
+|:-----------------|:-------|:---------------------------------|
+| done | Event | ACC has completed the operation. |
## Security Alerts
@@ -42,70 +42,70 @@ Referring to the [Comportable guideline for peripheral device functionality](htt
## Security Countermeasures
-| Countermeasure ID | Description |
-|:-----------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| OTBN.MEM.SCRAMBLE | Both the imem and dmem are scrambled by using prim_ram_1p_scr. |
-| OTBN.DATA.MEM.INTEGRITY | Dmem is protected with ECC integrity. This is carried through to OTBN's register file. |
-| OTBN.INSTRUCTION.MEM.INTEGRITY | Imem is protected with ECC integrity. This is carried through into OTBN's execute stage. |
-| OTBN.BUS.INTEGRITY | End-to-end bus integrity scheme. |
-| OTBN.CONTROLLER.FSM.GLOBAL_ESC | The controller FSM moves to a terminal error state upon global escalation. |
-| OTBN.CONTROLLER.FSM.LOCAL_ESC | The controller FSM moves to a terminal error state upon local escalation. Can be triggered by CONTROLLER.FSM.SPARSE, SCRAMBLE_CTRL.FSM.SPARSE, and START_STOP_CTRL.FSM.SPARSE. |
-| OTBN.CONTROLLER.FSM.SPARSE | The controller FSM uses a sparse state encoding. |
-| OTBN.SCRAMBLE.KEY.SIDELOAD | The scrambling key is sideloaded from OTP and thus unreadable by SW. |
-| OTBN.SCRAMBLE_CTRL.FSM.LOCAL_ESC | The scramble control FSM moves to a terminal error state upon local escalation. Can be triggered by SCRAMBLE_CTRL.FSM.SPARSE. |
-| OTBN.SCRAMBLE_CTRL.FSM.SPARSE | The scramble control FSM uses a sparse state encoding. |
-| OTBN.START_STOP_CTRL.FSM.GLOBAL_ESC | The start-stop control FSM moves to a terminal error state upon global escalation. |
-| OTBN.START_STOP_CTRL.FSM.LOCAL_ESC | The start-stop control FSM moves to a terminal error state upon local escalation. Can be triggered by START_STOP_CTRL.FSM.SPARSE. |
-| OTBN.START_STOP_CTRL.FSM.SPARSE | The start-stop control FSM uses a sparse state encoding. |
-| OTBN.DATA_REG_SW.SCA | Blanking of bignum data paths when unused by the executing instruction. |
-| OTBN.CTRL.REDUN | Check pre-decoded control matches separately decoded control from main decoder. This includes control signals used for blanking, pushing/popping the call stack, controlling loop and branch/jump instructions, as well as the actual branch target. |
-| OTBN.PC.CTRL_FLOW.REDUN | Check prefetch stage PC and execute stage PC match. The prefetch stage and execute stage store their PC's separately and have separate increment calculations. |
-| OTBN.RND.BUS.CONSISTENCY | Comparison on successive bus values received over the EDN RND interface. |
-| OTBN.RND.RNG.DIGEST | Checking that the random numbers received over the EDN RND interface have not been generated from entropy that failed the FIPS health checks in the entropy source. |
-| OTBN.RF_BASE.DATA_REG_SW.INTEGRITY | Register file is protected with ECC integrity. |
-| OTBN.RF_BASE.DATA_REG_SW.GLITCH_DETECT | This countermeasure checks for spurious write-enable signals on the register file by monitoring the one-hot0 property of the individual write-enable strobes. |
-| OTBN.STACK_WR_PTR.CTR.REDUN | The write pointer of the stack (used for calls and loops) is redundant. If the two instances of the counter mismatch, an error is emitted. |
-| OTBN.RF_BIGNUM.DATA_REG_SW.INTEGRITY | Register file is protected with ECC integrity. |
-| OTBN.RF_BIGNUM.DATA_REG_SW.GLITCH_DETECT | This countermeasure checks for spurious write-enable signals on the register file by monitoring the one-hot0 property of the individual write-enable strobes. |
-| OTBN.LOOP_STACK.CTR.REDUN | The iteration counter of each entry in the loop step uses cross counts via prim_count. |
-| OTBN.LOOP_STACK.ADDR.INTEGRITY | Loop start and end address on the loop stack are protected with ECC integrity. |
-| OTBN.CALL_STACK.ADDR.INTEGRITY | Call stack entries are protected with ECC integrity. |
-| OTBN.START_STOP_CTRL.STATE.CONSISTENCY | The secure wipe handshake between otbn_controller and otbn_start_stop_control uses a level-based req/ack interface. At the otbn_controller end, there is a check for unexpected acks. In otbn_start_stop_control, there is a check for secure wipe requests when we aren't in a state that allows it, and also a check for if the request drops at an unexpected time. |
-| OTBN.DATA.MEM.SEC_WIPE | Rotate the scrambling key, effectively wiping the dmem. Initiated on command, upon fatal errors and before RMA entry. |
-| OTBN.INSTRUCTION.MEM.SEC_WIPE | Rotate the scrambling key, effectively wiping the imem. Initiated on command, upon fatal errors and before RMA entry. |
-| OTBN.DATA_REG_SW.SEC_WIPE | Securely wipe programmer visible OTBN register (GPRs, WDRs, CSRs, WSRs) state with random data. Initiated after reset, at the end of any OTBN operation, upon recoverable and fatal errors, and before RMA entry. |
-| OTBN.WRITE.MEM.INTEGRITY | A software visible checksum is calculated for all dmem and imem writes |
-| OTBN.CTRL_FLOW.COUNT | A software visible count of instructions executed |
-| OTBN.CTRL_FLOW.SCA | OTBN architecture does not have any data dependent timing behaviour |
-| OTBN.DATA.MEM.SW_NOACCESS | A portion of DMEM is invisible to CPU software |
-| OTBN.KEY.SIDELOAD | Keys can be sideloaded without exposing them to the CPU |
-| OTBN.TLUL_FIFO.CTR.REDUN | The TL-UL response FIFO pointers are implemented with duplicate counters. |
+| Countermeasure ID | Description |
+|:----------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| ACC.MEM.SCRAMBLE | Both the imem and dmem are scrambled by using prim_ram_1p_scr. |
+| ACC.DATA.MEM.INTEGRITY | Dmem is protected with ECC integrity. This is carried through to ACC's register file. |
+| ACC.INSTRUCTION.MEM.INTEGRITY | Imem is protected with ECC integrity. This is carried through into ACC's execute stage. |
+| ACC.BUS.INTEGRITY | End-to-end bus integrity scheme. |
+| ACC.CONTROLLER.FSM.GLOBAL_ESC | The controller FSM moves to a terminal error state upon global escalation. |
+| ACC.CONTROLLER.FSM.LOCAL_ESC | The controller FSM moves to a terminal error state upon local escalation. Can be triggered by CONTROLLER.FSM.SPARSE, SCRAMBLE_CTRL.FSM.SPARSE, and START_STOP_CTRL.FSM.SPARSE. |
+| ACC.CONTROLLER.FSM.SPARSE | The controller FSM uses a sparse state encoding. |
+| ACC.SCRAMBLE.KEY.SIDELOAD | The scrambling key is sideloaded from OTP and thus unreadable by SW. |
+| ACC.SCRAMBLE_CTRL.FSM.LOCAL_ESC | The scramble control FSM moves to a terminal error state upon local escalation. Can be triggered by SCRAMBLE_CTRL.FSM.SPARSE. |
+| ACC.SCRAMBLE_CTRL.FSM.SPARSE | The scramble control FSM uses a sparse state encoding. |
+| ACC.START_STOP_CTRL.FSM.GLOBAL_ESC | The start-stop control FSM moves to a terminal error state upon global escalation. |
+| ACC.START_STOP_CTRL.FSM.LOCAL_ESC | The start-stop control FSM moves to a terminal error state upon local escalation. Can be triggered by START_STOP_CTRL.FSM.SPARSE. |
+| ACC.START_STOP_CTRL.FSM.SPARSE | The start-stop control FSM uses a sparse state encoding. |
+| ACC.DATA_REG_SW.SCA | Blanking of bignum data paths when unused by the executing instruction. |
+| ACC.CTRL.REDUN | Check pre-decoded control matches separately decoded control from main decoder. This includes control signals used for blanking, pushing/popping the call stack, controlling loop and branch/jump instructions, as well as the actual branch target. |
+| ACC.PC.CTRL_FLOW.REDUN | Check prefetch stage PC and execute stage PC match. The prefetch stage and execute stage store their PC's separately and have separate increment calculations. |
+| ACC.RND.BUS.CONSISTENCY | Comparison on successive bus values received over the EDN RND interface. |
+| ACC.RND.RNG.DIGEST | Checking that the random numbers received over the EDN RND interface have not been generated from entropy that failed the FIPS health checks in the entropy source. |
+| ACC.RF_BASE.DATA_REG_SW.INTEGRITY | Register file is protected with ECC integrity. |
+| ACC.RF_BASE.DATA_REG_SW.GLITCH_DETECT | This countermeasure checks for spurious write-enable signals on the register file by monitoring the one-hot0 property of the individual write-enable strobes. |
+| ACC.STACK_WR_PTR.CTR.REDUN | The write pointer of the stack (used for calls and loops) is redundant. If the two instances of the counter mismatch, an error is emitted. |
+| ACC.RF_BIGNUM.DATA_REG_SW.INTEGRITY | Register file is protected with ECC integrity. |
+| ACC.RF_BIGNUM.DATA_REG_SW.GLITCH_DETECT | This countermeasure checks for spurious write-enable signals on the register file by monitoring the one-hot0 property of the individual write-enable strobes. |
+| ACC.LOOP_STACK.CTR.REDUN | The iteration counter of each entry in the loop step uses cross counts via prim_count. |
+| ACC.LOOP_STACK.ADDR.INTEGRITY | Loop start and end address on the loop stack are protected with ECC integrity. |
+| ACC.CALL_STACK.ADDR.INTEGRITY | Call stack entries are protected with ECC integrity. |
+| ACC.START_STOP_CTRL.STATE.CONSISTENCY | The secure wipe handshake between acc_controller and acc_start_stop_control uses a level-based req/ack interface. At the acc_controller end, there is a check for unexpected acks. In acc_start_stop_control, there is a check for secure wipe requests when we aren't in a state that allows it, and also a check for if the request drops at an unexpected time. |
+| ACC.DATA.MEM.SEC_WIPE | Rotate the scrambling key, effectively wiping the dmem. Initiated on command, upon fatal errors and before RMA entry. |
+| ACC.INSTRUCTION.MEM.SEC_WIPE | Rotate the scrambling key, effectively wiping the imem. Initiated on command, upon fatal errors and before RMA entry. |
+| ACC.DATA_REG_SW.SEC_WIPE | Securely wipe programmer visible ACC register (GPRs, WDRs, CSRs, WSRs) state with random data. Initiated after reset, at the end of any ACC operation, upon recoverable and fatal errors, and before RMA entry. |
+| ACC.WRITE.MEM.INTEGRITY | A software visible checksum is calculated for all dmem and imem writes |
+| ACC.CTRL_FLOW.COUNT | A software visible count of instructions executed |
+| ACC.CTRL_FLOW.SCA | ACC architecture does not have any data dependent timing behaviour |
+| ACC.DATA.MEM.SW_NOACCESS | A portion of DMEM is invisible to CPU software |
+| ACC.KEY.SIDELOAD | Keys can be sideloaded without exposing them to the CPU |
+| ACC.TLUL_FIFO.CTR.REDUN | The TL-UL response FIFO pointers are implemented with duplicate counters. |
## Hardware Interface Requirements
-OTBN connects to other components in an OpenTitan system.
+ACC connects to other components in a top-level system.
This section lists requirements on those interfaces that go beyond the physical connectivity.
### Entropy Distribution Network (EDN)
-OTBN has two EDN connections: `edn_urnd` and `edn_rnd`.
-What kind of randomness is provided on the EDN connections is configurable at runtime, but unknown to OTBN.
-To maintain its security properties, OTBN requires the following configuration for the two EDN connections:
+ACC has two EDN connections: `edn_urnd` and `edn_rnd`.
+What kind of randomness is provided on the EDN connections is configurable at runtime, but unknown to ACC.
+To maintain its security properties, ACC requires the following configuration for the two EDN connections:
-* OTBN has no specific requirements on the randomness drawn from `edn_urnd`.
+* ACC has no specific requirements on the randomness drawn from `edn_urnd`.
For performance reasons, requests on this EDN connection should be answered quickly.
* `edn_rnd` must provide AIS31-compliant class PTG.3 random numbers.
The randomness from this interface is made available through the `RND` WSR and intended to be used for key generation.
### Life Cycle Controller (LC_CTRL)
-OTBN has three LC_CTRL connections: one for triggering life cycle escalation requests (`lc_escalate_en`) and two for handling RMA entry (`lc_rma_req/ack`).
+ACC has three LC_CTRL connections: one for triggering life cycle escalation requests (`lc_escalate_en`) and two for handling RMA entry (`lc_rma_req/ack`).
-As LC_CTRL might sit in a different clock domain and since all these connections are using multi-bit signals, OTBN might observe staggered signal transitions due to the clock domain crossings.
+As LC_CTRL might sit in a different clock domain and since all these connections are using multi-bit signals, ACC might observe staggered signal transitions due to the clock domain crossings.
To avoid spurious life cycle escalations and to enable reliable RMA entry, it should be ensured that:
-* The `lc_escalate_en` and `lc_rma_req` inputs are stably driven to `lc_ctrl_pkg::Off` before releasing the reset of OTBN.
-* When triggering RMA entry, the `lc_rma_req` input switches from `lc_ctrl_pkg::Off` to `lc_ctrl_pkg::On` exactly once, and then remains `On` until OTBN signals completion of the secure wipe operation with the `lc_rma_ack` output switching to `lc_ctrl_pkg::On`.
+* The `lc_escalate_en` and `lc_rma_req` inputs are stably driven to `lc_ctrl_pkg::Off` before releasing the reset of ACC.
+* When triggering RMA entry, the `lc_rma_req` input switches from `lc_ctrl_pkg::Off` to `lc_ctrl_pkg::On` exactly once, and then remains `On` until ACC signals completion of the secure wipe operation with the `lc_rma_ack` output switching to `lc_ctrl_pkg::On`.
diff --git a/hw/ip/otbn/doc/isa.md b/hw/ip/acc/doc/isa.md
similarity index 89%
rename from hw/ip/otbn/doc/isa.md
rename to hw/ip/acc/doc/isa.md
index 440497e8c55..72c7060e017 100644
--- a/hw/ip/otbn/doc/isa.md
+++ b/hw/ip/acc/doc/isa.md
@@ -1,7 +1,7 @@
-# OpenTitan Big Number Accelerator (OTBN) Instruction Set Architecture
+# Asymmetric Cryptographic Coprocessor (ACC) Instruction Set Architecture
-This document describes the instruction set for OTBN.
-For more details about the processor itself, see the [OTBN Technical Specification](../README.md).
+This document describes the instruction set for ACC.
+For more details about the processor itself, see the [ACC Technical Specification](../README.md).
In particular, this document assumes knowledge of the *Processor State* section from that guide.
The instruction set is split into *base* and *big number* subsets.
@@ -27,7 +27,7 @@ For example, the `SW` instruction's `offset` operand is split across two ranges
# Pseudo-code for operation descriptions
Each instruction has an Operation section.
-This is written in a Python-like pseudo-code, generated from the instruction set simulator (which can be found at `hw/ip/otbn/dv/otbnsim`).
+This is written in a Python-like pseudo-code, generated from the instruction set simulator (which can be found at `hw/ip/acc/dv/accsim`).
The code is generated from Python, but there are some extra changes made to aid readability.
All instruction operands are considered to be in scope and have integer values.
@@ -104,16 +104,16 @@ def extract_quarter_word(value: int, qwsel: int) -> int:
# Errors
-OTBN can detect various errors when it is operating.
-For details about OTBN's approach to error handling, see the [Errors section](../README.md#design-details-errors) of the Technical Specification.
+ACC can detect various errors when it is operating.
+For details about ACC's approach to error handling, see the [Errors section](../README.md#design-details-errors) of the Technical Specification.
The instruction descriptions below describe any software errors that executing the instruction can cause.
These errors are listed explicitly and also appear in the pseudo-code description, where the code sets a bit in the `ERR_BITS` register with a call to `state.stop_at_end_of_cycle()`.
Other errors are possible at runtime.
Specifically, any instruction that reads from a GPR or WDR might detect a register integrity error.
-In this case, OTBN will set the `REG_INTG_VIOLATION` bit.
+In this case, ACC will set the `REG_INTG_VIOLATION` bit.
Similarly, an instruction that loads from memory might detect a DMEM integrity error.
-In this case, OTBN will set the `DMEM_INTG_VIOLATION` bit.
+In this case, ACC will set the `DMEM_INTG_VIOLATION` bit.
TODO:
Specify interactions between these fatal errors and any other errors.
@@ -122,8 +122,8 @@ In particular, how do they interact with instructions that could cause other err
# Base Instruction Subset
-{{#otbn-isa base }}
+{{#acc-isa base }}
# Big Number Instruction Subset
-{{#otbn-isa bignum }}
+{{#acc-isa bignum }}
diff --git a/hw/ip/otbn/doc/programmers_guide.md b/hw/ip/acc/doc/programmers_guide.md
similarity index 79%
rename from hw/ip/otbn/doc/programmers_guide.md
rename to hw/ip/acc/doc/programmers_guide.md
index e195a0ed780..386de315839 100644
--- a/hw/ip/otbn/doc/programmers_guide.md
+++ b/hw/ip/acc/doc/programmers_guide.md
@@ -1,33 +1,33 @@
# Programmer's Guide
-## Running applications on OTBN
+## Running applications on ACC
-OTBN is a specialized coprocessor which is used from the host CPU.
-This section describes how to interact with OTBN from the host CPU to execute an existing OTBN application.
-The section [Writing OTBN applications](#writing-otbn-applications) describes how to write such applications.
+ACC is a specialized coprocessor which is used from the host CPU.
+This section describes how to interact with ACC from the host CPU to execute an existing ACC application.
+The section [Writing ACC applications](#writing-acc-applications) describes how to write such applications.
### High-level operation sequence
-The high-level sequence by which the host processor should use OTBN is as follows.
+The high-level sequence by which the host processor should use ACC is as follows.
1. Optional: Initialise [`LOAD_CHECKSUM`](registers.md#load_checksum).
-1. Write the OTBN application binary to [`IMEM`](registers.md#imem), starting at address 0.
+1. Write the ACC application binary to [`IMEM`](registers.md#imem), starting at address 0.
1. Optional: Write constants and input arguments, as mandated by the calling convention of the loaded application, to the half of DMEM accessible through the [`DMEM`](registers.md#dmem) window.
1. Optional: Read back [`LOAD_CHECKSUM`](registers.md#load_checksum) and perform an integrity check.
-1. Start the operation on OTBN by [issuing the `EXECUTE` command](./theory_of_operation.md#operations-and-commands).
+1. Start the operation on ACC by [issuing the `EXECUTE` command](./theory_of_operation.md#operations-and-commands).
Now neither data nor instruction memory may be accessed from the host CPU.
- After it has been started the OTBN application runs to completion without further interaction with the host.
+ After it has been started the ACC application runs to completion without further interaction with the host.
1. Wait for the operation to complete (see below).
- As soon as the OTBN operation has completed the data and instruction memories can be accessed again from the host CPU.
+ As soon as the ACC operation has completed the data and instruction memories can be accessed again from the host CPU.
1. Check if the operation was successful by reading the [`ERR_BITS`](registers.md#err_bits) register.
1. Optional: Retrieve results by reading [`DMEM`](registers.md#dmem), as mandated by the calling convention of the loaded application.
-OTBN applications are run to completion.
+ACC applications are run to completion.
The host CPU can determine if an application has completed by either polling [`STATUS`](registers.md#status) or listening for an interrupt.
* To poll for a completed operation, software should repeatedly read the [`STATUS`](registers.md#status) register.
The operation is complete if [`STATUS`](registers.md#status) is `IDLE` or `LOCKED`, otherwise the operation is in progress.
- When [`STATUS`](registers.md#status) has become `LOCKED` a fatal error has occurred and OTBN must be reset to perform further operations.
+ When [`STATUS`](registers.md#status) has become `LOCKED` a fatal error has occurred and ACC must be reset to perform further operations.
* Alternatively, software can listen for the `done` interrupt to determine if the operation has completed.
The standard sequence of working with interrupts has to be followed, i.e. the interrupt has to be enabled, an interrupt service routine has to be registered, etc.
The [DIF](#device-interface-functions-difs) contains helpers to do so conveniently.
@@ -35,36 +35,36 @@ The host CPU can determine if an application has completed by either polling [`S
Note: This operation sequence only covers functional aspects.
Depending on the application additional steps might be necessary, such as deleting secrets from the memories.
-## Writing OTBN applications
+## Writing ACC applications
-OTBN applications are (small) pieces of software written in OTBN assembly.
-The full instruction set is described in the [ISA manual](./isa.md), and example software is available in the `sw/otbn` directory of the OpenTitan source tree.
+ACC applications are (small) pieces of software written in ACC assembly.
+The full instruction set is described in the [ISA manual](./isa.md), and example software is available in the `sw/acc` directory of the source tree.
-A hands-on user guide to develop OTBN software can be found in the section [Writing and building software for OTBN](../../../../doc/contributing/sw/otbn_sw.md).
+A hands-on user guide to develop ACC software can be found in the section [Writing and building software for ACC](../../../../doc/contributing/sw/acc_sw.md).
### Toolchain support
-OTBN comes with a toolchain consisting of an assembler, a linker, and helper tools such as objdump.
+ACC comes with a toolchain consisting of an assembler, a linker, and helper tools such as objdump.
The toolchain wraps a RV32 GCC toolchain and supports many of its features.
The following tools are available:
-* `otbn_as.py`: The OTBN assembler.
-* `otbn_ld.py`: The OTBN linker.
-* `otbn_objdump.py`: objdump for OTBN.
+* `acc_as.py`: The ACC assembler.
+* `acc_ld.py`: The ACC linker.
+* `acc_objdump.py`: objdump for ACC.
Other tools from the RV32 toolchain can be used directly, such as objcopy.
-### Passing of data between the host CPU and OTBN
+### Passing of data between the host CPU and ACC
-Passing data between the host CPU and OTBN is done through the first 2kiB of data memory (DMEM).
-No standard or required calling convention exists, every application is free to pass data in and out of OTBN in whatever format it finds convenient.
-All data passing must be done when OTBN [is idle](./theory_of_operation.md#operational-states); otherwise both the instruction and the data memory are inaccessible from the host CPU.
+Passing data between the host CPU and ACC is done through the first 2kiB of data memory (DMEM).
+No standard or required calling convention exists, every application is free to pass data in and out of ACC in whatever format it finds convenient.
+All data passing must be done when ACC [is idle](./theory_of_operation.md#operational-states); otherwise both the instruction and the data memory are inaccessible from the host CPU.
### Returning from an application
-The software running on OTBN signals completion by executing the [`ECALL`](isa.md#ecall) instruction.
+The software running on ACC signals completion by executing the [`ECALL`](isa.md#ecall) instruction.
-Once OTBN has executed the [`ECALL`](isa.md#ecall) instruction, the following things happen:
+Once ACC has executed the [`ECALL`](isa.md#ecall) instruction, the following things happen:
- No more instructions are fetched or executed.
- A [secure wipe of internal state](./theory_of_operation.md#internal-state-secure-wipe) is performed.
@@ -72,15 +72,15 @@ Once OTBN has executed the [`ECALL`](isa.md#ecall) instruction, the following th
- The current operation is marked as complete by setting [`INTR_STATE.done`](registers.md#intr_state) and clearing [`STATUS`](registers.md#status).
The first 2kiB of DMEM can be used to pass data back to the host processor, e.g. a "return value" or an "exit code".
-Refer to the section [Passing of data between the host CPU and OTBN](#passing-of-data-between-the-host-cpu-and-otbn) for more information.
+Refer to the section [Passing of data between the host CPU and ACC](#passing-of-data-between-the-host-cpu-and-acc) for more information.
### Using hardware loops
-OTBN provides two hardware loop instructions: [`LOOP`](isa.md#loop) and [`LOOPI`](isa.md#loopi) .
+ACC provides two hardware loop instructions: [`LOOP`](isa.md#loop) and [`LOOPI`](isa.md#loopi) .
#### Loop nesting
-OTBN permits loop nesting and branches and jumps inside loops.
+ACC permits loop nesting and branches and jumps inside loops.
However, it doesn't have support for early termination of loops: there's no way to pop an entry from the loop stack without executing the last instruction of the loop the correct number of times.
It can also only pop one level of the loop stack per instruction.
@@ -89,7 +89,7 @@ To avoid polluting the loop stack and avoid surprising behaviour, the programmer
* Nested loops have distinct end addresses.
* The end instruction of an outer loop is not executed before an inner loop finishes.
-OTBN does not detect these conditions being violated, so no error will be signaled should they occur.
+ACC does not detect these conditions being violated, so no error will be signaled should they occur.
(Note indentation in the code examples is for clarity and has no functional impact.)
@@ -146,7 +146,7 @@ outer_body:
### Algorithic Examples: Multiplication with BN.MULQACC
-The big number instruction subset of OTBN generally operates on WLEN bit numbers.
+The big number instruction subset of ACC generally operates on WLEN bit numbers.
[`BN.MULQACC`](isa.md#bnmulqacc) operates with WLEN/4 bit operands (with a full WLEN accumulator).
This section outlines two techniques to perform larger multiplies by composing multiple [`BN.MULQACC`](isa.md#bnmulqacc) instructions.
@@ -351,14 +351,14 @@ The outlined technique can be extended to arbitrary bit widths but requires unro
-Code snippets giving examples of 256x256 and 384x384 multiplies can be found in `sw/otbn/code-snippets/mul256.s` and `sw/otbn/code-snippets/mul384.s`.
+Code snippets giving examples of 256x256 and 384x384 multiplies can be found in `sw/acc/code-snippets/mul256.s` and `sw/acc/code-snippets/mul384.s`.
## Device Interface Functions (DIFs)
-- [Device Interface Functions](../../../../sw/device/lib/dif/dif_otbn.h)
+- [Device Interface Functions](../../../../sw/device/lib/dif/dif_acc.h)
## Driver
-A higher-level driver for the OTBN block is available at `sw/device/lib/runtime/otbn.h`.
+A higher-level driver for the ACC block is available at `sw/device/lib/runtime/acc.h`.
-Another driver for OTBN is part of the silicon creator code at `sw/device/silicon_creator/lib/drivers/otbn.h`.
+Another driver for ACC is part of the silicon creator code at `sw/device/silicon_creator/lib/drivers/acc.h`.
diff --git a/hw/ip/otbn/doc/registers.md b/hw/ip/acc/doc/registers.md
similarity index 77%
rename from hw/ip/otbn/doc/registers.md
rename to hw/ip/acc/doc/registers.md
index cfe8fa70842..429e0d7896d 100644
--- a/hw/ip/otbn/doc/registers.md
+++ b/hw/ip/acc/doc/registers.md
@@ -1,23 +1,23 @@
# Registers
-
+
## Summary
-| Name | Offset | Length | Description |
-|:-----------------------------------------------|:---------|---------:|:------------------------------------------------|
-| otbn.[`INTR_STATE`](#intr_state) | 0x0 | 4 | Interrupt State Register |
-| otbn.[`INTR_ENABLE`](#intr_enable) | 0x4 | 4 | Interrupt Enable Register |
-| otbn.[`INTR_TEST`](#intr_test) | 0x8 | 4 | Interrupt Test Register |
-| otbn.[`ALERT_TEST`](#alert_test) | 0xc | 4 | Alert Test Register |
-| otbn.[`CMD`](#cmd) | 0x10 | 4 | Command Register |
-| otbn.[`CTRL`](#ctrl) | 0x14 | 4 | Control Register |
-| otbn.[`STATUS`](#status) | 0x18 | 4 | Status Register |
-| otbn.[`ERR_BITS`](#err_bits) | 0x1c | 4 | Operation Result Register |
-| otbn.[`FATAL_ALERT_CAUSE`](#fatal_alert_cause) | 0x20 | 4 | Fatal Alert Cause Register |
-| otbn.[`INSN_CNT`](#insn_cnt) | 0x24 | 4 | Instruction Count Register |
-| otbn.[`LOAD_CHECKSUM`](#load_checksum) | 0x28 | 4 | A 32-bit CRC checksum of data written to memory |
-| otbn.[`IMEM`](#imem) | 0x8000 | 32768 | Instruction Memory Access |
-| otbn.[`DMEM`](#dmem) | 0x18000 | 31744 | Data Memory Access |
+| Name | Offset | Length | Description |
+|:----------------------------------------------|:---------|---------:|:------------------------------------------------|
+| acc.[`INTR_STATE`](#intr_state) | 0x0 | 4 | Interrupt State Register |
+| acc.[`INTR_ENABLE`](#intr_enable) | 0x4 | 4 | Interrupt Enable Register |
+| acc.[`INTR_TEST`](#intr_test) | 0x8 | 4 | Interrupt Test Register |
+| acc.[`ALERT_TEST`](#alert_test) | 0xc | 4 | Alert Test Register |
+| acc.[`CMD`](#cmd) | 0x10 | 4 | Command Register |
+| acc.[`CTRL`](#ctrl) | 0x14 | 4 | Control Register |
+| acc.[`STATUS`](#status) | 0x18 | 4 | Status Register |
+| acc.[`ERR_BITS`](#err_bits) | 0x1c | 4 | Operation Result Register |
+| acc.[`FATAL_ALERT_CAUSE`](#fatal_alert_cause) | 0x20 | 4 | Fatal Alert Cause Register |
+| acc.[`INSN_CNT`](#insn_cnt) | 0x24 | 4 | Instruction Count Register |
+| acc.[`LOAD_CHECKSUM`](#load_checksum) | 0x28 | 4 | A 32-bit CRC checksum of data written to memory |
+| acc.[`IMEM`](#imem) | 0x8000 | 32768 | Instruction Memory Access |
+| acc.[`DMEM`](#dmem) | 0x18000 | 31744 | Data Memory Access |
## INTR_STATE
Interrupt State Register
@@ -31,10 +31,10 @@ Interrupt State Register
{"reg": [{"name": "done", "bits": 1, "attr": ["rw1c"], "rotate": -90}, {"bits": 31}], "config": {"lanes": 1, "fontsize": 10, "vspace": 80}}
```
-| Bits | Type | Reset | Name | Description |
-|:------:|:------:|:-------:|:-------|:----------------------------------|
-| 31:1 | | | | Reserved |
-| 0 | rw1c | 0x0 | done | OTBN has completed the operation. |
+| Bits | Type | Reset | Name | Description |
+|:------:|:------:|:-------:|:-------|:---------------------------------|
+| 31:1 | | | | Reserved |
+| 0 | rw1c | 0x0 | done | ACC has completed the operation. |
## INTR_ENABLE
Interrupt Enable Register
@@ -91,13 +91,13 @@ Alert Test Register
## CMD
Command Register
-A command initiates an OTBN operation. While performing the operation,
-OTBN is busy; the [`STATUS`](#status) register reflects that.
+A command initiates an ACC operation. While performing the operation,
+ACC is busy; the [`STATUS`](#status) register reflects that.
All operations signal their completion by raising the done
interrupt; alternatively, software may poll the [`STATUS`](#status) register.
-Writes are ignored if OTBN is not idle.
+Writes are ignored if ACC is not idle.
Unrecognized commands are ignored.
- Offset: `0x10`
- Reset default: `0x0`
@@ -135,10 +135,10 @@ Control Register
{"reg": [{"name": "software_errs_fatal", "bits": 1, "attr": ["rw"], "rotate": -90}, {"bits": 31}], "config": {"lanes": 1, "fontsize": 10, "vspace": 210}}
```
-| Bits | Type | Reset | Name | Description |
-|:------:|:------:|:-------:|:--------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| 31:1 | | | | Reserved |
-| 0 | rw | 0x0 | software_errs_fatal | Controls the reaction to software errors. When set software errors produce fatal errors, rather than recoverable errors. Writes are ignored if OTBN is not idle. |
+| Bits | Type | Reset | Name | Description |
+|:------:|:------:|:-------:|:--------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| 31:1 | | | | Reserved |
+| 0 | rw | 0x0 | software_errs_fatal | Controls the reaction to software errors. When set software errors produce fatal errors, rather than recoverable errors. Writes are ignored if ACC is not idle. |
## STATUS
Status Register
@@ -158,19 +158,19 @@ Status Register
| 7:0 | ro | 0x4 | [status](#status--status) |
### STATUS . status
-Indicates the current operational state OTBN is in.
+Indicates the current operational state ACC is in.
All BUSY values represent an operation started by a write to the
[`CMD`](#cmd) register.
| Value | Name | Description |
|:------|:-------------------|:------------------------------------------------------|
-| 0x00 | IDLE | OTBN is idle: it is not performing any action. |
-| 0x01 | BUSY_EXECUTE | OTBN is busy executing software. |
-| 0x02 | BUSY_SEC_WIPE_DMEM | OTBN is busy securely wiping the data memory. |
-| 0x03 | BUSY_SEC_WIPE_IMEM | OTBN is busy securely wiping the instruction memory. |
-| 0x04 | BUSY_SEC_WIPE_INT | OTBN is busy securely wiping the internal state. |
-| 0xFF | LOCKED | OTBN is locked as reaction to a fatal error, and must be reset to unlock it again. See also the section "Reaction to Fatal Errors". |
+| 0x00 | IDLE | ACC is idle: it is not performing any action. |
+| 0x01 | BUSY_EXECUTE | ACC is busy executing software. |
+| 0x02 | BUSY_SEC_WIPE_DMEM | ACC is busy securely wiping the data memory. |
+| 0x03 | BUSY_SEC_WIPE_IMEM | ACC is busy securely wiping the instruction memory. |
+| 0x04 | BUSY_SEC_WIPE_INT | ACC is busy securely wiping the internal state. |
+| 0xFF | LOCKED | ACC is locked as reaction to a fatal error, and must be reset to unlock it again. See also the section "Reaction to Fatal Errors". |
## ERR_BITS
@@ -181,8 +181,8 @@ Describes the errors detected during an operation.
Refer to the "List of Errors" section for a detailed description of the
errors.
-The host CPU can clear this register when OTBN is not running,
-by writing any value. Write attempts while OTBN is running are ignored.
+The host CPU can clear this register when ACC is not running,
+by writing any value. Write attempts while ACC is running are ignored.
- Offset: `0x1c`
- Reset default: `0x0`
- Reset mask: `0xff00ff`
@@ -218,8 +218,8 @@ by writing any value. Write attempts while OTBN is running are ignored.
Fatal Alert Cause Register
Describes any errors that led to a fatal alert.
-A fatal error puts OTBN in locked state; the value of this register
-does not change until OTBN is reset.
+A fatal error puts ACC in locked state; the value of this register
+does not change until ACC is reset.
Refer to the "List of Errors" section for a detailed description of the
errors.
@@ -256,10 +256,10 @@ Only the EXECUTE operation counts instructions; for all other operations
this register remains at 0. Instructions triggering an error do not
count towards the total.
-Always reads as 0 if OTBN is locked.
+Always reads as 0 if ACC is locked.
-The host CPU can clear this register when OTBN is not running,
-by writing any value. Write attempts while OTBN is running are ignored.
+The host CPU can clear this register when ACC is not running,
+by writing any value. Write attempts while ACC is running are ignored.
- Offset: `0x24`
- Reset default: `0x0`
- Reset mask: `0xffffffff`
@@ -296,11 +296,11 @@ See the "Memory Load Integrity" section of the manual for full details.
Instruction Memory Access
The instruction memory may only be accessed through this window
-while OTBN is idle.
+while ACC is idle.
-If OTBN is busy or locked, read accesses return 0 and write accesses
+If ACC is busy or locked, read accesses return 0 and write accesses
are ignored.
-If OTBN is busy, any access additionally triggers an
+If ACC is busy, any access additionally triggers an
ILLEGAL_BUS_ACCESS fatal error.
- Word Aligned Offset Range: `0x8000`to`0xfffc`
@@ -311,12 +311,12 @@ ILLEGAL_BUS_ACCESS fatal error.
## DMEM
Data Memory Access
-The data memory may only be accessed through this window while OTBN
+The data memory may only be accessed through this window while ACC
is idle.
-If OTBN is busy or locked, read accesses return 0 and write accesses
+If ACC is busy or locked, read accesses return 0 and write accesses
are ignored.
-If OTBN is busy, any access additionally triggers an
+If ACC is busy, any access additionally triggers an
ILLEGAL_BUS_ACCESS fatal error.
Note that DMEM is actually 4kiB in size, but only the first 3kiB of
diff --git a/hw/ip/otbn/doc/rshi.svg b/hw/ip/acc/doc/rshi.svg
similarity index 100%
rename from hw/ip/otbn/doc/rshi.svg
rename to hw/ip/acc/doc/rshi.svg
diff --git a/hw/ip/otbn/doc/theory_of_operation.md b/hw/ip/acc/doc/theory_of_operation.md
similarity index 68%
rename from hw/ip/otbn/doc/theory_of_operation.md
rename to hw/ip/acc/doc/theory_of_operation.md
index 91beb0acdaf..c201385091b 100644
--- a/hw/ip/otbn/doc/theory_of_operation.md
+++ b/hw/ip/acc/doc/theory_of_operation.md
@@ -2,50 +2,52 @@
## Block Diagram
-
+
## Design Details
### Memories
-The OTBN processor core has access to two dedicated memories: an instruction memory (IMEM), and a data memory (DMEM).
-The IMEM is 8 KiB, the DMEM is 4 KiB.
+The ACC processor core has access to two dedicated memories: an instruction memory (IMEM), and a data memory (DMEM).
+In the classical instantiation mode the IMEM is 8 KiB and the DMEM is 4 KiB.
+If ACC is instantiated with `AccPQCEn` to enable PQC, IMEM and DMEM should be 32 KiB each to support first-order-masking of ML-DSA-87.
The memory layout follows the Harvard architecture.
Both memories are byte-addressed, with addresses starting at 0.
-The instruction memory (IMEM) is 32b wide and provides the instruction stream to the OTBN processor.
+The instruction memory (IMEM) is 32b wide and provides the instruction stream to the ACC processor.
It cannot be read from or written to by user code through load or store instructions.
-The data memory (DMEM) is 256b wide and read-write accessible from the base and big number instruction subsets of the OTBN processor core.
+The data memory (DMEM) is 256b wide and read-write accessible from the base and big number instruction subsets of the ACC processor core.
There are four instructions that can access data memory.
-In the base instruction subset, there are {{#otbn-insn-ref LW}} (load word) and {{#otbn-insn-ref SW}} (store word).
+In the base instruction subset, there are {{#acc-insn-ref LW}} (load word) and {{#acc-insn-ref SW}} (store word).
These access 32b-aligned 32b words.
-In the big number instruction subset, there are {{#otbn-insn-ref BN.LID}} (load indirect) and {{#otbn-insn-ref BN.SID}} (store indirect).
+In the big number instruction subset, there are {{#acc-insn-ref BN.LID}} (load indirect) and {{#acc-insn-ref BN.SID}} (store indirect).
These access 256b-aligned 256b words.
-Both memories can be accessed through OTBN's register interface ([`DMEM`](registers.md#dmem) and [`IMEM`](registers.md#imem)).
+Both memories can be accessed through ACC's register interface ([`DMEM`](registers.md#dmem) and [`IMEM`](registers.md#imem)).
All memory accesses through the register interface must be word-aligned 32b word accesses.
-When OTBN is in any state other than [idle](#operational-states), reads return zero and writes have no effect.
-Furthermore, a memory access when OTBN is neither idle nor locked will cause OTBN to generate a fatal error with code `ILLEGAL_BUS_ACCESS`.
-A host processor can check whether OTBN is busy by reading the [`STATUS`](registers.md#status) register.
+When ACC is in any state other than [idle](#operational-states), reads return zero and writes have no effect.
+Furthermore, a memory access when ACC is neither idle nor locked will cause ACC to generate a fatal error with code `ILLEGAL_BUS_ACCESS`.
+A host processor can check whether ACC is busy by reading the [`STATUS`](registers.md#status) register.
The underlying memories used to implement the IMEM and DMEM may not grant all access requests (see [Memory Scrambling](#memory-scrambling) for details).
A request won't be granted if new scrambling keys have been requested for the memory that aren't yet available.
-Functionally it should be impossible for either OTBN or a host processor to make a memory request whilst new scrambling keys are unavailable.
-OTBN is in the busy state whilst keys are requested so OTBN will not execute any programs and a host processor access will generated an `ILLEGAL_BUS_ACCESS` fatal error.
+Functionally it should be impossible for either ACC or a host processor to make a memory request whilst new scrambling keys are unavailable.
+ACC is in the busy state whilst keys are requested so ACC will not execute any programs and a host processor access will generated an `ILLEGAL_BUS_ACCESS` fatal error.
Should a request not be granted due to a fault, a `BAD_INTERNAL_STATE` fatal error will be raised.
-While DMEM is 4kiB, only the first 3kiB (at addresses `0x0` to `0xbff`) is visible through the register interface.
-This is to allow OTBN applications to store sensitive information in the other 1kiB, making it harder for that information to leak back to Ibex.
+While DMEM is 4 KiB, only the first 3 KiB (at addresses `0x0` to `0xbff`) is visible through the register interface.
+When ACC is operating in its PQC mode the first 31 KiB are visible through the register interface.
+This is to allow ACC applications to store sensitive information in the other 1 KiB, making it harder for that information to leak back to Ibex.
Each memory write through the register interface updates a checksum.
See the [Memory Load Integrity](#memory-load-integrity) section for more details.
### Instruction Prefetch
-OTBN employs an instruction prefetch stage to enable pre-decoding of instructions to enable the [blanking SCA hardening measure](#blanking).
+ACC employs an instruction prefetch stage to enable pre-decoding of instructions to enable the [blanking SCA hardening measure](#blanking).
Its operation is entirely transparent to software.
It does not speculate and will only prefetch where the next instruction address can be known.
This results in a stall cycle for all conditional branches and jumps as the result is neither predicted nor known ahead of time.
@@ -53,37 +55,37 @@ Instruction bits held in the prefetch buffer are unscrambled but use the integri
### Random Numbers
-OTBN is connected to the [Entropy Distribution Network (EDN)](../../edn/README.md) which can provide random numbers via the `RND` and `URND` CSRs and WSRs.
+ACC is connected to the [Entropy Distribution Network (EDN)](../../edn/README.md) which can provide random numbers via the `RND` and `URND` CSRs and WSRs.
`RND` provides bits taken directly from the EDN connected via `edn_rnd`.
-The EDN interface provides 32b of entropy per transaction and comes from a different clock domain to the OTBN core.
-A FIFO is used to synchronize the incoming package to the OTBN clock domain.
+The EDN interface provides 32b of entropy per transaction and comes from a different clock domain to the ACC core.
+A FIFO is used to synchronize the incoming package to the ACC clock domain.
Synchronized packages are then set starting from bottom up to a single `WLEN` value of 256b.
In order to service a single EDN request, a total of 8 transactions are required from EDN interface.
The `RND` CSR and WSR take their bits from the same source.
A read from the `RND` CSR returns the bottom 32b; the other 192b are discarded.
-On a read from the `RND` CSR or WSR, OTBN will stall while it waits for data.
+On a read from the `RND` CSR or WSR, ACC will stall while it waits for data.
It will resume execution on the cycle after it receives the final word of data from the EDN.
-As an EDN request can take time, `RND` is backed by a single-entry cache containing the result of the most recent EDN request in OTBN core level.
+As an EDN request can take time, `RND` is backed by a single-entry cache containing the result of the most recent EDN request in ACC core level.
Writing any value to the `RND_PREFETCH` CSR initiates a prefetch.
This requests data from the EDN, storing it in the cache, and can hide the EDN latency.
Writes to `RND_PREFETCH` will be ignored whilst a prefetch is in progress or when the cache is already full.
If the cache is full, a read from `RND` returns immediately with the contents of the cache, which is then emptied.
-If the cache is not full, a read from `RND` will block as described above until OTBN receives the final word of data from the EDN.
+If the cache is not full, a read from `RND` will block as described above until ACC receives the final word of data from the EDN.
-OTBN discards any data that is in the cache at the start of an operation.
-If there is still a pending prefetch when an OTBN operation starts, the results of the prefetch will also discarded.
+ACC discards any data that is in the cache at the start of an operation.
+If there is still a pending prefetch when an ACC operation starts, the results of the prefetch will also discarded.
-`URND` provides bits from a local XoShiRo256++ PRNG within OTBN; reads from it never stall.
-This PRNG is seeded once from the EDN connected via `edn_urnd` when OTBN starts execution.
-Each new execution of OTBN will reseed the `URND` PRNG.
-The PRNG state is advanced every cycle when OTBN is running.
+`URND` provides bits from a local XoShiRo256++ PRNG within ACC; reads from it never stall.
+This PRNG is seeded once from the EDN connected via `edn_urnd` when ACC starts execution.
+Each new execution of ACC will reseed the `URND` PRNG.
+The PRNG state is advanced every cycle when ACC is running.
The PRNG has a long cycle length but has a fixed point: the sequence of numbers will get stuck if the state ever happens to become zero.
This will never happen in normal operation.
-If a fault causes the state to become zero, OTBN raises a `BAD_INTERNAL_STATE` fatal error.
+If a fault causes the state to become zero, ACC raises a `BAD_INTERNAL_STATE` fatal error.
### Operational States
@@ -92,33 +94,33 @@ Source: https://docs.google.com/drawings/d/1C0D4UriRk5pKGFoFtAXYLcJ1oBG1BCDd2omC
Download the SVG from Google Draw, open it in Inkscape once and save it without changes to add width/height information to the image.
-->
-
+
-OTBN can be in different operational states.
-After reset (*init*), OTBN performs a secure wipe of the internal state and then becomes *idle*.
-OTBN is *busy* for as long it is performing an operation.
-OTBN is *locked* if a fatal error was observed or after handling an RMA request.
+ACC can be in different operational states.
+After reset (*init*), ACC performs a secure wipe of the internal state and then becomes *idle*.
+ACC is *busy* for as long it is performing an operation.
+ACC is *locked* if a fatal error was observed or after handling an RMA request.
The current operational state is reflected in the [`STATUS`](registers.md#status) register.
-- After reset, OTBN is busy with the internal secure wipe and the [`STATUS`](registers.md#status) register is set to `BUSY_SEC_WIPE_INT`.
-- If OTBN is idle, the [`STATUS`](registers.md#status) register is set to `IDLE`.
-- If OTBN is busy, the [`STATUS`](registers.md#status) register is set to one of the values starting with `BUSY_`.
-- If OTBN is locked, the [`STATUS`](registers.md#status) register is set to `LOCKED`.
+- After reset, ACC is busy with the internal secure wipe and the [`STATUS`](registers.md#status) register is set to `BUSY_SEC_WIPE_INT`.
+- If ACC is idle, the [`STATUS`](registers.md#status) register is set to `IDLE`.
+- If ACC is busy, the [`STATUS`](registers.md#status) register is set to one of the values starting with `BUSY_`.
+- If ACC is locked, the [`STATUS`](registers.md#status) register is set to `LOCKED`.
-OTBN transitions into the busy state as result of host software [issuing a command](#operations-and-commands); OTBN is then said to perform an operation.
-OTBN transitions out of the busy state whenever the operation has completed.
+ACC transitions into the busy state as result of host software [issuing a command](#operations-and-commands); ACC is then said to perform an operation.
+ACC transitions out of the busy state whenever the operation has completed.
In the [`STATUS`](registers.md#status) register the different `BUSY_*` values represent the operation that is currently being performed.
A transition out of the busy state is signaled by the `done` interrupt ([`INTR_STATE.done`](registers.md#intr_state)).
-The locked state is a terminal state; transitioning out of it requires an OTBN reset.
+The locked state is a terminal state; transitioning out of it requires an ACC reset.
### Operations and Commands
-OTBN understands a set of commands to perform certain operations.
+ACC understands a set of commands to perform certain operations.
Commands are issued by writing to the [`CMD`](registers.md#cmd) register.
-The `EXECUTE` command starts the [execution of the application](#software-execution) contained in OTBN's instruction memory.
+The `EXECUTE` command starts the [execution of the application](#software-execution) contained in ACC's instruction memory.
The `SEC_WIPE_DMEM` command [securely wipes the data memory](#secure-wipe).
@@ -126,30 +128,30 @@ The `SEC_WIPE_IMEM` command [securely wipes the instruction memory](#secure-wipe
### Software Execution
-Software execution on OTBN is triggered by host software by [issuing the `EXECUTE` command](#operations-and-commands).
+Software execution on ACC is triggered by host software by [issuing the `EXECUTE` command](#operations-and-commands).
The software then runs to completion, without the ability for host software to interrupt or inspect the execution.
-- OTBN transitions into the busy state, and reflects this by setting [`STATUS`](registers.md#status) to `BUSY_EXECUTE`.
+- ACC transitions into the busy state, and reflects this by setting [`STATUS`](registers.md#status) to `BUSY_EXECUTE`.
- The internal randomness source, which provides random numbers to the `URND` CSR and WSR, is re-seeded from the EDN.
- The instruction at address zero is fetched and executed.
-- From this point on, all subsequent instructions are executed according to their semantics until either an {{#otbn-insn-ref ECALL}} instruction is executed, or an error is detected.
+- From this point on, all subsequent instructions are executed according to their semantics until either an {{#acc-insn-ref ECALL}} instruction is executed, or an error is detected.
- A [secure wipe of internal state](#internal-state-secure-wipe) is performed.
- The [`ERR_BITS`](registers.md#err_bits) register is set to indicate either a successful execution (value `0`), or to indicate the error that was observed (a non-zero value).
-- OTBN transitions into the [idle state](#operational-states) (in case of a successful execution, or a recoverable error) or the locked state (in case of a fatal error).
+- ACC transitions into the [idle state](#operational-states) (in case of a successful execution, or a recoverable error) or the locked state (in case of a fatal error).
This transition is signaled by raising the `done` interrupt ([`INTR_STATE.done`](registers.md#intr_state)), and reflected in the [`STATUS`](registers.md#status) register.
### Errors
-OTBN is able to detect a range of errors, which are classified as *software errors* or *fatal errors*.
-A software error is an error in the code that OTBN executes.
+ACC is able to detect a range of errors, which are classified as *software errors* or *fatal errors*.
+A software error is an error in the code that ACC executes.
In the absence of an attacker, these errors are due to a programmer's mistake.
A fatal error is typically the violation of a security property.
All errors and their classification are listed in the [List of Errors](#list-of-errors).
-Whenever an error is detected, OTBN reacts locally, and informs the OpenTitan system about it by raising an alert.
-OTBN generally does not try to recover from errors itself, and provides no error handling support to code that runs on it.
+Whenever an error is detected, ACC reacts locally, and informs the system about it by raising an alert.
+ACC generally does not try to recover from errors itself, and provides no error handling support to code that runs on it.
-OTBN gives host software the option to recover from some errors by restarting the operation.
+ACC gives host software the option to recover from some errors by restarting the operation.
All software errors are treated as recoverable, unless [`CTRL.software_errs_fatal`](registers.md#ctrl) is set, and are handled as described in the section [Reaction to Recoverable Errors](#reaction-to-recoverable-errors).
When [`CTRL.software_errs_fatal`](registers.md#ctrl) is set, software errors become fatal errors.
@@ -157,12 +159,12 @@ Fatal errors are treated as described in the section [Reaction to Fatal Errors](
### Reaction to Recoverable Errors
-Recoverable errors can be the result of a programming error in OTBN software.
-Recoverable errors can only occur during the execution of software on OTBN, and not in other situations in which OTBN might be busy.
+Recoverable errors can be the result of a programming error in ACC software.
+Recoverable errors can only occur during the execution of software on ACC, and not in other situations in which ACC might be busy.
-The following actions are taken when OTBN detects a recoverable error:
+The following actions are taken when ACC detects a recoverable error:
-1. The currently running operation is terminated, similar to the way an {{#otbn-insn-ref ECALL}} instruction [is executed](#returning-from-an-application):
+1. The currently running operation is terminated, similar to the way an {{#acc-insn-ref ECALL}} instruction [is executed](#returning-from-an-application):
- No more instructions are fetched or executed.
- A [secure wipe of internal state](#internal-state-secure-wipe) is performed.
- The [`ERR_BITS`](registers.md#err_bits) register is set to a non-zero value that describes the error.
@@ -170,17 +172,17 @@ The following actions are taken when OTBN detects a recoverable error:
- The [`STATUS`](registers.md#status) register is set to `IDLE`.
2. A [recoverable alert](#alerts) is raised.
-The host software can start another operation on OTBN after a recoverable error was detected.
+The host software can start another operation on ACC after a recoverable error was detected.
### Reaction to Fatal Errors
-Fatal errors are generally seen as a sign of an intrusion, resulting in more drastic measures to protect the secrets stored within OTBN.
-Fatal errors can occur at any time, even when an OTBN operation isn't in progress.
+Fatal errors are generally seen as a sign of an intrusion, resulting in more drastic measures to protect the secrets stored within ACC.
+Fatal errors can occur at any time, even when an ACC operation isn't in progress.
-The following actions are taken when OTBN detects a fatal error:
+The following actions are taken when ACC detects a fatal error:
1. A [secure wipe of the data memory](#data-memory-dmem-secure-wipe) and a [secure wipe of the instruction memory](#instruction-memory-imem-secure-wipe) is initiated.
-2. If OTBN [is not idle](#operational-states), then the currently running operation is terminated, similarly to how an operation ends after an {{#otbn-insn-ref ECALL}} instruction [is executed](#returning-from-an-application):
+2. If ACC [is not idle](#operational-states), then the currently running operation is terminated, similarly to how an operation ends after an {{#acc-insn-ref ECALL}} instruction [is executed](#returning-from-an-application):
- No more instructions are fetched or executed.
- A [secure wipe of internal state](#internal-state-secure-wipe) is performed.
- The [`ERR_BITS`](registers.md#err_bits) register is set to a non-zero value that describes the error.
@@ -188,11 +190,11 @@ The following actions are taken when OTBN detects a fatal error:
3. The [`STATUS`](registers.md#status) register is set to `LOCKED`.
4. A [fatal alert](#alerts) is raised.
-Note that OTBN can detect some errors even when it isn't running.
-One example of this is an error caused by an integrity error when reading or writing OTBN's memories over the bus.
+Note that ACC can detect some errors even when it isn't running.
+One example of this is an error caused by an integrity error when reading or writing ACC's memories over the bus.
In this case, the [`ERR_BITS`](registers.md#err_bits) register will not change.
This avoids race conditions with the host processor's error handling software.
-However, every error that OTBN detects when it isn't running is fatal.
+However, every error that ACC detects when it isn't running is fatal.
This means that the cause will be reflected in [`FATAL_ALERT_CAUSE`](registers.md#fatal_alert_cause), as described below in [Alerts](#alerts).
This way, no alert is generated without setting an error code somewhere.
@@ -280,7 +282,7 @@ This way, no alert is generated without setting an error code somewhere.
BAD_INTERNAL_STATE |
fatal |
- The internal state of OTBN has become corrupt. |
+ The internal state of ACC has become corrupt. |
ILLEGAL_BUS_ACCESS |
@@ -302,41 +304,41 @@ This way, no alert is generated without setting an error code somewhere.
### Alerts
-An alert is a reaction to an error that OTBN detected.
-OTBN has two alerts, one recoverable and one fatal.
+An alert is a reaction to an error that ACC detected.
+ACC has two alerts, one recoverable and one fatal.
A **recoverable alert** is a one-time triggered alert caused by [recoverable errors](#reaction-to-recoverable-errors).
The error that caused the alert can be determined by reading the [`ERR_BITS`](registers.md#err_bits) register.
A **fatal alert** is a continuously triggered alert caused by [fatal errors](#reaction-to-fatal-errors).
The error that caused the alert can be determined by reading the [`FATAL_ALERT_CAUSE`](registers.md#fatal_alert_cause) register.
-If OTBN was running, this value will also be reflected in the [`ERR_BITS`](registers.md#err_bits) register.
-A fatal alert can only be cleared by resetting OTBN through the `rst_ni` line.
+If ACC was running, this value will also be reflected in the [`ERR_BITS`](registers.md#err_bits) register.
+A fatal alert can only be cleared by resetting ACC through the `rst_ni` line.
-The host CPU can clear the [`ERR_BITS`](registers.md#err_bits) when OTBN is not running.
+The host CPU can clear the [`ERR_BITS`](registers.md#err_bits) when ACC is not running.
Writing any value to [`ERR_BITS`](registers.md#err_bits) clears this register to zero.
-Write attempts while OTBN is running are ignored.
+Write attempts while ACC is running are ignored.
### Reaction to Life Cycle Escalation Requests
-OTBN receives and reacts to escalation signals from the [life cycle controller](../../lc_ctrl/README.md#security-escalation).
+ACC receives and reacts to escalation signals from the [life cycle controller](../../lc_ctrl/README.md#security-escalation).
An incoming life cycle escalation is a fatal error of type `lifecycle_escalation` and treated as described in the section [Fatal Errors](#reaction-to-fatal-errors).
### Idle
-OTBN exposes a single-bit `idle_o` signal, intended to be used by the clock manager to clock-gate the block when it is not in use.
+ACC exposes a single-bit `idle_o` signal, intended to be used by the clock manager to clock-gate the block when it is not in use.
This signal is in the same clock domain as `clk_i`.
-The `idle_o` signal is high when OTBN [is idle](#operational-states), and low otherwise.
+The `idle_o` signal is high when ACC [is idle](#operational-states), and low otherwise.
-OTBN also exposes another version of the idle signal as `idle_otp_o`.
+ACC also exposes another version of the idle signal as `idle_otp_o`.
This works analogously, but is in the same clock domain as `clk_otp_i`.
TODO: Specify interactions between `idle_o`, `idle_otp_o` and the clock manager fully.
### Data Integrity Protection
-OTBN stores and operates on data (state) in its dedicated memories, register files, and internal registers.
-OTBN's data integrity protection is designed to protect all data stored and transmitted within OTBN from modifications through physical attacks.
+ACC stores and operates on data (state) in its dedicated memories, register files, and internal registers.
+ACC's data integrity protection is designed to protect all data stored and transmitted within ACC from modifications through physical attacks.
During transmission, the integrity of data is protected with an integrity protection code.
Data at rest in the instruction and data memories is additionally scrambled.
@@ -345,7 +347,7 @@ In the following, the Integrity Protection Code and the scrambling algorithm are
#### Integrity Protection Code
-OTBN uses the same integrity protection code everywhere to provide overarching data protection without regular re-encoding.
+ACC uses the same integrity protection code everywhere to provide overarching data protection without regular re-encoding.
The code is applied to 32b data words, and produces 39b of encoded data.
The code used is an (39,32) Hsiao "single error correction, double error detection" (SECDED) error correction code (ECC) [[CHEN08](#ref-chen08)].
@@ -354,18 +356,18 @@ The code is used for error detection only; no error correction is performed.
#### Memory Scrambling
-Contents of OTBN's instruction and data memories are scrambled while at rest.
+Contents of ACC's instruction and data memories are scrambled while at rest.
The data is bound to the address and scrambled before being stored in memory.
The addresses are randomly remapped.
-Note that data stored in other temporary memories within OTBN, including the register files, is not scrambled.
+Note that data stored in other temporary memories within ACC, including the register files, is not scrambled.
Scrambling is used to obfuscate the memory contents and to diffuse the data.
Obfuscation makes passive probing more difficult, while diffusion makes active fault injection attacks more difficult.
The scrambling mechanism is described in detail in the [section "Scrambling Primitive" of the SRAM Controller Technical Specification](../../sram_ctrl/README.md#scrambling-primitive).
-When OTBN comes out of reset, its memories have default scrambling keys.
+When ACC comes out of reset, its memories have default scrambling keys.
The host processor can request new keys for each memory by issuing a [secure wipe of DMEM](#data-memory-dmem-secure-wipe) and a [secure wipe of IMEM](#instruction-memory-imem-secure-wipe).
#### Actions on Integrity Errors
@@ -375,7 +377,7 @@ The section [Error Handling and Reporting](#design-details-error-handling-and-re
#### Register File Integrity Protection
-OTBN contains two register files: the 32b GPRs and the 256b WDRs.
+ACC contains two register files: the 32b GPRs and the 256b WDRs.
The data stored in both register files is protected with the [Integrity Protection Code](#integrity-protection-code).
Neither the register file contents nor register addresses are scrambled.
@@ -389,8 +391,8 @@ The register files can consume data protected with the Integrity Protection Code
Whenever possible the Integrity Protection Code is preserved from its source and written directly to the register files without recalculation, in particular in the following cases:
* Data coming from the data memory (DMEM) through the load-store unit to a GPR or WDR.
-* Data copied between WDRs using the {{#otbn-insn-ref BN.MOV}} or {{#otbn-insn-ref BN.MOVR}} instructions.
-* Data conditionally copied between WDRs using the {{#otbn-insn-ref BN.SEL}} instruction.
+* Data copied between WDRs using the {{#acc-insn-ref BN.MOV}} or {{#acc-insn-ref BN.MOVR}} instructions.
+* Data conditionally copied between WDRs using the {{#acc-insn-ref BN.SEL}} instruction.
* Data copied between the `ACC` and `MOD` WSRs and a WDR.
* Data copied between any of the `MOD0` to `MOD7` CSRs and a GPR.
(TODO: Not yet implemented.)
@@ -403,7 +405,7 @@ Detected integrity violations in a register file raise a fatal `reg_error`.
#### Data Memory (DMEM) Integrity Protection
-OTBN's data memory is 256b wide, but allows for 32b word accesses.
+ACC's data memory is 256b wide, but allows for 32b word accesses.
To facilitate such accesses, all integrity protection in the data memory is done on a 32b word granularity.
All data entering or leaving the data memory block is protected with the [Integrity Protection Code](#integrity-protection-code);
@@ -413,7 +415,7 @@ Before being stored in SRAM, the data word with the attached Integrity Protectio
The scrambling is reversed on a read.
The ephemeral memory scrambling key and the nonce are provided by the OTP block.
-They are set once when OTBN block is reset, and changed whenever a [secure wipe](#data-memory-dmem-secure-wipe) of the data memory is performed.
+They are set once when ACC block is reset, and changed whenever a [secure wipe](#data-memory-dmem-secure-wipe) of the data memory is performed.
For example, see earlgrey's [OTP block](../../../top_earlgrey/ip_autogen/otp_ctrl/doc/theory_of_operation.md#scrambling-key-derivation).
The Integrity Protection Code is checked on every memory read, even though the code remains attached to the data.
@@ -429,7 +431,7 @@ Before being stored in SRAM, the instruction word with the attached Integrity Pr
The scrambling is reversed on a read.
The ephemeral memory scrambling key and the nonce are provided by the OTP block (for example, see earlgrey's [scrambling specification](../../../top_earlgrey/ip_autogen/otp_ctrl/doc/theory_of_operation.md#scrambling-key-derivation)).
-They are set once when OTBN block is reset, and changed whenever a [secure wipe](#instruction-memory-imem-secure-wipe) of the instruction memory is performed.
+They are set once when ACC block is reset, and changed whenever a [secure wipe](#instruction-memory-imem-secure-wipe) of the instruction memory is performed.
The Integrity Protection Code is checked on every memory read, even though the code remains attached to the data.
A further check must be performed when the data is consumed.
@@ -437,13 +439,13 @@ Detected integrity violations in the data memory raise a fatal `imem_error`.
### Memory Load Integrity
-As well as the integrity protection discussed above for the memories and bus interface, OTBN has a second layer of integrity checking to allow a host processor to ensure that a program has been loaded correctly.
+As well as the integrity protection discussed above for the memories and bus interface, ACC has a second layer of integrity checking to allow a host processor to ensure that a program has been loaded correctly.
This is visible through the [`LOAD_CHECKSUM`](registers.md#load_checksum) register.
The register exposes a cumulative CRC checksum which is updated on every write to either memory.
This is intended as a light-weight way to implement a more efficient "write and read back" check.
It isn't a cryptographically secure MAC, so cannot spot an attacker who can completely control the bus.
-However, in this case the attacker would be equally able to control responses from OTBN, so any such check could be subverted.
+However, in this case the attacker would be equally able to control responses from ACC, so any such check could be subverted.
The CRC used is the 32-bit CRC-32-IEEE checksum.
This standard choice of generating polynomial makes it compatible with other tooling and libraries, such as the [crc32 function](https://docs.python.org/3/library/binascii.html#binascii.crc32) in the python 'binascii' module and the crc instructions in the RISC-V bitmanip specification [[SYMBIOTIC21]](#ref-symbiotic21).
@@ -460,13 +462,13 @@ Note the internal representation of the CRC is inverted from the register visibl
This is done to maintain compatibility with existing CRC-32-IEEE tooling and libraries.
To use this functionality, the host processor should set [`LOAD_CHECKSUM`](registers.md#load_checksum) to a known value (traditionally, `32'h00000000`).
-Next, it should write the program to be loaded to OTBN's IMEM and DMEM over the bus.
+Next, it should write the program to be loaded to ACC's IMEM and DMEM over the bus.
Finally, it should read back the value of [`LOAD_CHECKSUM`](registers.md#load_checksum) and compare it with an expected value.
### Secure Wipe
-Applications running on OTBN may store sensitive data in the internal registers or the memory.
-In order to prevent an untrusted application from reading any leftover data, OTBN provides the secure wipe operation.
+Applications running on ACC may store sensitive data in the internal registers or the memory.
+In order to prevent an untrusted application from reading any leftover data, ACC provides the secure wipe operation.
This operation can be applied to:
- [Data memory](#data-memory-dmem-secure-wipe)
- [Instruction memory](#instruction-memory-imem-secure-wipe)
@@ -478,13 +480,13 @@ A secure wipe of either the instruction or the data memory can be triggered from
A secure wipe of instruction memory, data memory, and all internal state is performed automatically when handling a [fatal error](#reaction-to-fatal-errors).
In addition, it can be triggered by the [Life Cycle Controller](../../lc_ctrl/README.md) before RMA entry using the `lc_rma_req/ack` interface.
-In both cases OTBN enters the locked state afterwards and needs to be reset.
+In both cases ACC enters the locked state afterwards and needs to be reset.
-A secure wipe of the internal state only is triggered automatically after reset and when OTBN [ends the software execution](#software-execution), either successfully, or unsuccessfully due to a [recoverable error](#reaction-to-recoverable-errors).
+A secure wipe of the internal state only is triggered automatically after reset and when ACC [ends the software execution](#software-execution), either successfully, or unsuccessfully due to a [recoverable error](#reaction-to-recoverable-errors).
-If OTBN cannot complete a secure wipe of the internal state (e.g., due to failing to obtain the required randomness), it immediately becomes locked.
-In this case, OTBN must be reset and will then retry the secure wipe.
-The secure wipe after reset must succeed before OTBN can be used.
+If ACC cannot complete a secure wipe of the internal state (e.g., due to failing to obtain the required randomness), it immediately becomes locked.
+In this case, ACC must be reset and will then retry the secure wipe.
+The secure wipe after reset must succeed before ACC can be used.
#### Data Memory (DMEM) Secure Wipe
@@ -512,7 +514,7 @@ Host software can initiate a data memory secure wipe by [issuing the `SEC_WIPE_I
#### Internal State Secure Wipe
-OTBN provides a mechanism to securely wipe all internal state, excluding the instruction and data memories.
+ACC provides a mechanism to securely wipe all internal state, excluding the instruction and data memories.
The following state is wiped:
* Register files: GPRs and WDRs
@@ -533,11 +535,16 @@ Host software cannot explicitly trigger an internal secure wipe; it is performed
### KMAC Application Interface
-The OTBN has an application interface connection to the KMAC block allowing for function calls directly to SHA3 and SHAKE algorithms.
+The ACC has an application interface side-load connection to the KMAC IP allowing for accelerated hashing with the SHA3 and SHAKE algorithms.
For KMAC specific implementation details of the AppIntf view the [`KMAC Theory of Operation`](../../kmac/doc/theory_of_operation.md#application-interface).
-The first word written from KMAC on the application interface is used to dynamically configure the algorithm executed within the KMAC block.
+The first word written from KMAC on the application interface is used to dynamically configure the algorithm executed within KMAC.
Bits [1:0] select the appropriate SHA3/cSHAKE/SHAKE algorithm and bits [4:2] select the appropriate Keccak drive strength.
-The CSR for configuring the KMAC operation can be found at 0x7D9.
+The CSR for configuring the KMAC operation can be found at `0x7D9`.
+After configuring the transaction, writes to the `kmac_msg` WSR register are used to send data over the AppIntf.
+Reading from the `kmac_digest` WSR will contain the valid digest from KMAC.
+ACC supports a partial word write through the `kmac_partial_write` CSR register.
+This register applies a byte-mask to the `kmac_msg` WSR such that a word less than 32B can be written to the internal FIFO and sent over the AppIntf.
+For register descriptions refer to the [csr.yml](../data/csr.yml) and [wsr.yml](../data/wsr.yml).
@@ -552,14 +559,3 @@ The CSR for configuring the KMAC operation can be found at 0x7D9.
CsrKmacPartialWrite | 0x7F3 |
-
-#### Partial Word Support
-
-To reduce additional complexity and code size in the OTBN when initializing a SHA3/SHAKE algorithm the OTBN supports partial word writes.
-Writing to the `Send to KMAC` register is used to transfer data over the AppIntf.
-The optimization provides a reduced code size for the following reason.
-If software wanted to compute SHAKE128(a || b) where a is 2 bytes and b is 32 bytes, without partial write support, software is required to compute a || b[29:0].
-Then write the result and follow with the last two bytes, b[31:30].
-A `_KMAC_WRITE_LEN` register is used to write the size of the next word being transferred, if it is not 32B in size.
-After writing the partial word to the KMAC register, the `_KMAC_WRITE_LEN` register will clear itself unless a new value is written.
-The OTBN should be able to make requests to the KMAC block back-to-back.
diff --git a/hw/ip/otbn/dv/README.md b/hw/ip/acc/dv/README.md
similarity index 64%
rename from hw/ip/otbn/dv/README.md
rename to hw/ip/acc/dv/README.md
index 1a1f04454eb..9a4419ace59 100644
--- a/hw/ip/otbn/dv/README.md
+++ b/hw/ip/acc/dv/README.md
@@ -1,8 +1,8 @@
-# OTBN DV document
+# ACC DV document
## Goals
* **DV**
- * Verify the OTBN processor by running dynamic simulations with a SV/UVM based testbench
+ * Verify the ACC processor by running dynamic simulations with a SV/UVM based testbench
* These simulations are grouped in tests listed in the [testplan](#testplan) below.
* Close code and functional coverage on the IP and all of its sub-modules
* **FPV**
@@ -11,35 +11,35 @@
## Current status
* [Design & verification stage](../../../README.md)
* [HW development stages](../../../../doc/project_governance/development_stages.md)
-* [Simulation results](https://reports.opentitan.org/hw/ip/otbn/dv/uvm/latest/report.html)
+* [Simulation results](https://reports.opentitan.org/hw/ip/acc/dv/uvm/latest/report.html)
## Design features
-OTBN, the OpenTitan Big Number accelerator, is a cryptographic accelerator.
-For detailed information on OTBN design features, see the [OTBN HWIP technical specification](../README.md).
+ACC, the OpenTitan Big Number accelerator, is a cryptographic accelerator.
+For detailed information on ACC design features, see the [ACC HWIP technical specification](../README.md).
## Testbench architecture
-The OTBN testbench is based on the [CIP testbench architecture](../../../dv/sv/cip_lib/README.md).
+The ACC testbench is based on the [CIP testbench architecture](../../../dv/sv/cip_lib/README.md).
It builds on the [dv_utils](../../../dv/sv/dv_utils/README.md) and [csr_utils](../../../dv/sv/csr_utils/README.md) packages.
### Block diagram
-OTBN testing makes use of a DPI-based model called `otbn_core_model`.
+ACC testing makes use of a DPI-based model called `acc_core_model`.
This is shown in the block diagram.
-The dotted interfaces in the `otbn` block are bound in by the model to access internal signals (register file and memory contents).
+The dotted interfaces in the `acc` block are bound in by the model to access internal signals (register file and memory contents).

### Top level testbench
-The top-level testbench is located at `hw/ip/otbn/dv/uvm/tb.sv`.
-This instantiates the OTBN DUT module `hw/ip/otbn/rtl/otbn.sv`.
+The top-level testbench is located at `hw/ip/acc/dv/uvm/tb.sv`.
+This instantiates the ACC DUT module `hw/ip/acc/rtl/acc.sv`.
-OTBN has the following interfaces:
+ACC has the following interfaces:
- A [Clock and reset interface](../../../dv/sv/common_ifs/README.md#clk_rst_if)
- A [TileLink interface](../../../dv/sv/tl_agent/README.md).
- OTBN is a TL-UL device, which expects to communicate with a TL-UL host.
+ ACC is a TL-UL device, which expects to communicate with a TL-UL host.
In the OpenTitan SoC, this will be the Ibex core.
- Idle signals in each clock domain, `idle_o`, and `idle_otp_o`
- One interrupt
@@ -52,17 +52,17 @@ OTBN has the following interfaces:
The idle and interrupt signals are modelled with the basic
[`pins_if`](../../../dv/sv/common_ifs/README.md#pins_if) interface.
-As well as instantiating OTBN, the testbench also instantiates an `otbn_core_model`.
-This module wraps an ISS (instruction set simulator) subprocess and performs checks to make sure that OTBN behaves the same as the ISS.
-The `otbn_core_model` module communicates with test sequences through an `otbn_model_if` interface, which is monitored by the `otbn_model_agent`, described below.
+As well as instantiating ACC, the testbench also instantiates an `acc_core_model`.
+This module wraps an ISS (instruction set simulator) subprocess and performs checks to make sure that ACC behaves the same as the ISS.
+The `acc_core_model` module communicates with test sequences through an `acc_model_if` interface, which is monitored by the `acc_model_agent`, described below.
The module communicates with the Python subprocess as shown in the diagram below.

-### OTBN model agent
+### ACC model agent
-The model agent is instantiated by the testbench to monitor the OTBN model.
+The model agent is instantiated by the testbench to monitor the ACC model.
It is a passive agent (essentially just a monitor): the inputs to the model are set in `tb.sv`.
The monitor for the agent generates transactions when it sees a start signal or a done signal.
@@ -71,12 +71,12 @@ To make sure that the processor is starting when we expect, we check start trans
### Reference models
-The main reference model for OTBN is the instruction set simulator (ISS), which is run as a subprocess by DPI code inside `otbn_core_model`.
-This Python-based simulator can be found at `hw/ip/otbn/dv/otbnsim`.
+The main reference model for ACC is the instruction set simulator (ISS), which is run as a subprocess by DPI code inside `acc_core_model`.
+This Python-based simulator can be found at `hw/ip/acc/dv/accsim`.
## Stimulus strategy
-When testing OTBN, we are careful to distinguish between
+When testing ACC, we are careful to distinguish between
- behaviour that can be triggered by particular instruction streams
- behaviour that is triggered by particular external stimuli (register writes; surprise resets etc.)
@@ -86,7 +86,7 @@ The idea is that this is much quicker for designers to use to smoke-test propose
This pre-DV phase cannot drive sign-off, but it does use much of the same tooling.
Once we are running full DV tests, we re-use this work, by using the same collection of randomised instruction streams and randomly picking from them for most of the sequences.
-At the moment, the full DV tests create binaries on the fly by running `hw/ip/otbn/dv/uvm/gen-binaries.py`.
+At the moment, the full DV tests create binaries on the fly by running `hw/ip/acc/dv/uvm/gen-binaries.py`.
This results in one or more ELF files in a directory, which the simulation then picks from at random.
The pre-DV testing doesn't address external stimuli like resets or TileLink-based register accesses.
@@ -94,13 +94,13 @@ These are driven by specialised test sequences, described below.
### Functional coverage
-As a complicated IP block, OTBN has a lot of functional coverage points defined.
-To avoid overwhelming this document, these are described in [OTBN functional coverage](./doc/fcov.md).
+As a complicated IP block, ACC has a lot of functional coverage points defined.
+To avoid overwhelming this document, these are described in [ACC functional coverage](./doc/fcov.md).
### Test sequences
-The test sequences can be found in `hw/ip/otbn/dv/uvm/env/seq_lib`.
-The basic test sequence (`otbn_base_vseq`) loads the instruction stream from a randomly chosen binary (see above), configures OTBN and then lets it run to completion.
+The test sequences can be found in `hw/ip/acc/dv/uvm/env/seq_lib`.
+The basic test sequence (`acc_base_vseq`) loads the instruction stream from a randomly chosen binary (see above), configures ACC and then lets it run to completion.
More specialized sequences include things like multiple runs, register accesses during operation (which should fail) and memory corruption.
We also check things like the correct operation of the interrupt registers.
@@ -108,7 +108,7 @@ We also check things like the correct operation of the interrupt registers.
## Self-checking strategy
### Scoreboard
-Much of the checking for these tests is actually performed in `otbn_core_model`, which ensures that the RTL and ISS have the same behaviour.
+Much of the checking for these tests is actually performed in `acc_core_model`, which ensures that the RTL and ISS have the same behaviour.
However, the scoreboard does have some checks, to ensure that interrupt and idle signals are high at the expected times.
### Assertions
@@ -118,7 +118,7 @@ Core TLUL protocol assertions are checked by binding the [TL-UL protocol checker
Outputs are also checked for `'X` values by assertions in the design RTL.
The design RTL contains other assertions defined by the designers, which will be checked in simulation (and won't have been checked by the pre-DV Verilator simulations).
-Finally, the `otbn_idle_checker` checks that the `idle_o` output correctly matches the running state that you'd expect, based on writes to the `CMD` register and responses that will appear in the `DONE` interrupt.
+Finally, the `acc_idle_checker` checks that the `idle_o` output correctly matches the running state that you'd expect, based on writes to the `CMD` register and responses that will appear in the `DONE` interrupt.
## Building and running tests
@@ -126,8 +126,8 @@ Tests can be run with [`dvsim.py`](../../../../util/dvsim/README.md).
The link gives details of the tool's features and command line arguments.
To run a basic smoke test, go to the top of the repository and run:
```console
-$ util/dvsim/dvsim.py hw/ip/otbn/dv/uvm/otbn_sim_cfg.hjson -i otbn_smoke
+$ util/dvsim/dvsim.py hw/ip/acc/dv/uvm/acc_sim_cfg.hjson -i acc_smoke
```
## Testplan
-[Testplan](../data/otbn_testplan.hjson)
+[Testplan](../data/acc_testplan.hjson)
diff --git a/hw/ip/otbn/dv/otbnsim/BUILD b/hw/ip/acc/dv/accsim/BUILD
similarity index 74%
rename from hw/ip/otbn/dv/otbnsim/BUILD
rename to hw/ip/acc/dv/accsim/BUILD
index bef51563dfc..c1e7fdd341b 100644
--- a/hw/ip/otbn/dv/otbnsim/BUILD
+++ b/hw/ip/acc/dv/accsim/BUILD
@@ -15,8 +15,8 @@ py_binary(
name = "standalone",
srcs = ["standalone.py"],
deps = [
- "//hw/ip/otbn/dv/otbnsim/sim:load_elf",
- "//hw/ip/otbn/dv/otbnsim/sim:standalonesim",
- "//hw/ip/otbn/dv/otbnsim/sim:stats",
+ "//hw/ip/acc/dv/accsim/sim:load_elf",
+ "//hw/ip/acc/dv/accsim/sim:standalonesim",
+ "//hw/ip/acc/dv/accsim/sim:stats",
],
)
diff --git a/hw/ip/otbn/dv/otbnsim/Makefile b/hw/ip/acc/dv/accsim/Makefile
similarity index 84%
rename from hw/ip/otbn/dv/otbnsim/Makefile
rename to hw/ip/acc/dv/accsim/Makefile
index 0d2b90c88e5..2c0fa793c3f 100644
--- a/hw/ip/otbn/dv/otbnsim/Makefile
+++ b/hw/ip/acc/dv/accsim/Makefile
@@ -5,10 +5,10 @@
.PHONY: all
all: lint
-# We need a directory to build stuff and use the "otbn/otbnsim" namespace
+# We need a directory to build stuff and use the "acc/accsim" namespace
# in the top-level build-bin directory.
repo-top := ../../../..
-build-dir := $(repo-top)/build-bin/otbn/otbnsim
+build-dir := $(repo-top)/build-bin/acc/accsim
$(build-dir):
mkdir -p $@
diff --git a/hw/ip/otbn/dv/otbnsim/README.md b/hw/ip/acc/dv/accsim/README.md
similarity index 62%
rename from hw/ip/otbn/dv/otbnsim/README.md
rename to hw/ip/acc/dv/accsim/README.md
index e34d4561ace..4c99bf7ca0f 100644
--- a/hw/ip/otbn/dv/otbnsim/README.md
+++ b/hw/ip/acc/dv/accsim/README.md
@@ -1,20 +1,20 @@
-# OTBNSim - OTBN Simulation Software
+# ACCSim - ACC Simulation Software
-`OTBNSim` class represents a simulator that models the whole OTBN block.
+`ACCSim` class represents a simulator that models the whole ACC block.
Therefore it includes abstract models for the state of the core, its memory modules, and also the register modules.
It has methods for starting the execution, cycle-accurate simulation tracing, and for injecting errors and reacting to those errors with a secure wipe.
-As explained in the overall [OTBN DV documentation](../README.md), this simulator is driven essentially from the SystemVerilog model of the OTBN module.
+As explained in the overall [ACC DV documentation](../README.md), this simulator is driven essentially from the SystemVerilog model of the ACC module.
-The simulator works in a step-by-step fashion and it has multiple methods to apply external stimuli to OTBN.
+The simulator works in a step-by-step fashion and it has multiple methods to apply external stimuli to ACC.
In a typical run without errors, the ISS does the following:
1. Decode the program on the path given by `iss_wrapper.cc` by the `decode_file` method in `decode.py`.
2. Load the decoded program to a local list in `sim.py`.
3. With each `step` command from the SystemVerilog side, update the simulated state of the core (`state.py`), registers (`wsr.py`, `csr.py` and `gpr.py`) and data memory (`dmem.py`).
- 4. Once the step is done, pass the generated trace to `iss_wrapper.cc`, which to then passes it on to `OTBNTraceChecker`.
+ 4. Once the step is done, pass the generated trace to `iss_wrapper.cc`, which to then passes it on to `ACCTraceChecker`.
## Co-Simulation with RTL
-For co-simulation of RTL and ISS, the `otbn_tracer` module logs state changes of the RTL, and the ISS logs state changes of the Python model.
-Trace entries from the simulated core (aka. from RTL) appear as a result of DPI callbacks while ISS trace entries appear in the trace checker through `ISSWrapper` using `OnIssTrace` method after sending a step command to `OTBNSim`.
+For co-simulation of RTL and ISS, the `acc_tracer` module logs state changes of the RTL, and the ISS logs state changes of the Python model.
+Trace entries from the simulated core (aka. from RTL) appear as a result of DPI callbacks while ISS trace entries appear in the trace checker through `ISSWrapper` using `OnIssTrace` method after sending a step command to `ACCSim`.
To check correct behaviour, the two separate logs generated by the model and the RTL are compared.
-For more information about how OTBN RTL produces traces see the [Tracer README](../tracer/README.md).
-To see the C++ program that compares both traces, check the method `otbn_trace_checker.cc` in `../model/otbn_trace_entry`.
+For more information about how ACC RTL produces traces see the [Tracer README](../tracer/README.md).
+To see the C++ program that compares both traces, check the method `acc_trace_checker.cc` in `../model/acc_trace_entry`.
diff --git a/hw/ip/otbn/dv/otbnsim/mypy.ini b/hw/ip/acc/dv/accsim/mypy.ini
similarity index 76%
rename from hw/ip/otbn/dv/otbnsim/mypy.ini
rename to hw/ip/acc/dv/accsim/mypy.ini
index 76db64b4560..93f74e399f6 100644
--- a/hw/ip/otbn/dv/otbnsim/mypy.ini
+++ b/hw/ip/acc/dv/accsim/mypy.ini
@@ -1,5 +1,5 @@
[mypy]
-# Add OTBN and OpenTitan util dirs to MYPYPATH
+# Add ACC and OpenTitan util dirs to MYPYPATH
mypy_path = $MYPY_CONFIG_FILE_DIR/../../util, $MYPY_CONFIG_FILE_DIR/../../../../../util
[mypy-semantic_version]
ignore_missing_imports = True
diff --git a/hw/ip/otbn/dv/otbnsim/sim/BUILD b/hw/ip/acc/dv/accsim/sim/BUILD
similarity index 92%
rename from hw/ip/otbn/dv/otbnsim/sim/BUILD
rename to hw/ip/acc/dv/accsim/sim/BUILD
index e7fab4e9d1d..a2c2b6bf5a2 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/BUILD
+++ b/hw/ip/acc/dv/accsim/sim/BUILD
@@ -37,7 +37,7 @@ py_library(
srcs = ["dmem.py"],
deps = [
":trace",
- "//hw/ip/otbn/util/shared:mem_layout",
+ "//hw/ip/acc/util/shared:mem_layout",
],
)
@@ -52,7 +52,7 @@ py_library(
deps = [
":edn_client",
":trace",
- "//hw/ip/otbn/util/shared:otbn_reggen",
+ "//hw/ip/acc/util/shared:acc_reggen",
"//util/reggen:field",
"//util/reggen:reg_block",
"//util/reggen:register",
@@ -92,7 +92,7 @@ py_library(
srcs = ["isa.py"],
deps = [
":state",
- "//hw/ip/otbn/util/shared:insn_yaml",
+ "//hw/ip/acc/util/shared:insn_yaml",
],
)
@@ -102,7 +102,7 @@ py_library(
deps = [
":decode",
":sim",
- "//hw/ip/otbn/util/shared:elf",
+ "//hw/ip/acc/util/shared:elf",
],
)
@@ -159,7 +159,7 @@ py_library(
":reg",
":trace",
":wsr",
- "//hw/ip/otbn/util/shared:mem_layout",
+ "//hw/ip/acc/util/shared:mem_layout",
],
)
diff --git a/hw/ip/otbn/dv/otbnsim/sim/__init__.py b/hw/ip/acc/dv/accsim/sim/__init__.py
similarity index 71%
rename from hw/ip/otbn/dv/otbnsim/sim/__init__.py
rename to hw/ip/acc/dv/accsim/sim/__init__.py
index 4d215cd298c..a2e2ecf9436 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/__init__.py
+++ b/hw/ip/acc/dv/accsim/sim/__init__.py
@@ -6,7 +6,7 @@
import sys
-# Ensure that the OTBN util directory is on sys.path. This allows us to import
-# modules "shared.foo" to get the OTBN shared code.
+# Ensure that the ACC util directory is on sys.path. This allows us to import
+# modules "shared.foo" to get the ACC shared code.
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__),
'../../../util')))
diff --git a/hw/ip/otbn/dv/otbnsim/sim/constants.py b/hw/ip/acc/dv/accsim/sim/constants.py
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/sim/constants.py
rename to hw/ip/acc/dv/accsim/sim/constants.py
diff --git a/hw/ip/otbn/dv/otbnsim/sim/csr.py b/hw/ip/acc/dv/accsim/sim/csr.py
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/sim/csr.py
rename to hw/ip/acc/dv/accsim/sim/csr.py
diff --git a/hw/ip/otbn/dv/otbnsim/sim/decode.py b/hw/ip/acc/dv/accsim/sim/decode.py
similarity index 88%
rename from hw/ip/otbn/dv/otbnsim/sim/decode.py
rename to hw/ip/acc/dv/accsim/sim/decode.py
index ab93c9aac6a..312793e54f5 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/decode.py
+++ b/hw/ip/acc/dv/accsim/sim/decode.py
@@ -8,17 +8,17 @@
from typing import Iterator, List, Optional, Tuple
from .constants import ErrBits
-from .isa import INSNS_FILE, OTBNInsn
+from .isa import INSNS_FILE, ACCInsn
from .insn import INSN_CLASSES
-from .state import OTBNState
+from .state import ACCState
MNEM_TO_CLASS = {cls.insn.mnemonic: cls for cls in INSN_CLASSES}
-class IllegalInsn(OTBNInsn):
+class IllegalInsn(ACCInsn):
'''A catch-all subclass of Instruction for bad data
- This handles anything that doesn't decode correctly. Doing so for OTBN is
+ This handles anything that doesn't decode correctly. Doing so for ACC is
much easier than if we wanted to support compressed-mode (RV32IC), because
we don't need to worry about whether we have 16 or 32 bits of rubbish.
@@ -35,12 +35,12 @@ def __init__(self, pc: int, raw: int, msg: str) -> None:
# disassembling the underlying DummyInsn.
self._disasm = (pc, '?? 0x{:08x}'.format(raw))
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
return None
-class EmptyInsn(OTBNInsn):
+class EmptyInsn(ACCInsn):
'''A subclass of Instruction that represents non-existent data
This is what we generate on a fetch error, where we don't really have any
@@ -57,12 +57,12 @@ def __init__(self, pc: int) -> None:
# disassembling the underlying DummyInsn.
self._disasm = (pc, '?? (no instruction data)')
- def execute(self, state: 'OTBNState') -> Optional[Iterator[None]]:
+ def execute(self, state: 'ACCState') -> Optional[Iterator[None]]:
state.stop_at_end_of_cycle(ErrBits.IMEM_INTG_VIOLATION)
return None
-def _decode_word(pc: int, word: int) -> OTBNInsn:
+def _decode_word(pc: int, word: int) -> ACCInsn:
mnem = INSNS_FILE.mnem_for_word(word)
if mnem is None:
return IllegalInsn(pc, word, 'No legal decoding')
@@ -84,7 +84,7 @@ def _decode_word(pc: int, word: int) -> OTBNInsn:
def decode_words(base_addr: int,
- data: List[Tuple[bool, int]]) -> List[OTBNInsn]:
+ data: List[Tuple[bool, int]]) -> List[ACCInsn]:
'''Decode instruction bytes as instructions'''
ret = []
for idx, (vld, w32) in enumerate(data):
@@ -93,7 +93,7 @@ def decode_words(base_addr: int,
return ret
-def decode_file(base_addr: int, path: str) -> List[OTBNInsn]:
+def decode_file(base_addr: int, path: str) -> List[ACCInsn]:
with open(path, 'rb') as handle:
raw_bytes = handle.read()
diff --git a/hw/ip/otbn/dv/otbnsim/sim/dmem.py b/hw/ip/acc/dv/accsim/sim/dmem.py
similarity index 97%
rename from hw/ip/otbn/dv/otbnsim/sim/dmem.py
rename to hw/ip/acc/dv/accsim/sim/dmem.py
index 0375f0cc405..921eea403e7 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/dmem.py
+++ b/hw/ip/acc/dv/accsim/sim/dmem.py
@@ -26,10 +26,10 @@ def trace(self) -> str:
class Dmem:
- '''An object representing OTBN's DMEM.
+ '''An object representing ACC's DMEM.
Memory is stored as an array of 32-byte words (the native width for the
- OTBN wide side). These words are stored as 256-bit unsigned integers. This
+ ACC wide side). These words are stored as 256-bit unsigned integers. This
is the same width as the wide-side registers (to avoid unnecessary
packing/unpacking work), but the unsigned values simplify tracing.
@@ -44,7 +44,7 @@ def __init__(self) -> None:
raise RuntimeError('Implausibly large DMEM size: {}'
.format(dmem_size))
- # The native width for the OTBN wide side is 256 bits. This means that
+ # The native width for the ACC wide side is 256 bits. This means that
# dmem_size needs to be divisible by 32.
if dmem_size % 32:
raise RuntimeError('DMEM size ({}) is not divisible by 32.'
diff --git a/hw/ip/otbn/dv/otbnsim/sim/edn_client.py b/hw/ip/acc/dv/accsim/sim/edn_client.py
similarity index 98%
rename from hw/ip/otbn/dv/otbnsim/sim/edn_client.py
rename to hw/ip/acc/dv/accsim/sim/edn_client.py
index d50ed978f11..97c1be8880e 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/edn_client.py
+++ b/hw/ip/acc/dv/accsim/sim/edn_client.py
@@ -44,7 +44,7 @@ def request(self) -> None:
self._acc = []
elif self._poisoned:
# This is a request when there was a RND fetch pending (from the
- # previous OTBN run), but we now actually want the results.
+ # previous ACC run), but we now actually want the results.
self._retry = True
def poison(self) -> None:
diff --git a/hw/ip/otbn/dv/otbnsim/sim/ext_regs.py b/hw/ip/acc/dv/accsim/sim/ext_regs.py
similarity index 96%
rename from hw/ip/otbn/dv/otbnsim/sim/ext_regs.py
rename to hw/ip/acc/dv/accsim/sim/ext_regs.py
index 55cc8259d36..1df20d9286b 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/ext_regs.py
+++ b/hw/ip/acc/dv/accsim/sim/ext_regs.py
@@ -8,7 +8,7 @@
from reggen.register import Register
from reggen.reg_block import RegBlock
-from shared.otbn_reggen import load_registers
+from shared.acc_reggen import load_registers
from .edn_client import EdnClient
from .trace import Trace
@@ -31,7 +31,7 @@ def trace(self) -> str:
suff = (''
if self.erc.new_value == self.erc.written
else ' (now {:#010x})'.format(self.erc.new_value))
- return ("otbn.{} {} {:#010x}{}{}"
+ return ("acc.{} {} {:#010x}{}{}"
.format(self.name,
self.erc.op,
self.erc.written,
@@ -39,7 +39,7 @@ def trace(self) -> str:
suff))
def rtl_trace(self) -> str:
- return '! otbn.{}: {:#010x}'.format(self.name, self.erc.new_value)
+ return '! acc.{}: {:#010x}'.format(self.name, self.erc.new_value)
class RGField:
@@ -152,7 +152,7 @@ def write(self,
immediately: bool = False) -> None:
'''Stage the effects of writing a value.
- If from_hw is true, this write is from OTBN hardware (rather than the
+ If from_hw is true, this write is from ACC hardware (rather than the
bus).
'''
@@ -241,8 +241,8 @@ def make_flag_reg(name: str, double_flopped: bool) -> RGReg:
return RGReg([RGField(name, 32, 0, 0, 'ro')], double_flopped)
-class OTBNExtRegs:
- '''A class representing OTBN's externally visible CSRs
+class ACCExtRegs:
+ '''A class representing ACC's externally visible CSRs
This models an extra flop between the core and some of the externally
visible registers by ensuring that a write only becomes visible after an
@@ -274,7 +274,7 @@ def __init__(self) -> None:
# finish.
self.regs['STOP_PC'] = make_flag_reg('STOP_PC', True)
- # Add a fake "RND_REQ" register to allow us to tell otbn_core_model to
+ # Add a fake "RND_REQ" register to allow us to tell acc_core_model to
# generate an EDN request. Expose it as a field so that the state
# object can poke it directly.
self._rnd_req = RndReq('RND_REQ')
diff --git a/hw/ip/otbn/dv/otbnsim/sim/flags.py b/hw/ip/acc/dv/accsim/sim/flags.py
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/sim/flags.py
rename to hw/ip/acc/dv/accsim/sim/flags.py
diff --git a/hw/ip/otbn/dv/otbnsim/sim/gpr.py b/hw/ip/acc/dv/accsim/sim/gpr.py
similarity index 98%
rename from hw/ip/otbn/dv/otbnsim/sim/gpr.py
rename to hw/ip/acc/dv/accsim/sim/gpr.py
index 556e951e184..5980238fef1 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/gpr.py
+++ b/hw/ip/acc/dv/accsim/sim/gpr.py
@@ -67,7 +67,7 @@ def start(self) -> None:
class GPRs(RegFile):
- '''The narrow OTBN register file'''
+ '''The narrow ACC register file'''
def __init__(self) -> None:
super().__init__('x', 32, 32)
diff --git a/hw/ip/otbn/dv/otbnsim/sim/insn.py b/hw/ip/acc/dv/accsim/sim/insn.py
similarity index 93%
rename from hw/ip/otbn/dv/otbnsim/sim/insn.py
rename to hw/ip/acc/dv/accsim/sim/insn.py
index 5bb50469057..4c466a5b922 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/insn.py
+++ b/hw/ip/acc/dv/accsim/sim/insn.py
@@ -3,7 +3,7 @@
# Modified by Authors of "Towards ML-KEM & ML-DSA on OpenTitan" (https://eprint.iacr.org/2024/1192).
# Copyright "Towards ML-KEM & ML-DSA on OpenTitan" Authors.
# Modified by Ruben Niederhagen and Hoang Nguyen Hien Pham - authors of
-# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for OTBN"
+# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for ACC"
# (https://eprint.iacr.org/2025/2028).
# Copyright Ruben Niederhagen and Hoang Nguyen Hien Pham.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
@@ -15,11 +15,11 @@
from .constants import ErrBits
from .flags import FlagReg
-from .isa import (OTBNInsn, RV32RegReg, RV32RegImm,
+from .isa import (ACCInsn, RV32RegReg, RV32RegImm,
RV32ImmShift, insn_for_mnemonic, logical_byte_shift,
bit_shift,
extract_quarter_word, extract_sub_word)
-from .state import OTBNState
+from .state import ACCState
DEBUG_MEM = False
DEBUG_BRANCH = False
@@ -59,7 +59,7 @@ def cmod_single_subv(n: int, q: int) -> int:
class ADD(RV32RegReg):
insn = insn_for_mnemonic('add', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned()
if state.gprs.call_stack_err:
@@ -89,7 +89,7 @@ def execute(self, state: OTBNState) -> None:
class ADDI(RV32RegImm):
insn = insn_for_mnemonic('addi', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
if state.gprs.call_stack_err:
state.stop_at_end_of_cycle(ErrBits.CALL_STACK)
@@ -115,7 +115,7 @@ def execute(self, state: OTBNState) -> None:
state.gprs.get_reg(self.grd).write_unsigned(result)
-class LUI(OTBNInsn):
+class LUI(ACCInsn):
insn = insn_for_mnemonic('lui', 2)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -123,14 +123,14 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grd = op_vals['grd']
self.imm = op_vals['imm']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
state.gprs.get_reg(self.grd).write_unsigned(self.imm << 12)
class SUB(RV32RegReg):
insn = insn_for_mnemonic('sub', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned()
if state.gprs.call_stack_err:
@@ -146,7 +146,7 @@ def execute(self, state: OTBNState) -> None:
class SLL(RV32RegReg):
insn = insn_for_mnemonic('sll', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned() & 0x1f
if state.gprs.call_stack_err:
@@ -162,7 +162,7 @@ def execute(self, state: OTBNState) -> None:
class SLLI(RV32ImmShift):
insn = insn_for_mnemonic('slli', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
if state.gprs.call_stack_err:
state.stop_at_end_of_cycle(ErrBits.CALL_STACK)
@@ -176,7 +176,7 @@ def execute(self, state: OTBNState) -> None:
class SRL(RV32RegReg):
insn = insn_for_mnemonic('srl', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned() & 0x1f
if state.gprs.call_stack_err:
@@ -192,7 +192,7 @@ def execute(self, state: OTBNState) -> None:
class SRLI(RV32ImmShift):
insn = insn_for_mnemonic('srli', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
if state.gprs.call_stack_err:
state.stop_at_end_of_cycle(ErrBits.CALL_STACK)
@@ -206,7 +206,7 @@ def execute(self, state: OTBNState) -> None:
class SRA(RV32RegReg):
insn = insn_for_mnemonic('sra', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_signed()
val2 = state.gprs.get_reg(self.grs2).read_unsigned() & 0x1f
if state.gprs.call_stack_err:
@@ -222,7 +222,7 @@ def execute(self, state: OTBNState) -> None:
class SRAI(RV32ImmShift):
insn = insn_for_mnemonic('srai', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_signed()
val2 = self.shamt
if state.gprs.call_stack_err:
@@ -236,7 +236,7 @@ def execute(self, state: OTBNState) -> None:
class AND(RV32RegReg):
insn = insn_for_mnemonic('and', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned()
if state.gprs.call_stack_err:
@@ -252,7 +252,7 @@ def execute(self, state: OTBNState) -> None:
class ANDI(RV32RegImm):
insn = insn_for_mnemonic('andi', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = self.to_2s_complement(self.imm)
if state.gprs.call_stack_err:
@@ -267,7 +267,7 @@ def execute(self, state: OTBNState) -> None:
class OR(RV32RegReg):
insn = insn_for_mnemonic('or', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned()
if state.gprs.call_stack_err:
@@ -282,7 +282,7 @@ def execute(self, state: OTBNState) -> None:
class ORI(RV32RegImm):
insn = insn_for_mnemonic('ori', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = self.to_2s_complement(self.imm)
if state.gprs.call_stack_err:
@@ -296,7 +296,7 @@ def execute(self, state: OTBNState) -> None:
class XOR(RV32RegReg):
insn = insn_for_mnemonic('xor', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned()
if state.gprs.call_stack_err:
@@ -310,7 +310,7 @@ def execute(self, state: OTBNState) -> None:
class XORI(RV32RegImm):
insn = insn_for_mnemonic('xori', 3)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = self.to_2s_complement(self.imm)
if state.gprs.call_stack_err:
@@ -321,7 +321,7 @@ def execute(self, state: OTBNState) -> None:
state.gprs.get_reg(self.grd).write_unsigned(result)
-class LW(OTBNInsn):
+class LW(ACCInsn):
insn = insn_for_mnemonic('lw', 3)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -330,7 +330,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.offset = op_vals['offset']
self.grs1 = op_vals['grs1']
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
# LW executes over two cycles. On the first cycle, we read the base
# address, compute the load address and check it for correctness, then
# perform the load itself, returning the result.
@@ -369,7 +369,7 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
return None
-class SW(OTBNInsn):
+class SW(ACCInsn):
insn = insn_for_mnemonic('sw', 3)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -378,7 +378,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.offset = op_vals['offset']
self.grs1 = op_vals['grs1']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
base = state.gprs.get_reg(self.grs1).read_unsigned()
addr = (base + self.offset) & ((1 << 32) - 1)
value = state.gprs.get_reg(self.grs2).read_unsigned()
@@ -402,7 +402,7 @@ def execute(self, state: OTBNState) -> None:
state.dmem.store_u32(addr, value)
-class BEQ(OTBNInsn):
+class BEQ(ACCInsn):
insn = insn_for_mnemonic('beq', 3)
affects_control = True
has_fetch_stall = True
@@ -413,7 +413,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grs2 = op_vals['grs2']
self.offset = op_vals['offset']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned()
if state.gprs.call_stack_err:
@@ -434,7 +434,7 @@ def execute(self, state: OTBNState) -> None:
eprint("not taken")
-class BNE(OTBNInsn):
+class BNE(ACCInsn):
insn = insn_for_mnemonic('bne', 3)
affects_control = True
has_fetch_stall = True
@@ -445,7 +445,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grs2 = op_vals['grs2']
self.offset = op_vals['offset']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
val2 = state.gprs.get_reg(self.grs2).read_unsigned()
@@ -467,7 +467,7 @@ def execute(self, state: OTBNState) -> None:
eprint("not taken")
-class JAL(OTBNInsn):
+class JAL(ACCInsn):
insn = insn_for_mnemonic('jal', 2)
affects_control = True
has_fetch_stall = True
@@ -477,7 +477,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grd = op_vals['grd']
self.offset = op_vals['offset']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
mask32 = ((1 << 32) - 1)
link_pc = (state.pc + 4) & mask32
state.gprs.get_reg(self.grd).write_unsigned(link_pc)
@@ -490,7 +490,7 @@ def execute(self, state: OTBNState) -> None:
state.set_next_pc(next_pc)
-class JALR(OTBNInsn):
+class JALR(ACCInsn):
insn = insn_for_mnemonic('jalr', 3)
affects_control = True
has_fetch_stall = True
@@ -501,7 +501,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grs1 = op_vals['grs1']
self.offset = op_vals['offset']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
val1 = state.gprs.get_reg(self.grs1).read_unsigned()
if state.gprs.call_stack_err:
state.stop_at_end_of_cycle(ErrBits.CALL_STACK)
@@ -519,7 +519,7 @@ def execute(self, state: OTBNState) -> None:
state.set_next_pc(next_pc)
-class CSRRS(OTBNInsn):
+class CSRRS(ACCInsn):
insn = insn_for_mnemonic('csrrs', 3)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -528,7 +528,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.csr = op_vals['csr']
self.grs1 = op_vals['grs1']
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
if not state.csrs.check_idx(self.csr):
# Invalid CSR index. Stop with an illegal instruction error.
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
@@ -557,7 +557,7 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
return None
-class CSRRW(OTBNInsn):
+class CSRRW(ACCInsn):
insn = insn_for_mnemonic('csrrw', 3)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -566,7 +566,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.csr = op_vals['csr']
self.grs1 = op_vals['grs1']
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
# eprint("csrrw")
if not state.csrs.check_idx(self.csr):
# Invalid CSR index. Stop with an illegal instruction error.
@@ -588,7 +588,7 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
if self.csr == 0x7f3:
# A write to KMAC_PW might stall, if there is a pending write
- # to the AppIntf FIFO inside OTBN Bignum ALU
+ # to the AppIntf FIFO inside ACC Bignum ALU
if DEBUG_KMAC:
eprint("\tBNWSRW FOR KMAC PARTIAL WRITE REGISTER")
while state.wsrs.KMAC_MSG.pending_write_pw():
@@ -607,15 +607,15 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
return None
-class ECALL(OTBNInsn):
+class ECALL(ACCInsn):
insn = insn_for_mnemonic('ecall', 0)
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
# Set INTR_STATE.done and STATUS, reflecting the fact we've stopped.
state.stop_at_end_of_cycle(err_bits=0)
-class LOOP(OTBNInsn):
+class LOOP(ACCInsn):
insn = insn_for_mnemonic('loop', 2)
affects_control = True
@@ -624,7 +624,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grs = op_vals['grs']
self.bodysize = op_vals['bodysize']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
num_iters = state.gprs.get_reg(self.grs).read_unsigned()
if state.gprs.call_stack_err:
state.stop_at_end_of_cycle(ErrBits.CALL_STACK)
@@ -636,7 +636,7 @@ def execute(self, state: OTBNState) -> None:
state.loop_start(num_iters, self.bodysize)
-class LOOPI(OTBNInsn):
+class LOOPI(ACCInsn):
insn = insn_for_mnemonic('loopi', 2)
affects_control = True
@@ -645,7 +645,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.iterations = op_vals['iterations']
self.bodysize = op_vals['bodysize']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
if DEBUG_FLOW:
eprint("LOOPI")
if self.iterations == 0:
@@ -654,7 +654,7 @@ def execute(self, state: OTBNState) -> None:
state.loop_start(self.iterations, self.bodysize)
-class BNADD(OTBNInsn):
+class BNADD(ACCInsn):
insn = insn_for_mnemonic('bn.add', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -666,7 +666,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -685,7 +685,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, flags)
-class BNADDC(OTBNInsn):
+class BNADDC(ACCInsn):
insn = insn_for_mnemonic('bn.addc', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -697,7 +697,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -713,7 +713,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, flags)
-class BNADDI(OTBNInsn):
+class BNADDI(ACCInsn):
insn = insn_for_mnemonic('bn.addi', 4)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -723,7 +723,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.imm = op_vals['imm']
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs).read_unsigned()
b = self.imm
@@ -740,7 +740,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, flags)
-class BNADDM(OTBNInsn):
+class BNADDM(ACCInsn):
insn = insn_for_mnemonic('bn.addm', 3)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -749,7 +749,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrs1 = op_vals['wrs1']
self.wrs2 = op_vals['wrs2']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
mod_val = state.wsrs.MOD.read_unsigned()
@@ -770,7 +770,7 @@ def execute(self, state: OTBNState) -> None:
state.wdrs.get_reg(self.wrd).write_unsigned(result)
-class BNADDV(OTBNInsn):
+class BNADDV(ACCInsn):
insn = insn_for_mnemonic('bn.addv', 4)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -780,7 +780,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrs2 = op_vals['wrs2']
self.type = op_vals['type']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
if not state.EN_PQC:
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
@@ -807,7 +807,7 @@ def execute(self, state: OTBNState) -> None:
state.wdrs.get_reg(self.wrd).write_unsigned(result)
-class BNMULV(OTBNInsn):
+class BNMULV(ACCInsn):
insn = insn_for_mnemonic('bn.mulv', 4)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -817,7 +817,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrs2 = op_vals['wrs2']
self.type = op_vals['type']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
if not state.EN_PQC:
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
@@ -917,7 +917,7 @@ def execute(self, state: OTBNState) -> None:
eprint(f"acch at the end = {hex(acch)}")
-class BNMULVL(OTBNInsn):
+class BNMULVL(ACCInsn):
insn = insn_for_mnemonic('bn.mulv.l', 5)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -928,7 +928,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.lane_reg = op_vals['lane_reg']
self.lane_index = op_vals['lane_index']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
if not state.EN_PQC:
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
@@ -1031,7 +1031,7 @@ def execute(self, state: OTBNState) -> None:
eprint(f"acch at the end = {hex(acch)}")
-class BNMULQACC(OTBNInsn):
+class BNMULQACC(ACCInsn):
insn = insn_for_mnemonic('bn.mulqacc', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1043,7 +1043,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrs2_qwsel = op_vals['wrs2_qwsel']
self.acc_shift_imm = op_vals['acc_shift_imm']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
@@ -1066,7 +1066,7 @@ def execute(self, state: OTBNState) -> None:
state.wsrs.ACC.write_unsigned(truncated)
-class BNMULQACCWO(OTBNInsn):
+class BNMULQACCWO(ACCInsn):
insn = insn_for_mnemonic('bn.mulqacc.wo', 8)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1080,7 +1080,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.acc_shift_imm = op_vals['acc_shift_imm']
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
@@ -1103,7 +1103,7 @@ def execute(self, state: OTBNState) -> None:
state.set_mlz_flags(self.flag_group, truncated)
-class BNMULQACCSO(OTBNInsn):
+class BNMULQACCSO(ACCInsn):
insn = insn_for_mnemonic('bn.mulqacc.so', 9)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1118,7 +1118,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.acc_shift_imm = op_vals['acc_shift_imm']
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
@@ -1165,7 +1165,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, new_flags)
-class BNSUB(OTBNInsn):
+class BNSUB(ACCInsn):
insn = insn_for_mnemonic('bn.sub', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1177,7 +1177,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -1196,7 +1196,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, flags)
-class BNSUBB(OTBNInsn):
+class BNSUBB(ACCInsn):
insn = insn_for_mnemonic('bn.subb', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1208,7 +1208,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -1224,7 +1224,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, flags)
-class BNSUBI(OTBNInsn):
+class BNSUBI(ACCInsn):
insn = insn_for_mnemonic('bn.subi', 4)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1234,7 +1234,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.imm = op_vals['imm']
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs).read_unsigned()
b = self.imm
@@ -1248,7 +1248,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, flags)
-class BNSUBM(OTBNInsn):
+class BNSUBM(ACCInsn):
insn = insn_for_mnemonic('bn.subm', 3)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1257,7 +1257,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrs1 = op_vals['wrs1']
self.wrs2 = op_vals['wrs2']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
mod_val = state.wsrs.MOD.read_unsigned()
@@ -1275,7 +1275,7 @@ def execute(self, state: OTBNState) -> None:
state.wdrs.get_reg(self.wrd).write_unsigned(result)
-class BNSUBV(OTBNInsn):
+class BNSUBV(ACCInsn):
insn = insn_for_mnemonic('bn.subv', 4)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1285,7 +1285,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrs2 = op_vals['wrs2']
self.type = op_vals['type']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
if not state.EN_PQC:
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
@@ -1312,7 +1312,7 @@ def execute(self, state: OTBNState) -> None:
state.wdrs.get_reg(self.wrd).write_unsigned(result)
-class BNAND(OTBNInsn):
+class BNAND(ACCInsn):
insn = insn_for_mnemonic('bn.and', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1324,7 +1324,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -1339,7 +1339,7 @@ def execute(self, state: OTBNState) -> None:
state.set_mlz_flags(self.flag_group, result)
-class BNOR(OTBNInsn):
+class BNOR(ACCInsn):
insn = insn_for_mnemonic('bn.or', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1351,7 +1351,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -1366,7 +1366,7 @@ def execute(self, state: OTBNState) -> None:
state.set_mlz_flags(self.flag_group, result)
-class BNNOT(OTBNInsn):
+class BNNOT(ACCInsn):
insn = insn_for_mnemonic('bn.not', 5)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1377,7 +1377,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs).read_unsigned()
a_shifted = logical_byte_shift(a, self.shift_type, self.shift_bytes)
@@ -1386,7 +1386,7 @@ def execute(self, state: OTBNState) -> None:
state.set_mlz_flags(self.flag_group, result)
-class BNXOR(OTBNInsn):
+class BNXOR(ACCInsn):
insn = insn_for_mnemonic('bn.xor', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1398,7 +1398,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -1411,7 +1411,7 @@ def execute(self, state: OTBNState) -> None:
state.set_mlz_flags(self.flag_group, result)
-class BNRSHI(OTBNInsn):
+class BNRSHI(ACCInsn):
insn = insn_for_mnemonic('bn.rshi', 4)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1421,7 +1421,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrs2 = op_vals['wrs2']
self.imm = op_vals['imm']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
@@ -1431,7 +1431,7 @@ def execute(self, state: OTBNState) -> None:
state.wdrs.get_reg(self.wrd).write_unsigned(result)
-class BNSHV(OTBNInsn):
+class BNSHV(ACCInsn):
insn = insn_for_mnemonic('bn.shv', 6)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1443,7 +1443,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bits = op_vals['shift_bits']
self.shift_arith = op_vals['shift_arith']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
if not state.EN_PQC:
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
@@ -1463,7 +1463,7 @@ def execute(self, state: OTBNState) -> None:
state.wdrs.get_reg(self.wrd).write_unsigned(result)
-class BNSEL(OTBNInsn):
+class BNSEL(ACCInsn):
insn = insn_for_mnemonic('bn.sel', 5)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1474,7 +1474,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.flag_group = op_vals['flag_group']
self.flag = op_vals['flag']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
flag_is_set = state.csrs.flags[self.flag_group].get_by_idx(self.flag)
wrs = self.wrs1 if flag_is_set else self.wrs2
value = state.wdrs.get_reg(wrs).read_unsigned()
@@ -1483,7 +1483,7 @@ def execute(self, state: OTBNState) -> None:
state.wdrs.get_reg(self.wrd).write_unsigned(value)
-class BNCMP(OTBNInsn):
+class BNCMP(ACCInsn):
insn = insn_for_mnemonic('bn.cmp', 5)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1494,7 +1494,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -1513,7 +1513,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, flags)
-class BNCMPB(OTBNInsn):
+class BNCMPB(ACCInsn):
insn = insn_for_mnemonic('bn.cmpb', 5)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1524,7 +1524,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.shift_bytes = op_vals['shift_bits'] // 8
self.flag_group = op_vals['flag_group']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
a = state.wdrs.get_reg(self.wrs1).read_unsigned()
b = state.wdrs.get_reg(self.wrs2).read_unsigned()
b_shifted = logical_byte_shift(b, self.shift_type, self.shift_bytes)
@@ -1539,7 +1539,7 @@ def execute(self, state: OTBNState) -> None:
state.set_flags(self.flag_group, flags)
-class BNLID(OTBNInsn):
+class BNLID(ACCInsn):
insn = insn_for_mnemonic('bn.lid', 5)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1550,7 +1550,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grs1 = op_vals['grs1']
self.grs1_inc = op_vals['grs1_inc']
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
# BN.LID executes over two cycles. On the first cycle, we read the base
# address, compute the load address and check it for correctness,
# increment any GPRs, then perform the load itself. On the second
@@ -1610,7 +1610,7 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
return None
-class BNSID(OTBNInsn):
+class BNSID(ACCInsn):
insn = insn_for_mnemonic('bn.sid', 5)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1621,7 +1621,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grs1 = op_vals['grs1']
self.grs1_inc = op_vals['grs1_inc']
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
if self.grs1_inc and self.grs2_inc:
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
return None
@@ -1669,7 +1669,7 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
return None
-class BNMOV(OTBNInsn):
+class BNMOV(ACCInsn):
insn = insn_for_mnemonic('bn.mov', 2)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1677,12 +1677,12 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrd = op_vals['wrd']
self.wrs = op_vals['wrs']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
value = state.wdrs.get_reg(self.wrs).read_unsigned()
state.wdrs.get_reg(self.wrd).write_unsigned(value)
-class BNMOVR(OTBNInsn):
+class BNMOVR(ACCInsn):
insn = insn_for_mnemonic('bn.movr', 4)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1692,7 +1692,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grs = op_vals['grs']
self.grs_inc = op_vals['grs_inc']
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
if DEBUG_ARITH:
eprint("MOVR")
if self.grs_inc and self.grd_inc:
@@ -1740,7 +1740,7 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
return None
-class BNWSRR(OTBNInsn):
+class BNWSRR(ACCInsn):
insn = insn_for_mnemonic('bn.wsrr', 2)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1748,7 +1748,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrd = op_vals['wrd']
self.wsr = op_vals['wsr']
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
# The first, and possibly only, cycle of execution.
if not state.wsrs.check_idx(self.wsr):
# Invalid WSR index. Stop with an illegal instruction error.
@@ -1786,7 +1786,7 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
return None
-class BNWSRW(OTBNInsn):
+class BNWSRW(ACCInsn):
insn = insn_for_mnemonic('bn.wsrw', 2)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1794,7 +1794,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wsr = op_vals['wsr']
self.wrs = op_vals['wrs']
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
if DEBUG_KMAC:
eprint(f"\tRun BNWSRW Address {self.wsr}")
if not state.wsrs.check_idx(self.wsr):
@@ -1816,7 +1816,7 @@ def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
state.wsrs.write_at_idx(self.wsr, val)
-class BNTRN(OTBNInsn):
+class BNTRN(ACCInsn):
insn = insn_for_mnemonic('bn.trn', 4)
def __init__(self, raw: int, op_vals: Dict[str, int]):
@@ -1826,7 +1826,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.wrs2 = op_vals['wrs2']
self.type = op_vals['type']
- def execute(self, state: OTBNState) -> None:
+ def execute(self, state: ACCState) -> None:
if not state.EN_PQC:
state.stop_at_end_of_cycle(ErrBits.ILLEGAL_INSN)
diff --git a/hw/ip/otbn/dv/otbnsim/sim/isa.py b/hw/ip/acc/dv/accsim/sim/isa.py
similarity index 94%
rename from hw/ip/otbn/dv/otbnsim/sim/isa.py
rename to hw/ip/acc/dv/accsim/sim/isa.py
index c1cb6149911..15d49439cdb 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/isa.py
+++ b/hw/ip/acc/dv/accsim/sim/isa.py
@@ -10,13 +10,13 @@
from shared.insn_yaml import Insn, DummyInsn, load_insns_yaml
-from .state import OTBNState
+from .state import ACCState
# Load the insns.yml file at module load time: we'll use its data while
-# declaring the classes. The point is that an OTBNInsn below is an instance of
+# declaring the classes. The point is that an ACCInsn below is an instance of
# a particular Insn object from shared.insn_yaml, so we want a class variable
-# on the OTBNInsn that points at the corresponding Insn.
+# on the ACCInsn that points at the corresponding Insn.
try:
INSNS_FILE = load_insns_yaml()
except RuntimeError as err:
@@ -50,8 +50,8 @@ def insn_for_mnemonic(mnemonic: str, num_operands: int) -> Insn:
return insn
-class OTBNInsn:
- '''A decoded OTBN instruction.
+class ACCInsn:
+ '''A decoded ACC instruction.
'''
@@ -81,14 +81,14 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
# it can't hurt to check).
self._disasm: Optional[Tuple[int, str]] = None
- def execute(self, state: OTBNState) -> Optional[Iterator[None]]:
+ def execute(self, state: ACCState) -> Optional[Iterator[None]]:
'''Execute the instruction
This may yield (returning an iterator object) if the instruction has
stalled the processor and will take multiple cycles.
'''
- raise NotImplementedError('OTBNInsn.execute')
+ raise NotImplementedError('ACCInsn.execute')
def disassemble(self, pc: int) -> str:
'''Generate an assembly listing for this instruction'''
@@ -127,7 +127,7 @@ def rtl_trace(self, pc: int) -> str:
f'# @{pc:#010x}: ??')
-class RV32RegReg(OTBNInsn):
+class RV32RegReg(ACCInsn):
'''A general class for register-register insns from the RV32I ISA'''
def __init__(self, raw: int, op_vals: Dict[str, int]):
super().__init__(raw, op_vals)
@@ -136,7 +136,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.grs2 = op_vals['grs2']
-class RV32RegImm(OTBNInsn):
+class RV32RegImm(ACCInsn):
'''A general class for register-immediate insns from the RV32I ISA'''
def __init__(self, raw: int, op_vals: Dict[str, int]):
super().__init__(raw, op_vals)
@@ -145,7 +145,7 @@ def __init__(self, raw: int, op_vals: Dict[str, int]):
self.imm = op_vals['imm']
-class RV32ImmShift(OTBNInsn):
+class RV32ImmShift(ACCInsn):
'''A general class for immediate shift insns from the RV32I ISA'''
def __init__(self, raw: int, op_vals: Dict[str, int]):
super().__init__(raw, op_vals)
diff --git a/hw/ip/otbn/dv/otbnsim/sim/kmac.py b/hw/ip/acc/dv/accsim/sim/kmac.py
similarity index 99%
rename from hw/ip/otbn/dv/otbnsim/sim/kmac.py
rename to hw/ip/acc/dv/accsim/sim/kmac.py
index fb7ce36a0f6..b80e02ef387 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/kmac.py
+++ b/hw/ip/acc/dv/accsim/sim/kmac.py
@@ -4,7 +4,7 @@
# Modified by Authors of "Towards ML-KEM & ML-DSA on OpenTitan" (https://eprint.iacr.org/2024/1192).
# Copyright "Towards ML-KEM & ML-DSA on OpenTitan" Authors.
# Modified by Ruben Niederhagen and Hoang Nguyen Hien Pham - authors of
-# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for OTBN"
+# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for ACC"
# (https://eprint.iacr.org/2025/2028)
# Copyright Ruben Niederhagen and Hoang Nguyen Hien Pham.
@@ -67,7 +67,7 @@ class KmacBlock:
# interface.
_APP_INTF_BYTES_PER_CYCLE = 8
- # FIFO within OTBN that waits to send message data over the application
+ # FIFO within ACC that waits to send message data over the application
# interface. Without this we'd have to stall on every message WSR write
# while we wait to send data to KMAC.
_APP_INTF_FIFO_SIZE_BYTES = 64
diff --git a/hw/ip/otbn/dv/otbnsim/sim/load_elf.py b/hw/ip/acc/dv/accsim/sim/load_elf.py
similarity index 95%
rename from hw/ip/otbn/dv/otbnsim/sim/load_elf.py
rename to hw/ip/acc/dv/accsim/sim/load_elf.py
index 9e8b55eb236..96086112cbe 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/load_elf.py
+++ b/hw/ip/acc/dv/accsim/sim/load_elf.py
@@ -5,7 +5,7 @@
# Copyright "Towards ML-KEM & ML-DSA on OpenTitan" Authors.
-'''OTBN ELF file handling'''
+'''ACC ELF file handling'''
import re
import struct
@@ -14,7 +14,7 @@
from shared.elf import read_elf
from .decode import decode_words
-from .sim import LoopWarps, OTBNSim
+from .sim import LoopWarps, ACCSim
def _get_exp_end_addr(symbols: Dict[str, int]) -> Optional[int]:
@@ -72,7 +72,7 @@ def _get_loop_warps(symbols: Dict[str, int]) -> LoopWarps:
return ret
-def load_elf(sim: OTBNSim, path: str, dump_rtl_sim: bool = False) -> Optional[int]:
+def load_elf(sim: ACCSim, path: str, dump_rtl_sim: bool = False) -> Optional[int]:
'''Load ELF file at path and inject its contents into sim
Returns the expected end address, if set, otherwise None.
diff --git a/hw/ip/otbn/dv/otbnsim/sim/loop.py b/hw/ip/acc/dv/accsim/sim/loop.py
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/sim/loop.py
rename to hw/ip/acc/dv/accsim/sim/loop.py
diff --git a/hw/ip/otbn/dv/otbnsim/sim/reg.py b/hw/ip/acc/dv/accsim/sim/reg.py
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/sim/reg.py
rename to hw/ip/acc/dv/accsim/sim/reg.py
diff --git a/hw/ip/otbn/dv/otbnsim/sim/sim.py b/hw/ip/acc/dv/accsim/sim/sim.py
similarity index 98%
rename from hw/ip/otbn/dv/otbnsim/sim/sim.py
rename to hw/ip/acc/dv/accsim/sim/sim.py
index 6fccede7746..f9b94e7b103 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/sim.py
+++ b/hw/ip/acc/dv/accsim/sim/sim.py
@@ -9,8 +9,8 @@
from .constants import ErrBits, LcTx, Status, read_lc_tx_t
from .decode import EmptyInsn
-from .isa import OTBNInsn
-from .state import OTBNState, FsmState
+from .isa import ACCInsn
+from .state import ACCState, FsmState
from .stats import ExecutionStats
from .trace import Trace
@@ -22,21 +22,21 @@
# The return type of the Step function: a possible instruction that was
# executed, together with a list of changes.
-StepRes = Tuple[Optional[OTBNInsn], List[Trace]]
+StepRes = Tuple[Optional[ACCInsn], List[Trace]]
-class OTBNSim:
+class ACCSim:
def __init__(self, pqc: bool) -> None:
self.EN_PQC = pqc
- self.state = OTBNState(self.EN_PQC)
- self.program: List[OTBNInsn] = []
+ self.state = ACCState(self.EN_PQC)
+ self.program: List[ACCInsn] = []
self.loop_warps: LoopWarps = {}
self.stats: Optional[ExecutionStats] = None
self.symbols: Dict[str, int] = {}
self._execute_generator: Optional[Iterator[None]] = None
- self._next_insn: Optional[OTBNInsn] = None
+ self._next_insn: Optional[ACCInsn] = None
- def load_program(self, program: List[OTBNInsn]) -> None:
+ def load_program(self, program: List[ACCInsn]) -> None:
self.program = program.copy()
self.state.clear_imem_invalidation()
@@ -81,7 +81,7 @@ def start_mem_wipe(self, is_imem: bool) -> None:
self.state.set_fsm_state(FsmState.MEM_SEC_WIPE)
self.state.ext_regs.write('STATUS', new_status, True)
- def _fetch(self, pc: int) -> OTBNInsn:
+ def _fetch(self, pc: int) -> ACCInsn:
word_pc = pc >> 2
if word_pc >= len(self.program):
raise RuntimeError('Trying to execute instruction at address '
@@ -117,7 +117,7 @@ def _on_stall(self,
def _on_retire(self,
verbose: bool,
- insn: OTBNInsn) -> List[Trace]:
+ insn: ACCInsn) -> List[Trace]:
'''This is run when an instruction completes'''
assert self._execute_generator is None
self.state.post_insn(self.loop_warps.get(self.state.pc, {}))
@@ -212,7 +212,7 @@ def step(self, verbose: bool) -> StepRes:
return stepper(verbose)
def _step_idle(self, verbose: bool) -> StepRes:
- '''Step the simulation when OTBN is IDLE or LOCKED'''
+ '''Step the simulation when ACC is IDLE or LOCKED'''
self.state.stop_if_pending_halt()
is_locked = self.state.get_fsm_state() == FsmState.LOCKED
diff --git a/hw/ip/otbn/dv/otbnsim/sim/standalonesim.py b/hw/ip/acc/dv/accsim/sim/standalonesim.py
similarity index 98%
rename from hw/ip/otbn/dv/otbnsim/sim/standalonesim.py
rename to hw/ip/acc/dv/accsim/sim/standalonesim.py
index ba231e1b560..d7b6713674e 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/standalonesim.py
+++ b/hw/ip/acc/dv/accsim/sim/standalonesim.py
@@ -5,7 +5,7 @@
from itertools import cycle
from typing import Dict, Optional, TextIO
-from .sim import OTBNSim
+from .sim import ACCSim
from .state import FsmState
_TEST_RND_DATA = cycle([
@@ -22,7 +22,7 @@
]
-class StandaloneSim(OTBNSim):
+class StandaloneSim(ACCSim):
def __init__(self, pqc: bool) -> None:
super().__init__(pqc=pqc)
diff --git a/hw/ip/otbn/dv/otbnsim/sim/state.py b/hw/ip/acc/dv/accsim/sim/state.py
similarity index 95%
rename from hw/ip/otbn/dv/otbnsim/sim/state.py
rename to hw/ip/acc/dv/accsim/sim/state.py
index 40d65a46936..0e00aeb4cdd 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/state.py
+++ b/hw/ip/acc/dv/accsim/sim/state.py
@@ -12,7 +12,7 @@
from .dmem import Dmem
from .constants import ErrBits, LcTx, Status
from .edn_client import EdnClient
-from .ext_regs import OTBNExtRegs
+from .ext_regs import ACCExtRegs
from .flags import FlagReg
from .gpr import GPRs
from .loop import LoopStack
@@ -40,7 +40,7 @@ class FsmState(IntEnum):
|
LOCKED <--------/
- PRE_WIPE is the initial state. OTBN is requesting a URND seed from the EDN.
+ PRE_WIPE is the initial state. ACC is requesting a URND seed from the EDN.
Once it arrives, we jump to WIPING and perform an actual round of wiping
internal state. Once that wipe is finished, we normally jump back to
PRE_WIPE and then back to WIPING again.
@@ -52,13 +52,13 @@ class FsmState(IntEnum):
fatal errors. It matches Status.IDLE. LOCKED represents the state when
there has been a fatal error. It matches Status.LOCKED.
- MEM_SEC_WIPE only represents the state where OTBN is busy operating on
+ MEM_SEC_WIPE only represents the state where ACC is busy operating on
secure wipe of DMEM/IMEM to perform the SEC_WIPE_I(D)MEM command. Secure
wipe of the memories also happen when we encounter a fatal error while on
Status.BUSY_EXECUTE. However, if we are getting a fatal error Status would
be LOCKED.
- PRE_EXEC is the period after starting OTBN where we're still waiting for an
+ PRE_EXEC is the period after starting ACC where we're still waiting for an
EDN value to seed URND. EXEC is the period where we start fetching and
executing instructions.
'''
@@ -77,13 +77,13 @@ class InitSecWipeState(IntEnum):
DONE = 2
-class OTBNState:
+class ACCState:
def __init__(self, pqc: bool) -> None:
self.EN_PQC = pqc
self.gprs = GPRs()
self.wdrs = RegFile('w', 256, 32)
- self.ext_regs = OTBNExtRegs()
+ self.ext_regs = ACCExtRegs()
self.kmac = KmacBlock()
self.wsrs = WSRFile(self.ext_regs, self.kmac, self.EN_PQC)
self.csrs = CSRFile(self.EN_PQC)
@@ -143,7 +143,7 @@ def __init__(self, pqc: bool) -> None:
self.injected_err_bits = 0
self.lock_immediately = False
- # OTBN might zero its insn_cnt register during a secure wipe. The
+ # ACC might zero its insn_cnt register during a secure wipe. The
# precise cycle that this happens depends slightly on how we decide to
# do so. If this is not None, it is a counter of the number of cycles
# before the zeroing should happen.
@@ -160,13 +160,13 @@ def __init__(self, pqc: bool) -> None:
# An RMA request is seen if the rma_req_i signal (tracked as rma_req
# here) is ON at a particular time.
#
- # The signal is observed by OTBN at a few specific times:
+ # The signal is observed by ACC at a few specific times:
#
- # - When OTBN is idle (the 'initial' and 'halt' states in
- # otbn_start_stop_control)
+ # - When ACC is idle (the 'initial' and 'halt' states in
+ # acc_start_stop_control)
#
# - At the end of a secure wipe (the 'wipe complete' state in
- # otbn_start_stop_control). It gets sampled at that particular
+ # acc_start_stop_control). It gets sampled at that particular
# point to allow an RMA to be chosen after triggering an error but
# before the secure wipe is completed and the module locks
# completely.
@@ -177,7 +177,7 @@ def __init__(self, pqc: bool) -> None:
# This flag gets set as soon as we leave the Idle state for the first
# time. It reflects the behaviour of wipe_after_urnd_refresh_q in
- # otbn_start_stop_control.sv, which skips a round of secure wiping
+ # acc_start_stop_control.sv, which skips a round of secure wiping
self.has_state_to_wipe = False
# If this flag is set, jump straight to the LOCKED state when we step
@@ -210,7 +210,7 @@ def edn_rnd_step(self, rnd_data: int, fips_err: bool) -> None:
def edn_flush(self) -> None:
self.ext_regs.rnd_reset()
self._urnd_client.edn_reset()
- # If the initial secure wipe is running, OTBN will directly request a
+ # If the initial secure wipe is running, ACC will directly request a
# new URND value.
if self.init_sec_wipe_is_running():
self._urnd_client.request()
@@ -239,7 +239,7 @@ def urnd_completed(self) -> None:
def start_init_sec_wipe(self) -> None:
self._init_sec_wipe_state = InitSecWipeState.IN_PROGRESS
- # OTBN will request a new URND value, so the model has to do the same.
+ # ACC will request a new URND value, so the model has to do the same.
self._urnd_client.request()
def init_sec_wipe_is_running(self) -> bool:
diff --git a/hw/ip/otbn/dv/otbnsim/sim/stats.py b/hw/ip/acc/dv/accsim/sim/stats.py
similarity index 97%
rename from hw/ip/otbn/dv/otbnsim/sim/stats.py
rename to hw/ip/acc/dv/accsim/sim/stats.py
index fd2417f92d9..b8bb776f1b1 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/stats.py
+++ b/hw/ip/acc/dv/accsim/sim/stats.py
@@ -16,12 +16,12 @@
from operator import add
from .insn import BEQ, BNE, ECALL, JAL, JALR, LOOP, LOOPI
-from .isa import OTBNInsn
-from .state import OTBNState
+from .isa import ACCInsn
+from .state import ACCState
class ExecutionStats:
- def __init__(self, program: List[OTBNInsn]) -> None:
+ def __init__(self, program: List[ACCInsn]) -> None:
# Executed program (the contents of the instruction memory).
self.program = program
@@ -45,7 +45,7 @@ def get_insn_count(self) -> int:
'''Get the number of executed instructions.'''
return sum(self.insn_histo.values())
- def record_stall(self, state_bc: OTBNState) -> None:
+ def record_stall(self, state_bc: ACCState) -> None:
'''Record a single stall cycle.'''
self.stall_count += 1
@@ -63,7 +63,7 @@ def record_stall(self, state_bc: OTBNState) -> None:
self.func_instrs[state_bc.pc] = {}
self.func_instrs[state_bc.pc][mnemonic] = [0, 1]
- def _insn_at_addr(self, addr: int) -> Optional[OTBNInsn]:
+ def _insn_at_addr(self, addr: int) -> Optional[ACCInsn]:
'''Get the instruction at a given address.'''
assert addr % 4 == 0
assert addr >= 0
@@ -71,12 +71,12 @@ def _insn_at_addr(self, addr: int) -> Optional[OTBNInsn]:
return self.program[word_addr]
def record_insn(self,
- insn: OTBNInsn,
- state_bc: OTBNState) -> None:
+ insn: ACCInsn,
+ state_bc: ACCState) -> None:
'''Record the execution of an instruction.
insn is the currently executed instruction. state_bc is the state of
- OTBN before the instruction is committed.
+ ACC before the instruction is committed.
'''
pc = state_bc.pc
@@ -213,7 +213,7 @@ def _get_addr_symbol_map(elf_file: ELFFile) -> Dict[int, str]:
class ExecutionStatAnalyzer:
- # Assumed clock frequency of OTBN, in MHz.
+ # Assumed clock frequency of ACC, in MHz.
FREQ_MHZ = 100
def __init__(self, stats: ExecutionStats, elf_file_path: str):
@@ -311,7 +311,7 @@ def _dump_execution_time(self) -> str:
cycles = insn_count + stall_count
time_ms = cycles / (self.FREQ_MHZ * 1e6) * 1e3
- out = f"OTBN executed {insn_count} instructions in {cycles} cycles.\n"
+ out = f"ACC executed {insn_count} instructions in {cycles} cycles.\n"
out += f"The execution stalled for {stall_count} cycles "
out += f"({stall_percent:.01f} percent).\n"
diff --git a/hw/ip/otbn/dv/otbnsim/sim/trace.py b/hw/ip/acc/dv/accsim/sim/trace.py
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/sim/trace.py
rename to hw/ip/acc/dv/accsim/sim/trace.py
diff --git a/hw/ip/otbn/dv/otbnsim/sim/wsr.py b/hw/ip/acc/dv/accsim/sim/wsr.py
similarity index 97%
rename from hw/ip/otbn/dv/otbnsim/sim/wsr.py
rename to hw/ip/acc/dv/accsim/sim/wsr.py
index 77475dc5ec8..c4e9e882822 100644
--- a/hw/ip/otbn/dv/otbnsim/sim/wsr.py
+++ b/hw/ip/acc/dv/accsim/sim/wsr.py
@@ -3,7 +3,7 @@
# Modified by Authors of "Towards ML-KEM & ML-DSA on OpenTitan" (https://eprint.iacr.org/2024/1192).
# Copyright "Towards ML-KEM & ML-DSA on OpenTitan" Authors.
# Modified by Ruben Niederhagen and Hoang Nguyen Hien Pham - authors of
-# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for OTBN"
+# "Improving ML-KEM & ML-DSA on OpenTitan - Efficient Multiplication Vector Instructions for ACC"
# (https://eprint.iacr.org/2025/2028).
# Copyright Ruben Niederhagen and Hoang Nguyen Hien Pham.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
@@ -13,7 +13,7 @@
import sys
from typing import List, Optional, Sequence, Tuple
from .trace import Trace
-from .ext_regs import OTBNExtRegs
+from .ext_regs import ACCExtRegs
from .kmac import KmacBlock
DEBUG_KMAC = False
@@ -128,14 +128,14 @@ def changes(self) -> List[TraceWSR]:
class RandWSR(WSR):
'''The magic RND WSR
- RND is special as OTBN can stall on reads to it. A read from RND either
+ RND is special as ACC can stall on reads to it. A read from RND either
immediately returns data from a cache of a previous EDN request (triggered
by writing to the RND_PREFETCH CSR) or waits for data from the EDN. To
model this, anything reading from RND must first call `request_value` which
returns True if the value is available.
'''
- def __init__(self, name: str, ext_regs: OTBNExtRegs):
+ def __init__(self, name: str, ext_regs: ACCExtRegs):
super().__init__(name)
self._random_value: Optional[int] = None
@@ -517,7 +517,7 @@ def commit(self) -> None:
kmac_debug_print(f"\tREG -> KMAC_MSG reg: {hex(self._next_value)}")
if self._value == (1 << 31):
# config value to release KMAC app intf
- # should be done once before OTBN yiels
+ # should be done once before ACC yiels
# to Ibex
self._kmac._reset()
else:
@@ -568,14 +568,14 @@ class KmacDigestWSR(WSR):
If KMAC is in the "idle" state, reads always return 0. When KMAC is in the
"absorb" state, reading from this register will issue a `process` command;
KMAC will move into the "squeeze" state and begin computing the digest.
- OTBN will stall until the digest computation finishes, and KMAC sends the
+ ACC will stall until the digest computation finishes, and KMAC sends the
first 256 bits of the digest as the read result.
Reads from this register in the "squeeze" state will pull 256-bit slices of
the digest sequentially from KMAC. The amount of digest available after
`process` depends on the rate of the specific Keccak instantiation. If 256
bits of digest are not available, a read from this register will issue the
- `run` command to KMAC and again OTBN will stall until the full 256 bits is
+ `run` command to KMAC and again ACC will stall until the full 256 bits is
ready.
'''
def __init__(self, name: str, kmac: KmacBlock):
@@ -591,7 +591,7 @@ def has_value(self) -> bool:
def request_value(self) -> bool:
'''Returns true if the full register value is ready,
but only one cycle after digest_ready() is asserted,
- modeling the OTBN app_req.next behavior'''
+ modeling the ACC app_req.next behavior'''
self._has_value = self._kmac.digest_ready()
kmac_debug_print(f"\tKMAC_DIGEST - Request value: {self._has_value}")
@@ -619,7 +619,7 @@ def commit(self) -> None:
class WSRFile:
'''A model of the WSR file'''
- def __init__(self, ext_regs: OTBNExtRegs, kmac: KmacBlock, pqc: bool) -> None:
+ def __init__(self, ext_regs: ACCExtRegs, kmac: KmacBlock, pqc: bool) -> None:
self.EN_PQC = pqc
self.KeyS0 = SideloadKey('KeyS0')
self.KeyS1 = SideloadKey('KeyS1')
diff --git a/hw/ip/otbn/dv/otbnsim/standalone.py b/hw/ip/acc/dv/accsim/standalone.py
similarity index 94%
rename from hw/ip/otbn/dv/otbnsim/standalone.py
rename to hw/ip/acc/dv/accsim/standalone.py
index 8d5304d2880..0d2b33ea48a 100755
--- a/hw/ip/otbn/dv/otbnsim/standalone.py
+++ b/hw/ip/acc/dv/accsim/standalone.py
@@ -14,7 +14,7 @@
from sim.load_elf import load_elf
from sim.standalonesim import StandaloneSim
from sim.stats import ExecutionStatAnalyzer
-from shared.testcase import OtbnTestCase
+from shared.testcase import AccTestCase
def main() -> int:
@@ -52,7 +52,7 @@ def main() -> int:
parser.add_argument(
'--pqc',
type=bool,
- help=("set otbnsim to PQC feature mode for ML-KEM and ML-DSA.")
+ help=("set accsim to PQC feature mode for ML-KEM and ML-DSA.")
)
args = parser.parse_args()
@@ -69,7 +69,7 @@ def main() -> int:
testcase = None
if args.testcase:
- testcase = OtbnTestCase.from_hjson(args.testcase.read(), sim.symbols)
+ testcase = AccTestCase.from_hjson(args.testcase.read(), sim.symbols)
key0 = int((str("deadbeef") * 12), 16)
key1 = int((str("baadf00d") * 12), 16)
diff --git a/hw/ip/otbn/dv/otbnsim/stepped.py b/hw/ip/acc/dv/accsim/stepped.py
similarity index 85%
rename from hw/ip/otbn/dv/otbnsim/stepped.py
rename to hw/ip/acc/dv/accsim/stepped.py
index 57acd0ddb2f..f78893fdb31 100755
--- a/hw/ip/otbn/dv/otbnsim/stepped.py
+++ b/hw/ip/acc/dv/accsim/stepped.py
@@ -80,7 +80,7 @@
from sim.decode import decode_file
from sim.load_elf import load_elf
-from sim.sim import OTBNSim
+from sim.sim import ACCSim
def read_word(arg_name: str, word_data: str, bits: int) -> int:
@@ -117,7 +117,7 @@ def check_arg_count(cmd: str, cnt: int, args: List[str]) -> None:
raise ValueError(f'{cmd} expects {txt_cnt} arguments. Got {args}.')
-def on_start_operation(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_start_operation(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('start_operation', 1, args)
command = args[0]
@@ -134,7 +134,7 @@ def on_start_operation(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_step(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_step(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Step one instruction'''
check_arg_count('step', 0, args)
@@ -184,7 +184,7 @@ def on_step(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_load_elf(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_load_elf(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Load contents of ELF at path given by only argument'''
check_arg_count('load_elf', 1, args)
@@ -196,7 +196,7 @@ def on_load_elf(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_add_loop_warp(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_add_loop_warp(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Add a loop warp to the simulation'''
check_arg_count('add_loop_warp', 3, args)
@@ -220,7 +220,7 @@ def on_add_loop_warp(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_clear_loop_warps(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_clear_loop_warps(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Run until ecall or error'''
check_arg_count('clear_loop_warps', 0, args)
@@ -229,7 +229,7 @@ def on_clear_loop_warps(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_load_d(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_load_d(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Load contents of data memory from file at path given by only argument'''
check_arg_count('load_d', 1, args)
@@ -242,7 +242,7 @@ def on_load_d(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_load_i(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_load_i(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Load contents of insn memory from file at path given by only argument'''
check_arg_count('load_i', 1, args)
@@ -254,7 +254,7 @@ def on_load_i(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_dump_d(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_dump_d(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Dump contents of data memory to file at path given by only argument'''
check_arg_count('dump_d', 1, args)
@@ -268,7 +268,7 @@ def on_dump_d(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_print_regs(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_print_regs(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Print registers to stdout'''
check_arg_count('print_regs', 0, args)
@@ -281,7 +281,7 @@ def on_print_regs(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_print_call_stack(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_print_call_stack(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
'''Print call stack to stdout. First element is the bottom of the stack'''
check_arg_count('print_call_stack', 0, args)
@@ -292,12 +292,12 @@ def on_print_call_stack(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_reset(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_reset(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('reset', 0, args)
- return OTBNSim(get_pqc_mode())
+ return ACCSim(get_pqc_mode())
-def on_edn_rnd_step(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_edn_rnd_step(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('edn_rnd_step', 2, args)
edn_rnd_data = read_word('edn_rnd_step', args[0], 32)
fips_err = read_word('fips_err', args[1], 1)
@@ -305,47 +305,47 @@ def on_edn_rnd_step(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_edn_urnd_step(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_edn_urnd_step(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('edn_urnd_step', 1, args)
edn_urnd_data = read_word('edn_urnd_step', args[0], 32)
sim.state.edn_urnd_step(edn_urnd_data)
return None
-def on_edn_flush(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_edn_flush(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('edn_flush', 0, args)
sim.state.edn_flush()
return None
-def on_edn_urnd_cdc_done(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_edn_urnd_cdc_done(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('urnd_cdc_done', 0, args)
sim.urnd_completed()
return None
-def on_edn_rnd_cdc_done(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_edn_rnd_cdc_done(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('edn_rnd_cdc_done', 0, args)
sim.state.rnd_completed()
return None
-def on_invalidate_imem(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_invalidate_imem(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('invalidate_imem', 0, args)
sim.state.invalidate_imem()
return None
-def on_invalidate_dmem(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_invalidate_dmem(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('invalidate_dmem', 0, args)
sim.state.dmem.empty_dmem()
return None
-def on_set_software_errs_fatal(sim: OTBNSim,
- args: List[str]) -> Optional[OTBNSim]:
+def on_set_software_errs_fatal(sim: ACCSim,
+ args: List[str]) -> Optional[ACCSim]:
check_arg_count('set_software_errs_fatal', 1, args)
new_val = read_word('error', args[0], 1)
assert new_val in [0, 1]
@@ -354,7 +354,7 @@ def on_set_software_errs_fatal(sim: OTBNSim,
return None
-def on_set_keymgr_value(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_set_keymgr_value(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('set_keymgr_value', 3, args)
key0 = read_word('key0', args[0], 384)
key1 = read_word('key1', args[1], 384)
@@ -365,19 +365,19 @@ def on_set_keymgr_value(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_step_crc(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_step_crc(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('step_crc', 2, args)
item = read_word('item', args[0], 48)
state = read_word('state', args[1], 32)
new_state = binascii.crc32(item.to_bytes(6, 'little'), state)
- print(f'! otbn.LOAD_CHECKSUM: 0x{new_state:08x}')
+ print(f'! acc.LOAD_CHECKSUM: 0x{new_state:08x}')
return None
-def on_send_err_escalation(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_send_err_escalation(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('send_err_escalation', 2, args)
err_val = read_word('err_val', args[0], 32)
lock_immediately = bool(read_word('lock_immediately', args[1], 1))
@@ -385,20 +385,20 @@ def on_send_err_escalation(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
return None
-def on_set_rma_req(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_set_rma_req(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('set_rma_req', 1, args)
rma_req = read_word('rma_req', args[0], 4)
sim.set_rma_req(rma_req)
return None
-def on_initial_secure_wipe(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_initial_secure_wipe(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('initial_secure_wipe', 0, args)
sim.initial_secure_wipe()
return None
-def on_otp_cdc_done(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
+def on_otp_cdc_done(sim: ACCSim, args: List[str]) -> Optional[ACCSim]:
check_arg_count('otp_key_cdc_done', 0, args)
sim.on_otp_cdc_done()
@@ -434,7 +434,7 @@ def on_otp_cdc_done(sim: OTBNSim, args: List[str]) -> Optional[OTBNSim]:
}
-def on_input(sim: OTBNSim, line: str) -> Optional[OTBNSim]:
+def on_input(sim: ACCSim, line: str) -> Optional[ACCSim]:
'''Process an input command'''
words = line.split()
@@ -459,7 +459,7 @@ def get_pqc_mode() -> bool:
def main() -> int:
- sim = OTBNSim(get_pqc_mode())
+ sim = ACCSim(get_pqc_mode())
try:
for line in sys.stdin:
ret = on_input(sim, line)
@@ -467,7 +467,7 @@ def main() -> int:
sim = ret
except KeyboardInterrupt:
- print("Received shutdown request, ending OTBN simulation.")
+ print("Received shutdown request, ending ACC simulation.")
return 0
return 0
diff --git a/hw/ip/otbn/dv/otbnsim/test/conftest.py b/hw/ip/acc/dv/accsim/test/conftest.py
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/conftest.py
rename to hw/ip/acc/dv/accsim/test/conftest.py
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/insns/add.exp b/hw/ip/acc/dv/accsim/test/simple/insns/add.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/insns/add.exp
rename to hw/ip/acc/dv/accsim/test/simple/insns/add.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/insns/add.s b/hw/ip/acc/dv/accsim/test/simple/insns/add.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/insns/add.s
rename to hw/ip/acc/dv/accsim/test/simple/insns/add.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/insns/addi.exp b/hw/ip/acc/dv/accsim/test/simple/insns/addi.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/insns/addi.exp
rename to hw/ip/acc/dv/accsim/test/simple/insns/addi.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/insns/addi.s b/hw/ip/acc/dv/accsim/test/simple/insns/addi.s
similarity index 90%
rename from hw/ip/otbn/dv/otbnsim/test/simple/insns/addi.s
rename to hw/ip/acc/dv/accsim/test/simple/insns/addi.s
index e9cc9316dc4..210eb17ed91 100644
--- a/hw/ip/otbn/dv/otbnsim/test/simple/insns/addi.s
+++ b/hw/ip/acc/dv/accsim/test/simple/insns/addi.s
@@ -6,7 +6,7 @@
Simple tests of the addi instruction
This test also uses a comment syntax that broke the parser in a
- previous version of otbn_as.py: if editing it, keep the block
+ previous version of acc_as.py: if editing it, keep the block
comments on the same lines as instructions to keep that test in
place.
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/insns/bnlid.exp b/hw/ip/acc/dv/accsim/test/simple/insns/bnlid.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/insns/bnlid.exp
rename to hw/ip/acc/dv/accsim/test/simple/insns/bnlid.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/insns/bnlid.s b/hw/ip/acc/dv/accsim/test/simple/insns/bnlid.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/insns/bnlid.s
rename to hw/ip/acc/dv/accsim/test/simple/insns/bnlid.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-end-loop.exp b/hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-end-loop.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-end-loop.exp
rename to hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-end-loop.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-end-loop.s b/hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-end-loop.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-end-loop.s
rename to hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-end-loop.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-overflow.exp b/hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-overflow.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-overflow.exp
rename to hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-overflow.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-overflow.s b/hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-overflow.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-overflow.s
rename to hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-overflow.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-zero.exp b/hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-zero.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-zero.exp
rename to hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-zero.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-zero.s b/hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-zero.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/loop-errs/loop-zero.s
rename to hw/ip/acc/dv/accsim/test/simple/loop-errs/loop-zero.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/loops/loops.exp b/hw/ip/acc/dv/accsim/test/simple/loops/loops.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/loops/loops.exp
rename to hw/ip/acc/dv/accsim/test/simple/loops/loops.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/loops/loops.s b/hw/ip/acc/dv/accsim/test/simple/loops/loops.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/loops/loops.s
rename to hw/ip/acc/dv/accsim/test/simple/loops/loops.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/README b/hw/ip/acc/dv/accsim/test/simple/multi/README
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/README
rename to hw/ip/acc/dv/accsim/test/simple/multi/README
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/beq-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/beq-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/beq-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/beq-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/beq-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/beq-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/beq-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/beq-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/beq-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/beq-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/beq-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/beq-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/beq-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/beq-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/beq-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/beq-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bne-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bne-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bne-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bne-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bne-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/bne-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bne-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bne-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bne-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bne-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bne-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bne-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bne-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/bne-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bne-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bne-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-2.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-2.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-2.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-2.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-2.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-2.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-2.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-2.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-3.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-3.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-3.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-3.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-3.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-3.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-3.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-3.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-4.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-4.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-4.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-4.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-4.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-4.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-4.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-4.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-5.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-5.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-5.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-5.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-5.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-5.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-5.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-5.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-6.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-6.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-6.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-6.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-6.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-6.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-6.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-6.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-7.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-7.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-7.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-7.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-7.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-7.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-7.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-7.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-8.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-8.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-8.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-8.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-8.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnlid-8.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnlid-8.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnlid-8.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-2.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-2.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-2.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-2.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-2.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-2.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-2.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-2.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-3.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-3.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-3.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-3.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-3.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-3.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-3.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-3.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-4.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-4.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-4.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-4.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-4.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-4.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-4.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-4.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-5.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-5.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-5.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-5.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-5.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-5.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnmovr-5.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnmovr-5.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-2.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-2.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-2.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-2.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-2.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-2.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-2.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-2.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-3.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-3.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-3.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-3.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-3.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-3.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-3.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-3.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-4.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-4.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-4.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-4.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-4.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-4.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-4.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-4.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-5.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-5.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-5.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-5.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-5.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-5.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-5.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-5.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-6.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-6.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-6.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-6.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-6.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-6.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-6.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-6.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-7.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-7.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-7.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-7.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-7.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-7.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-7.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-7.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-8.exp b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-8.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-8.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-8.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-8.s b/hw/ip/acc/dv/accsim/test/simple/multi/bnsid-8.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/bnsid-8.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/bnsid-8.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrs-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/csrrs-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrs-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/csrrs-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrs-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/csrrs-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrs-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/csrrs-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrs-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/csrrs-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrs-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/csrrs-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrs-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/csrrs-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrs-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/csrrs-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrw-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/csrrw-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrw-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/csrrw-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrw-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/csrrw-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrw-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/csrrw-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrw-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/csrrw-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrw-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/csrrw-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrw-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/csrrw-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/csrrw-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/csrrw-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jal-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jal-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/jal-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jal-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jal-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jal-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/jal-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jal-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-2.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jal-2.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-2.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jal-2.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-2.s b/hw/ip/acc/dv/accsim/test/simple/multi/jal-2.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-2.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jal-2.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-3.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jal-3.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-3.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jal-3.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-3.s b/hw/ip/acc/dv/accsim/test/simple/multi/jal-3.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jal-3.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jal-3.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-2.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-2.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-2.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-2.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-2.s b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-2.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-2.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-2.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-3.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-3.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-3.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-3.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-3.s b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-3.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-3.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-3.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-4.exp b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-4.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-4.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-4.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-4.s b/hw/ip/acc/dv/accsim/test/simple/multi/jalr-4.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/jalr-4.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/jalr-4.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/loop-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/loop-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/loop-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/loop-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/loop-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/loop-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/loop-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/loop-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/loop-1.exp b/hw/ip/acc/dv/accsim/test/simple/multi/loop-1.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/loop-1.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/loop-1.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/loop-1.s b/hw/ip/acc/dv/accsim/test/simple/multi/loop-1.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/loop-1.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/loop-1.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/loopi-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/loopi-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/loopi-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/loopi-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/loopi-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/loopi-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/loopi-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/loopi-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/lw-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/lw-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/lw-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/lw-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/lw-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/lw-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/lw-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/lw-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/sw-0.exp b/hw/ip/acc/dv/accsim/test/simple/multi/sw-0.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/sw-0.exp
rename to hw/ip/acc/dv/accsim/test/simple/multi/sw-0.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/multi/sw-0.s b/hw/ip/acc/dv/accsim/test/simple/multi/sw-0.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/multi/sw-0.s
rename to hw/ip/acc/dv/accsim/test/simple/multi/sw-0.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/pseudos/bigla.exp b/hw/ip/acc/dv/accsim/test/simple/pseudos/bigla.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/pseudos/bigla.exp
rename to hw/ip/acc/dv/accsim/test/simple/pseudos/bigla.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/pseudos/bigla.s b/hw/ip/acc/dv/accsim/test/simple/pseudos/bigla.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/pseudos/bigla.s
rename to hw/ip/acc/dv/accsim/test/simple/pseudos/bigla.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/pseudos/la.exp b/hw/ip/acc/dv/accsim/test/simple/pseudos/la.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/pseudos/la.exp
rename to hw/ip/acc/dv/accsim/test/simple/pseudos/la.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/pseudos/la.s b/hw/ip/acc/dv/accsim/test/simple/pseudos/la.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/pseudos/la.s
rename to hw/ip/acc/dv/accsim/test/simple/pseudos/la.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/pseudos/li.exp b/hw/ip/acc/dv/accsim/test/simple/pseudos/li.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/pseudos/li.exp
rename to hw/ip/acc/dv/accsim/test/simple/pseudos/li.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/pseudos/li.s b/hw/ip/acc/dv/accsim/test/simple/pseudos/li.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/pseudos/li.s
rename to hw/ip/acc/dv/accsim/test/simple/pseudos/li.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/relocs/hilo.exp b/hw/ip/acc/dv/accsim/test/simple/relocs/hilo.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/relocs/hilo.exp
rename to hw/ip/acc/dv/accsim/test/simple/relocs/hilo.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/relocs/hilo.s b/hw/ip/acc/dv/accsim/test/simple/relocs/hilo.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/relocs/hilo.s
rename to hw/ip/acc/dv/accsim/test/simple/relocs/hilo.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/subroutines/direct-call.exp b/hw/ip/acc/dv/accsim/test/simple/subroutines/direct-call.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/subroutines/direct-call.exp
rename to hw/ip/acc/dv/accsim/test/simple/subroutines/direct-call.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/subroutines/direct-call.s b/hw/ip/acc/dv/accsim/test/simple/subroutines/direct-call.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/subroutines/direct-call.s
rename to hw/ip/acc/dv/accsim/test/simple/subroutines/direct-call.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/subroutines/indirect-call.exp b/hw/ip/acc/dv/accsim/test/simple/subroutines/indirect-call.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/subroutines/indirect-call.exp
rename to hw/ip/acc/dv/accsim/test/simple/subroutines/indirect-call.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/subroutines/indirect-call.s b/hw/ip/acc/dv/accsim/test/simple/subroutines/indirect-call.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/subroutines/indirect-call.s
rename to hw/ip/acc/dv/accsim/test/simple/subroutines/indirect-call.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/x1/overflow.exp b/hw/ip/acc/dv/accsim/test/simple/x1/overflow.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/x1/overflow.exp
rename to hw/ip/acc/dv/accsim/test/simple/x1/overflow.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/x1/overflow.s b/hw/ip/acc/dv/accsim/test/simple/x1/overflow.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/x1/overflow.s
rename to hw/ip/acc/dv/accsim/test/simple/x1/overflow.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/x1/underflow.exp b/hw/ip/acc/dv/accsim/test/simple/x1/underflow.exp
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/x1/underflow.exp
rename to hw/ip/acc/dv/accsim/test/simple/x1/underflow.exp
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple/x1/underflow.s b/hw/ip/acc/dv/accsim/test/simple/x1/underflow.s
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple/x1/underflow.s
rename to hw/ip/acc/dv/accsim/test/simple/x1/underflow.s
diff --git a/hw/ip/otbn/dv/otbnsim/test/simple_test.py b/hw/ip/acc/dv/accsim/test/simple_test.py
similarity index 100%
rename from hw/ip/otbn/dv/otbnsim/test/simple_test.py
rename to hw/ip/acc/dv/accsim/test/simple_test.py
diff --git a/hw/ip/otbn/dv/otbnsim/test/state_test.py b/hw/ip/acc/dv/accsim/test/state_test.py
similarity index 97%
rename from hw/ip/otbn/dv/otbnsim/test/state_test.py
rename to hw/ip/acc/dv/accsim/test/state_test.py
index 5f01047e2bc..fc51fd1f552 100644
--- a/hw/ip/otbn/dv/otbnsim/test/state_test.py
+++ b/hw/ip/acc/dv/accsim/test/state_test.py
@@ -2,7 +2,7 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
-'''Test the implementation of OTBNState.'''
+'''Test the implementation of ACCState.'''
import py
diff --git a/hw/ip/otbn/dv/otbnsim/test/stats_test.py b/hw/ip/acc/dv/accsim/test/stats_test.py
similarity index 98%
rename from hw/ip/otbn/dv/otbnsim/test/stats_test.py
rename to hw/ip/acc/dv/accsim/test/stats_test.py
index 238c33fdd5a..33c07d8e068 100644
--- a/hw/ip/otbn/dv/otbnsim/test/stats_test.py
+++ b/hw/ip/acc/dv/accsim/test/stats_test.py
@@ -22,7 +22,7 @@ def _run_sim_for_stats(sim: StandaloneSim) -> ExecutionStats:
def _simulate_asm_file(asm_file: str, tmpdir: py.path.local) -> ExecutionStats:
- '''Run the OTBN simulator, collect statistics, and return them.'''
+ '''Run the ACC simulator, collect statistics, and return them.'''
sim = testutil.prepare_sim_for_asm_file(asm_file, tmpdir, True)
return _run_sim_for_stats(sim)
diff --git a/hw/ip/otbn/dv/otbnsim/test/testutil.py b/hw/ip/acc/dv/accsim/test/testutil.py
similarity index 82%
rename from hw/ip/otbn/dv/otbnsim/test/testutil.py
rename to hw/ip/acc/dv/accsim/test/testutil.py
index 5648f487b32..1c812a37564 100644
--- a/hw/ip/otbn/dv/otbnsim/test/testutil.py
+++ b/hw/ip/acc/dv/accsim/test/testutil.py
@@ -10,8 +10,8 @@
from sim.load_elf import load_elf
from sim.standalonesim import StandaloneSim
-OTBN_DIR = os.path.join(os.path.dirname(__file__), '../../..')
-UTIL_DIR = os.path.join(OTBN_DIR, 'util')
+ACC_DIR = os.path.join(os.path.dirname(__file__), '../../..')
+UTIL_DIR = os.path.join(ACC_DIR, 'util')
SIM_DIR = os.path.join(os.path.dirname(__file__), '..')
@@ -21,13 +21,13 @@ def asm_and_link_one_file(asm_path: str, work_dir: py.path.local) -> str:
Returns the path to the resulting ELF
'''
- otbn_as = os.path.join(UTIL_DIR, 'otbn_as.py')
- otbn_ld = os.path.join(UTIL_DIR, 'otbn_ld.py')
+ acc_as = os.path.join(UTIL_DIR, 'acc_as.py')
+ acc_ld = os.path.join(UTIL_DIR, 'acc_ld.py')
obj_path = os.path.join(work_dir, 'tst.o')
elf_path = os.path.join(work_dir, 'tst')
- subprocess.run([otbn_as, '-o', obj_path, asm_path], check=True)
- subprocess.run([otbn_ld, '-o', elf_path, obj_path], check=True)
+ subprocess.run([acc_as, '-o', obj_path, asm_path], check=True)
+ subprocess.run([acc_ld, '-o', elf_path, obj_path], check=True)
return elf_path
diff --git a/hw/ip/otbn/dv/doc/fcov.md b/hw/ip/acc/dv/doc/fcov.md
similarity index 97%
rename from hw/ip/otbn/dv/doc/fcov.md
rename to hw/ip/acc/dv/doc/fcov.md
index 50dde00d044..7b2a17f271b 100644
--- a/hw/ip/otbn/dv/doc/fcov.md
+++ b/hw/ip/acc/dv/doc/fcov.md
@@ -1,4 +1,4 @@
-# OTBN functional coverage
+# ACC functional coverage
We distinguish between *architectural* and *micro-architectural* functional coverage.
The idea is that the points that go into architectural coverage are those that a DV engineer could derive by reading the block specification.
@@ -33,7 +33,7 @@ All four of these events should be crossed with the three states of the call sta
The [loop stack](../README.md#loop-stack) is accessed by executing `LOOP` and `LOOPI` instructions.
Events concerning the start of loops are tracked at those instructions, but we can't track things like loop completion there.
-> Coverage for these points is tracked with cover properties in the `otbn_loop_if` interface.
+> Coverage for these points is tracked with cover properties in the `acc_loop_if` interface.
We expect to:
- Complete a loop.
@@ -60,13 +60,13 @@ See [CSRRS](#csrrs) and [CSRRW](#csrrw) for CSRs; [BN.WSRR](#bnwsrr) and [BN.WSR
## Random numbers
-Random numbers are exposed to OTBN code through the `RND` and `URND` CSRs and WSRs.
+Random numbers are exposed to ACC code through the `RND` and `URND` CSRs and WSRs.
A new random number can be prefetched for `RND` with the `RND_PREFETCH` CSR.
We track uses of each of these CSRs and WSRs in the instructions that access them.
See [CSRRS](#csrrs) and [CSRRW](#csrrw) for CSRs; [BN.WSRR](#bnwsrr) and [BN.WSRW](#bnwsrw) for WSRs.
However, we also want to see some interactions between `RND` and `RND_PREFETCH`.
-These are all tracked with cover properties in `otbn_rnd_if.sv`.
+These are all tracked with cover properties in `acc_rnd_if.sv`.
Specifically, we expect to see:
@@ -114,7 +114,7 @@ See the `mem_integrity` and `internal_integrity` entries in the testplan for mor
## Lifecycle escalation
-The lifecycle controller can send a "lifecycle escalation" signal to tell OTBN to clear its internal state and to raise its own fatal error.
+The lifecycle controller can send a "lifecycle escalation" signal to tell ACC to clear its internal state and to raise its own fatal error.
We expect to see this happen.
However, we don't track coverage for this explicitly since it's handled at the testplan level (with the `lc_escalation` testpoint).
@@ -132,16 +132,16 @@ CSRs](#external-bus-accessible-csrs) section below.
## Scratchpad memory
A portion of DMEM is inaccessible from the bus.
-We want to see accesses (read and write) to both endpoints of the inaccessible portion of DMEM when OTBN is in an idle state (so would otherwise allow them).
+We want to see accesses (read and write) to both endpoints of the inaccessible portion of DMEM when ACC is in an idle state (so would otherwise allow them).
These are tracked in the `addr_cp` coverpoint in `scratchpad_writes_cg`.
We also want to see a successful write to the top word of accessible DMEM.
-We don't track that explicitly, since it is covered by the `otbn_mem_walk` test.
+We don't track that explicitly, since it is covered by the `acc_mem_walk` test.
## External (bus-accessible) CSRs
-The OTBN block exposes functionality to a bus host through bus-accessible CSRs.
-Behavior of some CSRs depends on [OTBN's operational state](../../doc/theory_of_operation.md#operational-states).
+The ACC block exposes functionality to a bus host through bus-accessible CSRs.
+Behavior of some CSRs depends on [ACC's operational state](../../doc/theory_of_operation.md#operational-states).
For every CSR (no matter its access restrictions), we want to see an attempt to read it and an attempt to write it.
The CSRs are tracked in covergroups based on the CSR name, with the format: `ext_csr__cg`.
@@ -157,7 +157,7 @@ We track the last write state for a CSR and then sample that covergroup when the
Coverage is tracked in the `ext_csr_cmd_cg` covergroup.
We want to see all valid commands (plus at least one invalid command) being written in each operational state.
-This ensures commands are ignored as expected when OTBN is busy or locked.
+This ensures commands are ignored as expected when ACC is busy or locked.
It also ensures that bad commands are ignored as expected.
The `cmd_cp` bin covers the different types of commands.
@@ -240,8 +240,8 @@ This is tracked in the `ext_csr_wr_operational_state_cg` covergroup.
# Instruction-based coverage
-As a processor, much of OTBN's coverage points are described in terms of instructions being executed.
-Because OTBN doesn't have a complicated multi-stage pipeline or any real exception handling, we don't track much temporal information (such as sequences of instructions).
+As a processor, much of ACC's coverage points are described in terms of instructions being executed.
+Because ACC doesn't have a complicated multi-stage pipeline or any real exception handling, we don't track much temporal information (such as sequences of instructions).
As well as instruction-specific coverage points detailed below, we include a requirement that each instruction is executed at least once.
@@ -250,7 +250,7 @@ That is, we expect to see execution with each bit of each immediate field being
We also expect to see each field with values `'0` and `'1` (all zeros and all ones).
If the field is treated as a signed number, we also expect to see it with the extremal values for its range (just the MSB set, for the most negative value; all but the MSB set, for the most positive value).
-> The code to track this is split by encoding schema in `otbn_env_cov`.
+> The code to track this is split by encoding schema in `acc_env_cov`.
> Each instruction listed below will specify its encoding schema.
> Each encoding schema then has its own covergroup.
> Rather than tracking toggle coverage as described above, we just track extremal values in a coverpoint.
@@ -265,7 +265,7 @@ If the field is treated as a signed number, we also expect to see it with the ex
For any instruction that reads from or writes to a GPR, we expect to see that operand equal to `x0`, `x1` and an arbitrary register in the range `x2 .. x31`.
We don't have any particular coverage requirements for WDRs (since all of them work essentially the same).
-> As for immediates, the code to track this is split by encoding schema in `otbn_env_cov`.
+> As for immediates, the code to track this is split by encoding schema in `acc_env_cov`.
> Each register field gets a coverpoint with the same name, defined with the `DEF_GPR_CP` helper macro.
> If the encoding schema has more than one instruction, the coverpoint is then crossed with the mnemonic, using the `DEF_MNEM_CROSS` helper macro.
> For example, `add` is in the `enc_bnr_cg` covergroup.
@@ -278,7 +278,7 @@ We want to see each of the 32 bits of that operand set and unset (giving 64 cove
Similarly, `BN.ADD` reads from its `wrs1` operand.
We want to see each of the 256 bits of that operand set and unset (giving 512 coverage points).
-> Again, the code to track this is split by encoding schema in `otbn_env_cov`.
+> Again, the code to track this is split by encoding schema in `acc_env_cov`.
> The trace interface takes a copy of GPR and WDR read data.
> The relevant register read data are then passed to the encoding schema's covergroup in the `on_insn` method.
> To avoid extremely repetitive code, the actual coverpoints and crosses are defined with the help of macros.
@@ -290,7 +290,7 @@ This needn't be crossed with the two flag groups (that's tracked separately in t
For example, `BN.ADD` can write to each of the flags `C`, `M`, `L` and `Z`.
This paragraph implies eight coverage points (four flags times two values) for that instruction.
-> Again, the code to track this is split by encoding schema in `otbn_env_cov`.
+> Again, the code to track this is split by encoding schema in `acc_env_cov`.
> The trace interface takes a copy of flag write data.
> It doesn't bother storing the flag write flags, since these are implied by the instruction anyway.
> There is a coverage coverpoint tracking both values for each of the flags that can be written.
diff --git a/hw/ip/otbn/dv/doc/model.svg b/hw/ip/acc/dv/doc/model.svg
similarity index 98%
rename from hw/ip/otbn/dv/doc/model.svg
rename to hw/ip/acc/dv/doc/model.svg
index 9f7018b2d89..ffe8e1627cf 100644
--- a/hw/ip/otbn/dv/doc/model.svg
+++ b/hw/ip/acc/dv/doc/model.svg
@@ -263,7 +263,7 @@
id="tspan839"
x="105.76097"
y="70.315781"
- style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93889px;font-family:'Liberation Mono';-inkscape-font-specification:'Liberation Mono';text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.79375">otbn_core_model.sv
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93889px;font-family:'Liberation Mono';-inkscape-font-specification:'Liberation Mono';text-align:center;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.79375">acc_core_model.sv
otbn_model.cc
+ id="tspan848">acc_model.cc
match the otbn modulematch the acc modulein otbn.sv
+ id="tspan1192">in acc.sv
The code in otbn_core_model.sv is designed to beThe code in acc_core_model.sv is designed to beotbn_model.cc translates from DPI calls to a moreacc_model.cc translates from DPI calls to a moreiss_wrapper.cc doesn't know much about OTBN.iss_wrapper.cc doesn't know much about ACC.for OTBN.
+ id="tspan2269">for ACC.
otbn_base_test
+ id="tspan861">acc_base_test
otbn_env_cfg
+ id="tspan867">acc_env_cfg
otbn_core_if
+ id="tspan875">acc_core_if
otbn_model_agent_cfg
+ id="tspan883">acc_model_agent_cfg
otbn_mem_if
+ id="tspan891">acc_mem_if
otbn_base_test class derives) creates and runs the sequence acc_base_test class derives) creates and runs the sequence otbn_base_vseq
+ id="tspan941">acc_base_vseq
otbn_env
+ id="tspan983">acc_env
otbn_env_cov
+ id="tspan989">acc_env_cov
otbn_scoreboard
+ id="tspan997">acc_scoreboard
otbn_virtual_sequencer
+ id="tspan1005">acc_virtual_sequencer
otbn_model_agent
+ id="tspan1013">acc_model_agent
otbn
+ id="tspan1095">acc
@@ -1182,7 +1182,7 @@
id="text1123">u_otbn_core
+ id="tspan1121">u_acc_core
otbn_core_model
+ id="tspan1163">acc_core_model
otbn_env_cfg object. To denote this, those classes are acc_env_cfg object. To denote this, those classes are connected by a
dotted line to the otbn_env_cfg class.
+ style="shape-inside:url(#rect1653)">dotted line to the acc_env_cfg class.
p_sequencer handle to the otbn_virtual_sequencer inside p_sequencer handle to the acc_virtual_sequencer inside the environment
otbn_env inside the object of type otbn_base_test.acc_env inside the object of type acc_base_test.otbn_model_if
+ id="tspan1190">acc_model_if
#include
@@ -18,7 +18,7 @@
#include "sv_scoped.h"
#include "sv_utils.h"
-OtbnMemUtil::OtbnMemUtil(const std::string &top_scope)
+AccMemUtil::AccMemUtil(const std::string &top_scope)
: imem_(SVScoped::join_sv_scopes(top_scope, "u_imem"), 32768 / 4, 4 / 4),
dmem_(SVScoped::join_sv_scopes(top_scope, "u_dmem"), 32768 / 32, 32 / 4),
expected_end_addr_(-1) {
@@ -26,21 +26,21 @@ OtbnMemUtil::OtbnMemUtil(const std::string &top_scope)
RegisterMemoryArea("dmem", 0x18000, &dmem_);
}
-void OtbnMemUtil::LoadElf(const std::string &elf_path) {
+void AccMemUtil::LoadElf(const std::string &elf_path) {
LoadElfToMemories(false, elf_path);
}
-const StagedMem::SegMap &OtbnMemUtil::GetSegs(bool is_imem) const {
+const StagedMem::SegMap &AccMemUtil::GetSegs(bool is_imem) const {
return GetMemoryData(is_imem ? "imem" : "dmem").GetSegs();
}
-uint32_t OtbnMemUtil::GetLoopWarp(uint32_t addr, uint32_t from_cnt) const {
+uint32_t AccMemUtil::GetLoopWarp(uint32_t addr, uint32_t from_cnt) const {
auto key = std::make_pair(addr, from_cnt);
auto it = loop_warp_.find(key);
return (it == loop_warp_.end()) ? from_cnt : it->second;
}
-void OtbnMemUtil::OnElfLoaded(Elf *elf_file) {
+void AccMemUtil::OnElfLoaded(Elf *elf_file) {
assert(elf_file);
expected_end_addr_ = -1;
@@ -73,7 +73,7 @@ void OtbnMemUtil::OnElfLoaded(Elf *elf_file) {
}
}
-void OtbnMemUtil::OnSymbol(const std::string &name, uint32_t value) {
+void AccMemUtil::OnSymbol(const std::string &name, uint32_t value) {
// Expected end address
if (name == "_expected_end_addr") {
expected_end_addr_ = value;
@@ -111,8 +111,8 @@ void OtbnMemUtil::OnSymbol(const std::string &name, uint32_t value) {
}
}
-void OtbnMemUtil::AddLoopWarp(uint32_t addr, uint32_t from_cnt,
- uint32_t to_cnt) {
+void AccMemUtil::AddLoopWarp(uint32_t addr, uint32_t from_cnt,
+ uint32_t to_cnt) {
auto key = std::make_pair(addr, from_cnt);
auto pr = loop_warp_.insert(std::make_pair(key, to_cnt));
if (!pr.second) {
@@ -127,19 +127,18 @@ void OtbnMemUtil::AddLoopWarp(uint32_t addr, uint32_t from_cnt,
}
}
-extern "C" OtbnMemUtil *OtbnMemUtilMake(const char *top_scope) {
+extern "C" AccMemUtil *AccMemUtilMake(const char *top_scope) {
try {
- return new OtbnMemUtil(top_scope);
+ return new AccMemUtil(top_scope);
} catch (const std::exception &err) {
- std::cerr << "Failed to create OtbnMemUtil: " << err.what() << "\n";
+ std::cerr << "Failed to create AccMemUtil: " << err.what() << "\n";
return nullptr;
}
}
-extern "C" void OtbnMemUtilFree(OtbnMemUtil *mem_util) { delete mem_util; }
+extern "C" void AccMemUtilFree(AccMemUtil *mem_util) { delete mem_util; }
-extern "C" svBit OtbnMemUtilLoadElf(OtbnMemUtil *mem_util,
- const char *elf_path) {
+extern "C" svBit AccMemUtilLoadElf(AccMemUtil *mem_util, const char *elf_path) {
assert(mem_util);
assert(elf_path);
try {
@@ -152,8 +151,8 @@ extern "C" svBit OtbnMemUtilLoadElf(OtbnMemUtil *mem_util,
}
}
-extern "C" svBit OtbnMemUtilStageElf(OtbnMemUtil *mem_util,
- const char *elf_path) {
+extern "C" svBit AccMemUtilStageElf(AccMemUtil *mem_util,
+ const char *elf_path) {
assert(mem_util);
assert(elf_path);
try {
@@ -166,7 +165,7 @@ extern "C" svBit OtbnMemUtilStageElf(OtbnMemUtil *mem_util,
}
}
-extern "C" int OtbnMemUtilGetSegCount(OtbnMemUtil *mem_util, svBit is_imem) {
+extern "C" int AccMemUtilGetSegCount(AccMemUtil *mem_util, svBit is_imem) {
assert(mem_util);
const StagedMem::SegMap &segs = mem_util->GetSegs(is_imem);
size_t num_segs = segs.size();
@@ -181,9 +180,9 @@ extern "C" int OtbnMemUtilGetSegCount(OtbnMemUtil *mem_util, svBit is_imem) {
return num_segs;
}
-extern "C" svBit OtbnMemUtilGetSegInfo(OtbnMemUtil *mem_util, svBit is_imem,
- int seg_idx, svBitVecVal *seg_off,
- svBitVecVal *seg_size) {
+extern "C" svBit AccMemUtilGetSegInfo(AccMemUtil *mem_util, svBit is_imem,
+ int seg_idx, svBitVecVal *seg_off,
+ svBitVecVal *seg_size) {
assert(mem_util);
assert(seg_off);
assert(seg_size);
@@ -228,8 +227,8 @@ extern "C" svBit OtbnMemUtilGetSegInfo(OtbnMemUtil *mem_util, svBit is_imem,
return sv_1;
}
-extern "C" svBit OtbnMemUtilGetSegData(
- OtbnMemUtil *mem_util, svBit is_imem, int word_off,
+extern "C" svBit AccMemUtilGetSegData(
+ AccMemUtil *mem_util, svBit is_imem, int word_off,
/* output bit[31:0] */ svBitVecVal *data_value) {
assert(mem_util);
assert(data_value);
@@ -273,15 +272,15 @@ extern "C" svBit OtbnMemUtilGetSegData(
return sv_1;
}
-int OtbnMemUtilGetExpEndAddr(OtbnMemUtil *mem_util) {
+int AccMemUtilGetExpEndAddr(AccMemUtil *mem_util) {
assert(mem_util);
return mem_util->GetExpEndAddr();
}
-svBit OtbnMemUtilGetLoopWarp(OtbnMemUtil *mem_util,
- /* bit [31:0] */ const svBitVecVal *addr,
- /* bit [31:0] */ const svBitVecVal *from_cnt,
- /* output bit [31:0] */ svBitVecVal *to_cnt) {
+svBit AccMemUtilGetLoopWarp(AccMemUtil *mem_util,
+ /* bit [31:0] */ const svBitVecVal *addr,
+ /* bit [31:0] */ const svBitVecVal *from_cnt,
+ /* output bit [31:0] */ svBitVecVal *to_cnt) {
assert(mem_util);
uint32_t addr32 = get_sv_u32(addr);
uint32_t from32 = get_sv_u32(from_cnt);
@@ -290,7 +289,7 @@ svBit OtbnMemUtilGetLoopWarp(OtbnMemUtil *mem_util,
return to32 != from32;
}
-int OtbnMemUtilGetNumLoopWarps(OtbnMemUtil *mem_util) {
+int AccMemUtilGetNumLoopWarps(AccMemUtil *mem_util) {
assert(mem_util);
size_t sz = mem_util->GetLoopWarps().size();
@@ -299,11 +298,10 @@ int OtbnMemUtilGetNumLoopWarps(OtbnMemUtil *mem_util) {
return sz;
}
-void OtbnMemUtilGetLoopWarpByIndex(
- OtbnMemUtil *mem_util, int idx,
- /* output bit [31:0] */ svBitVecVal *addr,
- /* output bit [31:0] */ svBitVecVal *from_cnt,
- /* output bit [31:0] */ svBitVecVal *to_cnt) {
+void AccMemUtilGetLoopWarpByIndex(AccMemUtil *mem_util, int idx,
+ /* output bit [31:0] */ svBitVecVal *addr,
+ /* output bit [31:0] */ svBitVecVal *from_cnt,
+ /* output bit [31:0] */ svBitVecVal *to_cnt) {
assert(mem_util);
assert(0 <= idx);
diff --git a/hw/ip/otbn/dv/memutil/otbn_memutil.core b/hw/ip/acc/dv/memutil/acc_memutil.core
similarity index 64%
rename from hw/ip/otbn/dv/memutil/otbn_memutil.core
rename to hw/ip/acc/dv/memutil/acc_memutil.core
index 4a63b793567..52df30e64d9 100644
--- a/hw/ip/otbn/dv/memutil/otbn_memutil.core
+++ b/hw/ip/acc/dv/memutil/acc_memutil.core
@@ -3,17 +3,17 @@ CAPI=2:
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
-name: "lowrisc:dv:otbn_memutil"
-description: "A wrapper around memutil_verilator for OTBN"
+name: "lowrisc:dv:acc_memutil"
+description: "A wrapper around memutil_verilator for ACC"
filesets:
files_cpp:
depend:
- lowrisc:dv_verilator:memutil_dpi_scrambled
files:
- - otbn_memutil.cc
- - otbn_memutil.h: { is_include_file: true }
- - otbn_memutil_pkg.sv: { file_type: systemVerilogSource }
+ - acc_memutil.cc
+ - acc_memutil.h: { is_include_file: true }
+ - acc_memutil_pkg.sv: { file_type: systemVerilogSource }
- sv_utils.h: { file_type: cppSource, is_include_file: true }
file_type: cppSource
diff --git a/hw/ip/otbn/dv/memutil/otbn_memutil.h b/hw/ip/acc/dv/memutil/acc_memutil.h
similarity index 67%
rename from hw/ip/otbn/dv/memutil/otbn_memutil.h
rename to hw/ip/acc/dv/memutil/acc_memutil.h
index 8cefc2fb6e3..cb48994ef9e 100644
--- a/hw/ip/otbn/dv/memutil/otbn_memutil.h
+++ b/hw/ip/acc/dv/memutil/acc_memutil.h
@@ -1,8 +1,8 @@
// Copyright lowRISC contributors (OpenTitan project).
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
-#ifndef OPENTITAN_HW_IP_OTBN_DV_MEMUTIL_OTBN_MEMUTIL_H_
-#define OPENTITAN_HW_IP_OTBN_DV_MEMUTIL_OTBN_MEMUTIL_H_
+#ifndef OPENTITAN_HW_IP_ACC_DV_MEMUTIL_ACC_MEMUTIL_H_
+#define OPENTITAN_HW_IP_ACC_DV_MEMUTIL_ACC_MEMUTIL_H_
#include