2021-01-23 15:48:12 +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
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
// is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
// OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
///////////////////////////////////////////
2021-06-07 16:37:46 +00:00
// include shared configuration
`include "wally-shared.vh"
2021-04-17 18:44:32 +00:00
`define BUILDROOT 0
`define BUSYBEAR 0
2021-01-23 15:48:12 +00:00
// RV32 or RV64: XLEN = 32 or 64
2021-01-25 16:28:43 +00:00
`define XLEN 32
2021-01-23 15:48:12 +00:00
2021-03-31 02:19:27 +00:00
`define MISA (32'h00000104 | 1 << 20 | 1 << 18 | 1 << 12)
2021-01-23 15:48:12 +00:00
`define ZCSR_SUPPORTED 1
2021-06-10 01:03:03 +00:00
`define COUNTERS 32
2021-01-23 15:48:12 +00:00
`define ZCOUNTERS_SUPPORTED 1
// Microarchitectural Features
`define UARCH_PIPELINED 1
`define UARCH_SUPERSCALR 0
`define UARCH_SINGLECYCLE 0
`define MEM_DCACHE 0
`define MEM_DTIM 1
`define MEM_ICACHE 0
2021-03-31 02:19:27 +00:00
`define MEM_VIRTMEM 1
2021-04-15 23:13:42 +00:00
`define VECTORED_INTERRUPTS_SUPPORTED 1
2021-01-23 15:48:12 +00:00
2021-06-04 15:59:14 +00:00
`define ITLB_ENTRY_BITS 5
`define DTLB_ENTRY_BITS 5
2021-06-08 19:29:22 +00:00
// Legal number of PMP entries are 0, 16, or 64
`define PMP_ENTRIES 16
2021-01-25 20:57:36 +00:00
// Address space
`define RESET_VECTOR 32'h80000000
2021-01-29 22:28:53 +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
2021-06-18 12:05:50 +00:00
`define BOOTTIM_SUPPORTED 1'b1
`define BOOTTIM_BASE 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 BOOTTIM_RANGE 32'h00003FFF
//`define BOOTTIM_BASE 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 BOOTTIM_RANGE 32'h00000FFF
`define TIM_SUPPORTED 1'b1
`define TIM_BASE 32'h80000000
`define TIM_RANGE 32'h07FFFFFF
`define CLINT_SUPPORTED 1'b1
`define CLINT_BASE 32'h02000000
`define CLINT_RANGE 32'h0000FFFF
`define GPIO_SUPPORTED 1'b1
`define GPIO_BASE 32'h10012000
`define GPIO_RANGE 32'h000000FF
`define UART_SUPPORTED 1'b1
`define UART_BASE 32'h10000000
`define UART_RANGE 32'h00000007
`define PLIC_SUPPORTED 1'b1
`define PLIC_BASE 32'h0C000000
`define PLIC_RANGE 32'h03FFFFFF
2021-01-29 22:28:53 +00:00
// Bus Interface width
2021-01-29 20:37:51 +00:00
`define AHBW 32
2021-01-23 15:48:12 +00:00
// Test modes
// Tie GPIO outputs back to inputs
2021-04-30 10:26:31 +00:00
`define GPIO_LOOPBACK_TEST 1
2021-01-23 15:48:12 +00:00
// Hardware configuration
`define UART_PRESCALE 1
2021-04-04 10:40:53 +00:00
// Interrupt configuration
2021-04-16 01:09:15 +00:00
`define PLIC_NUM_SRC 4
2021-04-22 15:22:01 +00:00
// comment out the following if >=32 sources
`define PLIC_NUM_SRC_LT_32
2021-04-16 01:09:15 +00:00
`define PLIC_GPIO_ID 3
2021-04-04 10:40:53 +00:00
`define PLIC_UART_ID 4
2021-03-15 17:39:44 +00:00
`define TWO_BIT_PRELOAD "../config/rv32ic/twoBitPredictor.txt"
`define BTB_PRELOAD "../config/rv32ic/BTBPredictor.txt"
2021-04-26 19:27:42 +00:00
`define BPRED_ENABLED 1
2021-04-01 17:40:08 +00:00
`define BPTYPE "BPGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE
`define TESTSBP 0