Commit Graph
100 Commits
Author SHA1 Message Date
Andrew Waterman 3cbc5262ec Don't permit new acquires until the release queue is drained
If the queue is not empty before a dirty miss, C could block D.
I haven't seen this in the wild, but it could happen because of
dirty probe responses backed up in the queue.
2017-08-13 13:18:45 -07:00
Andrew Waterman 0190724492 Actually use the C-channel acquire-before-release queue
oops...
2017-08-13 13:03:35 -07:00
Andrew Waterman 7387f2a93a Don't block D-channel when handling a probe
This is an acquire-before-release regression.
2017-08-12 16:13:24 -07:00
Andrew Waterman 604abd5b07 Only report ECC errors when the RAM was actually read 2017-08-12 15:28:03 -07:00
Andrew Waterman 18fb052fc9 DRY 2017-08-12 15:27:30 -07:00
Andrew Waterman 176110b6d3 Don't trigger ECC writebacks when a release is in flight 2017-08-12 15:23:57 -07:00
Andrew WatermanandYunsup Lee 721770244e Fix IBuf bug
Don't examine a packet's xcpt signal if it might be invalid.  In this case,
the correct fix is to not examine xcpt at all; the deleted code was vestigial.
(Note, the other use of xcpt(j+1) in this code is indeed safe.)
2017-08-09 09:47:51 -07:00
Andrew Waterman 31b75987ca Avoid width warning 2017-08-08 20:57:31 -07:00
Andrew Waterman 809c7e8551 Don't merge stores that manifest WAW hazards
The following sequence would drop the first store when eccBytes=4:

    sb x0, 0(t0)
    nop
    sb x0, 4(t0)
    nop
    sb x0, 1(t0)

