designing digital signal processors with rocketchip
play

DESIGNING DIGITAL SIGNAL PROCESSORS WITH ROCKETCHIP Paul Rigge, - PowerPoint PPT Presentation

DESIGNING DIGITAL SIGNAL PROCESSORS WITH ROCKETCHIP Paul Rigge, Borivoje Nikoli {rigge,bora}@eecs.berkeley.edu UC Berkeley CARRV 2018 June 2, 2018 SoCs Combine Programmability + Efficiency


  1. DESIGNING DIGITAL SIGNAL PROCESSORS WITH ROCKETCHIP Paul Rigge, Borivoje Nikolić {rigge,bora}@eecs.berkeley.edu UC Berkeley CARRV 2018 June 2, 2018

  2. SoCs Combine Programmability + Efficiency https://telecomtalk.info/qualcomm-announces-64-bit-snapdragon-808-and-snapdragon-810-high-end-mobile-processors/115805/

  3. Digital Signal Processing • SoCs Integrate a lot of signal processing – Cellular+WiFi – Audio – Image Processing – GPS • Strongly benefits from custom hardware – Parallelism – High locality – Trim unneeded bits

  4. Designing SoCs is Hard • Long development cycle • High cost of tools, respins • Reuse limited • High NRE only justifiable in high volume

  5. Chisel, FIRRTL, Rocketchip • Chisel: domain specific Chisel 3 language (DSL) for writing programs that generate circuits • FIRRTL: Flexible Intermediate Transfor FIRRTL Representation for RTL (LLVM mations for hardware) • RocketChip: Open-source RISC- V implementation in Chisel Backends

  6. Growing Infrastructure • Stable cores • Compilers • Software Infrastructure • Accelerators – DMA – Hwacha – Etc. • Interconnect Generators

  7. Outline • DSP Generators in Chisel • AXI-4 Stream + Diplomacy • Memory-mapped DSP Peripherals – Useful building blocks • Verification • OFDM Baseband Example

  8. DSP Generators in Chisel

  9. dsptools https://github.com/ucb-bar/dsptools Paul Rigge, Angie Wang, Stevo Bailey, Chick Markley, Adam Izraelevitz

  10. Floating Point • Start implementing hardware without worrying about precision – Validate IO, control logic, algorithm • Validate floating point hardware implementation against floating point golden model • Uses Verilog “real” types (non-synthesizeable) Black Box Bundle Bundle Operation Uint <64> Uint <64> $bitstoreal $rtoi (e.g. +)

  11. Fixed Point • Fixed point types in Chisel and FIRRTL • Width inference like UInt, SInt • Binary point inference val sel = Wire( Bool ()) val a = Wire( FixedPoint (width = 10.W, binaryPoint = 9.BP)) val b = Wire( FixedPoint (width = 12.W, binaryPoint = 10.BP)) val reg = Reg ( FixedPoint ()) when (sel) { reg := a } .otherwise { reg := b }

  12. Complex Numbers • dsptools defines a Complex type • Generic as to underlying type, i.e. DspComplex[SInt] or DspComplex[FixedPoint] or DspComplex[FloatingPoint] OK • Can choose between 3 or 4 real-multiplies for a complex multiply

  13. DspContext • Automatic pipeline register insertion for adds, multiplies • Rounding • Precision for literals • Override global defaults with scope, e.g. DspContext.alter(myContext) { val sum = a context_* b // auto-pipelined }

  14. Polymorphic Generators • Implement basic • Tune rounding + functionality precision Generic Algorithm • Test against • Pipeline Description golden model • Area • Integrate with optimizations top level Floating Point Fixed Point Implementation Implementation

  15. Numeric Type Classes • Type classes: support ad hoc polymorphism by adding constraints to type variables • Support using type-generic generators with user-defined types • Use type classes from Spire numeric library – Add new type classes for hardware constructs, especially Bool – Hide expensive operations, e.g. division, sqrt

  16. Numeric Type Classes • Ring – +, -, *, zero, and one • Eq – === and =!= • Order (extends Eq) – <, >, <=, >=, max, min • Real (extends Ring with Order with Sign) – ceil, floor, round, isWhole • Integer (extends Real) – mod

  17. DspTester • Verification needs to be as parameterizable as hardware generators • Type-generic PeekPokeTester • Assert output is within epsilon (set by type) DspTester Generator poke(io.in, 3.0) Floating Point Fixed Point UInt Instance Instance Instance

  18. AXI-4 Stream + Diplomacy

  19. Diplomacy Background • Generator runs in two phases – Negotiate parameters – Elaborate hardware • Parameters flow both “in” and “out”

  20. AXI-4 Stream clock reset • AMBA standard for streaming data TREADY • Defines ready/valid TVALID TLAST handshake semantics 8n TDATA • Most fields optional n Master Slave TSTRB – Even TDATA! n TKEEP i TID d TDEST u TUSER

  21. AXI-4 Stream Diplomacy • Nodes exchange parameters Width of TDATA, TUSER # Masters • Edge resolves parameters, chooses Always Ready Has TDATA, TSTRB, TKEEP bundle parameters # Endpoints Master Node Slave Node Edge Bundle Parameters

  22. Memory-mapped DSP Peripherals

  23. • Connect DSP accelerators to Rocket Vector DMA Tile Rocket via Periphery Bus Bus L2 Cache Periphery Bus Bus Block 1 Block 2 Block 3 Block 4 DFT DSP

  24. DspBlock • Basic building block of DSP functionality Memory • Streaming inputs DSP Block and outputs CSR (any number) • Optional memory Unpack Pack interface AXI-S AXI-S DSP

  25. Type-generic DSP Blocks • Define DSP functionality T DspBlock and interconnect - streamNode: AXI4StreamNode - mem: Option[T] separately T MyDspBlock • Treat type of memory - module: Module interface as parameter <<bind>> <T -> APB> <<bind>> <T -> TileLink> TLMyDspBlock APBMyDspBlock <<bind>> <<bind>> <T -> AXI4> <T -> AHB> AXI4MyDspBlock AHBMyDspBlock

  26. DspChain • DspBlock composed of many internal DspBlocks • Generate memory interconnect, connections between blocks • Add design-for-test (DFT) structures CPU Bus DUT DUT Pattern Generator AXI4-Str Master Model Logic Analyzer DFT C Test

  27. Synchronous Data Flow Lee and Messerschmitt (1987). • Represent computation as digraph • Samples produced/consumed by each node known a priori

  28. DspRegister, DspQueue • Building blocks for SDF-style design • DspRegister – Register with programmable vector length – Stream in and out simultaneously – Processor has visibility into contents • DspQueue – Throw interrupt when entries exceeds programmable threshold – Support real-time

  29. Verification

  30. Unit Tests TileLink • PeekPokeTester Master Model – Type-generic with AXI4-Stream AXI4-Stream DspTester DUT Master Model Slave Model • FIRRTL Interpreter Scala Test very fast for small tests

  31. Integration Tests CPU Bus • Write C programs to DUT DUT run on Rocket, use Rocket test harness Pattern Generator • Generate design-for- AXI4-Str Logic Analyzer Master Model test (DFT) structures DFT C Test – Load test vectors, set muxes, store outputs • Same binary for simulation and bring-up

  32. IPXact • XML schema describing circuit metadata Chisel – Port mappings Generator – interface types – generator parameters • Use external tools FIRRTL/ IPXact C API – Python test vector Verilog generation + Verification Workbench

  33. OFDM Baseband Example

  34. OFDM Background • Frequency domain equalization • Uses FFT Guard Interval • Relax time domain synchronization CP OFDM Symbol time frequency

  35. OFDM Baseband • Transmitter and receiver Interrupt Sync Receiver CFO CP Channel Peak FFT Autocorr Correct Strip Eq Detect From ADC Splitter DspRegister DspQueue DspRegister Receiver DspRegister Transmission DspRegister Transmitter DspRegister To DAC Scheduler DspRegister Transmitter Add IFFT Add CP Pilot

  36. Conclusion • Chisel + FIRRTL + dsptools help building DSP • RocketChip is not just a processor, library of useful components – Diplomacy – Interconnect – Utilities • Can build and verify complex SoCs with RocketChip

  37. Thank You • Collaborators – Stevo Bailey, Angie Wang, Adam Izraelevitz, Chick Markley, Colin Schmidt, Timo Joas, and Jim Lawson – UCB BAR • Support – NSF GRFP – Adept and BWRC

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend