| Age | Commit message (Collapse) | Author | Files | Lines |
|
Add a --trace-tlb feature to log changes to the TLB. This also changes
the `--trace-all` CLI option to just `--trace` and removes especially
verbose options that people probably don't want by default.
|
|
This removes the `dirty_update` configuration attribute under
`memory.translation`, since the behavior that attribute configured can
now be modeled using the Svade and Svadu extensions.
This check for Svade/Svadu is centralized in a `update_and_write_pte`
helper.
The Svadu PMA requirement is validated by requiring that at least one
PMA region support hardware PTE writes if Svadu is supported.
While here, fix a couple of newline issues in the execution trace for
PTEs.
---------
Co-authored-by: Mingzhu Yan <trdthg@users.noreply.github.com>
Co-authored-by: Tim Hutt <tdhutt@gmail.com>
|
|
This allows finer control over whether `x`/ `f`/`v` register and CSR
state changes are printed.
Fixes #1602.
|
|
There was a small off-by-a-factor-of-8 bug in this code, but we can also
greatly simplify it by just using gmp's printing functions.
Fixes #1607
|
|
`ptw_fail_callback` was unconditionally printing PTW failures unlike the
other PTW callbacks which are gated on `config_print_ptw`.
|
|
Move the `config_..` settings into `CLIOptions` and `ModelImpl` so they
are no longer global.
|
|
This was initially introduced as a hook for CHERI to override as an
external (`ext_`) extension. However, this type can also be used to
support memory accesses for standard extensions such as Zicfiss (and
possibly others in addition to CHERI). The type is also redefined to an
`enum` (from `unit`) to support these forthcoming extensions.
|
|
Use `PRId64` instead of `%ld` for portability.
Enable more warning flags for the C++ code, and also warnings-as-errors
in CI.
---------
Signed-off-by: Tim Hutt <tdhutt@gmail.com>
Co-authored-by: Tim Hutt <tdhutt@gmail.com>
|
|
This fixes various annoyances in our clang-format style that have been
bothering me for a while:
* Binpacking arguments/parameters and aligning them to the opening `(`
is *really* bad for diffs/conflict resolution. This changes it to try to
match the "prettier" algorithm (also used by Sail's autoformatter),
which has much simpler and better behaviour - if the arguments fit on
one line do that, otherwise put each argument on its own line.
* Don't put functions on one line. This is also a little diff-unfriendly
and feels unnecessarily inconsistent to me.
* The line length limit of 80 characters is very constrictive so I
increased it to 120 characters.
* For some reason it didn't put `{` on a new line... except for function
bodies, which is weirdly inconsistent. Now `{` never starts on a new
line.
* Sort `#include`s. This might have been needed in the past but I
verified it builds with sorted includes now.
|
|
Add callbacks for each step of the page table walk process, and an
option to log them.
This required some quite awkward changes to resolve a dependency loop.
We can fix this better with [a change to the Sail
compiler](https://github.com/rems-project/sail/issues/1560#issuecomment-3628341263).
Fixes #1356
---------
Signed-off-by: Ariel Xiong <ArielHeleneto@outlook.com>
Co-authored-by: Tim Hutt <tdhutt@gmail.com>
|
|
This switches from using Sail's C output to using C++. The output code
gets wrapped in a `class`, which means we can create more than one
instance of it (e.g. for multicore).
The `Model` class is currently *not* thread safe due to the use of
temporary globals in `sail.c`. So although you can simulate multicore
systems, you have to execute them one at a time.
The handling of platform callbacks is a little convoluted but I think
this is a quite flexible solution. Sail is instructed to derive the
`Model` class from `PlatformImpl` which has virtual methods for all of
the platform callbacks with default nop implementations.
This means the default `Model` can be constructed and has a "nop"
platform. Then we add our implementation of the platform with
`ModelImpl` which overrides those methods.
`ModelImpl` also allows registering callback receivers.
This is not 100% perfect yet. We still have a global `g_model`, which is
not ideal.
---------
Signed-off-by: Tim Hutt <tdhutt@gmail.com>
Co-authored-by: Tim Hutt <timothy.hutt@codasip.com>
Co-authored-by: Nadime Barhoumi <nadime@riscv.org>
|
|
Remove callbacks which are empty. Add default implementation in base
class.
---------
Signed-off-by: Ariel Xiong <ArielHeleneto@outlook.com>
|
|
This adds a few state change callbacks that we needed for an internal
binary logging format. They aren't used by the RVFI or log callback
handlers but they should also be useful for the open source binary
logging format that we eventually add (#545).
* Add a `fetch_callback` that says which instruction was executed (if
any).
* Add `redirect_callback` that is called for taken and unconditional
branches.
* Add `is_interrupt` and `cause` to `trap_callback`.
I also renamed `value` to `new_pc` to be a bit more explicit.
Fixes #1352
|
|
Variable length arrays are a language extension. Clang warns about this.
MacOS builds use Clang so we see these in CI.
Also fix `uint64_t` printf specifier.
|
|
Allow configuring `regidx` to be 4 bits instead of 5, so only 16 `x`
registers are supported. Instruction encodings to access `x16` - `x31`
are reserved and will cause an illegal instruction exception if `E` is
enabled.
---------
Co-authored-by: Prashanth Mundkur <103736+pmundkur@users.noreply.github.com>
|
|
Currently the callbacks implementation depends directly on the RVFI
implementation. This commit avoids that by introducing a callback
registration mechanism, allowing multiple targets to receive the
callbacks. Currently the targets are text logs, and RVFI. In future we
will add a binary log format, and probably a C lockstep verification
API.
---------
Co-authored-by: Prashanth Mundkur <prashanth.mundkur@gmail.com>
Co-authored-by: Tim Hutt <timothy.hutt@codasip.com>
|