From 76006825b32dca2b2e6438f8762dabd994af77b8 Mon Sep 17 00:00:00 2001 From: David Harris Date: Fri, 26 Aug 2022 21:18:18 -0700 Subject: [PATCH] Set bit width of DMEM/IROM_SUPPORTED and fixed address decoding --- pipelined/config/buildroot/wally-config.vh | 4 ++-- pipelined/config/fpga/wally-config.vh | 4 ++-- pipelined/config/rv32e/wally-config.vh | 4 ++-- pipelined/config/rv32gc/wally-config.vh | 4 ++-- pipelined/config/rv32i/wally-config.vh | 4 ++-- pipelined/config/rv32ic/wally-config.vh | 8 ++++---- pipelined/config/rv64BP/wally-config.vh | 4 ++-- pipelined/config/rv64fp/wally-config.vh | 4 ++-- pipelined/config/rv64fpquad/wally-config.vh | 4 ++-- pipelined/config/rv64gc/wally-config.vh | 4 ++-- pipelined/config/rv64i/wally-config.vh | 4 ++-- pipelined/config/rv64ic/wally-config.vh | 8 ++++---- pipelined/src/mmu/adrdecs.sv | 2 +- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pipelined/config/buildroot/wally-config.vh b/pipelined/config/buildroot/wally-config.vh index c7e4bf7bb..440aa0b15 100644 --- a/pipelined/config/buildroot/wally-config.vh +++ b/pipelined/config/buildroot/wally-config.vh @@ -85,10 +85,10 @@ // 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 DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 34'h80000000 `define DTIM_RANGE 34'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 34'h80000000 `define IROM_RANGE 34'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/fpga/wally-config.vh b/pipelined/config/fpga/wally-config.vh index 5b576cdf8..1e3f330ef 100644 --- a/pipelined/config/fpga/wally-config.vh +++ b/pipelined/config/fpga/wally-config.vh @@ -87,10 +87,10 @@ // 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 DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 34'h80000000 `define DTIM_RANGE 34'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 34'h80000000 `define IROM_RANGE 34'h00001FFF diff --git a/pipelined/config/rv32e/wally-config.vh b/pipelined/config/rv32e/wally-config.vh index 7a2e3ff2f..5311cc004 100644 --- a/pipelined/config/rv32e/wally-config.vh +++ b/pipelined/config/rv32e/wally-config.vh @@ -86,10 +86,10 @@ // 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 DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 34'h80000000 `define DTIM_RANGE 34'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 34'h80000000 `define IROM_RANGE 34'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/rv32gc/wally-config.vh b/pipelined/config/rv32gc/wally-config.vh index 1033a24df..fd5d1b4b7 100644 --- a/pipelined/config/rv32gc/wally-config.vh +++ b/pipelined/config/rv32gc/wally-config.vh @@ -85,10 +85,10 @@ // 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 DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 34'h80000000 `define DTIM_RANGE 34'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 34'h80000000 `define IROM_RANGE 34'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/rv32i/wally-config.vh b/pipelined/config/rv32i/wally-config.vh index d6fa2b6bc..a0ea4607e 100644 --- a/pipelined/config/rv32i/wally-config.vh +++ b/pipelined/config/rv32i/wally-config.vh @@ -86,10 +86,10 @@ // 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 DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 34'h80000000 `define DTIM_RANGE 34'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 34'h80000000 `define IROM_RANGE 34'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/rv32ic/wally-config.vh b/pipelined/config/rv32ic/wally-config.vh index 5d1a6b332..e6d1a87a5 100644 --- a/pipelined/config/rv32ic/wally-config.vh +++ b/pipelined/config/rv32ic/wally-config.vh @@ -85,12 +85,12 @@ // 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 DTIM_SUPPORTED 1 +`define DTIM_SUPPORTED 1'b1 `define DTIM_BASE 34'h80000000 -`define DTIM_RANGE 34'h00001FFF -`define IROM_SUPPORTED 1 +`define DTIM_RANGE 34'h7FFFFFFF +`define IROM_SUPPORTED 1'b1 `define IROM_BASE 34'h80000000 -`define IROM_RANGE 34'h00001FFF +`define IROM_RANGE 34'h7FFFFFFF `define BOOTROM_SUPPORTED 1'b0 `define BOOTROM_BASE 34'h00001000 `define BOOTROM_RANGE 34'h00000FFF diff --git a/pipelined/config/rv64BP/wally-config.vh b/pipelined/config/rv64BP/wally-config.vh index bb02b9fb6..b0a33b667 100644 --- a/pipelined/config/rv64BP/wally-config.vh +++ b/pipelined/config/rv64BP/wally-config.vh @@ -90,10 +90,10 @@ // 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 DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 56'h80000000 `define DTIM_RANGE 56'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 56'h80000000 `define IROM_RANGE 56'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/rv64fp/wally-config.vh b/pipelined/config/rv64fp/wally-config.vh index e0c786110..b708bbb59 100644 --- a/pipelined/config/rv64fp/wally-config.vh +++ b/pipelined/config/rv64fp/wally-config.vh @@ -93,10 +93,10 @@ // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits // *** each of these is `PA_BITS wide. is this paramaterizable INSIDE the config file? -`define DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 56'h80000000 `define DTIM_RANGE 56'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 56'h80000000 `define IROM_RANGE 56'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/rv64fpquad/wally-config.vh b/pipelined/config/rv64fpquad/wally-config.vh index 4310f6369..17fd8fadd 100644 --- a/pipelined/config/rv64fpquad/wally-config.vh +++ b/pipelined/config/rv64fpquad/wally-config.vh @@ -92,10 +92,10 @@ // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits // *** each of these is `PA_BITS wide. is this paramaterizable INSIDE the config file? -`define DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 56'h80000000 `define DTIM_RANGE 56'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 56'h80000000 `define IROM_RANGE 56'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/rv64gc/wally-config.vh b/pipelined/config/rv64gc/wally-config.vh index b4bce027e..92e3a8a7e 100644 --- a/pipelined/config/rv64gc/wally-config.vh +++ b/pipelined/config/rv64gc/wally-config.vh @@ -92,10 +92,10 @@ // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits // *** each of these is `PA_BITS wide. is this paramaterizable INSIDE the config file? -`define DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 56'h80000000 `define DTIM_RANGE 56'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 56'h80000000 `define IROM_RANGE 56'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/rv64i/wally-config.vh b/pipelined/config/rv64i/wally-config.vh index b67c0711b..05af9011f 100644 --- a/pipelined/config/rv64i/wally-config.vh +++ b/pipelined/config/rv64i/wally-config.vh @@ -92,10 +92,10 @@ // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits // *** each of these is `PA_BITS wide. is this paramaterizable INSIDE the config file? -`define DTIM_SUPPORTED 0 +`define DTIM_SUPPORTED 1'b0 `define DTIM_BASE 56'h80000000 `define DTIM_RANGE 56'h00001FFF -`define IROM_SUPPORTED 0 +`define IROM_SUPPORTED 1'b0 `define IROM_BASE 56'h80000000 `define IROM_RANGE 56'h00001FFF `define BOOTROM_SUPPORTED 1'b1 diff --git a/pipelined/config/rv64ic/wally-config.vh b/pipelined/config/rv64ic/wally-config.vh index 3d14a7d7b..d9f37fb5e 100644 --- a/pipelined/config/rv64ic/wally-config.vh +++ b/pipelined/config/rv64ic/wally-config.vh @@ -92,12 +92,12 @@ // Range should be a thermometer code with 0's in the upper bits and 1s in the lower bits // *** each of these is `PA_BITS wide. is this paramaterizable INSIDE the config file? -`define DTIM_SUPPORTED 1 +`define DTIM_SUPPORTED 1'b1 `define DTIM_BASE 56'h80000000 -`define DTIM_RANGE 56'h00001FFF -`define IROM_SUPPORTED 01 +`define DTIM_RANGE 56'h7FFFFFFF +`define IROM_SUPPORTED 1'b1 `define IROM_BASE 56'h80000000 -`define IROM_RANGE 56'h00001FFF +`define IROM_RANGE 56'h7FFFFFFF `define BOOTROM_SUPPORTED 1'b0 `define BOOTROM_BASE 56'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 BOOTROM_RANGE 56'h00000FFF diff --git a/pipelined/src/mmu/adrdecs.sv b/pipelined/src/mmu/adrdecs.sv index 187e10111..038b426da 100644 --- a/pipelined/src/mmu/adrdecs.sv +++ b/pipelined/src/mmu/adrdecs.sv @@ -52,7 +52,7 @@ module adrdecs ( adrdec iromdec(PhysicalAddress, `IROM_BASE, `IROM_RANGE, `IROM_SUPPORTED, AccessRX, Size, SUPPORTED_SIZE, SelRegions[1]); adrdec dtimdec(PhysicalAddress, `DTIM_BASE, `DTIM_RANGE, `DTIM_SUPPORTED, AccessRWX, Size, SUPPORTED_SIZE, SelRegions[0]); - assign SelRegions[10] = ~|(SelRegions[7:2]); // none of the bus regions are selected + assign SelRegions[10] = ~|(SelRegions[7:0]); // none of the regions are selected endmodule