Commit Graph

44 Commits

Author SHA1 Message Date
Alexandre Joannou
4c19a34eda Workaround for scheduling issues when using PERFORMANCE_MONITORING (with jdw57) 2021-02-15 18:07:08 +00:00
jon
9e36ff95cd Roll back accidental commit of experimental change. 2021-02-11 12:22:00 +00:00
jon
40ea082310 Some updates to build with the new bsc compiler. 2021-02-10 17:22:26 +00:00
jon
4fcc18635a Supporting most architectural counters, wiring them out from
CommitStage.
Also support multiple events per cycle.
2020-12-02 15:28:41 +00:00
jon
e99e1e6274 Update CSR names to fullish standard names. 2020-12-02 10:18:25 +00:00
jon
259d34618c A design that actually passes one performance monitor trace from
TestRig.  The example counted redirections, which happend to match
between Flute and Toooba for this example.
2020-12-01 18:02:11 +00:00
Jessica Clarke
7eff218288 Replace enums-for-constants with structs wrapping a plain Bit#(n)
BSC does not play nicely with enums whose labels do not start at 0 and
increase linearly. Instead, in such cases, it generates a whole bunch of
conditions to "legalise" any read values, which causes an explosion of
logic in places like the ROB. Thus, use this ugly (but still typed)
alternative that, other than naming conventions enforced by BSC, looks
almost the same as an enum.
2020-07-15 03:16:24 +01:00
Peter Rugg
c406d357c9 Add CHERI+RVFI_DII grant codes and copyrights 2020-07-06 17:39:25 +01:00
Jessica Clarke
1173cbb2c6 CsrFile.bsv: Actually respect CHERI fault delegation
Also remove a dangerous default case item that masked this bug. It's
completely unnecessary upstream too and a bad idea.
2020-07-02 02:44:09 +01:00
Peter Rugg
20e940eb66 Allow delegation of CHERI traps 2020-07-01 16:07:08 +01:00
Peter Rugg
c8e4a64128 Add sentries 2020-06-29 23:29:08 +01:00
Peter Rugg
70185dabac Allow debug access to SCR offsets 2020-06-29 23:27:23 +01:00
Peter Rugg
0e7df46dce Allow read/write of dpc 2020-06-17 11:42:58 +01:00
Peter Rugg
962ade1092 Fixes for synthesis 2020-06-05 17:40:28 +01:00
Peter Rugg
4b4b5836e8 Populate tval with CHERI trap information 2020-05-29 13:27:23 +01:00
Peter Rugg
461ca6a703 Merge branch 'CHERI' into pdr32-wip 2020-05-11 14:08:42 +01:00
Peter Rugg
27947f4df7 Refactoring around SCRs 2020-05-07 16:19:26 +01:00
jon
d3e0908785 Check PCC bounds in rename. 2020-04-28 19:08:07 +01:00
jon
5693af05e5 Changes to make PCC consistent.
Specifically, attach the bounds to PC all the way back into the branch predictors.
2020-04-27 15:13:36 +01:00
Jonathan Woodruff
db41e2b9ed An initial implementation of mccsr. 2020-03-27 17:47:02 +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
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
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
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
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
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
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
83829590dd Fixed up logic for "Non-Debug-Module reset" request/response from the Debug Module
Now able to run multiple ISA tests in a single simulation run
connected to remote debugger DSharp, using either hart_reset or
ndm_reset between tests to bring the system back into reset state.
All Debug Module commands working:
 - dm_reset, hart_reset, ndm_reset
 - break    (set breakpoint)
 - step
 - continue (until breakpoint of 'halt' command)
 - halt
 - read/write GPR, FPR, CSR, memory
 - elf_load
2020-02-04 16:02:53 -05:00
rsnikhil
4960a59da0 Fixes for GDB control: can run consecutive tests in single simulation, without intermediate reset.
After a test, GDB can write DCSR to restore to Machine privilege,
write to PC (DPC) to restore boot value,
write MSTATUS to restore to initial value,
then can load and run next test.
2020-01-30 22:46:51 -05:00
rsnikhil
27c3c7cb4d Work in progress on Debug Module integration. Got further on start/step/halt 2020-01-12 22:25:14 -05:00
rsnikhil
cd779e1cbe Work in progress: updates to handle stop/step/run from Debug Module 2020-01-08 20:17:50 -05:00
rsnikhil
5d69e3b178 Fixes so it now passes ISA test rv64uc-v-rvc ('C' extension, virtual mem). Details below.
Modified:
    src_Core/CPU/CsrFile.bsv
        Modified method 'trap' to use 'addr' for trap_val (MTVAL) instead of PC
	    for InstAccessFault and InstPageFault
    src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv
        Added 'tval' field to Fetch2Fetch3; set the value on TLB faults; send it out in 'FromFetchStage' struct
    src_Core/RISCY_OOO/procs/RV64G_OOO/RenameStage.bsv
        In rule doRenamingTrap, pass tval from FromFetchStage struct to ToReorderBuffer struct
    src_Core/RISCY_OOO/procs/lib/ReorderBuffer.bsv
        Add 'tval' Ehr to reorderbuffer slot, to accompany 'trap' Ehr.
	In method write_enq, store tval from ToReorderBuffer arg into tval Ehr.
	In method read_deq, send 'tval' Ehr value into 'ToReorderBuffer' output (goes to CommitStage)
    src_Core/RISCY_OOO/procs/RV64G_OOO/CommitStage.bsv
        Modified rule doCommitTrap_flush to take tval from 'ToReorderBuffer' input from ROB,
            for InstAccessFault and InstPageFault

    LICENSE
    README.md
        Clarified licensing of MIT code and Bluespec code

    Tests/Run_regression.py
        Emptied out 'exclude_list'

    builds/RV64ADFIMSU_Toooba_verilator/Makefile
        Added 'C' to Makefile
2019-04-10 10:27:40 -04:00
rsnikhil
113f888d37 Added support for 'debug_external_interrupt_req'
New method 'debug_external_interrupt_req' to support emulation of a
debug module starts at P3_Core interface and is plumbed all the way in
to the CSR register MIP as interrupt [14].  The corresponding MIE[14]
is always 1, so it is never masked. Still todo: should not be masked
by MSTATUS interrupt-enables either.  Also expanded
interrupt-detection logic, mcause etc. to extend up to interrupt 14.

Builds in standalone mode, runs ISA tests.

Builds in src_SSITH_P3, generating RTL.
2019-04-01 12:26:54 -04:00
rsnikhil
ee24a93944 Initial load of files 2019-03-26 14:49:40 -04:00