This applies when the binary is set to "none".
This is useful when implementing a binary loading
mechanism outside of the HTIF, and the bootloader
is supposed to boot from that.
Adds an optional --instructions=N CLI argument which will stop the simulation after N instructions.
This is useful for benchmarking and profiling and sometimes debugging.
When compiled as PIE, executable can be loaded at any memory address.
Lately, OpenSBI switched to such behavior and spike was not able to load
it anymore. This patch add an additional load_offset parameter for
load_elf(). This load_offset value is passed as DRAM_BASE and used only
for ET_DYN elfs.
Signed-off-by: Clément Léger <cleger@rivosinc.com>
Currently signal handler would call exit() only on second received
signal, this prevent proper program cleanup.
Instead use signal flag to exit loop.
Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Delete the old branch and pull a new one, because of a wrong force push. Git is not as easy as I think.
Signed-off-by: gr816ox <50945677+gr816ox@users.noreply.github.com>
This replaces multiple uses of `std::vector::operator[]` where the
parameter is a constant `0` with the use of C++11's `std::vector::data`
method. This fixes the root cause of invalid memory accesses.
`std::vector::operator[]` is an unchecked memory access, and when the
buffers are zero-sized (that is the buffer container is empty) either
due to a 0 padding in the case of elfloader or NULL parameters to
syscalls where permitted, the unchecked access may cause an invalid
memory access. The use of `std::vector::data` is permitted even in such
a case, though the returned memory may not be dereferenced. The general
usage of the returned pointer is to pass to `memif_t`, which is careful
about 0-sized buffer accesses, and so passing the result of
`std::vector::data` is safe. This is theoretically a better access
pattern as it also avoids having the compiler to re-materialize the
pointer from the de-referenced location.
* reduce sig_len constraint to 4 bytes
Spike currently asserts that the signature length should always be a multiple of 16-bytes. However, the compliance suite has agreed to upon the signature being a multiple ot 4-bytes. This prevents some of the tests to run on spike since it fails the assertion.
The proposed change fixes this issue and reduces the assertion to 4 bytes.
* Added size argument to htif arguments and zero padding for signature output. Defaultline size-16.
* Modified type of line_size to unsigned.
* Renamed size to granularity.
* Rename granularity to signature-granularity.
Co-authored-by: dracarys99 <spawan1999@gmail.com>
* Adding symbol lookup when --enable-commitlog is enabled
* Removed the #ifdef RISCV_ENABLE_COMMITLOG for all get_symbol related function
Only retained the in processor.cc where it is called.
Co-authored-by: Shajid Thiruvathodi <sthiruva@valtrix.in>
Firmware implementations, such as OpenSBI's fw_jump, make use of this
feature on other targets to avoid having to be rebuilt every time the
payload is updated.