Riscv Zscale Workshop June2015 PDF
Riscv Zscale Workshop June2015 PDF
Riscv Zscale Workshop June2015 PDF
2
Berkeley’s RISC-V Core Generators
3
Z-scale Pipeline
WB
PC DE
IF MEM
Gen. EX
MUL
§ Note: numbers are very likely to change in the future as we tune the
design and add things to the core.
5
RV32E
6
Building a Z-scale System
AHB-Lite
JTAG Z-Scale
Debugger Core
APB
D Devices
J-Bus I-Bus D-Bus
AHB-Lite P Peripherals
Crossbar
S-Bus
NOR Boot
SRAM
Flash ROM AHB
DRAM D D D
APB
§ Working on
P-Bus
“platform
specification” P P P P P
7
Z-scale Generator is Written in Chisel
8
Functional Programming 101
9
Functional Programming Example
Used in AHB-Lite Crossbar
masters(0) masters(1)
masters(0,1) AHB-Lite Crossbar
master
AHB-Lite Bus AHB-Lite Bus AHB-Lite Bus
AHB-Lite
Crossbar
slaves(0,1,2)
ins(0,1)
slaves(0,1,2)
AHB-Lite Arbiter Arbiter Arbiter
Slave Mux Arbiter
Slave Mux Slave Mux Slave Mux
11
Z-scale FPGA DEMO System
0x8000_0800
JTAG Z-Scale CORE RESET
Debugger Core (1KB)
0x8000_0400
GPIO LED
J-Bus I-Bus D-Bus (1KB)
0x8000_0000
AHB-Lite Empty
Crossbar 0x2400_4000
SPI FLASH
S-Bus (16KB)
0x2400_0000
Boot DRAM
ROM SPI AHB (64MB)
DRAM
FLASH APB
0x2000_0000
P-Bus Empty
0x0000_4000
Boot ROM
AHB-Lite
GPIO CORE (16KB)
APB 0x0000_0000
LED RESET
12
Z-scale FPGA DEMO System Mapped to
Xilinx Spartan6 LX9
§ Avnet LX9 Microboard
- $89
- Xilinx Spartan6 LX9
- 64MB LPDDR RAM
- 16MB SPI FLASH
Resource Used Percentage
- 10/100 Ethernet
Registers 2,329 20%
- USB-to-UART
LUTs 4,328 75%
- USB-to-JTAG
RAM16 8 25%
- 2x Pmod headers
RAM8 0 0%
- 4x LEDs
Test program is stored in bootrom. - 4x DIP switches
It is a memory test program, which - RESET/PROG buttons
writes 32-bit words generated from
an LFSR to 64MB of DRAM, and § 4 boards for raffle!
checks it by reading 64MB of data,
and toggles LED if it succeeds.
13
Z-scale Use Cases
§ Microcontrollers
- Implement your simple control loops
- If code density matters
§ Embedded Systems
- Build your system around Z-scale
§ Validation of Tiny 32-bit RISC-V Systems
- You don’t need to use our code, just consider Z-
scale as an existence proof and implement your
own RV32I core
§ Both Chisel and Verilog versions of Z-scale is
open-sourced under the BSD license
- https://github.com/ucb-bar/zscale
- https://github.com/ucb-bar/fpga-spartan6
14
What is the Rocket Chip Generator?
§ Parameterized SoC
Tile Tile HTIF
Rocket Rocket
generator written in
HTIFIO
Core Core
ROCC
ROCCIO
Accel.
Chisel
FPU FPU
HostIO
O
IO n kI
ink eLi
L
TileL
Tile
Coherence Manager
- L1 Crossbar
L2Cache L2Cache L2Cache L2Cache L2Cache
mngr mngr mngr mngr mngr
directory bits
client client client client client
TileLink
TileLinkIO
15
Rocket Chip Generator Updates
Since the 1st RISC-V Workshop
§ Implemented L2$ with
Tile Tile HTIF
Rocket Rocket HTIFIO
directory bits
Core Core
ROCC
ROCCIO
Accel.
FPU FPU
ROCC
HostIO
§ RoCC coprocessor has
a memory port
Accel.
L1 Inst
L1 Inst L1 Data L1 Data
sets, sets, sets,
TileLink
happen on the rocket-
L1 Network arb
nkIO
O
IO n kI
ink Til eLi
i
L
TileL
Tile
chip repository
Coherence Manager
L2Cache L2Cache L2Cache L2Cache L2Cache
standardized memory
ways ways ways ways ways
interfaces
TileLink
TileLinkIO
16
Important Memory Interfaces
§ TileLink
- Our cache-coherent interconnect
- For more details, watch my talk from last workshop
§ NASTI (pronounced nasty)
- Not A STandard Interface
- Our implementation of the AXI4 standard
§ HASTI (pronounced hasty)
- Highly Advanced System Transport Interface
- Our implementation of the AHB-Lite standard
§ POCI (pronounced pokey)
- Peripheral Oriented Connection Interface
- Our implementation of the APB standard
17
Rocket Chip Generator Grand Plan
with Z-scale
RocketTile RocketTile
Rocket RoCC Rocket
L1I$ L1I$ JTAG
Accel.
RoCC Debug
CSR CSR Accel.
File L1D$ File L1D$
L1 Network
Z-scale
L2$ Bank Cache-
L2$ Bank Cache-
Coherent
L2$ Bank Coherent
L2$ Bank Device AHB-Lite Bus
Device
Low-
Scratch SCR
Speed
L2 Network Pad File
IO Device
High- High-
DRAM DRAM
Speed Speed IO Peripheral Peripheral Peripheral
Controller Controller
IO Device Device
18
Conclusion, Future Work, and Raffle