Page 2
SiFive does not assume any liability rising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation indirect, incidental, spe- cial, exemplary, or consequential damages.
Table 1: E31 Core Complex Feature Set 1.1 E31 Core Complex Overview An overview of the SiFive E31 Core Complex is shown in Figure 1. This RISC-V Core IP includes a 32-bit RISC‑V microcontroller core, memory interfaces including an instruction cache...
Chapter 7. 1.5 Memory System The E31 Core Complex memory system has Tightly Integrated Instruction and Data Memory sub-systems optimized for high performance. The instruction subsystem consists of a 16 KiB 2-way instruction cache with the ability to reconfigure a single way into a fixed-address tightly integrated memory.
JTAG Joint Test Action Group Loosely Integrated Memory. Used to describe memory space delivered in a SiFive Core Complex but not tightly integrated to a CPU core. Physical Memory Protection PLIC Platform-Level Interrupt Controller. The global interrupt controller in a RISC-V system.
Instruction Tightly Integrated Memory (ITIM), which is further described in Section 3.1.1. See the E31 Core Complex Memory Map in Chapter 4 for a description of exe- cutable address regions that are denoted by the attribute X.
The E31 implements the standard Compressed (C) extension to the RISC‑V architecture, which allows for 16-bit RISC‑V instructions. 3.3 Execution Pipeline The E31 execution unit is a single-issue, in-order pipeline. The pipeline comprises five stages: instruction fetch, instruction decode and register fetch, execute, data memory access, and regis- ter writeback.
See The RISC‑V Instruction Set Manual, Volume I: User-Level ISA, Version 2.1 for more infor- mation on the instructions added by this extension. 3.6 Local Interrupts The E31 supports up to 16 local interrupt sources that are routed directly to the core. See Chap- ter 5 for a detailed description of Local Interrupts.
3.8.1 Functional Description The E31 includes a PMP unit, which can be used to restrict access to memory and isolate processes from each other. The E31 PMP unit has 8 regions and a minimum granularity of 4 bytes. Overlapping regions are permitted.
3.9 Hardware Performance Monitor The E31 Core Complex supports a basic hardware performance monitoring facility compliant with The RISC‑V Instruction Set Manual, Volume II: Privileged Architecture, Version 1.10. The CSR holds a count of the number of clock cycles the hart has executed since some mcycle arbitrary time in the past.
0x8000_FFFF RWX A Memory (DTIM) On Core Complex (64 KiB) Address Space Reserved 0x8001_0000 0xFFFF_FFFF Table 4: E31 Core Complex Memory Map. Memory Attributes: R - Read, W - Write, X - Exe- cute, C - Cacheable, A - Atomics...
Chapter 5 Interrupts This chapter describes how interrupt concepts in the RISC‑V architecture apply to the E31 Core Complex. The definitive resource for information about the RISC‑V interrupt architecture is The RISC‑V Instruction Set Manual, Volume II: Privileged Architecture, Version 1.10.
A summary of the fields related to interrupts in mstatus the E31 Core Complex is provided in Table 5. Note that this is not a complete description of as it contains fields unrelated to interrupts. For the full description of , please...
+ 0x2C for any global mtvec.BASE interrupt. See Table 10 for a description of the register. See Table 11 for a description of the mtvec field. See Table 9 for the E31 Core Complex interrupt exception code values. mtvec.MODE...
• Machine timer interrupts 5.5 Interrupt Latency Interrupt latency for the E31 Core Complex is 4 cycles, as counted by the numbers of cycles it takes from signaling of the interrupt to the hart to the first instruction fetch of the handler.
Core Local Interruptor (CLINT) The CLINT block holds memory-mapped control and status registers associated with software and timer interrupts. The E31 Core Complex CLINT complies with The RISC‑V Instruction Set Manual, Volume II: Privileged Architecture, Version 1.10. 6.1 CLINT Memory Map Table 12 shows the memory map for CLINT on SiFive E31 Core Complex.
6.3 Timer Registers is a 64-bit read-write register that contains the number of cycles counted from the mtime signal described in the E31 Core Complex User Guide. A timer interrupt is pending rtc_toggle whenever is greater than or equal to the value in the register.
7.1 Memory Map The memory map for the E31 Core Complex PLIC control registers is shown in Table 13. The PLIC memory map has been designed to only require naturally aligned 32-bit memory accesses.
Table 13: SiFive PLIC Register Map. Only naturally aligned 32-bit memory accesses are required. 7.2 Interrupt Sources The E31 Core Complex has 127 interrupt sources. These are exposed at the top level via the signals. Any unused inputs should be tied to logic 0.
7.3 Interrupt Priorities Each PLIC interrupt source can be assigned a priority by writing to its 32-bit memory-mapped register. The E31 Core Complex supports 7 levels of priority. A priority value of 0 is priority reserved to mean "never interrupt" and effectively disables the interrupt. Priority 1 is the lowest active priority, and priority 7 is the highest.
A successful claim also atomically clears the corresponding pending bit on the interrupt source. A E31 Core Complex hart can perform a claim at any time, even if the MEIP bit in its (Table 7) register is not set.
Chapter 8 Debug This chapter describes the operation of SiFive debug hardware, which follows The RISC‑V Debug Specification 0.13. Currently only interactive debug and hardware breakpoints are sup- ported. 8.1 Debug CSRs This section describes the per-hart trace and debug registers (TDRs), which are mapped into...
Debug ROM. The debugger may use it as described in The RISC‑V Debug Specifi- cation 0.13. 8.2 Breakpoints The E31 Core Complex supports four hardware breakpoint registers per hart, which can be flex- ibly shared between debug mode and machine mode. When a breakpoint register is selected with...
– 0x300 0x3FF The E31 Core Complex has 16 32-bit words of program buffer for the debugger to direct a hart to execute arbitrary RISC-V code. Its location in memory can be determined by executing aiupc instructions and storing the result into the program buffer.
The specific behavior of the flags is not further documented here. 8.3.4 Safe Zero Address In the E31 Core Complex, the debug module contains the address in the memory map. Reads to this address always return 0, and writes to this address have no impact. This property allows a "safe"...
Chapter 9 References Visit the SiFive forums for support and answers to frequently asked questions: https://forums.sifive.com [1] A. Waterman and K. Asanovic, Eds., The RISC-V Instruction Set Manual, Volume I: User- Level ISA, Version 2.2, May 2017. [Online]. Available: https://riscv.org/specifications/ [2] ——, The RISC-V Instruction Set Manual Volume II: Privileged Architecture Version 1.10,...
Need help?
Do you have a question about the E31 and is the answer not in the manual?
Questions and answers