Commit Graph

57 Commits

Author SHA1 Message Date
rsnikhil
cd779e1cbe Work in progress: updates to handle stop/step/run from Debug Module 2020-01-08 20:17:50 -05:00
rsnikhil
0f04b9cbe1 Tweaks to builds/Resources/Include_..._.mk 2020-01-08 19:49:49 -05:00
Rishiyur S. Nikhil
09340dac13 Merge pull request #7 from jrtc27/bluesim
Add RV64ACDFIMSU_Toooba_bluesim build
2020-01-04 14:54:43 -08:00
James Clarke
7ecde58b1d Add RV64ACDFIMSU_Toooba_bluesim build 2020-01-04 22:44:59 +00:00
James Clarke
7b6c1e655b Avoid divide-by-zero in simulation model 2020-01-04 22:44:59 +00:00
James Clarke
6927e6bab1 Add simulation model for ResetGuard 2020-01-04 22:44:59 +00:00
Darius Rad
d337f1b8cf Update compiled output. 2019-10-25 00:13:58 -04:00
Rishiyur S. Nikhil
35e0b09202 Merge pull request #6 from nirajnsharma/master
src_SSITH_P3 Makefile edits
2020-01-03 04:37:48 -08:00
Niraj Nayan Sharma
364b1d1cf3 For src_SSITH_P3 builds, added conditions to include/exclude
simulation models of the integer divider
2020-01-03 16:59:34 +05:30
Rishiyur S. Nikhil
afce8b4a6d Merge pull request #5 from jrtc27/fixes
Fix FMIN/FMAX ISA test failures
2020-01-01 17:26:32 -08:00
James Clarke
9ff062a5db Fix FMIN/FMAX ISA test failures
FMIN(sNaN, x), where x is not NaN, should behave like FMIN(qNaN, x) and
yield x rather than the canonical NaN. The only difference is that the
invalid operation flag should still be set despite not yielding NaN. The
same applies to FMAX.
2020-01-02 01:12:51 +00:00
Rishiyur S. Nikhil
8a2c45c901 Merge pull request #4 from jrtc27/fixes
Reduce needless fetch stalls in presence of compressed instructions
2020-01-01 16:28:44 -08:00
James Clarke
60c1e31b01 Reduce needless fetch stalls in presence of compressed instructions
Currently, our next address prediction cannot distinguish between a
taken compressed branch to PC+4 and an uncompressed instruction that
falls through. We can instead make the NAP machinery much more robust by
keying it on the 16b parcels, with uncompressed branches having their
taken prediction on the second 16b parcel. This also removes the need
for the address prediction requests to be chained.

Moreover, if we decode more than 2 instructions in one cycle due to
decompression, we throw away any subsequent instructions and treat it
like a branch miss, redirecting and thus restarting the pipeline from
the first discarded PC. We should therefore instead save them for
issuing on the next cycle and avoid the redirects. To ensure we don't
needlessly reduce our IPC, if we have a partial issue's width of
instructions saved, we should also support issuing instructions from the
next ICache response if valid, which should be the case in hot
correctly-predicted code paths, especially tight loops. As part of this
change, we also keep the pending straddle state in Fetch3 rather than
sending it to Decode only to have it be forwarded back.

