2021-01-15 04:37:51 +00:00
|
|
|
///////////////////////////////////////////
|
|
|
|
// wallypipelinedhart.sv
|
|
|
|
//
|
|
|
|
// Written: David_Harris@hmc.edu 9 January 2021
|
|
|
|
// Modified:
|
|
|
|
//
|
|
|
|
// Purpose: Pipelined RISC-V Processor
|
|
|
|
//
|
|
|
|
// A component of the Wally configurable RISC-V project.
|
|
|
|
//
|
|
|
|
// Copyright (C) 2021 Harvey Mudd College & Oklahoma State University
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
|
|
|
|
// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
|
|
|
|
// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
|
|
|
|
// is furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
|
|
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
|
|
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
|
|
|
// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
///////////////////////////////////////////
|
|
|
|
|
2021-01-23 15:48:12 +00:00
|
|
|
`include "wally-config.vh"
|
2021-01-27 11:40:26 +00:00
|
|
|
/* verilator lint_on UNUSED */
|
2021-01-15 04:37:51 +00:00
|
|
|
|
2021-10-23 18:03:28 +00:00
|
|
|
module wallypipelinedhart (
|
2021-06-24 18:05:22 +00:00
|
|
|
input logic clk, reset,
|
|
|
|
// Privileged
|
|
|
|
input logic TimerIntM, ExtIntM, SwIntM,
|
|
|
|
input logic [63:0] MTIME_CLINT, MTIMECMP_CLINT,
|
|
|
|
// Bus Interface
|
|
|
|
input logic [`AHBW-1:0] HRDATA,
|
|
|
|
input logic HREADY, HRESP,
|
|
|
|
output logic HCLK, HRESETn,
|
|
|
|
output logic [31:0] HADDR,
|
|
|
|
output logic [`AHBW-1:0] HWDATA,
|
|
|
|
output logic HWRITE,
|
|
|
|
output logic [2:0] HSIZE,
|
|
|
|
output logic [2:0] HBURST,
|
|
|
|
output logic [3:0] HPROT,
|
|
|
|
output logic [1:0] HTRANS,
|
|
|
|
output logic HMASTLOCK,
|
|
|
|
// Delayed signals for subword write
|
|
|
|
output logic [2:0] HADDRD,
|
|
|
|
output logic [3:0] HSIZED,
|
|
|
|
output logic HWRITED
|
|
|
|
);
|
|
|
|
|
|
|
|
// logic [1:0] ForwardAE, ForwardBE;
|
|
|
|
logic StallF, StallD, StallE, StallM, StallW;
|
|
|
|
logic FlushF, FlushD, FlushE, FlushM, FlushW;
|
2021-07-17 19:22:24 +00:00
|
|
|
logic RetM, TrapM;
|
2021-01-15 04:37:51 +00:00
|
|
|
|
2021-01-27 12:46:52 +00:00
|
|
|
// new signals that must connect through DP
|
2021-06-24 18:05:22 +00:00
|
|
|
logic MulDivE, W64E;
|
|
|
|
logic CSRReadM, CSRWriteM, PrivilegedM;
|
2021-07-13 17:46:20 +00:00
|
|
|
logic [1:0] AtomicE;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic [1:0] AtomicM;
|
2021-11-17 18:53:17 +00:00
|
|
|
logic [`XLEN-1:0] ForwardedSrcAE, ForwardedSrcBE, SrcAE, SrcBE;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic [`XLEN-1:0] SrcAM;
|
|
|
|
logic [2:0] Funct3E;
|
2021-04-04 01:28:24 +00:00
|
|
|
// logic [31:0] InstrF;
|
2021-10-23 19:00:32 +00:00
|
|
|
logic [31:0] InstrD, InstrM;
|
|
|
|
logic [`XLEN-1:0] PCF, PCE, PCM, PCLinkE;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic [`XLEN-1:0] PCTargetE;
|
|
|
|
logic [`XLEN-1:0] CSRReadValW, MulDivResultW;
|
|
|
|
logic [`XLEN-1:0] PrivilegedNextPCM;
|
|
|
|
logic [1:0] MemRWM;
|
2021-07-13 17:19:13 +00:00
|
|
|
logic InstrValidM;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic InstrMisalignedFaultM;
|
|
|
|
logic IllegalBaseInstrFaultD, IllegalIEUInstrFaultD;
|
|
|
|
logic ITLBInstrPageFaultF, DTLBLoadPageFaultM, DTLBStorePageFaultM;
|
|
|
|
logic WalkerInstrPageFaultF, WalkerLoadPageFaultM, WalkerStorePageFaultM;
|
|
|
|
logic LoadMisalignedFaultM, LoadAccessFaultM;
|
|
|
|
logic StoreMisalignedFaultM, StoreAccessFaultM;
|
|
|
|
logic [`XLEN-1:0] InstrMisalignedAdrM;
|
2021-09-15 17:14:00 +00:00
|
|
|
logic InvalidateICacheM, FlushDCacheM;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic PCSrcE;
|
|
|
|
logic CSRWritePendingDEM;
|
|
|
|
logic DivBusyE;
|
2021-07-13 18:20:50 +00:00
|
|
|
logic LoadStallD, StoreStallD, MulDivStallD, CSRRdStallD;
|
2021-10-23 17:29:52 +00:00
|
|
|
logic SquashSCW;
|
2021-06-24 22:39:18 +00:00
|
|
|
// floating point unit signals
|
2021-07-02 16:52:26 +00:00
|
|
|
logic [2:0] FRM_REGW;
|
2021-10-23 19:00:32 +00:00
|
|
|
logic [4:0] RdM, RdW;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic FStallD;
|
2021-07-02 16:52:26 +00:00
|
|
|
logic FWriteIntE, FWriteIntM, FWriteIntW;
|
|
|
|
logic [`XLEN-1:0] FWriteDataE;
|
|
|
|
logic [`XLEN-1:0] FIntResM;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic FDivBusyE;
|
|
|
|
logic IllegalFPUInstrD, IllegalFPUInstrE;
|
2021-07-13 17:20:30 +00:00
|
|
|
logic FRegWriteM;
|
2021-07-02 16:52:26 +00:00
|
|
|
logic FPUStallD;
|
|
|
|
logic [4:0] SetFflagsM;
|
2021-01-30 04:43:48 +00:00
|
|
|
|
2021-03-04 08:11:34 +00:00
|
|
|
// memory management unit signals
|
2021-10-23 17:12:33 +00:00
|
|
|
logic ITLBWriteF;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic ITLBFlushF, DTLBFlushM;
|
2021-10-23 17:12:33 +00:00
|
|
|
logic ITLBMissF;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic [`XLEN-1:0] SATP_REGW;
|
2021-07-04 17:20:29 +00:00
|
|
|
logic STATUS_MXR, STATUS_SUM, STATUS_MPRV;
|
|
|
|
logic [1:0] STATUS_MPP;
|
2021-06-24 18:05:22 +00:00
|
|
|
logic [1:0] PrivilegeModeW;
|
2021-07-17 19:04:39 +00:00
|
|
|
logic [`XLEN-1:0] PTE;
|
2021-07-17 06:31:23 +00:00
|
|
|
logic [1:0] PageType;
|
2021-03-04 08:11:34 +00:00
|
|
|
|
2021-04-22 19:34:02 +00:00
|
|
|
// PMA checker signals
|
2021-06-21 05:17:08 +00:00
|
|
|
var logic [`XLEN-1:0] PMPADDR_ARRAY_REGW [`PMP_ENTRIES-1:0];
|
2021-07-04 15:39:59 +00:00
|
|
|
var logic [7:0] PMPCFG_ARRAY_REGW[`PMP_ENTRIES-1:0];
|
2021-04-22 19:34:02 +00:00
|
|
|
|
2021-03-30 19:25:07 +00:00
|
|
|
// IMem stalls
|
2021-06-24 18:05:22 +00:00
|
|
|
logic ICacheStallF;
|
2021-07-15 15:16:16 +00:00
|
|
|
logic LSUStall;
|
2021-07-04 18:49:38 +00:00
|
|
|
|
2021-06-25 20:07:41 +00:00
|
|
|
|
2021-03-18 18:35:46 +00:00
|
|
|
|
2021-07-09 20:16:38 +00:00
|
|
|
// cpu lsu interface
|
2021-06-24 18:05:22 +00:00
|
|
|
logic [2:0] Funct3M;
|
2021-07-09 20:16:38 +00:00
|
|
|
logic [`XLEN-1:0] MemAdrM, MemAdrE, WriteDataM;
|
2021-07-22 19:51:14 +00:00
|
|
|
logic [`XLEN-1:0] ReadDataM;
|
|
|
|
logic [`XLEN-1:0] ReadDataW;
|
2021-07-09 20:16:38 +00:00
|
|
|
logic CommittedM;
|
|
|
|
|
|
|
|
// AHB ifu interface
|
2021-06-24 18:05:22 +00:00
|
|
|
logic [`PA_BITS-1:0] InstrPAdrF;
|
|
|
|
logic [`XLEN-1:0] InstrRData;
|
|
|
|
logic InstrReadF;
|
2021-07-09 20:16:38 +00:00
|
|
|
logic InstrAckF;
|
|
|
|
|
|
|
|
// AHB LSU interface
|
|
|
|
logic [`PA_BITS-1:0] DCtoAHBPAdrM;
|
|
|
|
logic DCtoAHBReadM;
|
|
|
|
logic DCtoAHBWriteM;
|
|
|
|
logic DCfromAHBAck;
|
|
|
|
logic [`XLEN-1:0] DCfromAHBReadData;
|
|
|
|
logic [`XLEN-1:0] DCtoAHBWriteData;
|
|
|
|
|
2021-06-24 18:05:22 +00:00
|
|
|
logic BPPredWrongE;
|
|
|
|
logic BPPredDirWrongM;
|
|
|
|
logic BTBPredPCWrongM;
|
|
|
|
logic RASPredPCWrongM;
|
|
|
|
logic BPPredClassNonCFIWrongM;
|
|
|
|
logic [4:0] InstrClassM;
|
2021-07-06 18:43:53 +00:00
|
|
|
logic InstrAccessFaultF;
|
2021-07-09 20:16:38 +00:00
|
|
|
logic [2:0] DCtoAHBSizeM;
|
2021-07-06 18:43:53 +00:00
|
|
|
|
2021-07-14 20:00:33 +00:00
|
|
|
logic ExceptionM;
|
|
|
|
logic PendingInterruptM;
|
2021-07-20 03:12:20 +00:00
|
|
|
logic DCacheMiss;
|
|
|
|
logic DCacheAccess;
|
2021-08-23 20:43:43 +00:00
|
|
|
logic BreakpointFaultM, EcallFaultM;
|
2021-07-01 22:59:55 +00:00
|
|
|
|
2021-06-24 18:05:22 +00:00
|
|
|
|
2021-10-27 20:45:37 +00:00
|
|
|
ifu ifu(
|
2021-11-17 20:39:05 +00:00
|
|
|
.clk, .reset,
|
|
|
|
.StallF, .StallD, .StallE, .StallM, .StallW,
|
|
|
|
.FlushF, .FlushD, .FlushE, .FlushM, .FlushW,
|
|
|
|
|
2021-11-21 04:35:47 +00:00
|
|
|
.ExceptionM, .PendingInterruptM,
|
2021-11-17 20:39:05 +00:00
|
|
|
// Fetch
|
|
|
|
.InstrInF(InstrRData), .InstrAckF, .PCF, .InstrPAdrF,
|
|
|
|
.InstrReadF, .ICacheStallF,
|
|
|
|
|
|
|
|
// Execute
|
2021-10-27 20:45:37 +00:00
|
|
|
.PCLinkE, .PCSrcE, .PCTargetE, .PCE,
|
|
|
|
.BPPredWrongE,
|
2021-11-17 20:39:05 +00:00
|
|
|
|
|
|
|
// Mem
|
|
|
|
.RetM, .TrapM, .PrivilegedNextPCM, .InvalidateICacheM,
|
|
|
|
.InstrD, .InstrM, . PCM, .InstrClassM, .BPPredDirWrongM,
|
|
|
|
.BTBPredPCWrongM, .RASPredPCWrongM, .BPPredClassNonCFIWrongM,
|
|
|
|
|
|
|
|
// Writeback
|
|
|
|
|
|
|
|
// output logic
|
|
|
|
// Faults
|
|
|
|
.IllegalBaseInstrFaultD, .ITLBInstrPageFaultF,
|
|
|
|
.IllegalIEUInstrFaultD, .InstrMisalignedFaultM,
|
|
|
|
.InstrMisalignedAdrM,
|
|
|
|
|
|
|
|
// mmu management
|
2021-10-27 20:45:37 +00:00
|
|
|
.PrivilegeModeW, .PTE, .PageType, .SATP_REGW,
|
2021-11-17 20:39:05 +00:00
|
|
|
.STATUS_MXR, .STATUS_SUM, .STATUS_MPRV,
|
|
|
|
.STATUS_MPP, .ITLBWriteF, .ITLBFlushF,
|
|
|
|
.WalkerInstrPageFaultF, .ITLBMissF,
|
|
|
|
|
|
|
|
// pmp/pma (inside mmu) signals. *** temporarily from AHB bus but eventually replace with internal versions pre H
|
|
|
|
.PMPCFG_ARRAY_REGW, .PMPADDR_ARRAY_REGW,
|
2021-10-27 20:45:37 +00:00
|
|
|
.InstrAccessFaultF
|
2021-11-17 20:39:05 +00:00
|
|
|
|
2021-10-27 20:45:37 +00:00
|
|
|
|
|
|
|
); // instruction fetch unit: PC, branch prediction, instruction cache
|
|
|
|
|
2021-01-28 03:49:47 +00:00
|
|
|
|
2021-11-17 21:24:28 +00:00
|
|
|
ieu ieu(
|
|
|
|
.clk, .reset,
|
|
|
|
|
|
|
|
// Decode Stage interface
|
|
|
|
.InstrD, .IllegalIEUInstrFaultD,
|
|
|
|
.IllegalBaseInstrFaultD,
|
|
|
|
|
|
|
|
// Execute Stage interface
|
|
|
|
.PCE, .PCLinkE, .FWriteIntE, .IllegalFPUInstrE,
|
|
|
|
.FWriteDataE, .PCTargetE, .MulDivE, .W64E,
|
|
|
|
.Funct3E, .ForwardedSrcAE, .ForwardedSrcBE, // *** these are the src outputs before the mux choosing between them and PCE to put in srcA/B
|
|
|
|
.SrcAE, .SrcBE, .FWriteIntM,
|
|
|
|
|
|
|
|
// Memory stage interface
|
|
|
|
.SquashSCW, // from LSU
|
|
|
|
.MemRWM, // read/write control goes to LSU
|
|
|
|
.AtomicE, // atomic control goes to LSU
|
|
|
|
.AtomicM, // atomic control goes to LSU
|
|
|
|
.MemAdrM, .MemAdrE, .WriteDataM, // Address and write data to LSU
|
|
|
|
.Funct3M, // size and signedness to LSU
|
|
|
|
.SrcAM, // to privilege and fpu
|
|
|
|
.RdM, .FIntResM, .InvalidateICacheM, .FlushDCacheM,
|
|
|
|
|
|
|
|
// Writeback stage
|
|
|
|
.CSRReadValW, .ReadDataM, .MulDivResultW,
|
|
|
|
.FWriteIntW, .RdW, .ReadDataW,
|
|
|
|
.InstrValidM,
|
|
|
|
|
|
|
|
// hazards
|
|
|
|
.StallD, .StallE, .StallM, .StallW,
|
|
|
|
.FlushD, .FlushE, .FlushM, .FlushW,
|
|
|
|
.FPUStallD, .LoadStallD, .MulDivStallD, .CSRRdStallD,
|
|
|
|
.PCSrcE,
|
|
|
|
.CSRReadM, .CSRWriteM, .PrivilegedM,
|
|
|
|
.CSRWritePendingDEM, .StoreStallD
|
|
|
|
|
|
|
|
); // integer execution unit: integer register file, datapath and controller
|
2021-05-21 02:17:59 +00:00
|
|
|
|
2021-07-03 20:51:25 +00:00
|
|
|
lsu lsu(.clk(clk),
|
|
|
|
.reset(reset),
|
|
|
|
.StallM(StallM),
|
|
|
|
.FlushM(FlushM),
|
2021-07-04 18:49:38 +00:00
|
|
|
.StallW(StallW),
|
2021-07-03 20:51:25 +00:00
|
|
|
.FlushW(FlushW),
|
2021-07-09 20:16:38 +00:00
|
|
|
// CPU interface
|
2021-07-04 18:49:38 +00:00
|
|
|
.MemRWM(MemRWM),
|
2021-07-09 20:16:38 +00:00
|
|
|
.Funct3M(Funct3M),
|
|
|
|
.Funct7M(InstrM[31:25]),
|
2021-07-14 20:00:33 +00:00
|
|
|
.AtomicM(AtomicM),
|
|
|
|
.ExceptionM(ExceptionM),
|
|
|
|
.PendingInterruptM(PendingInterruptM),
|
2021-07-20 03:12:20 +00:00
|
|
|
.CommittedM(CommittedM),
|
|
|
|
.DCacheMiss,
|
|
|
|
.DCacheAccess,
|
2021-07-04 18:49:38 +00:00
|
|
|
.SquashSCW(SquashSCW),
|
2021-10-23 19:00:32 +00:00
|
|
|
//.DataMisalignedM(DataMisalignedM),
|
2021-07-09 20:16:38 +00:00
|
|
|
.MemAdrE(MemAdrE),
|
2021-07-04 18:49:38 +00:00
|
|
|
.MemAdrM(MemAdrM),
|
|
|
|
.WriteDataM(WriteDataM),
|
2021-07-22 19:51:14 +00:00
|
|
|
.ReadDataM(ReadDataM),
|
2021-09-15 17:14:00 +00:00
|
|
|
.FlushDCacheM,
|
2021-07-03 20:51:25 +00:00
|
|
|
|
|
|
|
// connected to ahb (all stay the same)
|
2021-07-09 20:16:38 +00:00
|
|
|
.DCtoAHBPAdrM(DCtoAHBPAdrM),
|
|
|
|
.DCtoAHBReadM(DCtoAHBReadM),
|
|
|
|
.DCtoAHBWriteM(DCtoAHBWriteM),
|
|
|
|
.DCfromAHBAck(DCfromAHBAck),
|
|
|
|
.DCfromAHBReadData(DCfromAHBReadData),
|
|
|
|
.DCtoAHBWriteData(DCtoAHBWriteData),
|
2021-07-13 22:24:59 +00:00
|
|
|
.DCtoAHBSizeM(DCtoAHBSizeM),
|
2021-07-03 20:51:25 +00:00
|
|
|
|
|
|
|
// connect to csr or privilege and stay the same.
|
|
|
|
.PrivilegeModeW(PrivilegeModeW), // connects to csr
|
|
|
|
.PMPCFG_ARRAY_REGW(PMPCFG_ARRAY_REGW), // connects to csr
|
|
|
|
.PMPADDR_ARRAY_REGW(PMPADDR_ARRAY_REGW), // connects to csr
|
|
|
|
// hptw keep i/o
|
|
|
|
.SATP_REGW(SATP_REGW), // from csr
|
|
|
|
.STATUS_MXR(STATUS_MXR), // from csr
|
|
|
|
.STATUS_SUM(STATUS_SUM), // from csr
|
2021-07-04 21:19:39 +00:00
|
|
|
.STATUS_MPRV(STATUS_MPRV), // from csr
|
|
|
|
.STATUS_MPP(STATUS_MPP), // from csr
|
2021-07-03 20:51:25 +00:00
|
|
|
|
|
|
|
.DTLBFlushM(DTLBFlushM), // connects to privilege
|
|
|
|
.DTLBLoadPageFaultM(DTLBLoadPageFaultM), // connects to privilege
|
|
|
|
.DTLBStorePageFaultM(DTLBStorePageFaultM), // connects to privilege
|
|
|
|
.LoadMisalignedFaultM(LoadMisalignedFaultM), // connects to privilege
|
|
|
|
.LoadAccessFaultM(LoadAccessFaultM), // connects to privilege
|
|
|
|
.StoreMisalignedFaultM(StoreMisalignedFaultM), // connects to privilege
|
|
|
|
.StoreAccessFaultM(StoreAccessFaultM), // connects to privilege
|
|
|
|
|
2021-07-04 18:49:38 +00:00
|
|
|
.PCF(PCF),
|
|
|
|
.ITLBMissF(ITLBMissF),
|
2021-07-17 19:04:39 +00:00
|
|
|
.PTE(PTE),
|
2021-07-17 06:31:23 +00:00
|
|
|
.PageType,
|
2021-07-04 18:49:38 +00:00
|
|
|
.ITLBWriteF(ITLBWriteF),
|
|
|
|
.WalkerInstrPageFaultF(WalkerInstrPageFaultF),
|
|
|
|
.WalkerLoadPageFaultM(WalkerLoadPageFaultM),
|
|
|
|
.WalkerStorePageFaultM(WalkerStorePageFaultM),
|
2021-07-15 15:16:16 +00:00
|
|
|
.LSUStall(LSUStall)); // change to LSUStall
|
2021-07-09 20:16:38 +00:00
|
|
|
|
2021-06-23 21:43:22 +00:00
|
|
|
|
2021-07-09 20:16:38 +00:00
|
|
|
|
2021-06-23 21:43:22 +00:00
|
|
|
|
2021-07-09 20:16:38 +00:00
|
|
|
ahblite ebu(// IFU connections
|
|
|
|
.InstrPAdrF(InstrPAdrF),
|
|
|
|
.InstrReadF(InstrReadF),
|
|
|
|
.InstrRData(InstrRData),
|
|
|
|
.InstrAckF(InstrAckF),
|
|
|
|
// LSU connections
|
|
|
|
.DCtoAHBPAdrM(DCtoAHBPAdrM), // rename to DCtoAHBPAdrM
|
|
|
|
.DCtoAHBReadM(DCtoAHBReadM), // rename to DCtoAHBReadM
|
|
|
|
.DCtoAHBWriteM(DCtoAHBWriteM), // rename to DCtoAHBWriteM
|
|
|
|
.DCtoAHBWriteData(DCtoAHBWriteData),
|
|
|
|
.DCfromAHBReadData(DCfromAHBReadData),
|
|
|
|
.DCfromAHBAck(DCfromAHBAck),
|
|
|
|
// remove these
|
|
|
|
.MemSizeM(DCtoAHBSizeM[1:0]), // *** depends on XLEN should be removed
|
|
|
|
.UnsignedLoadM(1'b0),
|
|
|
|
.AtomicMaskedM(2'b00),
|
2021-06-24 18:05:22 +00:00
|
|
|
.*);
|
2021-06-23 21:43:22 +00:00
|
|
|
|
2021-06-24 18:05:22 +00:00
|
|
|
|
2021-11-17 22:21:23 +00:00
|
|
|
muldiv mdu(
|
|
|
|
.clk, .reset,
|
|
|
|
// Execute Stage interface
|
|
|
|
// .SrcAE, .SrcBE,
|
|
|
|
.ForwardedSrcAE, .ForwardedSrcBE, // *** these are the src outputs before the mux choosing between them and PCE to put in srcA/B
|
|
|
|
.Funct3E, .Funct3M,
|
|
|
|
.MulDivE, .W64E,
|
|
|
|
// Writeback stage
|
|
|
|
.MulDivResultW,
|
|
|
|
// Divide Done
|
|
|
|
.DivBusyE,
|
|
|
|
// hazards
|
|
|
|
.StallM, .StallW, .FlushM, .FlushW
|
|
|
|
); // multiply and divide unit
|
2021-04-03 20:52:26 +00:00
|
|
|
|
2021-11-17 22:08:08 +00:00
|
|
|
hazard hzu(
|
|
|
|
.BPPredWrongE, .CSRWritePendingDEM, .RetM, .TrapM,
|
|
|
|
.LoadStallD, .StoreStallD, .MulDivStallD, .CSRRdStallD,
|
|
|
|
.LSUStall, .ICacheStallF,
|
|
|
|
.FPUStallD, .FStallD,
|
|
|
|
.DivBusyE, .FDivBusyE,
|
|
|
|
.EcallFaultM, .BreakpointFaultM,
|
|
|
|
.InvalidateICacheM,
|
|
|
|
// Stall & flush outputs
|
|
|
|
.StallF, .StallD, .StallE, .StallM, .StallW,
|
|
|
|
.FlushF, .FlushD, .FlushE, .FlushM, .FlushW); // global stall and flush control
|
2021-01-27 11:40:26 +00:00
|
|
|
|
|
|
|
// Priveleged block operates in M and W stages, handling CSRs and exceptions
|
2021-01-27 12:46:52 +00:00
|
|
|
privileged priv(.*);
|
2021-04-03 20:52:26 +00:00
|
|
|
|
2021-01-27 11:40:26 +00:00
|
|
|
|
2021-06-08 16:32:46 +00:00
|
|
|
fpu fpu(.*); // floating point unit
|
2021-06-24 18:05:22 +00:00
|
|
|
|
2021-01-15 04:37:51 +00:00
|
|
|
endmodule
|