mit’s riscy expedition - risc-v foundation€¦ · mit’s riscy expedition andy wright, sizhuo...

13
Computation Structures Group MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology RISC V Workshop, Redwood Shores, CA January 6, 2015 1

Upload: others

Post on 15-May-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Computation Structures Group

MIT’s RISCY Expedition

Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind

Computer Science & Artificial Intelligence Lab.Massachusetts Institute of Technology

RISC V Workshop, Redwood Shores, CAJanuary 6, 2015

1

Page 2: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

IntroductionWe made an 64-bit RISC-V processorn IMAFD extensionsn Machine, Supervisor, and User modesn Boots RISC-V Linux with Sv39 Paged Virtual Memoryn Tandem verified with Spiken Written in Bluespec System Verilog

We are using this as a base for our “RiscyExpedition”

2

Page 3: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Riscy ExpeditionFormal specification of the ISA n using an operational model

Formally verified processor implementationsMemory Consistency Modelsn Should RISC V have a weak memory model? n Which memory model?

AcceleratorsMicroarchitecture explorationVLSI implementations using standard ASIC flow – “push button” synthesisn Processors tuned for ASIC designs

3

Page 4: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Verified DesignOur Philosophy: Get a working processor first, figure out why it is slow, and make it faster without breaking itThere is no separation of Design and Verification – There’s just verified designCurrently we are using Tandem Verification*In our expedition we are moving to Formal Verification

4

* Technology developed by Bluespec Inc

Page 5: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Tandem verification

Spike RiscyFpga

HTIF HTIF

𝑆"#$%&(𝑛) = 𝑆+$",-(𝑛)

S contains : The pc at step n.The instruction executed at step nThe operands and the concerned registersThe packets exchanged with HTIF, if existsThe memory operations wanted to be performed, if exists…

…Jmp a;…

…Jmp a;…

pc pc

Very useful but for highly-parameterized designs it provides only a weak sense of correctness

5

Synchronized

Page 6: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Formal Verification and Specification

Formal Verification is constructing a proof that a processor matches a formal specificationn But we need a formal specification for RISC-V

In the ISA there are lots of (odd) cases that need to be specified for a formal verificationn Are referenced bits in page table entries set for

speculatively accessed pages?n A single instruction can result in up to 13 effective

memory accesses. How exactly do they interact with each other?w How does they influence the memory model?

6

Page 7: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Memory Consistency ModelStrong consistency models (e.g. SC, TSO)n Easy to understand, but restricts optimizations

Weak consistency modelsn Permit HW optimizations, but difficult to understandn Release Consistency (RC)

w Defined with “operation performed with respect to certain processor”

n Power/ARMw Definition in official ISA is not clearw General description: no ordering should be assumedw Special cases where ordering is enforced

n Dependent loads cannot be reordered

7

Page 8: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

We want Simple operational definitions

Legal behaviors must be observable on a simple abstract machine consisting of cores and a shared monolithic memoryCores execute one instruction at a time in program ordern May have local buffers, like the store buffer used to define

TSO; useful in modeling implicit reordering of memory instructions

n The effect of Fence instructions is to flush local buffers

Multi-ported monolithic memory which processes one read or write immediately

8

Page 9: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

WMM: A new weak consistency model

WMM is defined using a store buffer and an invalidation buffer per coren Permits all load-store reorderings except stores

overtaking loadsn Allows almost all microarchitectural optimizations

w out-of-order executionw memory dependency speculationw load-value speculation

n Provides an easy to understand operational model between cores

9

Page 10: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

“Flavored” Memory Accesses

Inst. Fetch Mem.Exec.

TLB TLB

Instruction Fetch (I)

Virtual Address Translation (VAT)

Data Access

(D)

Input/Output(IO)

10

This looks like 4 separate cores accessing the same memory

Page 11: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Flavored Memory Synchronization

SFENCE.VMn D.ST < SFENCE.VM < VAT.LD

w VAT.LD must see result of D.STn With this specification, some SFENCE.VMs are

missing from the Linux kernelNo instruction for the other direction (yet)n VAT.ST < ? < D.LDn So does D.LD always need to see the results of

all previous VAT.STs immediately?We are looking at these flavored accesses closely and incorporating them into the memory model

11

Page 12: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Further Work

Acceleratorsn Convolutional Neural Network accelerator in

BlueDBM

Microarchitecturen Out-of-order execution multicore processor

ASIC Implementationn Processor building blocks tuned for ASIC

performance

12

Page 13: MIT’s RISCY Expedition - RISC-V Foundation€¦ · MIT’s RISCY Expedition Andy Wright, Sizhuo Zhang, Thomas Bourgeat, Amol Bhave, Jamey Hicks, Arvind Computer Science & Artificial

Questions?

Contact information:n Andy Wright – [email protected] csg.csail.mit.edu/riscy-e

13