From 7d857cf4bd9a43a1fc7c8fa2ecafe62b84dd807b Mon Sep 17 00:00:00 2001 From: David Harris Date: Tue, 6 Jul 2021 18:39:30 -0400 Subject: [PATCH] more TLB name touchups --- wally-pipelined/src/mmu/tlb.sv | 13 ++----------- wally-pipelined/src/mmu/tlbcam.sv | 7 +++---- wally-pipelined/src/mmu/tlbcontrol.sv | 4 ++-- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/wally-pipelined/src/mmu/tlb.sv b/wally-pipelined/src/mmu/tlb.sv index bdd6ec081..34db4341a 100644 --- a/wally-pipelined/src/mmu/tlb.sv +++ b/wally-pipelined/src/mmu/tlb.sv @@ -89,10 +89,6 @@ module tlb #(parameter TLB_ENTRIES = 8, output logic TLBPageFault ); - // Store current virtual memory mode (SV32, SV39, SV48, ect...) - //logic [`SVMODE_BITS-1:0] SvMode; - logic [1:0] EffectivePrivilegeMode; // privilege mode, possibly modified by MPRV - logic [TLB_ENTRIES-1:0] ReadLines, WriteEnables, PTE_G; // used as the one-hot encoding of WriteIndex // Sections of the virtual and physical addresses @@ -113,19 +109,14 @@ module tlb #(parameter TLB_ENTRIES = 8, tlbcontrol tlbcontrol(.SATP_REGW, .Address, .STATUS_MXR, .STATUS_SUM, .STATUS_MPRV, .STATUS_MPP, .PrivilegeModeW, .ReadAccess, .WriteAccess, .DisableTranslation, .TLBFlush, - .PTEAccessBits, .CAMHit, .TLBMiss, .TLBHit, .TLBPageFault, .EffectivePrivilegeMode, + .PTEAccessBits, .CAMHit, .TLBMiss, .TLBHit, .TLBPageFault, .SV39Mode, .Translate); - // TLB entries are evicted according to the LRU algorithm tlblru #(TLB_ENTRIES) lru(.clk, .reset, .TLBWrite, .TLBFlush, .ReadLines, .CAMHit, .WriteEnables); - - // tlbram #(TLB_ENTRIES) tlbram(.*); - tlbram #(TLB_ENTRIES) tlbram(.clk, .reset, .PTE, .ReadLines, .WriteEnables, .PhysicalPageNumber, .PTEAccessBits, .PTE_G); - - // tlbcam #(TLB_ENTRIES, `VPN_BITS + `ASID_BITS, `VPN_SEGMENT_BITS) tlbcam(.*); tlbcam #(TLB_ENTRIES, `VPN_BITS + `ASID_BITS, `VPN_SEGMENT_BITS) tlbcam(.clk, .reset, .VirtualPageNumber, .PageTypeWriteVal, .SV39Mode, .TLBFlush, .WriteEnables, .PTE_G, .ASID(SATP_REGW[`ASID_BASE+`ASID_BITS-1:`ASID_BASE]), .ReadLines, .HitPageType, .CAMHit); + tlbram #(TLB_ENTRIES) tlbram(.clk, .reset, .PTE, .ReadLines, .WriteEnables, .PhysicalPageNumber, .PTEAccessBits, .PTE_G); // Replace segments of the virtual page number with segments of the physical // page number. For 4 KB pages, the entire virtual page number is replaced. diff --git a/wally-pipelined/src/mmu/tlbcam.sv b/wally-pipelined/src/mmu/tlbcam.sv index 35a6fb3fe..2a7879512 100644 --- a/wally-pipelined/src/mmu/tlbcam.sv +++ b/wally-pipelined/src/mmu/tlbcam.sv @@ -54,11 +54,10 @@ module tlbcam #(parameter TLB_ENTRIES = 8, // page number segments. tlbcamline #(KEY_BITS, SEGMENT_BITS) camlines[TLB_ENTRIES-1:0]( - .WriteEnable(WriteEnables), - .PageTypeRead, // *** change name to agree - .Match(ReadLines), // *** change name to agree - .*); + .clk, .reset, .VirtualPageNumber, .ASID, .SV39Mode, .PTE_G, .PageTypeWriteVal, .TLBFlush, + .WriteEnable(WriteEnables), .PageTypeRead, .Match(ReadLines)); assign CAMHit = |ReadLines & ~TLBFlush; assign HitPageType = PageTypeRead.or; // applies OR to elements of the (TLB_ENTRIES x 2) array to get 2-bit result endmodule + diff --git a/wally-pipelined/src/mmu/tlbcontrol.sv b/wally-pipelined/src/mmu/tlbcontrol.sv index 85731217e..1a8b85fc6 100644 --- a/wally-pipelined/src/mmu/tlbcontrol.sv +++ b/wally-pipelined/src/mmu/tlbcontrol.sv @@ -48,14 +48,14 @@ module tlbcontrol #(parameter TLB_ENTRIES = 8, output logic TLBMiss, output logic TLBHit, output logic TLBPageFault, - output logic [1:0] EffectivePrivilegeMode, output logic SV39Mode, output logic Translate ); // Sections of the page table entry - logic [11:0] PageOffset; + logic [11:0] PageOffset; logic [`SVMODE_BITS-1:0] SVMode; + logic [1:0] EffectivePrivilegeMode; logic PTE_D, PTE_A, PTE_U, PTE_X, PTE_W, PTE_R; // Useful PTE Control Bits logic UpperBitsUnequalPageFault;