Because the first and second store are to different ECC granules, the
hazard check correctly allowed the second one to proceed, but the third
was merged with the second, even though it conflicted with the first.
So, don't allow the third to be merged with the second, since the second
stored to a different ECC granule.
2017-08-08 15:19:05 -07:00
Andrew Waterman 7935c61c19 Don't report to the DTIM that data is cacheable
Otherwise, it will attempt to perform AMOs where they're unsupported!
2017-08-08 11:55:04 -07:00
Andrew Waterman 74d309c18e Make I vs. D a static property of TLB, not an input pin
The microarchitecture doesn't really support unified TLBs, so don't fake it.
2017-08-08 11:54:47 -07:00
Andrew Waterman e92981b0bd DRY 2017-08-08 11:46:38 -07:00
Andrew Waterman 62ccba304c Perform tag error detectoin/correction in same cycle as RAM
The tag RAMs tend to be fast, so take up some of the slack.
This makes s2_nack faster.
2017-08-08 10:21:30 -07:00
Andrew Waterman ea4b1bc349 Use vlsi_mem_gen for verilator flow 2017-08-07 20:36:22 -07:00
Andrew Waterman b0f32c8f09 Randomize disabled read ports in vlsi_mem_gen 2017-08-07 20:35:40 -07:00
Andrew Waterman 402907990c Revert "Remove one gate from D$ ECC check"
This reverts commit 7d94074b05, which
works fine with optimistic behavioral RAMs but not real ones.
2017-08-07 17:33:20 -07:00
Andrew WatermanandYunsup Lee 3d0051e799 bump tools for test fixes 2017-08-06 22:36:25 -07:00
Andrew Waterman 658e36f98b Reduce fanout on frontend io.cpu.req.valid signal 2017-08-06 17:38:51 -07:00
Andrew Waterman 7d94074b05 Remove one gate from D$ ECC check
The D$ corrects via writeback, so which word the error was in doesn't
matter, as the entire line is corrected.
2017-08-06 17:36:53 -07:00
Andrew Waterman 39b7e930ca Disable AMBAUnitTestConfig, as it is blocking unrelated PRs 2017-08-05 16:14:02 -07:00
Andrew Waterman 83875e3a0c Only flush D$ on FENCE.I if it won't always be probed on I$ miss 2017-08-05 14:22:40 -07:00
Andrew Waterman 991e16de92 Remove probe address mux from TLB response path 2017-08-05 12:57:38 -07:00
Andrew Waterman b9b4142bb4 Get s2_nack off the critical path
We were using it to compute the next PC on flush vs. replay (which require
PC+4 and PC, respectively).  This fix gets rid of the adder altogether by
reusing the M-stage PC in the flush case, which by construction holds PC+4.
2017-08-05 00:30:36 -07:00
Andrew Waterman bc298bf146 Optimize ShiftQueue for late-arriving deq.ready 2017-08-04 22:06:37 -07:00
Andrew Waterman 6112adfbb0 Get L2 TLB tag/parity check off the D$ arbitration path 2017-08-04 17:01:51 -07:00
Andrew Waterman 8d97684555 Fix L2 TLB perfctr
It was counting conflict misses but not cold misses.
2017-08-04 17:01:31 -07:00
Andrew Waterman df7f09b9ce Get I$ ECC check further off critical path 2017-08-04 16:59:21 -07:00
Andrew Waterman 4bfbe75d74 Avoid pipeline replays when fetch queue is full 2017-08-04 16:59:21 -07:00
Andrew Waterman a45997d03f Separate I$ parity error from miss signal
Handle parity errors with a pipeline flush rather than a faster
frontend replay, reducing a critical path.
2017-08-04 16:59:21 -07:00
Andrew Waterman 06a831310b Shave a gate delay off I$ backpressure path
The deleted code was a holdover from Hwacha's vector fences.
2017-08-04 13:12:43 -07:00
Andrew Waterman ecc2ee366c Shave a few gate delays off IBuf control logic
It takes a while for the pipeline to compute the stall signal, so avoid
using it until the last logic levels in the clock cycle.
2017-08-04 13:12:43 -07:00
Andrew Waterman 21ac28b57a Don't build verilog twice for emulator and emulator-debug
Since we aren't using chisel2, the output is the same either way.
2017-08-04 01:02:33 -07:00
Andrew Waterman f483bab4aa Fix I$ miss perfctr
The old version was counting prefetches, too.
2017-08-03 00:52:12 -07:00
Andrew Waterman 2537d0d54e Optionally prefetch next I$ line into L2$ on miss 2017-08-02 17:10:56 -07:00
Andrew Waterman 744cdb2f72 Make TLB report when it's safe to prefetch within a page 2017-08-02 17:09:38 -07:00
Andrew Waterman 7d2dd3769f Optimize a hazard check critical path 2017-08-02 14:27:25 -07:00
Andrew Waterman 2eb239d03f Add option to retime D$ way mux into subsequent pipeline stage 2017-08-01 23:59:20 -07:00
Andrew Waterman 9464c6db40 Mitigate(?) frontend critical path 2017-08-01 18:51:17 -07:00
Andrew Waterman 735701382f Mitigate some I$ response valid critical paths 2017-08-01 18:51:17 -07:00
Andrew Waterman 2ecea2ef60 Don't use a pipe queue on D$ TL A-channel
This cuts an I$->D$ path.
2017-08-01 15:17:07 -07:00
Andrew Waterman e140893a01 Use 1-entry queue on processor-side E-channel
The cache can't sink a grant every cycle, so extra E buffering doesn't help.
2017-07-31 18:06:54 -07:00
Andrew Waterman 5681693ccc Fix a D$ ready-valid signaling regression
I broke this in 66d06460fa.
2017-07-31 18:05:14 -07:00
Andrew Waterman d811692c3b Mitigate I$->D$->I$ critical path
This seemingly irrelevant change shaves several gate delays off the I$
tl.a.valid path.
2017-07-31 01:43:04 -07:00
Andrew Waterman ac4339a8e7 Pass D$ backpressure to D-channel, rather than asserting 2017-07-29 11:48:36 -07:00
Andrew Waterman edcd2c696c Avoid needless stall on E-channel back pressure 2017-07-29 11:47:58 -07:00
Andrew Waterman fdb8935712 Improve fidelity of two perf counters 2017-07-28 13:14:04 -07:00
Andrew Waterman 4c82f6b77e Don't refill BTB on not-taken branches 2017-07-28 13:13:52 -07:00
Andrew Waterman 2e8b02e780 Merge D$ store hits when ECC is enabled
This avoids pipeline flushes due to subword WAW hazards, as with
consecutive byte stores.
2017-07-28 12:56:36 -07:00
Andrew Waterman 838864870e Bypass TLB refill signal to halve L2 TLB hit time
The 4-cycle hit time is 1 cycle too long to avoid a second
pipeline replay, so it was effectively 9 cycles instead of 4.
2017-07-28 12:56:36 -07:00
Andrew Waterman ae1f7a95f6 Don't nack misses when there's a pending store
That effectively increased the miss latency by 5 cycles when there was
a store hit followed by a load miss.  Since pending stores are drained
when releaseInFlight, the check I removed was redundant.
2017-07-28 12:56:36 -07:00
Andrew Waterman 5a5b78b15e Improve L2 TLB coding style 2017-07-26 02:22:43 -07:00
Andrew Waterman 5a9c673f41 Fix L2 TLB response bug
Sometimes, it would inform the L1 TLB that the translation was for
a superpage, even though that's never the case.
2017-07-26 02:20:41 -07:00
Andrew Waterman acca0fccf5 Fix BTB not being refilled on some indirect jumps
We are overloading the BTB-hit signal to mean that any part of the frontend
changed the control-flow, not just the BTB.  That's the right thing to do for
most of the control logic, but it means the BTB sometimes won't get refilled
when we'd like it to.  This commit makes the frontend use an invalid BTB entry
number when it, rather than the BTB, changes the control flow.  Since the
entry number is invalid, the BTB will treat it as a miss and refill itself.

