| Age | Commit message (Collapse) | Author | Files | Lines |
|
LR/SC. (#1675)
This enables configuration of the Sail model to match the behavior of
implementations such as Spike.
|
|
The previous heuristic did not suffice for a few ACT4 tests where the
trap count grew slowly but steadily over the xret count.
Adjust by introducing an instruction retired callback and resetting the
loop detector when a sufficient number of instructions have retired
since the last trap.
This still catches tight trap loops but allows the above tests to
complete successfully.
---------
Co-authored-by: Alex Richardson <alexrichardson@google.com>
|
|
This helps in automated tested environments where an infinite loop
caused by a failing test can cause issues.
An `xret_callback` is used in combination with the existing
`trap_callback` to detect trap loops. The `trap_callback` is now called
after the state changes due to the trap are visible.
|
|
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.
|
|
With a thrown Sail exception, the log now terminates with something
like:
```
[119] [M]: 0x000000008000200E (0x10A29073) csrrw x0, senvcfg, x5 main+14
Fatal reserved behavior: xenvcfg.CBIE = 0b10
Exiting due to uncaught exception: prelude/errors.sail:28.2-28.41
```
where previously it would only show
```
[119] [M]: 0x000000008000200E (0x10A29073) csrrw x0, senvcfg, x5 main+14
Exiting due to uncaught exception: prelude/errors.sail:28.2-28.41
```
This fixes #1553.
|
|
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.
|
|
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>
|