Combined, these two approaches ensure the fetch unit can maintain an IPC
of 2 after it has had time to be correctly trained, regardless of the
distribution of compressed instructions.
2020-01-01 22:22:17 +00:00
Rishiyur S. Nikhil
5df163d414 Merge pull request #3 from nirajnsharma/master
Fixes to the floating point
2019-12-24 07:51:17 -08:00
Niraj Nayan Sharma
601bbe5a82 No longer using Xilinx FPU modules 2019-12-14 12:44:02 +05:30
Niraj Nayan Sharma
09ce172b91 FP ISA tests bug fixes:
Added nanboxing for float in a 64-bit FPR system
Fixed behaviour around NaNs for comparison opcodes
2019-12-06 14:27:33 +05:30
Rishiyur S. Nikhil
021b374833 Merge pull request #2 from jrtc27/fixes
Multiple bug and performance fixes
2019-11-26 12:15:22 -05:00
James Clarke
3b5443e284 FetchStage: Clear straddle state on redirect
Otherwise, if the last instruction we tried to decode was the first half
of a 32-bit instruction, we will think the first 16-bit parcel from the
new PC is the second half of the previous instruction and take an
assertion failure because the PC does not match what was expected. This
fixes rv64uc-p-rvc, which broke after the previous commit as the
scheduling changes exposed this bug.
2019-11-03 04:59:52 +00:00
James Clarke
67be950d3a FetchStage: Use EHRs to remove conflicts between doDecode and doFetch3
This conflict was introduced by 53aacff7c when compressed support was
added. Previously, doDecode could be scheduled in the same cycle as
doFetch3 (and only in that order), but the Reg reads added to doDecode
prevented this. Instead, use EHRs to allow a bypass path from doDecode
to doFetch3. This means we can issue every cycle again, rather than only
every other cycle.
2019-11-03 04:12:34 +00:00
James Clarke
87daa8e319 Revert unwanted MMIOInst diff in e7fbf32b38
This stopped unmapped addresses from faulting, instead giving back a
list of all Invalid entries, triggering the "Fetched insts not enough"
assertion in FetchStage's doDecode. Fixes rv64mi-p-access.
2019-11-03 03:47:25 +00:00
James Clarke
78cad5bbcc Fix BTB entry aliasing with C extension 2019-11-02 20:38:35 +00:00
James Clarke
a0fd5a8f37 Print cycle counter like Piccolo/Flute on write to to_host 2019-11-02 20:37:34 +00:00
Darius Rad
bb557e5e23 Update compiled output. 2019-04-24 21:48:33 -04:00
Darius Rad
4fba332f17 Add missing module (FIFOL1) to Xilinx import. 2019-04-24 21:34:52 -04:00
rsnikhil
532998461d Merge branch 'master' of https://github.com/bluespec/Toooba 2019-04-22 15:12:52 -04:00
rsnikhil
666dd2ad92 Small tweak to remove unnecessary explicit boot rom addrs (subsumed by IO) 2019-04-22 15:12:30 -04:00
Darius Rad
afb5e0d13c Update compiled output. 2019-04-22 13:55:36 -04:00
Darius Rad
4a8fcef186 Start processor after reset. 2019-04-22 13:42:11 -04:00
rsnikhil
51bdff05d8 Updated Run_regression.py to utilize parallel processes 2019-04-18 18:42:06 -04:00
rsnikhil
fd02260fc8 Merge branch 'master' of https://github.com/bluespec/Toooba 2019-04-17 18:09:20 -04:00
rsnikhil
e7fbf32b38 Bugfix in MMIOPlatform.bsv for instruction-fetch from IO addrs
Detail: an "instruction-fetch" response from mmioplatform to core
should be an "InstFetch". This was true for successful fabric reads,
but on error responses it was wrongly returned as a "DataAccess"
response.  This was causing a deadlock.
2019-04-17 15:29:10 -04:00
rsnikhil
e9c04c7050 Renamed builds/RV64ADFIMSU_... to builds/RV64ACDFIMSU_... now that we support C extension 2019-04-17 09:10:30 -04:00
rsnikhil
a865a30e70 Updated README
Regression status: RV64ACDFIMSU_Toooba_verilator  207/229 PASS

    This is in simulation only.  The 22 failures are known and
    expected; they are all in the floating-point tests, and are likely
    due to the current inaccurate simulation-only models of
    floating-point arithmetic.

    When synthesized to FPGA, floating-point arithmetic is instead
    done with vendor-supplied IP, and all tests are expected to pass.
2019-04-11 15:26:34 -04:00
rsnikhil
85e03fad21 Bugfix. Now passing rv64si-p-dirty ISA test.
Modified:
  src_Core/RISCY_OOO/procs/lib/L2Tlb.bsv
    In rule doPageWalk, if (!leafPte) ... else: added check for PPN alignment.
    (In mega-/giga-page PTEs, lower bits of PPN must be zero for alignment)
2019-04-11 14:30:53 -04:00
rsnikhil
3dcb189694 Bugfix. Now passing 'rv64mi-p-illegal' ISA test
Modified:
    src_Core/RISCY_OOO/procs/RV64G_OOO/RenameStage.bsv
        In getTrap() function, added check for WFI trap
	(WFI traps if MSTATUS.TW==1 and PRIV < M)
