From 679e507cc689c91d0d23edc9c0f4a222b6576885 Mon Sep 17 00:00:00 2001 From: David Harris Date: Thu, 17 Jun 2021 21:36:32 -0400 Subject: [PATCH] Added SUPPORTED to each peripheral in each config file --- .../config/buildroot/wally-config.vh | 31 +++++++++++-------- .../config/busybear/wally-config.vh | 28 ++++++++++------- .../config/coremark-64i/wally-config.vh | 16 ++++++++-- .../config/coremark/wally-config.vh | 12 +++++-- .../config/coremark_bare/wally-config.vh | 12 +++++-- wally-pipelined/config/rv64BP/wally-config.vh | 10 +++++- .../config/rv64icfd/wally-config.vh | 15 ++++++--- .../config/rv64imc/wally-config.vh | 12 +++++-- wally-pipelined/src/mmu/pmaadrdec.sv | 2 +- wally-pipelined/src/mmu/pmachecker.sv | 12 +++---- 10 files changed, 106 insertions(+), 44 deletions(-) diff --git a/wally-pipelined/config/buildroot/wally-config.vh b/wally-pipelined/config/buildroot/wally-config.vh index 826f560f..065a6ebc 100644 --- a/wally-pipelined/config/buildroot/wally-config.vh +++ b/wally-pipelined/config/buildroot/wally-config.vh @@ -1,5 +1,5 @@ ////////////////////////////////////////// -// busybear-config.vh +// wally-config.vh // // Written: David_Harris@hmc.edu 4 January 2021 // Modified: @@ -61,22 +61,27 @@ // Peripheral Addresses // Peripheral memory space extends from BASE to BASE+RANGE // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits - +`define BOOTTIMSUPPORTED 1'b1 `define BOOTTIMBASE 32'h00000000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder `define BOOTTIMRANGE 32'h00003FFF -`define CLINTBASE 32'h02000000 -`define CLINTRANGE 32'h0000FFFF -`define PLICBASE 32'h0C000000 -`define PLICRANGE 32'h03FFFFFF -`define UARTBASE 32'h10000000 -`define UARTRANGE 32'h00000007 -`define VBD0BASE 32'h10001000 -`define VBD0RANGE 32'h000001FF -// differing from Imperas' OVPSim by not having a VND0 -`define GPIOBASE 32'h20000000 -`define GPIORANGE 32'h000000FF +//`define BOOTTIMBASE 32'h00001000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +//`define BOOTTIMRANGE 32'h00000FFF +`define TIMSUPPORTED 1'b1 `define TIMBASE 32'h80000000 `define TIMRANGE 32'h07FFFFFF +`define CLINTSUPPORTED 1'b1 +`define CLINTBASE 32'h02000000 +`define CLINTRANGE 32'h0000FFFF +`define GPIOSUPPORTED 1'b1 +`define GPIOBASE 32'h10012000 +`define GPIORANGE 32'h000000FF +`define UARTSUPPORTED 1'b1 +`define UARTBASE 32'h10000000 +`define UARTRANGE 32'h00000007 +`define PLICSUPPORTED 1'b1 +`define PLICBASE 32'h0C000000 +`define PLICRANGE 32'h03FFFFFF + // Bus Interface width `define AHBW 64 diff --git a/wally-pipelined/config/busybear/wally-config.vh b/wally-pipelined/config/busybear/wally-config.vh index ce189ff1..da7db228 100644 --- a/wally-pipelined/config/busybear/wally-config.vh +++ b/wally-pipelined/config/busybear/wally-config.vh @@ -62,21 +62,27 @@ // Peripheral memory space extends from BASE to BASE+RANGE // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits +`define BOOTTIMSUPPORTED 1'b1 `define BOOTTIMBASE 32'h00000000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder `define BOOTTIMRANGE 32'h00003FFF -`define CLINTBASE 32'h02000000 -`define CLINTRANGE 32'h0000FFFF -`define PLICBASE 32'h0C000000 -`define PLICRANGE 32'h03FFFFFF -`define UARTBASE 32'h10000000 -`define UARTRANGE 32'h00000007 -`define VBD0BASE 32'h10001000 -`define VBD0RANGE 32'h000001FF -// differing from Imperas' OVPSim by not having a VND0 -`define GPIOBASE 32'h20000000 -`define GPIORANGE 32'h000000FF +//`define BOOTTIMBASE 32'h00001000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +//`define BOOTTIMRANGE 32'h00000FFF +`define TIMSUPPORTED 1'b1 `define TIMBASE 32'h80000000 `define TIMRANGE 32'h07FFFFFF +`define CLINTSUPPORTED 1'b1 +`define CLINTBASE 32'h02000000 +`define CLINTRANGE 32'h0000FFFF +`define GPIOSUPPORTED 1'b1 +`define GPIOBASE 32'h10012000 +`define GPIORANGE 32'h000000FF +`define UARTSUPPORTED 1'b1 +`define UARTBASE 32'h10000000 +`define UARTRANGE 32'h00000007 +`define PLICSUPPORTED 1'b1 +`define PLICBASE 32'h0C000000 +`define PLICRANGE 32'h03FFFFFF + // Bus Interface width `define AHBW 64 diff --git a/wally-pipelined/config/coremark-64i/wally-config.vh b/wally-pipelined/config/coremark-64i/wally-config.vh index 2ac36a2a..848cb3bc 100644 --- a/wally-pipelined/config/coremark-64i/wally-config.vh +++ b/wally-pipelined/config/coremark-64i/wally-config.vh @@ -54,14 +54,26 @@ // Peripheral memory space extends from BASE to BASE+RANGE // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits -`define TIMBASE 32'h80000000 -`define TIMRANGE 32'h0007FFFF +`define BOOTTIMSUPPORTED 1'b1 +`define BOOTTIMBASE 32'h00000000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +`define BOOTTIMRANGE 32'h00003FFF +//`define BOOTTIMBASE 32'h00001000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +//`define BOOTTIMRANGE 32'h00000FFF +`define TIMSUPPORTED 1'b1 +`define TIMBASE 32'h80000000 +`define TIMRANGE 32'h07FFFFFF +`define CLINTSUPPORTED 1'b1 `define CLINTBASE 32'h02000000 `define CLINTRANGE 32'h0000FFFF +`define GPIOSUPPORTED 1'b1 `define GPIOBASE 32'h10012000 `define GPIORANGE 32'h000000FF +`define UARTSUPPORTED 1'b1 `define UARTBASE 32'h10000000 `define UARTRANGE 32'h00000007 +`define PLICSUPPORTED 1'b1 +`define PLICBASE 32'h0C000000 +`define PLICRANGE 32'h03FFFFFF // Test modes diff --git a/wally-pipelined/config/coremark/wally-config.vh b/wally-pipelined/config/coremark/wally-config.vh index d5935665..615e1802 100644 --- a/wally-pipelined/config/coremark/wally-config.vh +++ b/wally-pipelined/config/coremark/wally-config.vh @@ -62,16 +62,24 @@ // Peripheral memory space extends from BASE to BASE+RANGE // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits +`define BOOTTIMSUPPORTED 1'b1 `define BOOTTIMBASE 32'h00000000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder `define BOOTTIMRANGE 32'h00003FFF -`define TIMBASE 32'h00000000 -`define TIMRANGE 32'hFFFFFFFF +//`define BOOTTIMBASE 32'h00001000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +//`define BOOTTIMRANGE 32'h00000FFF +`define TIMSUPPORTED 1'b1 +`define TIMBASE 32'h80000000 +`define TIMRANGE 32'h07FFFFFF +`define CLINTSUPPORTED 1'b1 `define CLINTBASE 32'h02000000 `define CLINTRANGE 32'h0000FFFF +`define GPIOSUPPORTED 1'b1 `define GPIOBASE 32'h10012000 `define GPIORANGE 32'h000000FF +`define UARTSUPPORTED 1'b1 `define UARTBASE 32'h10000000 `define UARTRANGE 32'h00000007 +`define PLICSUPPORTED 1'b1 `define PLICBASE 32'h0C000000 `define PLICRANGE 32'h03FFFFFF diff --git a/wally-pipelined/config/coremark_bare/wally-config.vh b/wally-pipelined/config/coremark_bare/wally-config.vh index 2a9a6c4c..219e4225 100644 --- a/wally-pipelined/config/coremark_bare/wally-config.vh +++ b/wally-pipelined/config/coremark_bare/wally-config.vh @@ -62,16 +62,24 @@ // Peripheral memory space extends from BASE to BASE+RANGE // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits +`define BOOTTIMSUPPORTED 1'b1 `define BOOTTIMBASE 32'h00000000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder `define BOOTTIMRANGE 32'h00003FFF -`define TIMBASE 32'h80000000 -`define TIMRANGE 32'h000FFFFF +//`define BOOTTIMBASE 32'h00001000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +//`define BOOTTIMRANGE 32'h00000FFF +`define TIMSUPPORTED 1'b1 +`define TIMBASE 32'h80000000 +`define TIMRANGE 32'h07FFFFFF +`define CLINTSUPPORTED 1'b1 `define CLINTBASE 32'h02000000 `define CLINTRANGE 32'h0000FFFF +`define GPIOSUPPORTED 1'b1 `define GPIOBASE 32'h10012000 `define GPIORANGE 32'h000000FF +`define UARTSUPPORTED 1'b1 `define UARTBASE 32'h10000000 `define UARTRANGE 32'h00000007 +`define PLICSUPPORTED 1'b1 `define PLICBASE 32'h0C000000 `define PLICRANGE 32'h03FFFFFF diff --git a/wally-pipelined/config/rv64BP/wally-config.vh b/wally-pipelined/config/rv64BP/wally-config.vh index 6cc8ce73..0cf38f28 100644 --- a/wally-pipelined/config/rv64BP/wally-config.vh +++ b/wally-pipelined/config/rv64BP/wally-config.vh @@ -63,16 +63,24 @@ // Peripheral memory space extends from BASE to BASE+RANGE // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits +`define BOOTTIMSUPPORTED 1'b1 `define BOOTTIMBASE 32'h00000000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder `define BOOTTIMRANGE 32'h00003FFF -`define TIMBASE 32'h00000000 +//`define BOOTTIMBASE 32'h00001000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +//`define BOOTTIMRANGE 32'h00000FFF +`define TIMSUPPORTED 1'b1 +`define TIMBASE 32'h80000000 `define TIMRANGE 32'h07FFFFFF +`define CLINTSUPPORTED 1'b1 `define CLINTBASE 32'h02000000 `define CLINTRANGE 32'h0000FFFF +`define GPIOSUPPORTED 1'b1 `define GPIOBASE 32'h10012000 `define GPIORANGE 32'h000000FF +`define UARTSUPPORTED 1'b1 `define UARTBASE 32'h10000000 `define UARTRANGE 32'h00000007 +`define PLICSUPPORTED 1'b1 `define PLICBASE 32'h0C000000 `define PLICRANGE 32'h03FFFFFF diff --git a/wally-pipelined/config/rv64icfd/wally-config.vh b/wally-pipelined/config/rv64icfd/wally-config.vh index 0b0726be..20da468c 100644 --- a/wally-pipelined/config/rv64icfd/wally-config.vh +++ b/wally-pipelined/config/rv64icfd/wally-config.vh @@ -65,17 +65,24 @@ // Peripheral memory space extends from BASE to BASE+RANGE // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits -`define BOOTTIMBASE 32'h00000000 +`define BOOTTIMSUPPORTED 1'b1 +`define BOOTTIMBASE 32'h00000000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder `define BOOTTIMRANGE 32'h00003FFF -`define TIMBASE 32'h80000000 -// `define TIMRANGE 32'h0007FFFF -`define TIMRANGE 32'h07FFFFFF +//`define BOOTTIMBASE 32'h00001000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +//`define BOOTTIMRANGE 32'h00000FFF +`define TIMSUPPORTED 1'b1 +`define TIMBASE 32'h80000000 +`define TIMRANGE 32'h07FFFFFF +`define CLINTSUPPORTED 1'b1 `define CLINTBASE 32'h02000000 `define CLINTRANGE 32'h0000FFFF +`define GPIOSUPPORTED 1'b1 `define GPIOBASE 32'h10012000 `define GPIORANGE 32'h000000FF +`define UARTSUPPORTED 1'b1 `define UARTBASE 32'h10000000 `define UARTRANGE 32'h00000007 +`define PLICSUPPORTED 1'b1 `define PLICBASE 32'h0C000000 `define PLICRANGE 32'h03FFFFFF diff --git a/wally-pipelined/config/rv64imc/wally-config.vh b/wally-pipelined/config/rv64imc/wally-config.vh index be0970de..5e63f6da 100644 --- a/wally-pipelined/config/rv64imc/wally-config.vh +++ b/wally-pipelined/config/rv64imc/wally-config.vh @@ -61,16 +61,24 @@ // Peripheral memory space extends from BASE to BASE+RANGE // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits +`define BOOTTIMSUPPORTED 1'b1 `define BOOTTIMBASE 32'h00000000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder `define BOOTTIMRANGE 32'h00003FFF -`define TIMBASE 32'h80000000 -`define TIMRANGE 32'h0007FFFF +//`define BOOTTIMBASE 32'h00001000 // spec had been 0x1000 to 0x2FFF, but dh truncated to 0x1000 to 0x1FFF because upper half seems to be all zeros and this is easier for decoder +//`define BOOTTIMRANGE 32'h00000FFF +`define TIMSUPPORTED 1'b1 +`define TIMBASE 32'h80000000 +`define TIMRANGE 32'h07FFFFFF +`define CLINTSUPPORTED 1'b1 `define CLINTBASE 32'h02000000 `define CLINTRANGE 32'h0000FFFF +`define GPIOSUPPORTED 1'b1 `define GPIOBASE 32'h10012000 `define GPIORANGE 32'h000000FF +`define UARTSUPPORTED 1'b1 `define UARTBASE 32'h10000000 `define UARTRANGE 32'h00000007 +`define PLICSUPPORTED 1'b1 `define PLICBASE 32'h0C000000 `define PLICRANGE 32'h03FFFFFF diff --git a/wally-pipelined/src/mmu/pmaadrdec.sv b/wally-pipelined/src/mmu/pmaadrdec.sv index bc217876..a133503b 100644 --- a/wally-pipelined/src/mmu/pmaadrdec.sv +++ b/wally-pipelined/src/mmu/pmaadrdec.sv @@ -35,7 +35,7 @@ module pmaadrdec ( output logic HSEL ); - logic [31:0] match; + logic match; // determine if an address is in a range starting at the base // for example, if Base = 0x04002000 and range = 0x00000FFF, diff --git a/wally-pipelined/src/mmu/pmachecker.sv b/wally-pipelined/src/mmu/pmachecker.sv index 95a82179..8821c0cf 100644 --- a/wally-pipelined/src/mmu/pmachecker.sv +++ b/wally-pipelined/src/mmu/pmachecker.sv @@ -64,12 +64,12 @@ module pmachecker ( // Determine which region of physical memory (if any) is being accessed - pmaadrdec boottimdec(HADDR, `BOOTTIMBASE, `BOOTTIMRANGE, `BOOTTIMSUPPORTED, AccessRX, Size, 4'b1111, BootTim); - pmaadrdec timdec(HADDR, `TIMBASE, `TIMRANGE, `TIMSUPPORTED, AccessRWX, Size, 4'b1111, Tim); - pmaadrdec clintdec(HADDR, `CLINTBASE, `CLINTRANGE, `CLINTSUPPORTED, AccessRW, Size, (`XLEN==64 ? 4'b1000 : 4'b0100), CLINT); - pmaadrdec gpiodec(HADDR, `GPIOBASE, `GPIORANGE, `GPIOSUPPORTED, AccessRW, Size, 4'b0100, GPIO); - pmaadrdec uartdec(HADDR, `UARTBASE, `UARTRANGE, `UARTSUPPORTED, AccessRW, Size, 4'b0001, UART); - pmaadrdec plicdec(HADDR, `PLICBASE, `PLICRANGE, `PLICSUPPORTED, AccessRW, Size, 4'b0100, PLIC); + pmaadrdec boottimdec(HADDR, `BOOTTIMBASE, `BOOTTIMRANGE, `BOOTTIMSUPPORTED, AccessRX, HSIZE, 4'b1111, BootTim); + pmaadrdec timdec(HADDR, `TIMBASE, `TIMRANGE, `TIMSUPPORTED, AccessRWX, HSIZE, 4'b1111, Tim); + pmaadrdec clintdec(HADDR, `CLINTBASE, `CLINTRANGE, `CLINTSUPPORTED, AccessRW, HSIZE, (`XLEN==64 ? 4'b1000 : 4'b0100), CLINT); + pmaadrdec gpiodec(HADDR, `GPIOBASE, `GPIORANGE, `GPIOSUPPORTED, AccessRW, HSIZE, 4'b0100, GPIO); + pmaadrdec uartdec(HADDR, `UARTBASE, `UARTRANGE, `UARTSUPPORTED, AccessRW, HSIZE, 4'b0001, UART); + pmaadrdec plicdec(HADDR, `PLICBASE, `PLICRANGE, `PLICSUPPORTED, AccessRW, HSIZE, 4'b0100, PLIC); // Swizzle region bits assign Regions = {BootTim, Tim, CLINT, GPIO, UART, PLIC};