aboutsummaryrefslogtreecommitdiff
path: root/riscv/processor.h
AgeCommit message (Collapse)AuthorFilesLines
2019-11-11rvv: refine vsetvl[i] logicChih-Min Chao1-1/+1
1. fix the ELAN check for vill 2. handle 'rs1 = x0' 3. make logic more readable Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
2019-10-28Implement support for big-endian hostsMarcus Comstedt1-0/+5
2019-09-27Fixed match trigger MATCH_NAPOT case. (#335)fborisovskii1-1/+1
Mask calculation was not in consistency with debug spec. Watch debug spec. 5.2.7 match field overview and debug spec. B.9 fourth example. Mask should not cover LSB zero bit. Also there is a way to make it simplier: reg_t mask = ~(((~state.tdata2[i]) - 1) ^ ~state.tdata2[i]);
2019-09-18Extends the commit log feature with memory writes. (#324)dave-estes-syzexion1-0/+8
* Extends the commit log feature with memory writes. This provides a little more information for debugging instruction traces, allowing you to maintain the state of memory as the trace is processed. The following sample trace output illustrates the formatting of the new memory writes. The first line is an instruction at location 0x80000094, containing the bytes (0x80830313) and commiting the value 0x80000898 to the register x6. The second line is an instruction which neither commits a register nor writes memory. The third line writes the value 0x0 to 0x80000890. 3 0x80000094 (0x80830313) x 6 0x80000898 3 0x80000098 (0x0062d663) 3 0x8000009c (0x00028023) mem 0x80000890 0x0 * Changes addressing feedback from review.
2019-09-18Adds --log-commits commandline option. (#323)dave-estes-syzexion1-0/+3
* Adds --log-commits commandline option. Similar to histogram support, the commit logging feature must be enabled with a configure option: --enable-commitlog. However, unlike that feature, there was no way to turn off the logging with a commandline option once the functionality was built in. This (git) commit provides that abilty. * Changes addressing review feedback.
2019-07-16Writing non-existent CSRs, access FPRs with mstatus.FS=0 (#311)Tim Newsome1-1/+1
* Don't corrupt s0 when abstract CSR write fails. * Support abstract FPR access then mstatus.FS=0 Discussion on the spec list leans towards this being a requirement. Certainly users want their debugger to be able to access all registers regardless of target state.
2019-07-12Add debug_mode state bit, rather than overloading dcsr.causeAndrew Waterman1-2/+4
In the previous scheme, debug-mode software could exit debug mode by zeroing the dcsr.cause field. While benign, that behavior is out of spec.
2019-06-14rvv: add varch option parser and initialize vector unitChih-Min Chao1-1/+3
the default vector parameters are defined in configuration time but can be changed throught command-line option Signed-off-by: Dave Wen <dave.wen@sifive.com>
2019-06-14rvv: add vector unit structureChih-Min Chao1-0/+118
Signed-off-by: Bruce Hoult <bruce@hoult.org> Signed-off-by: Dave Wen <dave.wen@sifive.com>
2018-09-25Add PMP supportAndrew Waterman1-0/+4
2018-07-10Refactor and fix LR/SC implementation (#217)Andrew Waterman1-3/+0
- Use physical addresses to avoid homonym ambiguity (closes #215) - Yield reservation on store-conditional (https://github.com/riscv/riscv-isa-manual/commit/03a5e722fc0fe7b94dd0a49f550ff7b41a63f612) - Don't yield reservation on exceptions (it's no longer required).
2018-03-21Implement Hauser misa.C misalignment proposal (#187)Andrew Waterman1-1/+4
See https://github.com/riscv/riscv-isa-manual/commit/0472bcdd166f45712492829a250e228bb45fa5e7 - Reads of xEPC[1] are masked when RVC is disabled - Writes to MISA are suppressed if they would cause a misaligned fetch - Misaligned PCs no longer need to be checked upon fetch
2018-03-14Fix a bug caused by moving misa into state_t. (#180)Prashanth Mundkur1-1/+1
* Fix misa losing its value in processor constructor due to state:reset() following state.misa initialization. Make state:reset() preserve misa. * Set state.misa to max_isa on reset(). * Idiomatic fix for earlier commit.
2018-03-13Move processor.isa to state.misa, since it really belongs there.Prashanth Mundkur1-2/+2
2018-03-06Narrow the interface used by the processors and memory to the top-level ↵Prashanth Mundkur1-4/+5
simulator/htif. This allows the implementation of an alternative top-level simulator class.
2018-03-06Fix install of a missed header from debug_rom.Prashanth Mundkur1-1/+1
The installed header files from the riscv subproject were incomplete, since processor.h includes debug_rom_defines.h, and the latter was not installed. Fix by moving it into riscv/, add it to the riscv subproject header list, which ensures it will get installed. While here, also add a missed dependency of debug_rom on riscv/encoding.h to debug_rom/Makefile.
2018-03-03Implement clearing-misa.C-while-PC-is-misaligned proposalAndrew Waterman1-0/+5
See https://github.com/riscv/riscv-isa-manual/pull/139 Not adopted yet, but I'm putting the implementation here for reference.
2017-11-27Rename badaddr to tvalAndrew Waterman1-2/+2
2017-11-27Rename sptbr to satpAndrew Waterman1-1/+1
2017-11-09H-mode no longer existsAndrew Waterman1-1/+0
It's supplanted by the hypervisor extension, which doesn't use the privilege encoding of 2; it still looks like supervisor (i.e. 1).
2017-11-09MPP is now WARLAndrew Waterman1-0/+1
2017-10-20Fix commit-log for Q extension, and for RV32 (#143)Andrew Waterman1-1/+9
* Fix commit-log for Q extension, and for RV32 The number of nibbles printed out now depends upon XLEN or FLEN, as appropriate. * Factor out FLEN calculation
2017-09-21Fix corner case in repeated execution (#127)Tim Newsome1-0/+3
Specifically, don't print out the execution count if the same instruction is executed by different harts.
2017-08-07Fix multicore debug.Tim Newsome1-6/+0
In an older implementation I was thinking of having different entry points for different harts, but that's no longer true. Also get rid of a bunch of trailing whitespace.
2017-04-18debug: Checkpoint which somewhat works with OpenOCD v13, but still has some ↵Megan Wachs1-0/+1
bugs.
2017-04-17debug: Move things around, but addresses now conflict with ROM.Megan Wachs1-0/+1
2017-04-17Merge remote-tracking branch 'origin/priv-1.10' into HEADMegan Wachs1-6/+5
2017-03-22riscv: replace rtc device with a real clint implementationWesley W. Terpstra1-1/+1
2017-02-25New counter enable schemeAndrew Waterman1-2/+2
https://github.com/riscv/riscv-isa-manual/issues/10
2017-02-10Entering debug mode now jumps to "dynamic rom"Tim Newsome1-0/+6
2017-02-10Implement hartstatus field.Tim Newsome1-0/+1
2017-02-02Fix interrupt delegation for coprocessorsAndrew Waterman1-3/+2
2016-09-09allow MAFDC bits in MISA to be modifiedAndrew Waterman1-0/+1
2016-09-02Merge branch 'master' into triggerTim Newsome1-2/+2
Conflicts: riscv/encoding.h riscv/processor.cc
2016-08-31Rename tdata[0-2] to tdata[1-3].Tim Newsome1-12/+14
Add timing bit (but it doesn't do anything). Implement dmode bit.
2016-08-29Rename tdata0--tdata2 to tdata1--tdata3.Tim Newsome1-0/+1
2016-08-26Add (degenerate) performance counter facilityAndrew Waterman1-2/+2
2016-08-25partially update spike to newer debug specAndrew Waterman1-25/+16
2016-08-25Fix spike interactive (-d) modeAndrew Waterman1-3/+2
2016-08-22Implement address and data triggers.Tim Newsome1-1/+151
So far I only have testcases for instruction and data address. Not implemented is the mechanism that lets the debugger prevent a user program from using triggers at all. I'll be adding that soonish. The critical path is unchanged, but my experimenting shows the simulation is slowed down about 8% by this code. Reducing the size of trigger_match() (which is never called during my benchmark) fixes that, but making it not be inlined has no effect. I suspect the slowdown comes from cache alignment or something similar, and on a different CPU or after more code changes the speed will come back.
2016-08-17Allow mstatus.MPP to store bad values; instead, validate on MRETAndrew Waterman1-1/+0
Either approach is legal, but this more closely matches Rocket.
2016-07-28Add support for virtual priv register. (#59)Tim Newsome1-0/+1
Users can use this register to inspect and change the privilege level of the core. It doesn't make any assumptions about the actual underlying debug mechanism (as opposed to having the user change DCSR directly, which may not exist in all debug implementations).
2016-06-29Disassemble RVC instructions based on XLENAndrew Waterman1-0/+1
The interpretation of RVC opcodes depends on XLEN, and the disassembler always assumed RV32. h/t Michael Clark
2016-06-22Remove legacy HTIF; implement HTIF directlyAndrew Waterman1-3/+1
2016-06-22Fix paddr_bits computation prior to VM setupAndrew Waterman1-0/+1
2016-05-23Make -H halt the core right out of reset.Tim Newsome1-1/+2
Added a test, too.
2016-05-23Single step appears to work.Tim Newsome1-0/+8
2016-05-23processor_t unfriends gdbserver_t.Tim Newsome1-3/+3
2016-05-23Add debug_module bus device.Tim Newsome1-2/+0
This should replace the ROM hack I implemented earlier, but for now both exist together. Back to the point where gdb connects, core jumps to ROM->RAM->ROM.
2016-05-23When gdb connects, jump to Debug ROM and segfault.Tim Newsome1-9/+1