2019-04-11 12:30:14 -04:00
rsnikhil
f280287589 Bug fixes; now passing rv64mi-p-csr ISA test
Modified:
    src_Core/RISCY_OOO/procs/RV64G_OOO/RenameStage.bsv
        Bug fixes in 'getTrap' function:
	- Trap if Fpu regs are accessed but mstatus_fs is "Off" (2'b00)
	- Trap if r/w or privilege denies access to CSR in CSRRW/C/S instruction
    src_Core/RISCY_OOO/procs/lib/ProcTypes.bsv
        Bug fix: add support for 'u' bit in function 'getExtensionBits'
2019-04-10 23:06:27 -04:00
rsnikhil
f369ed14e3 Small fixes to allow booting from any IO address, including Flash, not just Boot ROM
Regression status: RV64ADFIMSU_Toooba_verilator  204/229 PASS
      (22 expected floating-point failures due to inaccurate modeling)

  Modified
    src_Core/RISCY_OOO/procs/lib/MMIOInst.bsv
        Renamed 'BootRom' to 'IODevice'
        Imported and instantiated SoC_Map
        changed method getFetchTarget to use soc_map.is_IO_addr (phyPC)
        to classify as IODevice

    src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv
        Changed 'BootRom' constant to 'IODevice' constant (just a renaming)

    src_Testbench/SoC/SoC_Map.bsv
        Changed boot rom classification from 'mem' to 'IO device'
2019-04-10 15:36:20 -04:00
rsnikhil
3d4960edc5 Bug fixes; now passing rv64mi-p-access ISA test
Modified
  src_Core/CPU/MMIO_AXI4_Adapter.bsv
    Instead of aborting on axi4 mem read error, pass the error on to the core
  src_Core/RISCY_OOO/procs/lib/MMIOAddrs.bsv
    Added mainMemBoundAddr
  src_Core/RISCY_OOO/procs/lib/MMIOCore.bsv
    Update isMMIOAddr check to also check mainMemBoundAddr
  src_Core/RISCY_OOO/procs/lib/MMIOInst.bsv
    Update getFetchTarget to also check mainMemBoundAddr
    (still TODO: allow other IO addrs other than bootRom)
2019-04-10 12:42:23 -04:00
rsnikhil
905583fac9 Tweak to workaround internal bsc compiler error 2019-04-10 10:36:38 -04: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
Darius Rad
20c87b4c88 Update Verilog files for synthesis. Again.
Apparently these files necessary.
2019-04-09 18:26:54 -04:00
Darius Rad
af887627ee Update Verilog files for synthesis.
This mostly removes unnecessary files.  A few are updated from
bsc Verilog library files.
2019-04-09 17:45:27 -04:00
Darius Rad
93e28c7000 Add missing files necessary for synthesis. 2019-04-09 14:32:41 -04:00
Darius Rad
2125e86f8f Update compiled output. 2019-04-09 14:21:52 -04:00
Darius Rad
9b94fc9f58 Add files for GFE integration. 2019-04-09 14:08:36 -04:00
Darius Rad
72175d87db Ensure that halt asserted after ndm reset is not ignored.
Issue halt if haltreq is asserted and the hart is running.  This
will ensure that the hart is always halted after ndmreset, as is
done with OpenOCD.

This corresponds to Flute commit 71d7e715f.
2019-04-09 14:08:36 -04:00
Darius Rad
4d1030df47 Add support for external debug module. 2019-04-09 14:08:36 -04:00
rsnikhil
53aacff7c5 Changes to support 'C' extension (compressed instructions). Details follow.
>----------------
Status and outlook:

    For RV64GC, out of 229 standard ISA tests, 202 PASS, 27 FAIL.
    Below is a list of current failures, current diagnoses, and outlook.

    'C' instructions:
        rv64uc-v-rvc

        Diagnosis: error in saved regs during instruction page fault
            when a 32-bit instruction straddles a page boundary and
            the second 16-bits encounters a page fault.

            Note: the corresponding rv64uc-p-rvc passes, containing
            the same set of tests except for the virtual-memory
            aspect, so we expect this test to pass once this issue is
            fixed.

        Outlook: Target date for fix: 2019-Apr-09 (today)

    System instructions:
        rv64mi-p-access
        rv64mi-p-csr
        rv64si-p-dirty
        rv64mi-p-illegal

        Diagnosis: we do not have accurate diagnoses yet, although
            some symptoms look similar to what we saw with earlier
            processors (these test various corner-cases of system
            instructions).

        Outlook: Target date for fix: 2019-Apr-15

    'F' and 'D' instructions
        rv64uf-p-fadd        rv64uf-v-fadd
        rv64uf-p-fcmp        rv64uf-v-fcmp
        rv64uf-p-fdiv        rv64uf-v-fdiv
        rv64uf-p-fmin        rv64uf-v-fmin

        rv64ud-p-fadd        rv64ud-v-fadd
        rv64ud-p-fcmp        rv64ud-v-fcmp
        rv64ud-p-fdiv        rv64ud-v-fdiv
        rv64ud-p-fmadd       rv64ud-v-fmadd
        rv64ud-p-fmin        rv64ud-v-fmin
        rv64ud-p-ldst        rv64ud-v-ldst
        rv64ud-p-move        rv64ud-v-move

        Diagnosis: These seem to be simulation-only errors. Simulation
            uses some quick-and-dirty floating-point "model" modules
            written by the MIT authors, which are not accurate.  All
            the errors seem to be regarding incomplete treatment of
            NaNs in the models.  These errors should not happen in
            FPGA since those use Xilinx IP modules instead.  MIT has
            been booting Linux with the Xilinx IP modules, lending
            more confidence in the FPGA version.

            The actual number of root-cause failures is likely to be
            smaller than the list.  For example, the 'fadd' test has
            four variants: {uf/ud} x {-p-/-v-}; they all likely need a
            comon fix.

        Outlook: Target date: 2019-Apr-30
            [Lower priority, since FPGA versions should be ok even now.]

>----------------
Detailed comments on file changes

New files:
    Doc/micro2018.pdf
        MIT's paper on RISCY-OOO at IEEE Micro
    src_Core/CPU/CPU_Decode_C.bsv
        Function to expand 'C' instrs to 32-bit counterparts, taken from Piccolo/Flute

Modified files:
    src_Core/CPU/Core.bsv
        Added rob_getOrig_Inst method

    src_Core/RISCY_OOO/procs/RV64G_OOO/AluExePipeline.bsv
        Added 'orig_inst' stuff, $displays

    src_Core/RISCY_OOO/procs/RV64G_OOO/CommitStage.bsv
        Mostly verbosity stuff, including printing out brief instruction trace similar to Piccolo/Flute.

    src_Core/RISCY_OOO/procs/RV64G_OOO/FetchStage.bsv
        Major changes for 'C', including call to Decode_C function from Piccolo/Flute
        Pass orig_inst to downpipe.

    src_Core/RISCY_OOO/procs/RV64G_OOO/RenameStage.bsv
        Added 'orig_inst', input from FetchStage and passed on to ROB
        Tweaked PC+4 check to accommodate 'C' instructions.

    src_Core/RISCY_OOO/procs/lib/BrPred.bsv
        Fixed 'decodeBrPred' to accommodate 'C' instructions

    src_Core/RISCY_OOO/procs/lib/Exec.bsv
        Fixed 'brAddrCalc', 'getControlFlow', 'basicExec' to acommodate 'C' instructions

    src_Core/RISCY_OOO/procs/lib/MemLoader.bsv
        Switched off 'verbose' by default

    src_Core/RISCY_OOO/procs/lib/ProcTypes.bsv
        Added 'C' to MISA, 'getExtensionBits'

    src_Core/RISCY_OOO/procs/lib/ReorderBuffer.bsv
        Added 'orig_inst' register to basic cell, and methods to set/access.

    src_Core/RISCY_OOO/procs/lib/Types.bsv
        Added typedefs for 'C' instructions
>----------------
2019-04-09 13:50:16 -04:00
rsnikhil
9683df04fd Regenerated src_SSITH_P3 RTL 2019-04-04 15:09:35 -04:00
rsnikhil
ca0535e4e0 Fixed typo in Makefile 2019-04-04 14:05:54 -04:00