Riscduino Single Risc Core 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.
Riscduino is a Single 32 bit RISC V based SOC design pin compatible to arudino platform and this soc targetted 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.
Riscduino Block Diagram
Key features
* Open sourced under Apache-2.0 License (see LICENSE file) - unrestricted commercial use allowed.
* Dual 32 Bit RISC-V core
* 2KB SRAM for instruction cache
* 2KB SRAM for data cache
* 2KB SRAM for Tightly coupled memory - For Data Memory
* Quad SPI Master with 4 Chip select, supports both SPI flash and SRAM interface
* 2 x UART with 16Byte FIFO
* USB 1.1 Host
* I2C Master
* UART Master
* Simple SPI Master with 4 Chip select
* 6 Channel ADC (in Progress)
* 6 x PWM
* 3 x Timer (16 Bit), 1us/1ms/1second resolution
* Pin Compatbible to arudino uno
* Wishbone compatible design
* Written in System Verilog
* Open-source tool set
* simulation - iverilog
* synthesis - yosys
* backend/sta - openlane tool set
* Verification suite provided.
Riscduino derivatives
MPW Shuttle on Riscduino
MPW
Tape-out
Project Name
Project Details
Github
Efabless
MPW-2
18-June-2021
YiFive
Single 32bit RISCV core without cache + SDRAM Controller + WB Interconnect
Carvel SOC provides 38 GPIO pins for user functionality. Riscduino SOC GPIO Pin Mapping as follows vs ATMEGA328 and Arudino
ATMGA328 Pin No
Functionality
Arudino Pin Name
Carvel Pin Mapping
Pin-1
PC6/RESET
digital_io[0]
Pin-2
PD0/RXD[0]
D0
digital_io[1]
Pin-3
PD1/TXD[0]
D1
digital_io[2]
Pin-4
PD2/RXD[1]/INT0
D2
digital_io[3]
Pin-5
PD3/INT1/OC2B(PWM0)
D3
digital_io[4]
Pin-6
PD4/TXD[1]
D4
digital_io[5]
Pin-7
VCC
-
Pin-8
GND
-
Pin-9
PB6/XTAL1/TOSC1
digital_io[6]
Pin-10
PB7/XTAL2/TOSC2
digital_io[7]
Pin-11
PD5/SS[3]/OC0B(PWM1)/T1
D5
digital_io[8]
Pin-12
PD6/SS[2]/OC0A(PWM2)/AIN0
D6
digital_io[9] /analog_io[2]
Pin-13
PD7/A1N1
D7
digital_io[10]/analog_io[3]
Pin-14
PB0/CLKO/ICP1
D8
digital_io[11]
Pin-15
PB1/SS[1]OC1A(PWM3)
D9
digital_io[12]
Pin-16
PB2/SS[0]/OC1B(PWM4)
D10
digital_io[13]
Pin-17
PB3/MOSI/OC2A(PWM5)
D11
digital_io[14]
Pin-18
PB4/MISO
D12
digital_io[15]
Pin-19
PB5/SCK
D13
digital_io[16]
Pin-20
AVCC
-
Pin-21
AREF
analog_io[10]
Pin-22
GND
-
Pin-23
PC0/ADC0
A0
digital_io[18]/analog_io[11]
Pin-24
PC1/ADC1
A1
digital_io[19]/analog_io[12]
Pin-25
PC2/ADC2
A2
digital_io[20]/analog_io[13]
Pin-26
PC3/ADC3
A3
digital_io[21]/analog_io[14]
Pin-27
PC4/ADC4/SDA
A4
digital_io[22]/analog_io[15]
Pin-28
PC5/ADC5/SCL
A5
digital_io[23]/analog_io[16]
Additional Pad used for Externam ROM/RAM/USB
Sflash
sflash_sck
digital_io[24]
SFlash
sflash_ss0
digital_io[25]
SFlash
sflash_ss1
digital_io[26]
SFlash
sflash_ss2
digital_io[27]
SFlash
sflash_ss3
digital_io[28]
SFlash
sflash_io0
digital_io[29]
SFlash
sflash_io1
digital_io[30]
SFlash
sflash_io2
digital_io[31]
SFlash
sflash_io3
digital_io[32]
SSRAM
Reserved
digital_io[33]
SSRAM
uartm rxd
digital_io[34]
SSRAM
uartm txd
digital_io[35]
usb1.1
usb_dp
digital_io[36]
usb1.1
usb_dn
digital_io[37]
# Sub IP features
RISC V Core
Riscduino SOC Integrated 32 Bits RISC V core. Initial version of Single core RISC-V core is picked from
Syntacore SCR1 (https://github.com/syntacore/scr1)
RISC V core customization for Riscduino SOC
Following Design changes are done on the basic version of syntacore RISC core
* Some of the sv syntex are changed to standard verilog format to make compatibile with opensource tool iverilog & yosys
* local Instruction Memory is increased from 4 to 8 location
* Instruction Request are changed from Single word to 4 Word Burst
* Multiplication and Divsion are changed to improve timing
* Additional pipe line stages added to improve the RISC timing closure near to 50Mhz
* 2KB instruction cache
* 2KB data cache
* Additional router are added towards instruction cache
* Additional router are added towards data cache
* Modified AXI/AHB interface to wishbone interface for instruction and data memory interface
Block Diagram
RISC V Core Key feature
* RV32I or RV32E ISA base + optional RVM and RVC standard extensions
* Machine privilege mode only
* 2 to 5 stage pipeline
* 2KB icache
* 2KB dcache
* Optional Integrated Programmable Interrupt Controller with 16 IRQ lines
* Optional RISC-V Debug subsystem with JTAG interface
* Optional on-chip Tightly-Coupled Memory
6 Channel SAR ADC
In Process - Looking for community help ...
SOC Memory Map
RISC IMEM
RISC DMEM
EXT MAP
Target IP
0x0000_0000 to 0x0FFF_FFFF
0x0000_0000 to 0x0FFF_FFFF
0x0000_0000 to 0x0FFF_FFFF
QSPI FLASH MEMORY
0x1000_0000 to 0x1000_00FF
0x1000_0000 to 0x1000_00FF
0x1000_0000 to 0x1000_00FF
QSPI Config Reg
0x1001_0000 to 0x1001_003F
0x1001_0000 to 0x1001_003F
0x1001_0000 to 0x1001_003F
UART
0x1001_0040 to 0x1001_007F
0x1001_0040 to 0x1001_007F
0x1001_0040 to 0x1001_007F
I2C
0x1001_0080 to 0x1001_00BF
0x1001_0080 to 0x1001_00BF
0x1001_0080 to 0x1001_00BF
USB
0x1001_00C0 to 0x1001_00FF
0x1001_00C0 to 0x1001_00FF
0x1001_00C0 to 0x1001_00FF
SSPI
0x1002_0080 to 0x1002_00FF
0x1002_0080 to 0x1002_00FF
0x1002_0080 to 0x1002_00FF
PINMUX
0x1003_0080 to 0x1003_07FF
0x1003_0080 to 0x1003_07FF
0x1003_0080 to 0x1003_07FF
SRAM-0 (2KB)
0x1003_0800 to 0x1003_0FFF
0x1003_0800 to 0x1003_0FFF
0x1003_0800 to 0x1003_0FFF
SRAM-1 (2KB)
0x1003_1000 to 0x1003_17FF
0x1003_1000 to 0x1003_17FF
0x1003_1000 to 0x1003_17FF
SRAM-2 (2KB)
0x1003_1800 to 0x1003_1FFF
0x1003_1800 to 0x1003_1FFF
0x1003_1800 to 0x1003_1FFF
SRAM-3 (2KB)
-
-
0x3080_0000 to 0x3080_00FF
WB HOST
SOC Size
Block
Total Cell
Seq
Combo
RISC
20982
3164
17818
PINMUX
5693
1022
4671
SPI
7120
1281
5839
UART_I2C_USB_SPI
11196
2448
8748
WB_HOST
2796
588
2208
WB_INTC
1878
108
1770
SAR_ADC
118
18
100
MBIST
3125
543
2582
TOTAL
52908
9172
43736
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
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
user_mbist_test1 - Standalone MBIST test
user_spi - Standalone SPI test
user_i2c - Standalone I2C test
user_risc_soft_boot - Standalone Risc with SRAM as Boot
Running Simulation
Examples:
make verify-wb_port
make verify-risc_boot
make verify-uart_master
make verify-user_basic
make verify-user_uart
make verify-user_uart1
make verify-user_spi
make verify-user_i2cm
make verify-user_risc_boot
make verify-user_pwm
make verify-user_timer
make verify-user_sspi
make verify-user_qspi
make verify-user_usb
make verify-user_uart_master
make verify-wb_port SIM=RTL DUMP=OFF
make verify-wb_port SIM=RTL DUMP=ON
make verify-riscv_regress
Tool Sets
Riscduino 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