Commit Graph

91 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
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
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
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
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
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
rsnikhil
0264984136 Numerous fixes, so now generating correct Tandem-Verification traces for all 229 ISA tests. 2020-02-14 15:37:20 -05:00
rsnikhil
8434df2dac Fixes for Tandem Verification for store-values, CSR values on traps, etc. (detail below)
src_Core/CPU/CsrFile.bsv
    Various fixes for WARL'd values of mstatus and sstatus, medeleg,
    Added tval field in Trap_Updates returned by csrf.trap

src_Core/Core/Trace_Data2.bsv
    Added fields for store_data and store_data_BE

src_Core/Core/Trace_Data2_to_Trace_Data.bsv
    Added treatment of store_data and store_data_BE
    Fixed bug in next_pc for mkTrace_RET

src_Core/RISCY_OOO/procs/RV64G_OOO/CommitStage.bsv
    Fixed Trace_Data2 struct to TV for pc in case of xRET, and tval in case of trap

src_Core/RISCY_OOO/procs/RV64G_OOO/MemExePipeline.bsv
    Added store_data and store_data_BE in calls to rob_setExecuted_doFinishMem

src_Core/RISCY_OOO/procs/lib/ReorderBuffer.bsv
    Added store_data and store_data_BE in methods rob_setExecuted_doFinishMem
2020-02-12 19:43:04 -05:00
rsnikhil
82e56c2908 Fixed Tandem Verif trace gen for CSRRx on WARL regs: report post-WARL-xformed write-data 2020-02-11 15:46:24 -05:00
rsnikhil
db114186af More progress towards Tandem Verification trace generation (detail below)
Now handling all Alu and Fpu pipeline outputs, traps and xRets.
Still todo:
 (1) Mem pipeline outputs (Ld, Lr/Sc, Amo outputs to dest reg)
 (2) For CSRRx, currently reporting WARL pre-write updates; needs to be WARL'd update.
2020-02-10 15:08:08 -05:00
rsnikhil
c0ae2776e8 Further additions to Tandem Verification trace info.
Rd value (destination register) of Integer ops supported
Trap updates (priv and CSR updates) supported.
Still pending: Memory ops Rd value, Fpu Rd value
2020-02-07 23:10:53 -05:00
rsnikhil
af0b1ef415 Incremental additions to Tandem Verification trace gen 2020-02-06 20:46:26 -05:00
rsnikhil
c14c9b3e6c Minor tweaks, mostly cosmetic and $displays 2020-02-06 14:18:16 -05:00