aboutsummaryrefslogtreecommitdiff
path: root/riscv
AgeCommit message (Collapse)AuthorFilesLines
2023-04-14Fix encoding conflict for fround.h and fcvt.bf16.sWeiwei Li1-0/+2
2023-04-14Add flh/fsh/fmv_h_x/fmv_x_h instructions to Zvfbfmin/Zvfbfwma extensionsWeiwei Li5-4/+6
2023-04-14Add support for new instructions of Zvfbfwma extensionWeiwei Li4-0/+69
2023-04-14Add support for new instructions of Zvfbfmin extensionWeiwei Li4-0/+37
2023-04-14Add support for new instructions of Zfbfmin extensionWeiwei Li4-2/+23
2023-04-14Update encoding.h to add instructions for BF16 extensionsWeiwei Li1-1/+19
2023-04-14Add isa string support for Zfbfmin/Zvfbfmin/ZvfbfwmaWeiwei Li2-0/+17
2023-04-12Add debug_defines.h to list of installed headersJerry Zhao1-0/+1
2023-04-11explicitly show D(-mode) instead of M(-mode) when in debug modeYenHaoChen1-0/+2
Debug mode (D-mode) can be considered an additional privilege mode. This commit proposes printing D(-mode) instead of M(-mode) for D-mode.
2023-04-04Merge pull request #1307 from Jakub-Palider/master-stats-alwaysAndrew Waterman1-3/+0
Print cache stats even when no access
2023-04-04Merge pull request #1306 from Jakub-Palider/master-override-cache-nameAndrew Waterman1-2/+4
Allow client to override default names of caches
2023-04-04Merge pull request #1305 from Jakub-Palider/master-cache-statsAndrew Waterman1-0/+4
Add cache statistics print on demand
2023-04-04Decrement icount trigger count on external interruptScott Johnson1-0/+1
Spec says: > This trigger matches on every instruction completed or trap > taken from a privilege mode where the trigger is enabled. Other (synchronous) traps were already correctly decrementing count, but external interrupts (i.e. timer interrupts) were not.
2023-04-04Don't waste time checking icount when unnecessaryScott Johnson1-1/+1
2023-04-04Initialize all fields of icount_tScott Johnson1-5/+5
According to table in debug spec. This has no visible effect, because every time we instantiate an icount_t (in triggers::module_t::tdata1_write) we immediately call tdata1_write() which sets these values, but it's cleaner this way.
2023-04-04Allow client to override default names of cachesJakub Palider1-2/+4
In multi-processor systems it is desired to track caches separately by assigning unique names to them. Signed-off-by: Jakub Palider <jpalider@marvell.com>
2023-04-04Print cache stats even when no accessJakub Palider1-3/+0
The cache stats are printed regardless on accesses they recorded. This allows better insight into system operation and provides consistent output for scripting. Signed-off-by: Jakub Palider <jpalider@marvell.com>
2023-04-04Add cache statistics print on demandJakub Palider1-0/+4
With this change it is not necessary to wait for tracer destructor to trigger statistics printout. Signed-off-by: Jakub Palider <jpalider@marvell.com>
2023-04-03Implement Zfa.Philipp Tomsich36-0/+468
This passes our developer test suite, when comparing output (signature) against the SAIL implementation. If any corner-cases require additional changes after ACT goes upstream, we can apply an add-on patch.
2023-04-03encoding.h: regeneratePhilipp Tomsich1-1/+157
2023-03-30Fix --bootargs default value in spike usage help() functionJulien Olivain2-2/+3
Commit 191634d285 changed the default kernel boot args from "console=hvc0 earlycon=sbi" to "console=ttyS0 earlycon", but didn't updated the spike usage help() function. This commit introduces a new macro DEFAULT_KERNEL_BOOTARGS in order to have a single definition. This macro is used everywhere in dts.cc and spike.cc help() function. Signed-off-by: Julien Olivain <ju.o@free.fr>
2023-03-29Stop unconditionally adding zicntr_zihpm to extensionsJerry Zhao1-4/+2
2023-03-29Support zihpm && !zicntrJerry Zhao1-2/+2
2023-03-29Set counteren_mask properly when !(zihpm && zicntr)Jerry Zhao1-1/+1
2023-03-27Add zicntr_zihpm to DEFAULT_ISAJerry Zhao1-2/+2
2023-03-23Add processor_t::is_waiting_for_interrupt accessorJerry Zhao1-0/+2
Signed-off-by: Jerry Zhao <jerryz123@berkeley.edu>
2023-03-23interactive: Improve ctrlc responsivenessJerry Zhao1-4/+7
* Move most ctrl-c logic to interactive() * 5f4cabc was only a partial fix. This change catches more corner cases where the ctrlc is registered Signed-off-by: Jerry Zhao <jerryz123@berkeley.edu>
2023-03-20Implement Smrnmi extensionAndrew Waterman9-3/+68
We don't model any sources of RNMI, so this is mostly vestigial.
2023-03-16Make MPRV logic consistent; factor it outAndrew Waterman2-2/+9
I believe the fact that mmu_t::refill_tlb was ignoring debug mode was benign, but certainly paying attention to debug mode is OK.
2023-03-16Update encoding.h for Smrnmi CSR and opcode definitionsAndrew Waterman1-40/+16
2023-03-16Fix the relationship between Zce and ZcfWeiwei Li1-1/+1
2023-03-09Use simif_t instead of sim_t for clint/plicScott Johnson3-8/+8
In keeping with the spirit of simif_t.
2023-03-09Switch debug_module to use simif_t instead of sim_tScott Johnson2-5/+6
In keeping with the spirit of simif_t.
2023-03-09Move debug_mmu used by debug_module up to simif_tScott Johnson2-2/+2
2023-03-09Move methods used by debug_module/clint/plic up to simif_tScott Johnson2-3/+11
So we can soon convert those classes to use simif_t instead of sim_t.
2023-03-08Add virtual/override to sim_t declarationsScott Johnson1-12/+12
To be explicit about which methods of simif_t and htif_t we implement.
2023-03-07Fix ctrl-c responsiveness when running-silent in interactive modeJerry Zhao1-1/+1
Break out of the interactive_run->interactive_run loop when ctrlc_pressed Signed-off-by: Jerry Zhao <jerryz123@berkeley.edu>
2023-03-06Merge pull request #1268 from riscv-software-src/more-plic-fixesAndrew Waterman4-21/+40
Don't issue misaligned or non-power-of-2 MMIO accesses
2023-03-04Don't issue misaligned or non-power-of-2 MMIO accessesScott Johnson2-7/+25
@aswaterman explains: Rather than requiring each MMIO device to support arbitrary sizes and alignments, decompose MMIO misaligned loads and stores in such a way as to guarantee their constituent parts are always aligned. (Specifically, they now always decompose to a sequence of one-byte accesses.) This is not a semantic change for main-memory accesses, but it is a semantic change for I/O devices. It makes them more realistic, in that most bus standards don't support non-power-of-2-sized accesses.
2023-03-03Fix misaligned accesses to clint's msip regsScott Johnson1-5/+7
Misaligned MMIO is unspecified but this is simple enough.
2023-03-03Improve plic_context_t initialization styleAndrew Waterman1-9/+8
2023-03-02Merge pull request #1251 from plctlab/plct-zc-update-v1.0.3Andrew Waterman5-14/+16
update support for Zc* to v1.0.3
2023-03-02Merge pull request #1267 from scottj97/clint-initialize-mtipAndrew Waterman1-0/+1
Initialize MTIP at reset
2023-03-02Merge pull request #1266 from riscv-software-src/fix-o0-compileAndrew Waterman1-0/+2
Define sim_t::INTERLEAVE so that it can be accessed by reference
2023-03-02Initialize MTIP at resetScott Johnson1-0/+1
Since mtime and mtimecmp both initialize to 0, and "a machine timer interrupt becomes pending whenever mtime contains a value greater than or equal to mtimecmp," MTIP should be 1. Before this change, MTIP would be 0 until the first increment, or until reading/writing from CLINT regs (since clint_t::load() and clint_t::store() call increment(0)).
2023-03-02Define sim_t::INTERLEAVE so that it can be accessed by referenceAndrew Waterman1-0/+2
std::min takes its arguments by reference, so the arguments need to be defined. An alternative would have been to force the problematic argument into being an rvalue (e.g., by adding 0), but this approach seems to me to be more robust. This fixes compilation under -O0; see https://github.com/riscv-software-src/riscv-isa-sim/pull/1264#issuecomment-1451114717 @scottj97 I posit that this situation is unusual enough that it shouldn't motivate us to test -O0 in CI.
2023-03-01Support discontiguous hart IDs in CLINTAndrew Waterman3-34/+51
This is a large delta because the old implementation baked in multiple assumptions about the contiguity of hart IDs. As a side effect, fix implementation for big-endian hosts.
2023-03-01Fix PLIC on big-endian hostsAndrew Waterman2-3/+26
2023-03-01Remove unnecessary conditional in plic_t::loadAndrew Waterman1-3/+1
It's safe to overwrite bytes when returning false.
2023-03-01Correctly instantiate PLIC contexts for mixed-hart targetsAndrew Waterman3-7/+11
This commit started as an attempt to make the PLIC tolerant of discontiguous hart IDs, but it turns out it was already most of the way there: PLIC contexts can still be dense even if the hart IDs are not. Nevertheless, I wanted to avoid passing the procs vector directly to the plic_t constructor. In removing it, I realized I could also get rid of the smode parameter by querying whether each hart has S-mode. This is also more correct; previously, we were instantiating the PLIC as though all harts had S-mode, regardless of whether they actually did.