Commit Graph

110 Commits

Author SHA1 Message Date
Peter Rugg
72dc8f8bad Fix cap instructions not being sent to ALU 2020-04-07 19:55:09 +01:00
jon
56885f06c0 Changes for CJALR-only TestRIG to work.
This includes replacing register read values with nullCap if reading x0, which is generally necessary.
This is more-or-less using a new mechanism which shouldn't actually be necessary if the default value in the register file is nullCap.
(In RVFI_DII, we initialise with the almightyCap instead.)
2020-04-07 16:32:31 +01:00
jon
2918854bbc Add missing ifdef. 2020-04-07 12:37:14 +01:00
jon
850e632140 Changes for CJALR to work in a basic case, as well as piping CHERI exceptions through to commit, though the register isn't piped and I've undone some useful work for that piping. Oh well. 2020-04-06 18:18:05 +01:00
Peter Rugg
4ce8f54903 Add initial exception checks 2020-04-06 12:26:19 +01:00
jon
1ecdf73dd3 Make CJALR work like JALR but without an immediate. Seems to work!
Obviously doesn't throw capability exceptions yet...
2020-04-03 17:57:57 +01:00
jon
d07d6f4761 Add OpCHERI to the function that rationalises opcodes. 2020-04-03 16:42:14 +01:00
Peter Rugg
f20c644bae Add startings of decoding 2020-04-02 21:08:59 +01:00
jon
2c6ad40f93 Check the already decoded destination to decide to populate the register write data field in RVFI. 2020-04-02 17:10:52 +01:00
jon
b656f46859 Both enable tracing of floating-point register writes in RVFI-DII, and then properly not use them (since we're not expected to).
This is better than using nonsense as we were previously doing on floating point instructions.
2020-04-02 16:28:18 +01:00
jon
7618c5cec8 Trap on access of fcsr when floating point is not enabled. 2020-04-02 13:05:42 +01:00
jon
4714070aef Trace the next PC correctly for mret. 2020-04-01 18:43:48 +01:00
Jonathan Woodruff
81da99237e Move the register file to CapReg format, and pipe CapPipe around the pipeline. 2020-03-31 15:44:23 +01:00
Jonathan Woodruff
480b5923da Make type of register file generic. 2020-03-30 15:20:28 +01:00
Jonathan Woodruff
db41e2b9ed An initial implementation of mccsr. 2020-03-27 17:47:02 +00:00
Alexandre Joannou
b5b2b4fe5c Port AXI4 changes from Flute 2020-03-27 16:45:26 +00:00
Jonathan Woodruff
ded8dc72e7 Do the MTCC->PCC->MEPCC shuffle on trap. 2020-03-27 15:55:02 +00:00
Jonathan Woodruff
c035f359e8 Merge branch 'CHERI' into pdr32-tmp
and get it to build!
2020-03-26 18:03:58 +00:00
Peter Rugg
5f33b1c87a Very initial decode and ALU work for CHERI 2020-03-26 14:35:02 +00:00
Jonathan Woodruff
d5b73a2d50 Add DDC exception.
Also enable working exception reporting for the memory pipe.
2020-03-26 14:29:06 +00:00
Jonathan Woodruff
f2f2285f75 Check the bounds on PCC and report the correct exception in Xcause registers.
This required makeing the Exception type wider by one.
The actual "inBounds" check is currently implemented in the reorder buffer rows, which duplicates the logic ~80 times (number of outstanding instructions), which isn't ideal, but it's using the quick in-bounds check that only compares the mantissa-sized things.
2020-03-25 15:20:03 +00:00
Jonathan Woodruff
88ca03f4ed Pipe through an exception to the Reorder buffer from each execute pipe.
Also move to SetAddrUnsafe, as is traditional for setting the address of PCC where we do proper checks on branches so we really only have the possibility of executing off the end of the length, and therefore cannot become unrepresentable.
2020-03-25 11:51:33 +00:00
Jonathan Woodruff
c813abe9c9 Write pcc bounds into reorderbuffer pc in the all execute pipeline stages.
This allows pcc bounds to be consistent in the model of CSRs (written in commit and read in execute) in preparation for fancier forwarding eventually.
2020-03-25 09:10:38 +00:00
Jonathan Woodruff
22938d2384 Propagate a CapPipe through the PC of each instruction record. 2020-03-23 17:24:05 +00:00
Jonathan Woodruff
2aa902f61a Change tabs to 8 spaces, this time being careful to do this only in BSV files. 2020-03-23 14:44:39 +00:00
Jonathan Woodruff
a6e5a7bff0 Revert "Fix whitespace in src_Core directory."
This reverts commit a137a6ede7.
2020-03-23 14:40:02 +00:00
Jonathan Woodruff
a137a6ede7 Fix whitespace in src_Core directory.
Replace all tabs with 8 spaces.
2020-03-23 14:28:00 +00:00
Jonathan Woodruff
43fa43e2c9 Implement writes to PCC and preparation for checking the bounds of PCC. 2020-03-23 14:24:44 +00:00
Jonathan Woodruff
a299a763ed Add a special capability register file and pass it's interfaces to all the places that the current CSR file goes.
We may need to trim some of these later, but most of them seem like places that we'll need access.
2020-03-23 10:10:11 +00:00
Jonathan Woodruff
c97ee15851 A couple initial files with beginnings of CHERI support. 2020-03-20 15:34:18 +00:00
Jonathan Woodruff
d77c158b76 Merge branch 'mac_build' into RVFI_DII 2020-03-20 11:35:11 +00:00
Jonathan Woodruff
b830f4bf41 Resolve some issues to build on mac.
This includes renaming Fifo.bsv to Fifos.bsv to account for a case insensitive file system which confuses this library with FIFO.bsv.
Also this includes an update of the verilator flags that are needed for modern verilator.
Finally, some verilator flag changes for building with LLVM.
2020-03-19 19:21:59 +00:00
Jonathan Woodruff
3a79b022ea Merge branch 'master' into RVFI_DII, a complex merge for the fetch stage! 2020-03-18 11:35:59 +00:00
Jonathan Woodruff
1246aae7f8 Commented back in necessary PC update. 2020-03-13 13:11:07 +00:00
rsnikhil
c278e4fe68 Fixed a bug, and a related Tandem-Verification bug, re. CSR MIP MEIP/MTIP/MSIP.
Two of these were not properly restricted as read-only from CSRRX instructions,
and there was a bug in the WARL function for writing MIP,
and there was a bug in the TV-reporting of MIP updates.
2020-03-12 21:44:00 -04:00
Jonathan Woodruff
264f99f06b Track the next PC accurately. 2020-03-12 18:17:45 +00:00
Jonathan Woodruff
79935d848f Reduce "verbosity". 2020-03-12 10:47:07 +00:00
Jonathan Woodruff
41fd6b2b60 Updated conditions to print the destination register and value correctly for various instruction types. 2020-03-12 10:46:00 +00:00
rsnikhil
f02e9af515 Improved avoidance of initial timer interrupt in MMIOPlatform; removed spurios MSTATUS TV report on CSRRS/C with rs1==0 2020-03-11 22:42:18 -04:00
Jonathan Woodruff
3eccf92544 Move to 8 MiB RVFI-DII memory. 2020-03-11 11:53:19 +00:00
rsnikhil
a19eb97f34 Small tweak to MMIOPlatform.bsv to avoid spurious timer interrupt at start of time. 2020-03-09 22:58:04 -04:00
rsnikhil
b00f1d2eec Fixed a Tandem Verification trace generation bug for FMV.X.F and FMV.X.D
We were reporting the incremental value of fflags (=0)
instead of the final value of fflags (same as pre-value, which may not be 0).
2020-03-09 14:47:20 -04:00
rsnikhil
976494a8ff Fixed Tandem-Verification trace generation issue re. MSTATUS on CSRRx instructions that write to FCSR.
When a CSRRx instruction writes to FCSR/FFLAGS/FRM, the CPU also
changes MSTATUS.FS and, by implication, MSTATUS.SD because the
floating point state has become "dirty".  Tandem Verification
trace-generation was not reporting this update.
2020-03-08 21:29:30 -04:00
rsnikhil
fafd99c983 Fixes reported by Joe Stoy: PLIC, MMIO_AXI4_Adapter and Core.bsv (details below)
PLIC: updated to latest version from Piccolo/Flute.

MMIO_AXI4_Adapter: added workaround for Xilinx IP problem on 64-bit
    AXI4 fabrics. Writes that specify 8-byte size, but only write in
    upper or lower word using strobes, are converted into 4-byte size.

Core.bsv: added a notification to the Debug Module re. CPU halt.
2020-03-08 15:39:57 -04:00
rsnikhil
4bdbcbfd88 Additional fix to previous commit (75df204e) which only fixed MIP/MIE; this fixes SIP/SIE as well. 2020-03-04 13:14:31 -05:00
rsnikhil
75df204e31 Fixed a Tandem-Verification bug (reporting incorrect MIP/MIE/SIP/SIE post-write values)
MIP/MIE/SIP/SIE fields are WARL (Write-Any/Read-Legal). The CSR
register forces the user-privilege bits ([8,4,0]) to 0 since riscy-ooo
does not support user-level interrupts.  However, function
Csrfile.fv_warl_xform() was not mirroring this correctly.
2020-03-04 09:50:39 -05:00
rsnikhil
40b55d2c32 Fixed a Tandem-Verification issue (report MIP change due to interrupts).
CSR MIP can change due to external/timer interrupts.  These non-instruction-related
changes were not being reported to the Tandem Verifier.
2020-03-03 18:34:00 -05:00
rsnikhil
ac6043ce2d Fixed two bugs: (1) not trapping on unimplemented CSRs (2) MSTATUS.FS initialization
(1) riscy-ooo was mapping all unimplemented CSRs to a benign, user-privilege read-write CSR
    Instead, we now catch this RenameStage and steer it to a trap.
(2) MSTATUS.FS was initialized to 2'b00 (absent/off); should be 2'b01 (present and initial)
2020-03-03 13:56:31 -05:00
rsnikhil
e02dac1449 In CsrFile.bsv, changed user-privilege bits in MIP/SIP/MIE/SIE to read-only 0 since MISA.N=0 2020-03-02 16:20:07 -05:00
rsnikhil
96a0897bf5 In MMIO_AXI4_Adapter.bsv, added check for unmapped addresses, provide err response immediately.
Previously, the request went out into the fabric, and we were relying
on the fabric returning an error response.  Some fabrics don't do this
reliably, so this removes that reliance on the fabric.
2020-02-28 14:07:45 -05:00