forked from Github_Repos/cvw
added a few very simple arbitrations in the lsuArb that pass regression. cleaned up a few unused signals. Added several comments and concerns to lsuarb so I can remember where my thoughts were at the end of the day.
This commit is contained in:
parent
286b4b5b26
commit
c8f80967a6
@ -76,7 +76,7 @@ module ifu (
|
||||
|
||||
// pmp/pma (inside mmu) signals. *** temporarily from AHB bus but eventually replace with internal versions pre H
|
||||
input logic [31:0] HADDR,
|
||||
input logic [2:0] HSIZE, HBURST,
|
||||
input logic [2:0] HSIZE,
|
||||
input logic HWRITE,
|
||||
input logic ExecuteAccessF, //read, write, and atomic access are all set to zero because this mmu is onlt working with instructinos in the F stage.
|
||||
input logic [63:0] PMPCFG01_REGW, PMPCFG23_REGW, // *** all of these come from the privileged unit, so they're gonna have to come over into ifu and dmem
|
||||
|
@ -42,9 +42,6 @@ module lsu (
|
||||
output logic SquashSCW,
|
||||
output logic DataMisalignedM,
|
||||
|
||||
// part of the page table walker
|
||||
input logic DisableTranslation,
|
||||
|
||||
// address and write data
|
||||
input logic [`XLEN-1:0] MemAdrM,
|
||||
input logic [`XLEN-1:0] WriteDataM,
|
||||
@ -78,6 +75,7 @@ module lsu (
|
||||
input logic STATUS_MXR, STATUS_SUM, // from csr
|
||||
input logic DTLBWriteM,
|
||||
output logic DTLBMissM,
|
||||
input logic DisableTranslation, // used to stop intermediate PTE physical addresses being saved to TLB.
|
||||
|
||||
|
||||
|
||||
@ -85,7 +83,7 @@ module lsu (
|
||||
|
||||
// PMA/PMP (inside mmu) signals
|
||||
input logic [31:0] HADDR, // *** replace all of these H inputs with physical adress once pma checkers have been edited to use paddr as well.
|
||||
input logic [2:0] HSIZE, HBURST,
|
||||
input logic [2:0] HSIZE,
|
||||
input logic HWRITE,
|
||||
input logic AtomicAccessM, WriteAccessM, ReadAccessM, // execute access is hardwired to zero in this mmu because we're only working with data in the M stage.
|
||||
input logic [63:0] PMPCFG01_REGW, PMPCFG23_REGW, // *** all of these come from the privileged unit, so thwyre gonna have to come over into ifu and dmem
|
||||
|
@ -26,29 +26,76 @@
|
||||
|
||||
`include "wally-config.vh"
|
||||
|
||||
module lsuArb
|
||||
(input logic clk, reset,
|
||||
module lsuArb (
|
||||
input logic clk, reset,
|
||||
|
||||
// signals from page table walker
|
||||
output logic [`XLEN-1:0] MMUReadPTE,
|
||||
input logic MMUTranslate, // *** rename to HPTWReq
|
||||
output logic MMUReady,
|
||||
input logic [`XLEN-1:0] MMUPAdr,
|
||||
// output logic [`XLEN-1:0] MMUReadPTE, // *** it seems like this is the value out of the ahblite that gets sent back to the ptw. I don;t think it needs to get checked until the next paddr has been extracted from it.
|
||||
input logic MMUTranslate, // *** rename to HPTWReq
|
||||
// output logic MMUReady, // *** Similar reason to mmuReadPTE
|
||||
input logic [`XLEN-1:0] MMUPAdr,
|
||||
|
||||
// signal from CPU
|
||||
input logic [1:0] MemRWM,
|
||||
input logic [2:0] Funct3M,
|
||||
input logic [1:0] AtomicM,
|
||||
// back to CPU
|
||||
output logic CommittedM,
|
||||
output logic SquashSCW,
|
||||
output logic DataMisalignedM,
|
||||
// signal from CPU
|
||||
input logic [1:0] MemRWM,
|
||||
input logic [2:0] Funct3M,
|
||||
input logic [1:0] AtomicM,
|
||||
input logic [`XLEN-1:0] MemAdrM, // memory addrress to be checked coming from the CPU. *** this will be used to arbitrate to decide HADDR going into the PM checks, but it also gets sent in its normal form to the lsu because we need the virtual address for the tlb.
|
||||
// back to CPU
|
||||
|
||||
// to LSU
|
||||
output logic DisableTranslation,
|
||||
output logic [1:0] MemRWMtoLSU,
|
||||
output logic [2:0] Funct3MtoLSU,
|
||||
output logic [1:0] AtomicMtoLSU,
|
||||
/* *** unused for not (23 June 2021)
|
||||
output logic CommittedM,
|
||||
output logic SquashSCW,
|
||||
output logic DataMisalignedM,
|
||||
*/
|
||||
// to LSU
|
||||
output logic DisableTranslation,
|
||||
output logic [1:0] MemRWMtoLSU,
|
||||
output logic [2:0] Funct3MtoLSU,
|
||||
output logic [1:0] AtomicMtoLSU
|
||||
|
||||
/* *********** KMG: A lot of the rest of the signals that need to be arbitrated are going to be very annoying
|
||||
these are the ones that used to get sent from the ahb to the pma checkers. but our eventual
|
||||
goal is to have many of them sent thru the pmp/pma FIRST before the bus can get to them.
|
||||
|
||||
deciding how to choose the right Haddr for the PM checkers will be difficult since they currently get
|
||||
HADDR from the ahblite which seems like it could come from any number of sources, while we will eventually be narrowing it down to two possible sources.
|
||||
|
||||
other problems arise when some signals like HSIZE are used in the PM checks but there's also a differnent size input to the tlb and both of these get to go through the mmu.
|
||||
which one should be chosen for which device? can the be merged somehow?
|
||||
|
||||
*/
|
||||
|
||||
/*// pmp/pma specifics sent through lsu
|
||||
output logic [`XLEN-1:0] HADDRtoLSU,
|
||||
output logic [2:0] HSIZEtoLSU // *** May not actually need to be arbitrated, since I'm
|
||||
*/
|
||||
);
|
||||
|
||||
/* *** these are all the signals that get sent to the pmp/pma chackers straight from the ahblite. We want to switch it around so the
|
||||
checkers get these signals first and then the newly checked values can get sent to the ahblite.
|
||||
input logic [31:0] HADDR, // *** replace all of these H inputs with physical adress once pma checkers have been edited to use paddr as well.
|
||||
input logic [2:0] HSIZE,
|
||||
input logic HWRITE,
|
||||
input logic AtomicAccessM, WriteAccessM, ReadAccessM, // execute access is hardwired to zero in this mmu because we're only working with data in the M stage.
|
||||
*/
|
||||
|
||||
generate
|
||||
if (`XLEN == 32) begin
|
||||
|
||||
assign Funct3MtoLSU = MMUTranslate ? 3'b010 : Funct3M; // *** is this the right thing for the msB?
|
||||
|
||||
end else begin
|
||||
|
||||
assign Funct3MtoLSU = MMUTranslate ? 3'b011 : Funct3M; // *** is this the right thing for the msB?
|
||||
|
||||
end
|
||||
endgenerate
|
||||
|
||||
assign AtomicMtoLSU = MMUTranslate ? 2'b00 : AtomicM;
|
||||
assign MemRWMtoLSU = MemRWM; // *** along with the rest of the lsu, the mmu uses memrwm in it's pure form so I think we can just forward it through
|
||||
assign DisableTranslation = MMUTranslate;
|
||||
// assign HADDRtoLSU = MMUTranslate ? MMUPAdr : MemAdrM; // *** Potentially a huge breaking point since the PM checks always get HADDR from ahblite and not necessarily just these two sources. this will need to be looked over when we fix PM to only take physical addresses.
|
||||
// assign HSIZEtoLSU = {1'b0, Funct3MtoLSU[1:0]}; // the Hsize is always just the funct3M indicating the size of the data transfer.
|
||||
|
||||
|
||||
|
||||
|
@ -68,7 +68,7 @@ module mmu #(parameter ENTRY_BITS = 3,
|
||||
|
||||
// PMA checker signals
|
||||
input logic [31:0] HADDR,
|
||||
input logic [2:0] HSIZE, HBURST,
|
||||
input logic [2:0] HSIZE,
|
||||
input logic HWRITE,
|
||||
input logic AtomicAccessM, ExecuteAccessF, WriteAccessM, ReadAccessM,
|
||||
input logic [63:0] PMPCFG01_REGW, PMPCFG23_REGW, // *** all of these come from the privileged unit, so thwyre gonna have to come over into ifu and dmem
|
||||
|
@ -52,7 +52,7 @@ module pagetablewalker (
|
||||
|
||||
|
||||
|
||||
// *** modify to send to LSU
|
||||
// *** modify to send to LSU // *** KMG: These are inputs/results from the ahblite whose addresses should have already been checked, so I don't think they need to be sent through the LSU
|
||||
input logic [`XLEN-1:0] MMUReadPTE,
|
||||
input logic MMUReady,
|
||||
|
||||
|
@ -155,7 +155,12 @@ module wallypipelinedhart (
|
||||
logic [4:0] InstrClassM;
|
||||
|
||||
logic [`XLEN-1:0] HRDATAW;
|
||||
|
||||
|
||||
// IEU vs HPTW arbitration signals to send to LSU
|
||||
logic DisableTranslation;
|
||||
logic [1:0] MemRWMtoLSU;
|
||||
logic [2:0] Funct3MtoLSU;
|
||||
logic [1:0] AtomicMtoLSU;
|
||||
|
||||
ifu ifu(.InstrInF(InstrRData), .*); // instruction fetch unit: PC, branch prediction, instruction cache
|
||||
|
||||
@ -174,13 +179,19 @@ module wallypipelinedhart (
|
||||
.MemSizeM(Funct3M[1:0]), .UnsignedLoadM(Funct3M[2]),
|
||||
.*); */
|
||||
|
||||
|
||||
// arbiter between IEU and pagetablewalker
|
||||
lsuArb arbiter(.MMUTranslate(MMUTranslate), .MMUPAdr(MMUPAdr), .MemRWM(MemRWM|FMemRWM),
|
||||
.Funct3M(Funct3M), .AtomicM(AtomicM), .MemAdrM(MemAdrM),
|
||||
// outputs to LSU
|
||||
.DisableTranslation(DisableTranslation), .MemRWMtoLSU(MemRWMtoLSU), .Funct3MtoLSU(Funct3MtoLSU),
|
||||
.AtomicMtoLSU(AtomicMtoLSU), .*);
|
||||
|
||||
|
||||
lsu lsu(.MemRWM(MemRWM|FMemRWM), .WriteDataM(WriteDatatmpM),.*,
|
||||
.ReadDataW(ReadDataW),
|
||||
.DisableTranslation(1'b0) // *** will connect to page table walker arbiter
|
||||
); // data cache unit
|
||||
lsu lsu(.MemRWM(MemRWMtoLSU), .AtomicM(AtomicMtoLSU), .Funct3M(Funct3MtoLSU),
|
||||
.DisableTranslation(DisableTranslation),
|
||||
.WriteDataM(WriteDatatmpM),
|
||||
.ReadDataW(ReadDataW), .* ); // data cache unit
|
||||
|
||||
ahblite ebu(
|
||||
//.InstrReadF(1'b0),
|
||||
|
Loading…
Reference in New Issue
Block a user