From 00500c668572cafe2f931b61563f44bd9da2eacb Mon Sep 17 00:00:00 2001 From: David Harris Date: Sat, 14 Jan 2023 17:49:10 -0800 Subject: [PATCH] mmu cleanup --- pipelined/src/mmu/adrdec.sv | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pipelined/src/mmu/adrdec.sv b/pipelined/src/mmu/adrdec.sv index 0d8248f26..7f8ed324c 100644 --- a/pipelined/src/mmu/adrdec.sv +++ b/pipelined/src/mmu/adrdec.sv @@ -27,17 +27,17 @@ `include "wally-config.vh" module adrdec ( - input logic [`PA_BITS-1:0] PhysicalAddress, - input logic [`PA_BITS-1:0] Base, Range, - input logic Supported, - input logic AccessValid, - input logic [1:0] Size, - input logic [3:0] SizeMask, - output logic Sel + input logic [`PA_BITS-1:0] PhysicalAddress, // Physical address to decode + input logic [`PA_BITS-1:0] Base, Range, // Base and range of peripheral addresses + input logic Supported, // Is this peripheral supported? + input logic AccessValid, // Is the access type valid? + input logic [1:0] Size, // Size of access + input logic [3:0] SizeMask, // List of supported sizes: 0 = 8, 1 = 16, 2 = 32, 3 = 64-bit + output logic Sel // Decoder selects this peripheral ); - logic Match; - logic SizeValid; + logic Match; // Address matches in range + logic SizeValid; // Size of access is valid // determine if an address is in a range starting at the base // for example, if Base = 0x04002000 and range = 0x00000FFF, @@ -47,7 +47,7 @@ module adrdec ( // determine if legal size of access is being made (byte, halfword, word, doubleword) assign SizeValid = SizeMask[Size]; + // Select this peripheral if the address matches, the peripheral is supported, and the type and size of access is ok assign Sel = Match & Supported & AccessValid & SizeValid; - endmodule