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.
Chapter 1 Introduction The FE310-G003 is the third revision of the General Purpose Freedom E300 family with addi- tional DTIM memory. The FE310-G003 is built around the E31 Core Complex instantiated in the Freedom E300 plat- form and fabricated in the TSMC CL018G 180nm process. This manual serves as an architec- tural reference and integration guide for the FE310-G003.
Page 11
Chapter 1 Introduction Figure 1: FE310-G003 top-level block diagram. Table 1: FE310-G003 Feature Summary. Available in Feature Description QFN48 1× E31 RISC‑V cores with machine and user mode, RISC-V Core 16 KiB 2-way L1 I-cache, and 64 KiB data tightly inte- ✔...
1.3 Interrupts The FE310-G003 includes a RISC-V standard platform-level interrupt controller (PLIC), which supports 52 global interrupts with 7 priority levels. The FE310-G003 also provides the standard RISC‑V machine-mode timer and software interrupts via the Core-Local Interruptor (CLINT). Interrupts are described in Chapter 8. The CLINT is described in Chapter 9. The PLIC is described in Chapter 10.
1.8 Hardware Serial Peripheral Interface (SPI) There are 3 serial peripheral interface (SPI) controllers. Each controller provides a means for serial communication between the FE310-G003 and off-chip devices, like quad-SPI Flash mem- ory. Each controller supports master-only operation over single-lane, dual-lane, and quad-lane protocols.
Chapter 1 Introduction 1.10 I²C The FE310-G003 has an I²C controller to communicate with external I²C devices, such as sen- sors, ADCs, etc. The I²C is described in detail in Chapter 20. 1.11 Debug Support The FE310-G003 provides external debugger support over an industry-standard JTAG port, including 8 hardware-programmable breakpoints per hart.
Joint Test Action Group JTAG 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 Platform-Level Interrupt Controller. The global interrupt controller in a PLIC RISC-V system.
Chapter 3 E31 RISC-V Core This chapter describes the 32-bit E31 RISC‑V processor core used in the FE310-G003. The E31 processor core comprises an instruction memory system, an instruction fetch unit, an exe- cution pipeline, a data memory system, and support for global, software, and timer interrupts.
Chapter 3 E31 RISC-V Core FE310-G003 Memory Map in Chapter 4 for a description of executable address regions that are denoted by the attribute X. Trying to execute an instruction from a non-executable address results in a synchronous trap. 3.1.1...
Chapter 3 E31 RISC-V Core 3.8 Hardware Performance Monitor The FE310-G003 supports a basic hardware performance monitoring facility compliant with The RISC‑V Instruction Set Manual, Volume II: Privileged Architecture, Version 1.10. The mcycle CSR holds a count of the number of clock cycles the hart has executed since some arbitrary time in the past.
Chapter 4 Memory Map The memory map of the FE310-G003 is shown in Table 4. Table 4: FE310-G003 Memory Map. Memory Attributes: R - Read, W - Write, X - Execute, C - Cacheable, A - Atomics Base Attr. Description...
Page 24
Chapter 4 Memory Map Table 4: FE310-G003 Memory Map. Memory Attributes: R - Read, W - Write, X - Execute, C - Cacheable, A - Atomics Base Attr. Description Notes Reserved 0x1000_9000 0x1000_FFFF OTP Control 0x1001_0000 0x1001_0FFF Reserved 0x1001_1000 0x1001_1FFF...
Chapter 5 Boot Process The FE310-G003 supports booting from several sources, which are controlled using the Mode Select ( ) pins on the chip. All possible values are enumerated in Table 5. MSEL[1:0] Table 5: Boot media based on pins...
AON block (Chapter 12) or the PRCI block (Section 6.2). 6.1 Clock Generation Overview Figure 2: FE310-G003 clock generation scheme Figure 2 shows an overview of the FE310-G003 clock generation scheme. Most digital clocks on the chip are divided down from a central high-frequency clock produced from either hfclk the PLL or an on-chip trimmable oscillator.
The AON block contains registers with similar functions, but only for the AON block units. Table 8 shows the memory map for the PRCI on the FE310-G003. Table 8: SiFive PRCI memory map, offsets relative to PRCI base address.
Page 31
Figure 3: Controlling the FE310-G003 PLL output frequency. field encodes the reference clock divide ratio as a 2-bit binary value, where the pllr[1:0] value is one less than the divide ratio (i.e., =4).
This mux selection can only be controlled by external pads, it is not psdlfaltclksel controllable by software. 6.9 Clock Summary Table 15 summarizes the major clocks on the FE310-G003 and their initial reset conditions. At external reset, the AON domain is clocked by either the LFROSC or , as...
Chapter 7 Power Modes This chapter describes the different power modes available on the FE310-G003. The FE310-G003 supports three power modes: Run, Wait, and Sleep. 7.1 Run Mode Run mode corresponds to regular execution where the processor is running. Power consump- tion can be adjusted by varying the clock frequency of the processor and peripheral bus, and by enabling or disabling individual peripheral blocks.
Page 37
HFROSC at the default setting, and must reconfigure clocks to run from an alternate clock source (HFXOSC or PLL) or at a different setting on the HFROSC. Because the FE310-G003 has no internal power regulator, the PMU’s control of the power sup- plies is through chip outputs, .
Instruction Set Manual, Volume II: Privileged Architecture, Version 1.10. 8.1 Interrupt Concepts The FE310-G003 supports Machine Mode interrupts. It also has support for the following types of RISC‑V interrupts: local and global. Local interrupts are signaled directly to an individual hart with a dedicated interrupt value. This...
Chapter 8 Interrupts Figure 4: FE310-G003 Interrupt Architecture Block Diagram. 8.2 Interrupt Operation If the global interrupt-enable is clear, then no interrupts will be taken. If mstatus.MIE is set, then pending-enabled interrupts at a higher interrupt level will preempt cur- mstatus.MIE...
A summary of the fields related to interrupts in mstatus the FE310-G003 is provided in Table 16. Note that this is not a complete description of mstatus as it contains fields unrelated to interrupts. For the full description of...
Page 41
See Table 17 for a description of the register. See Table 18 for a description of the mtvec field. See Table 22 for the FE310-G003 interrupt exception code values. mtvec.MODE Mode Direct When operating in direct mode all synchronous exceptions and asynchronous interrupts trap to address.
• Machine timer interrupts 8.5 Interrupt Latency Interrupt latency for the FE310-G003 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.
Chapter 9 Core-Local Interruptor (CLINT) The CLINT block holds memory-mapped control and status registers associated with software and timer interrupts. The FE310-G003 CLINT complies with The RISC‑V Instruction Set Manual, Volume II: Privileged Architecture, Version 1.10. 9.1 CLINT Memory Map Table 23 shows the memory map for CLINT on SiFive FE310-G003.
Architecture, Version 1.10 and supports 52 interrupt sources with 7 priority levels. 10.1 Memory Map The memory map for the FE310-G003 PLIC control registers is shown in Table 24. The PLIC memory map has been designed to only require naturally aligned 32-bit memory accesses.
0x1000_0000 10.2 Interrupt Sources The FE310-G003 has 52 interrupt sources. These are driven by various on-chip devices as listed in Table 25. These signals are positive-level triggered. In the PLIC, as specified in The RISC‑V Instruction Set Manual, Volume II: Privileged Architec- ture, Version 1.10, Global Interrupt ID 0 is defined to mean "no interrupt."...
10.3 Interrupt Priorities Each PLIC interrupt source can be assigned a priority by writing to its 32-bit memory-mapped register. The FE310-G003 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.
WARL field, where the FE310-G003 supports a maximum threshold of 7. threshold The FE310-G003 masks all PLIC interrupts of a priority less than or equal to . For threshold example, a value of zero permits all interrupts with non-zero priority, whereas a threshold value of 7 masks all interrupts.
(Table 32), which returns the ID of the highest-priority pending interrupt or zero if there is no pending interrupt. A successful claim also atomically clears the corresponding pending bit on the interrupt source. A FE310-G003 hart can perform a claim at any time, even if the MEIP bit in its (Table 20) register is not set.
Chapter 12 Always-On (AON) Domain The FE310-G003 supports an always-on (AON) domain that includes real-time counter, a watchdog timer, backup registers, low frequency clocking, and reset and power-management circuitry for the rest of the system. Figure 5 shows an overview of the AON block.
12.3 AON Reset Unit An AON reset is the widest reset on the FE310-G003, and resets all state except for the JTAG debug interface. An AON reset can be triggered by an on-chip power-on reset (POR) circuit when power is first...
The Real-Time Clock is described in detail in Chapter 15. 12.9 Backup Registers The backup registers provide a place to store critical data during sleep. The FE310-G003 has 32 32-bit backup registers. 12.10 Power-Management Unit (PMU) The power-management unit (PMU) sequences the system power supplies and reset signals when transitioning into and out of sleep mode.
Page 68
Chapter 14 Power-Management Unit (PMU) The FE310-G003 power-management unit (PMU) is implemented within the AON domain and sequences the system’s power supplies and reset signals during power-on reset and when tran- sitioning the "mostly off" (MOFF) block into and out of sleep mode.
Page 69
Signal Condition/ Synchronize Figure 7: FE310-G003 Power-Management Unit The PMU is a synchronous unit clocked by the in the AON domain. The PMU handles lfClk reset, wakeup, and sleep actions initiated by power-on reset, wakeup events, and sleep requests.
Page 77
This chapter describes the operation of the General Purpose Input/Output Controller (GPIO) on the FE310-G003. The GPIO controller is a peripheral device mapped in the internal memory map. It is responsible for low-level configuration of actual GPIO pads on the device (direction, pull up-enable, and drive value ), as well as selecting between various sources of the controls for these signals.
Page 79
Chapter 16 General Purpose Input/Output Controller 16.1 GPIO Instance in FE310-G003 FE310-G003 contains one GPIO instance. Its address and parameters are shown in Table 50. Table 50: GPIO Instance Instance Number Address ngpio 0x10012000 16.2 Memory Map The memory map for the GPIO control registers is shown in Table 51. The GPIO memory map has been designed to require only naturally-aligned 32-bit memory accesses.
Page 83
The UART peripheral does not support hardware flow control or other modem control signals, or synchronous serial data transfers. 17.2 UART Instances in FE310-G003 FE310-G003 contains two UART instances. Their addresses and parameters are shown in Table 53. Table 53: UART Instances...
Page 89
Hardware interlocks ensure that the current transfer completes before mode transitions and control register updates take effect. 18.2 SPI Instances in FE310-G003 FE310-G003 contains three SPI instances. Their addresses and parameters are shown in Table Table 63: SPI Instances Instance...
Page 111
Chapter 20 Inter-Integrated Circuit (I²C) Master Interface The SiFive Inter-Integrated Circuit (I²C) Master Interface is based on OpenCores® I²C Master Core. Download the original documentation at https://opencores.org/project,i2c. All I²C control register addresses are 4-byte aligned. 20.1 I²C Instance in FE310-G003 FE310-G003 contains one I²C instance.
Page 112
Chapter 21 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. 21.1 Debug CSRs This section describes the per-hart trace and debug registers (TDRs), which are mapped into...
Page 114
Debug ROM. The debugger may use it as described in The RISC‑V Debug Specifi- cation 0.13. 21.2 Breakpoints The FE310-G003 supports eight hardware breakpoint registers per hart, which can be flexibly shared between debug mode and machine mode. When a breakpoint register is selected with...
Page 118
– 0x300 0x3FF The FE310-G003 has 16 32-bit words of program buffer for the debugger to direct a hart to exe- cute arbitrary RISC-V code. Its location in memory can be determined by executing aiupc instructions and storing the result into the program buffer.
Page 119
Chapter 21 Debug 21.4 Debug Interface The SiFive FE310-G003 includes the JTAG debug transport module (DTM) described in The RISC‑V Debug Specification 0.13. This enables a single external industry-standard 1149.1 JTAG interface to test and debug the system. The JTAG interface is directly connected to input pins.
Page 120
On the FE310-G003, the IDCODE is set to 0x20000913 21.4.5 JTAG Debug Commands The JTAG DEBUG instruction gives access to the SiFive debug module by connecting the debug scan register between jtag_TDI jtag_TDO The debug scan register includes a 2-bit opcode field, a 7-bit debug module address field, and a 32-bit data field to allow various memory-mapped read/write operations to be specified with a single scan of the debug scan register.
Page 121
Chapter 22 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 FE310-G003 and is the answer not in the manual?
Questions and answers