Commit d67cca89 authored by Evgeniy Naydanov's avatar Evgeniy Naydanov
Browse files

Add decoding facilities into debug_defines.h

This commit implements facilities to decode register fields for each
register described in debug_defines.h.

`enum riscv_debug_reg_ordinal` -- provides a way to specify the
register. Address cannot be used for this purpose, since some registers
share a common address (e.g. `tdata1` and `mcontrol`).

Structure `riscv_debug_reg_ctx_t` -- provides a context sufficient to
decode a register (e.g. the width of `tselect` depends on `XLEN`).

Structure `riscv_debug_reg_info_t` -- contains register name and a list
of it's fields, accessible via a call of the function pointer.

Structure `riscv_debug_reg_field_list_t` -- represents an element of a
field list. If non-null, the call of the function pointer returns next
element of the list.

Structure `riscv_debug_reg_field_info_t` -- represents a field of a
register.

`get_riscv_debug_reg_info()` returns the structure corresponding to the
given register ordinal.
parent c13d9bd3
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment