aboutsummaryrefslogtreecommitdiff
path: root/fesvr
AgeCommit message (Collapse)AuthorFilesLines
2026-04-15refactor: remove excessive chunk_max_size callsAlexander Romanov2-4/+5
These calls are virtual and cause notable overhead
2026-03-22make the executable path relative from spikeHiroo HAYASHI1-2/+26
If the relative path cannot be found, use the current PREFIX. Signed-off-by: Hiroo HAYASHI <24754036+hirooih@users.noreply.github.com>
2026-02-09Modify in_bits to check in_valid before accessingAbraham Gonzalez1-1/+1
Signed-off-by: Abraham Gonzalez <abe.j.gonza@gmail.com>
2025-11-10Don't hang when invoked as background processAndrew Waterman1-2/+37
It's (normally) only reasonable to launch Spike as a background process when it's used in a mode that does not need stdin. But we should support those use cases without hanging. Fix the hang by catching SIGTTOU. For obvious reasons, `spike -d` will still hang waiting for input until it's in the foreground. Fixes #2133
2025-04-16Fix the remaining few warnings that Clang catchesAndrew Waterman1-3/+1
2025-04-16Fix missing initializers (-Wextra)Andrew Waterman1-4/+8
2025-04-16Remove VLAs in htif/memif (-Wvla)Andrew Waterman2-19/+18
I don't think these are actually performance-critical, but if they prove to be, there are obvious optimizations.
2025-04-16Remove VLAs in DTM (-Wvla)Andrew Waterman2-17/+13
2025-04-16Fix overflow warning (-Woverflow)Andrew Waterman1-1/+1
2025-04-16Explicitly annotate use of GNU extension (-Wpedantic)Andrew Waterman1-2/+2
2025-04-16Remove non-ISO compound literals (-Wpedantic)Andrew Waterman1-3/+6
2025-04-16Remove zero-sized arrays (-Werror)Andrew Waterman1-2/+2
2025-02-25Don't send reset from HTIF, if no binary is givenFriedrich Hunstock1-2/+1
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.
2025-02-25Load symbols even when no binary is givenFriedrich Hunstock2-20/+31
2025-02-22allow to set tohost/from host via --symbol-elfTilmann Bartsch1-7/+7
2025-02-07Add instruction limitTim Hutt3-8/+24
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.
2024-10-02fix typosYang Hau1-1/+1
2024-07-16Obtain definition of reg_t in elfloader.hAndrew Waterman1-0/+1
2024-07-16Avoid dependence on config.h in byteorder.hAndrew Waterman1-12/+6
The runtime check will compile out.
2024-05-29add support to load ET_DYN elfClément Léger6-14/+25
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>
2024-03-22Implement syscall readlinkatMing-Yi Lai2-0/+15
2023-11-09fesvr/htif: allow exit on SIGINT.Volodymyr Fialko1-1/+1
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>
2023-10-09Update dtm.h with switch_to_* functionsAbraham Gonzalez1-0/+10
Signed-off-by: Abraham Gonzalez <abe.j.gonza@gmail.com>
2023-08-16Include cerrno in fesvr/elfloader.ccMark Lai1-0/+1
It caused compile error "use of undeclared identifier 'errno'" at line 26 and 33. I Add #include <cerrno> in fesvr/elfloader.cc to fix error and compile successfully.
2023-06-19fesvr: support int128_t/uint128_tGianluca Guida1-0/+7
Also remove now duplicate definition for types.
2023-05-19Add Spike's meta files for pkg-configWojciech Bartczak1-0/+2
This commit adds the *.pc files for Spike's simulation library, enabling dynamic and static linking without the need to directly reference Spike sources. Using Spike as a stand-alone library provides an interesting option for developing tools and applications based on Spike.
2023-04-20Close file descriptors in destructor of syscall_tYinan Xu2-3/+12
2023-04-12Make some dtm_t interfaces protectedJerry Zhao1-8/+10
* This enables useful functionality in inheritors
2023-04-12Unify fesvr/debug_defines.h and riscv/debug_defines.hJerry Zhao2-1478/+60
* fesvr/debug_defines.h is removed
2023-03-15fesvr: fix compilation with gcc 13Julien Olivain1-0/+1
Compiling spike with gcc 13 (for example, included in Fedora 38 prerelease) fails with error: In file included from fesvr/syscall.h:6, from fesvr/syscall.cc:4: fesvr/device.h:15:30: error: ‘uint64_t’ was not declared in this scope 15 | typedef std::function<void(uint64_t)> callback_t; | ^~~~~~~~ This is due to a gcc header dependency change. See for reference: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes This commit explicitly adds the missing <cstdint> header inclusion to fix this build failure. Signed-off-by: Julien Olivain <ju.o@free.fr>
2023-03-07fesvr: Add --symbol-elf flag to populate htif-t::symbol_elfsJerry Zhao2-0/+10
2023-03-07fesvr: Add symbol_elfs field to htif_tJerry Zhao2-0/+17
When populated, symbol_elfs are additional elf files that populate the addr2symbol map in htif
2023-03-07fesvr: Fix brace style in htif_t::load_programJerry Zhao1-11/+9
2023-03-07fesvr: fix +signature-granularity opt parsing to be required_argJerry Zhao1-1/+1
2023-03-07fesvr: Add +target-argument= flag to htif parsingJerry Zhao2-0/+8
2023-03-07fesvr: Fix spacing in parse_argumentsJerry Zhao1-4/+3
2023-03-07fesvr: target_args() should return a constJerry Zhao1-1/+1
2023-03-07make target_args() protected instead of private to allow subclasses to ↵Sagar Karandikar1-2/+1
inject args
2023-02-24fesvr: elfloader: replace asserts after open and mmap by exceptionsViktor Prutyanov1-2/+4
Asserts (especially without a message) aren't human readable way of error reporting. So, replace them by exceptions with messages with errno string.
2023-02-02Make htif->get_to/fromhost_addr methods publicJerry Zhao1-3/+3
2023-01-17Add htif_t tohost/fromhost accessorsJerry Zhao1-0/+3
Signed-off-by: Jerry Zhao <jerryz123@berkeley.edu>
2023-01-16Add more hint when searched path is wrong gr816ox1-0/+6
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>
2022-12-22Remove non-installed header lists from Makefile fragmentsAndrew Waterman1-3/+1
It's just dead code. (Dependences on headers are auto-generated as `.d` files.)
2022-12-15Use relative include paths to support public usage of these headersJerry Zhao1-1/+1
2022-12-15Add config.h includes directly to source files instead of relying on header ↵Jerry Zhao3-0/+3
chaining This step is to ensure that removing config.h out of headers will not cause regressions.
2022-12-15Rename memif_endianness_t to endianness_tJerry Zhao3-11/+11
2022-12-15Pull memif_endianness_t into cfg.hJerry Zhao2-8/+1
2022-10-25Remove set_target_endianness | add --big-endian flagJerry Zhao2-7/+6
Set target endianess in constructors
2022-10-25Remove memif_endianness_undecided, change default to little-endianJerry Zhao1-2/+1
2022-10-04Fixed -Wnon-virtual-dtor warningsJerin Joy1-0/+2
Signed-off-by: Jerin Joy <joy@rivosinc.com>