This is kind of a hack, but a more palatable fix requires reworking the RVC
IBuf, which I don't have time for right now.
2017-07-26 02:13:43 -07:00
Andrew Waterman 15878d4691 Perform some control-flow transfers within the Frontend 2017-07-25 15:19:16 -07:00
Andrew Waterman 62c4080585 Add RVC instruction patterns 2017-07-25 15:19:16 -07:00
Andrew Waterman 66d06460fa Add option for acquire-before-release 2017-07-25 15:19:16 -07:00
Andrew Waterman 86ccd935fc Add method to print perf events 2017-07-25 15:19:16 -07:00
Andrew Waterman 5df8f0d1ea Add L2 TLB miss counter 2017-07-25 15:19:16 -07:00
Andrew Waterman 3ced04b70a Mix in trait to connect global_reset_vector 2017-07-25 15:19:16 -07:00
Andrew Waterman b2351c5fbf Use consistent casing 2017-07-06 11:16:56 -07:00
Andrew Waterman be4eceec0d Fix stupid D$ probe bug 2017-07-06 01:20:47 -07:00
Andrew Waterman 90a7d6a343 Add L2 TLB option 2017-07-06 01:19:18 -07:00
Andrew Waterman 438abc76d2 Handle TL errors in L1 I$
Cache the error bit in the tag array; report precisely on access.
2017-07-06 01:02:11 -07:00
Andrew Waterman 0ef45fac9b Add tag ECC to D$ 2017-07-03 18:16:37 -07:00
Andrew Waterman e9752f76ae Improve probe state machine
- Reduce reliance on s2_prb_ack_data due to future ECC changes
- Shave a cycle off valid, but clean, probes
- Code cleanup
2017-07-03 16:25:04 -07:00
Andrew Waterman b9a934ae28 Support eccBytes > 1 2017-06-28 02:09:18 -07:00
Andrew Waterman 8e4be40efc Propagate wb_reg_rs2 for sfence ASID
This would have been a bug if we supported ASIDs.
2017-06-28 02:09:18 -07:00
Andrew Waterman 2077e4190b Make log more sensible for long-latency operations
Show only one write to the destination register, not two.
2017-06-28 02:09:18 -07:00
Andrew Waterman 6f8fdff762 Basic L1 D$ ECC support
Only supports ECC on data, not tags; only supports byte granularity.
2017-06-28 02:09:18 -07:00
Andrew Waterman 6100600179 Minor D$ code cleanup 2017-06-28 02:09:18 -07:00
Andrew Waterman 9c78ac4d78 Add grouped method to AugmentedUInt, like Seq.grouped 2017-06-28 02:09:18 -07:00
Andrew Waterman 8989f5654c Add swizzle method to Encoding 2017-06-28 02:09:18 -07:00
Andrew Waterman 3e04a99f61 Refactor frontend exception passing
Bundle them, and leverage regularity, so that if we have to add more
exceptions in the future, we don't need to change so much code.
2017-06-28 02:09:18 -07:00
Andrew Waterman cc2f87c214 Forbid S-mode execution from user memory
https://github.com/riscv/riscv-isa-manual/commit/285c81746fe664060b62ae0584865dbfa9f42e1a
2017-06-28 02:09:18 -07:00
Andrew Waterman 8aa16a11f3 Reduce D$ access energy when refill width > access width 2017-06-28 02:09:18 -07:00
Andrew Waterman 25f585f2a9 Remove unused signal from TLB interface 2017-06-28 02:09:18 -07:00
Andrew Waterman d5f80df0ae Allow speculative I$ refill to cacheable regions
Backpedaling on 27b143013f.  Shaving
four cycles off of I$ miss penalty is obviously worth the HW cost.
2017-06-28 02:09:18 -07:00
Andrew Waterman a6d9884cc0 Improve integer mul/div
- Signed integer multiplication latency is now deterministic (before,
it would take an extra cycle if the multiplier was negative).
- High-part multiplication is now one cycle faster.
- RV64 MULW now takes half as many cycles as MUL.
- Positive remainders are now one cycle faster.
2017-06-19 12:09:21 -07:00
Andrew Waterman 76af15a6ff Fix FPU control bug for div/sqrt
I was examining a WB-stage control signal instead of a MEM-stage control
signal.  I refactored the code to group the signals together, so that this
sort of bug is less likely going forward.
2017-06-09 15:51:06 -07:00
Andrew Waterman 8552c77972 Fix I$ reset regression FU-357
Can't rely on s2 TLB response, so mask using s2_valid.
2017-06-09 00:48:24 -07:00
Andrew Waterman 07ad9203ff Fix FMUL sign of zero 2017-06-05 17:35:42 -07:00
Andrew WatermanandWesley W. Terpstra 16ecbdd5b2 Reduce fanout on critical I$ miss signal 2017-06-02 20:45:50 -07:00
Andrew WatermanandWesley W. Terpstra 27b143013f Improve ITLB QoR
- No need to check cacheability
- Remove a gate delay from PMP path
2017-06-02 20:45:50 -07:00
Andrew WatermanandWesley W. Terpstra 0ffb2c8baf Simplify and improve QoR of ShiftQueue 2017-06-02 20:44:52 -07:00
Andrew WatermanandWesley W. Terpstra 8229bdee03 Remove FP unboxing from FMA critical path 2017-06-02 20:44:52 -07:00
Andrew WatermanandWesley W. Terpstra 7504b47bbe Improve code quality in FP->FP and Int->FP units 2017-06-02 20:44:52 -07:00
Andrew WatermanandWesley W. Terpstra 84c4ae775f Improve QoR for FP->Int conversions 2017-06-02 20:44:52 -07:00
Andrew WatermanandWesley W. Terpstra 07968df183 Refactor FP Classify 2017-06-02 20:44:52 -07:00
Andrew WatermanandWesley W. Terpstra 6ecd58a977 Incorporate new div/sqrt unit 2017-06-02 20:44:15 -07:00
Andrew Waterman 7eefc12705 Support vectored stvec interrupts, too
https://github.com/riscv/riscv-isa-manual/commit/137812654e54e5d765e21909679a2a24a38be123
2017-05-07 15:40:08 -07:00
Andrew WatermanandAndrew Waterman c6135a02df Revert "rocket: hard-wire UXL/SXL fields to 0"
This reverts commit ea0714bfcb.

