feat(debug): Transition debug module to CSR-based interface

This commit refactors the debug module's external interface, moving from direct pin-level connections to a memory-mapped CSR (Control and Status Register) interface accessible via the AXI bus. This change provides a more structured and extensible mechanism for controlling and interacting with the debug module.

Key changes include:

- **Hardware:**
    - The `CoreAxi` top-level module is updated to connect the debug module to the new CSR interface, removing the direct `dm` port.
    - `CoreAxiCSR` is enhanced with a set of registers for debug requests and responses, including registers for address, data, operation, and status.
    - The debug module's request and response signals are now driven by these CSRs, enabling control via AXI writes and reads.

- **Testbench:**
    - The `CoreMiniAxiInterface` is significantly updated to use the new CSR-based communication protocol.
    - The `dm_req_agent` and `dm_rsp_agent`, which previously managed the pin-level protocol, have been removed.
    - The `dm_read` and `dm_write` functions are rewritten to perform the multi-step process of writing to the request CSRs, polling the status CSR, and reading the response CSRs.
    - All debug-related tests are updated to use the new `dm_read` and `dm_write` functions.

- **Documentation:**
    - The debug module documentation is updated to describe the new CSR-based command protocol.
    - A table of the new AXI CSRs is added, including their addresses and descriptions.
    - The command examples are updated to reflect the new multi-step process for reading and writing GPRs via the CSR interface.

This refactoring simplifies the hardware interface, improves the robustness of the testbench, and provides a clearer and more comprehensive programming model for external debuggers.

Change-Id: I39be61d805d0e1236550a33a40dbb20f91da0d67
4 files changed
tree: 6417b388a2cb4b22f7a29868906e6129a4334573
  1. doc/
  2. examples/
  3. external/
  4. hdl/
  5. hw_sim/
  6. kelvin_test_utils/
  7. lib/
  8. platforms/
  9. rules/
  10. tests/
  11. third_party/
  12. toolchain/
  13. utils/
  14. .bazelrc
  15. .bazelversion
  16. .gitignore
  17. CONTRIBUTING.md
  18. LICENSE
  19. PREUPLOAD.cfg
  20. README.md
  21. WORKSPACE
README.md

Kelvin

Kelvin is a RISC-V32IM core with a custom instruction set.

Kelvin block diagram

More information on the design can be found in the overview.

Getting Started

  • If you are hardware engineer looking to integrate Kelvin into your design, check out our integration guide.
  • If you are a software engineer looking to write code for Kelvin, start with this tutorial.

Building

Kelvin uses bazel as it's build system. The Verilated simulator for Kelvin can be generated using:

bazel build //tests/verilator_sim:core_sim

The verilog source for the Kelvin core can be generated using:

bazel build //hdl/chisel/src/kelvin:core_cc_library_emit_verilog

Verilog source for the Matcha SoC can be generated using:

bazel clean --expunge  # To generate the ToT sha
bazel build //hdl/chisel:matcha_kelvin_verilog