Commit Graph

61 Commits

Author SHA1 Message Date
Luke Wren 20cf408632 Add fine (as well as coarse) register predecode, so that predecoded regnum can be used in bypass zeroing. 2022-04-04 20:16:19 +01:00
Luke Wren 7dc5046505 Perf option for dedicated branch comparator 2022-04-02 11:40:47 +01:00
Luke Wren 7b8fe43c1c Fix bad timing of predecoded regnum register update (thanks BMC) 2022-04-02 10:11:55 +01:00
Luke Wren 887c93dbf0 Reuse predecoded regnums for bypass mux (though can't be used for zeroing unfortunately) 2022-03-02 18:35:16 +00:00
Luke Wren 9ed99d8695 Use define to guard X-checks, instead of hot comments 2022-02-24 10:35:16 +00:00
Luke Wren bf15b6c49f Fix forward reference to net 2022-01-18 23:02:39 +00:00
Luke Wren 0a369efc06 Add single-port bus compliance. Fix adapter not re-arbitrating following an ERROR response, causing a squashed younger load-store to remain presented to the bus. 2021-12-18 15:41:05 +00:00
Luke Wren 1b0e205f87 Fix bad AMO asserts. Fix hwdata instability during stalled AMO write dphase, which meant AMOs were fundamentally broken following yesterday's datapath origami 2021-12-18 14:51:46 +00:00
Luke Wren 6b8d4913ee Remove unnecessary mux of mw_result -> m_result 2021-12-18 01:34:25 +00:00
Luke Wren 79fec3a2f5 Overload mw_result register for capturing AMO read data. Save some LCs. 2021-12-18 01:24:26 +00:00
Luke Wren 28b53ef7b5 Delete the AMO ALU. Save around 80 LCs vs original implementation, maybe enables some more savings. 2021-12-18 00:35:13 +00:00
Luke Wren 7485269ddf Use the branch target adder for load/store addresses. Preparing for AMO ALU deletion 2021-12-17 22:36:40 +00:00
Luke Wren a35739baf1 Fix AMO failing to loop on global monitor write fail 2021-12-17 17:04:22 +00:00
Luke Wren b0d28447ab New license headers: DWTFPL -> Apache 2.0 2021-12-13 23:23:40 +00:00
Luke Wren f1cda26bcc Oops, try a little harder this time to ensure local monitor is cleared by sc.w errors _always_, even if lined up with trap entry stalls etc 2021-12-12 23:32:01 +00:00
Luke Wren 25b44d04cf Add more properties wrt AMO. Fix awful bugs in interaction between AMOs and prior lr/sc, prior load/store exception, or IRQ which is asserted then deasserted. Fix sc with HRESP=1 HEXOKAY=1 not clearing the local monitor (not a bug, but unfriendly). 2021-12-12 23:24:25 +00:00
Luke Wren 88fea7acfa Fix lockup on misaligned AMO. Add tests for misaligned/faulting AMOs. 2021-12-12 18:28:23 +00:00
Luke Wren 9460b3cd04 Add load/store and lr/sc bus fault tests. Fix lr.w not clearing local monitor when HRESP=1 HEXOKAY=1. 2021-12-11 15:52:34 +00:00
Luke Wren 3d2c912b4f Add test script to make it easier to add software testcases 2021-12-09 22:25:18 +00:00
Luke Wren 7d2fa6a049 Fix width warnings in A instruction decode, add don't-care to bus rdata picking logic 2021-12-09 06:26:31 +00:00
Luke Wren 116e34df49 Fix commented out frontend properties which relied on non-constant past reset values 2021-12-07 20:24:29 +00:00
Luke Wren ed22d502fd Fix bus stall getting stuck high when a bus fault exception isn't immediately accepted by the frontend 2021-12-06 19:28:21 +00:00
Luke Wren 50d3d5d3b3 Maintain AMO IRQ holdoff when transitioning from data phase to error phase, to prevent error possibly being flushed 2021-12-06 19:27:20 +00:00
Luke Wren 29c5c8ca7f Fix AMO stall falling through when write data phase should proceed to error phase 2021-12-06 18:28:56 +00:00
Luke Wren 8bfc089660 Slightly more strict holdoff of IRQs on AMO 2021-12-06 18:13:43 +00:00
Luke Wren 4c532240f8 Hold off IRQ when AMO is past the point of no return 2021-12-06 07:45:13 +00:00
Luke Wren cc38f46848 Fix AMO wdata valid left high when entering trap at just the right time 2021-12-06 07:28:50 +00:00
Luke Wren 9b9120960d Fix missing RAW stall on sc.w succes result. Closing laptop again. 2021-12-05 01:05:01 +00:00
Luke Wren df658d86ff First plausibly working AMOs. Add AMOs to instruction timings list 2021-12-04 23:44:22 +00:00
Luke Wren 5c098866f2 Sketch in AMO support 2021-12-04 20:46:39 +00:00
Luke Wren a8933c332d Fix illegal issue of pipelined exclusives on the bus, and document correct timings 2021-12-04 18:23:01 +00:00
Luke Wren 5e17bb805e Add basic support for lr/sc instructions from the A extension 2021-12-04 15:02:31 +00:00
Luke Wren 607147f280 Rewrite byte pick/sign-extend logic, preparing to handle more memops 2021-12-04 12:08:54 +00:00
Luke Wren a988adfec8 Add RISC-V opcodes and memory operation codes for atomics 2021-12-04 11:16:24 +00:00
Luke Wren c8afb4ac33 Add option for fast high-half multiplies 2021-11-29 18:48:02 +00:00
Luke Wren 58c20a39d0 First pass at implementing bitmanip. Breaks CXXRTL. Ooop 2021-11-25 23:30:35 +00:00
Luke Wren ed6b6a3660 Cleanup order of declaration/use of a couple of wires 2021-11-25 15:16:59 +00:00
Luke Wren e05e9a4109 Add default_nettype none at top of every file, and default_nettype wire at bottom 2021-11-23 22:10:39 +00:00
Luke Wren 0b9b706e81 Safer logic for load/store blocked by preceding WFI 2021-11-23 22:01:14 +00:00
Luke Wren cc6a6c09ba Vaguely implement wfi 2021-11-05 18:48:42 +00:00
Luke Wren cfe16caf41 Remove some old todos 2021-09-05 22:20:40 +01:00
Luke Wren e9fccffca0 Fix break and single-step on a load/store access fault dropping the exception. Better fix for halt request on definitely-excepting stage M instruction giving unreachable next-instruction DPC. 2021-09-05 04:45:38 +01:00
Luke Wren d03a82a826 Add instruction fetch faults 2021-09-04 02:57:39 +01:00
Luke Wren 8e3dc62b97 Fiddly handshake changes for hardware single-stepping. Can now step correctly through illegal instructions 2021-07-16 20:43:24 +01:00
Luke Wren 5aca6be572 Implement data0 inside of DM instead of core, so it gets correct reset. Add dummy tselect CSR. 2021-07-16 18:28:30 +01:00
Luke Wren 307955c810 Make CPU regfile nonresettable when FPGA symbol is defined, to support BRAM inference 2021-07-13 01:10:55 +01:00
Luke Wren 63d661af63 Start hacking in debug support to the core -- seems to work as well as before adding debug! 2021-07-10 18:53:48 +01:00
Luke Wren af684c4e82 Some cleanup; correctly decode 16-bit EBREAK 2021-06-03 20:03:43 +01:00
Luke Wren 5f8d217395 Implement new IRQ behaviour, and change mip.meip to be masked by individual enables in meip0 2021-05-31 17:54:12 +01:00
Luke Wren ea5db61582 Fix exception being passed to M when X is stalled but M is not (a load which had an unaligned address spuriously during a RAW stall on the result register) 2021-05-29 22:52:50 +01:00