We've waffled on this matter in the priv spec: https://github.com/riscv/riscv-isa-manual/commit/326bec83de23f4d2daf24cfed6b5251748cad632
2017-05-07 15:23:21 -07:00
Andrew WatermanandAndrew Waterman dd1546fd69 Check PPN LSBs for superpage PTEs
https://github.com/riscv/riscv-isa-manual/commit/5a32fe87820f2f0f7ffab16a4a33906e78e26abb
2017-05-05 15:30:09 -07:00
Andrew WatermanandYunsup Lee 398600d4da Interlock to prevent ITIM hazard when tl.a.valid & tl.d.valid & !tl.d.ready 2017-05-04 00:57:29 -07:00
Andrew Waterman fa6ecdf813 Fix RVC/uncacheable instruction memory performance bug
9c1d126965 was an incomplete fix, so
sometimes we were requesting pipeline replays when they weren't
necessary.
2017-05-03 17:52:06 -07:00
Andrew Waterman 3a1a37d41b Support PutPartial in ScratchpadSlavePort 2017-05-02 03:07:02 -07:00
Andrew Waterman 938b089543 Remove legacy devices that use AMOALU
I'm going to change the AMOALU API, and so I'm removing dependent dead code.
2017-05-02 03:05:41 -07:00
Andrew Waterman f8151ce786 Remove subword load muxing in ScratchpadSlavePort 2017-05-02 00:14:46 -07:00
Andrew Waterman 044b6ed3f9 Improve logical ops in AMOALU
As with integer ALU, shave off some muxing.
2017-05-02 00:14:46 -07:00
Andrew Waterman f49172b5bc ScratchpadSlavePort doesn't support byte/halfword atomics 2017-05-02 00:14:46 -07:00
Andrew WatermanandAndrew Waterman dd85d7e0a0 I$: Don't raise io.resp.valid if io.s1_kill was high previous cycle
@solomatnikov found the bug.  It doesn't manifest in Rocket because the
Frontend masks io.resp.valid with s2_valid.
2017-04-28 16:44:58 -07:00