Skip to content

Commit

Permalink
cheshire_pkg: Fix CVA6 debug module addresses
Browse files Browse the repository at this point in the history
This fixes two errors in the debug module addresses passed to CVA6:

1. `HaltAddress` and `ExceptionAddress` are assumed to be relative to
`DmBaseAddress`, see
https://github.com/pulp-platform/cva6/blob/99ae53bde1a94b90c1d9bbbe7fe272a9336200a6/core/frontend/frontend.sv#L380
and
https://github.com/pulp-platform/cva6/blob/99ae53bde1a94b90c1d9bbbe7fe272a9336200a6/core/csr_regfile.sv#L2295.
Coincidentally, this currently does not cause any issues since `AmDbg = '0`,

2. `ExceptionAddress` was changed from `0x808` to `0x810` in
pulp-platform/riscv-dbg#145, which is included
in the debug module version used in Cheshire. This means that exceptions
in debug mode currently cause CVA6 to jump to `resume` and return from
debug mode instead of handling the exception, which breaks several
openocd commands that use exceptions to discover CSR availabilities.

Signed-off-by: Nils Wistoff <[email protected]>
  • Loading branch information
niwis committed Dec 5, 2024
1 parent 97fddf4 commit 5e23871
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/cheshire_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ package cheshire_pkg;
EnableAccelerator : 0,
RVS : 1,
RVU : 1,
HaltAddress : AmDbg + 'h800,
ExceptionAddress : AmDbg + 'h808,
HaltAddress : 'h800, // Relative to AmDbg
ExceptionAddress : 'h810, // Relative to AmDbg
RASDepth : cfg.Cva6RASDepth,
BTBEntries : cfg.Cva6BTBEntries,
BHTEntries : cfg.Cva6BHTEntries,
Expand Down

0 comments on commit 5e23871

Please sign in to comment.