YiFive SOC
Permission to use, copy, modify, and/or distribute this soc for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOC IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOC INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOC.
YiFive is a 32 bit RISC V based SOC design targeted for efabless Shuttle program. This project uses only open source tool set for simulation,synthesis and backend tools. The SOC flow follow the openlane methodology and SOC environment is compatible with efabless/carvel methodology.
YiFive Block Diagram
Key features
* Open sourced under Apache-2.0 License (see LICENSE file) - unrestricted commercial use allowed.
* industry-grade and silicon-proven Open-Source RISC-V core from syntacore
* industry-graded and silicon-proven 8-bit SDRAM controller
* Quad SPI Master
* UART with 16Byte FIFO
* I2C Master
* Wishbone compatible design
* Written in System Verilog
* Open-source tool set
* simulation - iverilog
* synthesis - yosys
* backend/sta - openlane tool set
* Verification suite provided.
Sub IP features
RISC V Core
YiFive SOC Integrated Syntacore SCR1 Open-source RISV-V compatible MCU-class core.
It is industry-grade and silicon-proven IP. Git link: https://github.com/syntacore/scr1
Block Diagram
RISC V Core Key feature
* RV32I or RV32E ISA base + optional RVM and RVC standard extensions
* Machine privilege mode only
* 2 to 4 stage pipeline
* Optional Integrated Programmable Interrupt Controller with 16 IRQ lines
* Optional RISC-V Debug subsystem with JTAG interface
* Optional on-chip Tightly-Coupled Memory
RISC V core customization YiFive SOC
Update: Modified some of the system verilog syntax to basic verilog syntax to compile/synthesis in open source tool like simulator (iverilog) and synthesis (yosys).
Modification: Modified the AXI/AHB interface to wishbone interface towards instruction & data memory interface
8bit SDRAM Controller
Due to number of pin limitation in carvel shuttle, YiFive SOC integrate 8bit SDRAM controller.
This is a silicon proven IP. IP Link: https://opencores.org/projects/sdr_ctrl
Block Diagram
SDRAM Controller key Feature
* 8/16/32 Configurable SDRAM data width
* Wish Bone compatible
* Application clock and SDRAM clock can be async
* Programmable column address
* Support for industry-standard SDRAM devices and modules
* Supports all standard SDRAM functions.
* Fully Synchronous; All signals registered on positive edge of system clock.
* One chip-select signals
* Support SDRAM with four banks
* Programmable CAS latency
* Data mask signals for partial write operations
* Bank management architecture, which minimizes latency.
* Automatic controlled refresh
SOC Memory Map
RISC IMEM
RISC DMEM
EXT MAP
Target IP
0x0000_0000 to 0x0FFF_FFFF
0x0000_0000 to 0x0FFF_FFFF
0x4000_0000 to 0x4FFF_FFFF
SPI FLASH MEMORY
0x1000_0000 to 0x1000_00FF
0x1000_0000 to 0x1000_00FF
0x5000_0000 to 0x5000_00FF
SPI Config Reg
0x2000_0000 to 0x2FFF_FFFF
0x2000_0000 to 0x2FFF_FFFF
0x6000_0000 to 0x6FFF_FFFF
SDRAM
0x3000_0000 to 0x3000_00FF
0x3000_0000 to 0x3000_00FF
0x3000_0000 to 0x3000_00FF
Global Register
SOC Size
Block
Total Cell
Seq
Combo
RISC
26642
3158
23484
GLOBAL REG
2753
575
2178
SDRAM
7198
1207
5991
SPI
7607
1279
6328
UART_I2C
3561
605
2956
WB_HOST
3073
515
2558
WB_INTC
1291
110
1181
TOTAL
52125
7449
44676
SOC Register Map
Register Map: Wishbone HOST
Offset
Name
Description
0x00
GLBL_CTRL
[RW] Global Wishbone Access Control Register
0x04
BANK_CTRL
[RW] Bank Selection, MSB 8 bit Address
0x08
CLK_SKEW_CTRL1
[RW] Clock Skew Control2
0x0c
CLK_SKEW_CTRL2
[RW] Clock Skew Control2
Register: GLBL_CTRL
Bits
Name
Description
31:24
Resevered
Unsused
23:20
RTC_CLK_CTRL
RTC Clock Div Selection
19:16
CPU_CLK_CTRL
CPU Clock Div Selection
15:12
SDARM_CLK_CTRL
SDRAM Clock Div Selection
10:8
WB_CLK_CTRL
Core Wishbone Clock Div Selection
7
UART_I2C_SEL
0 - UART , 1 - I2C Master IO Selection
5
I2C_RST
I2C Reset Control
4
UART_RST
UART Reset Control
3
SDRAM_RST
SDRAM Reset Control
2
SPI_RST
SPI Reset Control
1
CPU_RST
CPU Reset Control
0
WB_RST
Wishbone Core Reset Control
Register: BANK_CTRL
Bits
Name
Description
31:24
Resevered
Unsused
7:0
BANK_SEL
Holds the upper 8 bit address core Wishbone Address
Docker (ensure docker daemon is running) -- tested with version 19.03.12, but any recent version should suffice.
Environment setting
Note: PDK alreay installed inside the docker, no need to define the PDK_ROOT, This will be point to /opt/pdk path inside the docker
if user define the PDK_ROOT path, then flow will use the user defined PDK PATH
The simulation package includes the following tests:
risc_boot - Simple User Risc core boot
wb_port - User Wishbone validation
user_risc_boot - Standalone User Risc core boot
Running Simulation
Examples:
make verify-wb_port
make verify-risc_boot
make verify-user_uart
make verify-user_spi
make verify-user_i2cm
make verify-user_risc_boot
make verify-riscv_regress
Tool Sets
YiFive Soc flow uses Openlane tool sets.
Synthesis
yosys - Performs RTL synthesis
abc - Performs technology mapping
OpenSTA - Pefroms static timing analysis on the resulting netlist to generate timing reports
Floorplan and PDN
init_fp - Defines the core area for the macro as well as the rows (used for placement) and the tracks (used for routing)
ioplacer - Places the macro input and output ports
pdn - Generates the power distribution network
tapcell - Inserts welltap and decap cells in the floorplan
Placement
RePLace - Performs global placement
Resizer - Performs optional optimizations on the design
OpenPhySyn - Performs timing optimizations on the design
OpenDP - Perfroms detailed placement to legalize the globally placed components
CTS
TritonCTS - Synthesizes the clock distribution network (the clock tree)
Routing
FastRoute - Performs global routing to generate a guide file for the detailed router
CU-GR - Another option for performing global routing.
TritonRoute - Performs detailed routing
SPEF-Extractor - Performs SPEF extraction
GDSII Generation
Magic - Streams out the final GDSII layout file from the routed def
Klayout - Streams out the final GDSII layout file from the routed def as a back-up
Checks
Magic - Performs DRC Checks & Antenna Checks
Klayout - Performs DRC Checks
Netgen - Performs LVS Checks
CVC - Performs Circuit Validity Checks
important Note
Following tools in openlane docker is older version, we need to update these tool set.
Icarus Verilog version 12.0 (devel) (s20150603-1107-ga446c34d)