2021-07-15 01:24:48 +00:00
|
|
|
//////////////////////////////////////////
|
|
|
|
// wally-config.vh
|
|
|
|
//
|
|
|
|
// Written: David_Harris@hmc.edu 4 January 2021
|
|
|
|
// Modified:
|
|
|
|
//
|
|
|
|
// Purpose: Specify which features are configured
|
|
|
|
// Macros to determine which modes are supported based on MISA
|
|
|
|
//
|
|
|
|
// A component of the Wally configurable RISC-V project.
|
|
|
|
//
|
|
|
|
// Copyright (C) 2021 Harvey Mudd College & Oklahoma State University
|
|
|
|
//
|
2023-01-27 23:17:17 +00:00
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
2021-07-15 01:24:48 +00:00
|
|
|
//
|
2023-01-27 23:17:17 +00:00
|
|
|
// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file
|
|
|
|
// except in compliance with the License, or, at your option, the Apache License version 2.0. You
|
|
|
|
// may obtain a copy of the License at
|
2021-07-15 01:24:48 +00:00
|
|
|
//
|
2023-01-27 23:17:17 +00:00
|
|
|
// https://solderpad.org/licenses/SHL-2.1/
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, any work distributed under the
|
|
|
|
// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
|
|
// either express or implied. See the License for the specific language governing permissions
|
|
|
|
// and limitations under the License.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
2021-07-15 01:24:48 +00:00
|
|
|
|
|
|
|
// include shared configuration
|
|
|
|
`include "wally-shared.vh"
|
|
|
|
|
2021-12-02 23:47:46 +00:00
|
|
|
`define FPGA 0
|
2021-08-06 15:16:06 +00:00
|
|
|
`define QEMU 0
|
2021-07-15 01:24:48 +00:00
|
|
|
|
|
|
|
// RV32 or RV64: XLEN = 32 or 64
|
|
|
|
`define XLEN 32
|
|
|
|
|
2021-12-29 18:59:17 +00:00
|
|
|
// IEEE 754 compliance
|
|
|
|
`define IEEE754 0
|
|
|
|
|
2021-10-10 22:07:51 +00:00
|
|
|
`define MISA (32'h00000104 | 1 << 20 | 1 << 18 | 1 << 12 | 1 << 0 | 1 <<3 | 1 << 5)
|
2021-09-15 17:14:00 +00:00
|
|
|
`define ZICSR_SUPPORTED 1
|
|
|
|
`define ZIFENCEI_SUPPORTED 1
|
2021-07-15 01:24:48 +00:00
|
|
|
`define COUNTERS 32
|
2021-09-15 17:14:00 +00:00
|
|
|
`define ZICOUNTERS_SUPPORTED 1
|
2022-04-04 17:17:12 +00:00
|
|
|
`define ZFH_SUPPORTED 0
|
2023-03-04 23:46:26 +00:00
|
|
|
`define SSTC_SUPPORTED 1
|
2021-07-15 01:24:48 +00:00
|
|
|
|
2022-08-24 17:35:15 +00:00
|
|
|
// LSU microarchitectural Features
|
2023-01-29 02:35:53 +00:00
|
|
|
`define BUS_SUPPORTED 1
|
2023-01-29 02:52:00 +00:00
|
|
|
`define DCACHE_SUPPORTED 1
|
|
|
|
`define ICACHE_SUPPORTED 1
|
2022-02-03 01:08:34 +00:00
|
|
|
`define VIRTMEM_SUPPORTED 1
|
2021-12-14 21:05:32 +00:00
|
|
|
`define VECTORED_INTERRUPTS_SUPPORTED 1
|
2022-05-08 06:46:35 +00:00
|
|
|
`define BIGENDIAN_SUPPORTED 1
|
2021-07-15 01:24:48 +00:00
|
|
|
|
2021-07-19 22:19:46 +00:00
|
|
|
// TLB configuration. Entries should be a power of 2
|
2021-07-15 01:24:48 +00:00
|
|
|
`define ITLB_ENTRIES 32
|
|
|
|
`define DTLB_ENTRIES 32
|
|
|
|
|
2021-07-19 22:19:46 +00:00
|
|
|
// Cache configuration. Sizes should be a power of two
|
2022-01-05 04:08:18 +00:00
|
|
|
// typical configuration 4 ways, 4096 bytes per way, 256 bit or more lines
|
2021-07-19 22:19:46 +00:00
|
|
|
`define DCACHE_NUMWAYS 4
|
2021-10-10 22:07:51 +00:00
|
|
|
`define DCACHE_WAYSIZEINBYTES 4096
|
2022-06-10 00:37:53 +00:00
|
|
|
`define DCACHE_LINELENINBITS 512
|
2021-10-10 22:07:51 +00:00
|
|
|
`define ICACHE_NUMWAYS 4
|
2021-07-20 12:57:13 +00:00
|
|
|
`define ICACHE_WAYSIZEINBYTES 4096
|
2022-06-10 00:37:53 +00:00
|
|
|
`define ICACHE_LINELENINBITS 512
|
2021-07-19 22:19:46 +00:00
|
|
|
|
2021-10-03 05:10:15 +00:00
|
|
|
// Integer Divider Configuration
|
2022-12-15 16:23:34 +00:00
|
|
|
// IDIV_BITSPERCYCLE must be 1, 2, or 4
|
|
|
|
`define IDIV_BITSPERCYCLE 4
|
2023-01-29 19:33:54 +00:00
|
|
|
`define IDIV_ON_FPU 1
|
2021-10-03 05:10:15 +00:00
|
|
|
|
2021-07-15 01:24:48 +00:00
|
|
|
// Legal number of PMP entries are 0, 16, or 64
|
2023-01-06 13:11:14 +00:00
|
|
|
`define PMP_ENTRIES 16
|
2021-07-15 01:24:48 +00:00
|
|
|
|
|
|
|
// Address space
|
|
|
|
`define RESET_VECTOR 32'h80000000
|
|
|
|
|
2022-04-17 17:20:35 +00:00
|
|
|
// WFI Timeout Wait
|
2022-04-27 18:18:49 +00:00
|
|
|
`define WFI_TIMEOUT_BIT 16
|
2022-04-17 17:20:35 +00:00
|
|
|
|
2021-07-15 01:24:48 +00:00
|
|
|
// 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
|
2022-08-27 04:18:18 +00:00
|
|
|
`define DTIM_SUPPORTED 1'b0
|
2022-08-27 03:26:12 +00:00
|
|
|
`define DTIM_BASE 34'h80000000
|
2022-11-30 23:03:25 +00:00
|
|
|
`define DTIM_RANGE 34'h007FFFFF
|
2022-08-27 04:18:18 +00:00
|
|
|
`define IROM_SUPPORTED 1'b0
|
2022-08-27 03:26:12 +00:00
|
|
|
`define IROM_BASE 34'h80000000
|
2022-11-30 23:03:25 +00:00
|
|
|
`define IROM_RANGE 34'h007FFFFF
|
2021-12-14 21:43:06 +00:00
|
|
|
`define BOOTROM_SUPPORTED 1'b1
|
|
|
|
`define BOOTROM_BASE 34'h00001000
|
|
|
|
`define BOOTROM_RANGE 34'h00000FFF
|
2022-08-24 23:09:07 +00:00
|
|
|
`define UNCORE_RAM_SUPPORTED 1'b1
|
|
|
|
`define UNCORE_RAM_BASE 34'h80000000
|
|
|
|
`define UNCORE_RAM_RANGE 34'h07FFFFFF
|
2021-12-02 23:47:46 +00:00
|
|
|
`define EXT_MEM_SUPPORTED 1'b0
|
|
|
|
`define EXT_MEM_BASE 34'h80000000
|
|
|
|
`define EXT_MEM_RANGE 34'h07FFFFFF
|
2021-07-15 01:24:48 +00:00
|
|
|
`define CLINT_SUPPORTED 1'b1
|
|
|
|
`define CLINT_BASE 34'h02000000
|
|
|
|
`define CLINT_RANGE 34'h0000FFFF
|
|
|
|
`define GPIO_SUPPORTED 1'b1
|
2022-01-26 18:16:34 +00:00
|
|
|
`define GPIO_BASE 34'h10060000
|
2021-07-15 01:24:48 +00:00
|
|
|
`define GPIO_RANGE 34'h000000FF
|
|
|
|
`define UART_SUPPORTED 1'b1
|
|
|
|
`define UART_BASE 34'h10000000
|
|
|
|
`define UART_RANGE 34'h00000007
|
|
|
|
`define PLIC_SUPPORTED 1'b1
|
|
|
|
`define PLIC_BASE 34'h0C000000
|
|
|
|
`define PLIC_RANGE 34'h03FFFFFF
|
2021-12-02 23:47:46 +00:00
|
|
|
`define SDC_SUPPORTED 1'b0
|
|
|
|
`define SDC_BASE 34'h00012100
|
|
|
|
`define SDC_RANGE 34'h0000001F
|
2021-07-15 01:24:48 +00:00
|
|
|
|
|
|
|
// Bus Interface width
|
|
|
|
`define AHBW 32
|
|
|
|
|
|
|
|
// Test modes
|
|
|
|
|
|
|
|
// Tie GPIO outputs back to inputs
|
|
|
|
`define GPIO_LOOPBACK_TEST 1
|
|
|
|
|
|
|
|
// Hardware configuration
|
|
|
|
`define UART_PRESCALE 1
|
|
|
|
|
|
|
|
// Interrupt configuration
|
2022-02-22 03:46:08 +00:00
|
|
|
`define PLIC_NUM_SRC 10
|
2021-07-15 01:24:48 +00:00
|
|
|
// comment out the following if >=32 sources
|
|
|
|
`define PLIC_NUM_SRC_LT_32
|
|
|
|
`define PLIC_GPIO_ID 3
|
2022-02-22 03:46:08 +00:00
|
|
|
`define PLIC_UART_ID 10
|
2021-07-15 01:24:48 +00:00
|
|
|
|
2023-01-29 02:17:42 +00:00
|
|
|
`define BPRED_SUPPORTED 1
|
2023-05-11 19:56:26 +00:00
|
|
|
`define BPRED_TYPE "BP_LOCAL_REPAIR" // BP_GSHARE_BASIC, BP_GLOBAL, BP_GLOBAL_BASIC, BP_TWOBIT
|
2023-03-01 22:40:42 +00:00
|
|
|
`define BPRED_SIZE 16
|
2023-05-02 16:11:04 +00:00
|
|
|
`define BPRED_NUM_LHR 8
|
2023-02-20 12:02:00 +00:00
|
|
|
`define BTB_SIZE 10
|
2022-02-05 05:19:00 +00:00
|
|
|
|
2023-04-12 00:42:26 +00:00
|
|
|
`define SVADU_SUPPORTED 1
|
2023-02-27 15:29:53 +00:00
|
|
|
`define ZMMUL_SUPPORTED 0
|
2023-01-29 23:55:37 +00:00
|
|
|
|
|
|
|
// FPU division architecture
|
|
|
|
`define RADIX 32'h4
|
|
|
|
`define DIVCOPIES 32'h4
|
|
|
|
|
|
|
|
// bit manipulation
|
2023-02-23 04:17:52 +00:00
|
|
|
`define ZBA_SUPPORTED 1
|
|
|
|
`define ZBB_SUPPORTED 1
|
|
|
|
`define ZBC_SUPPORTED 1
|
|
|
|
`define ZBS_SUPPORTED 1
|
2023-01-29 23:55:37 +00:00
|
|
|
|
|
|
|
// Memory synthesis configuration
|
|
|
|
`define USE_SRAM 0
|