Approaching Overhead-Free Execution on FPGA Soft-Processors Charles - - PowerPoint PPT Presentation

approaching overhead free execution on fpga soft
SMART_READER_LITE
LIVE PREVIEW

Approaching Overhead-Free Execution on FPGA Soft-Processors Charles - - PowerPoint PPT Presentation

Approaching Overhead-Free Execution on FPGA Soft-Processors Charles Eric LaForest Jason Anderson J. Gregory Steffan University of Toronto ICFPT 2014, Shanghai Motivation Designing on FPGAs remains difficult Larger systems Longer


slide-1
SLIDE 1

Approaching Overhead-Free Execution

  • n FPGA Soft-Processors

Charles Eric LaForest Jason Anderson

  • J. Gregory Steffan

University of Toronto ICFPT 2014, Shanghai

slide-2
SLIDE 2

2

Motivation

  • Designing on FPGAs remains difficult

– Larger systems – Longer CAD processing times – Increases time-to-market and engineering costs

Clip art by Angela Melick, http://www.wastedtalent.ca/

slide-3
SLIDE 3

3

Better Design Processes

  • FPGA Overlays (soft-processors)

– Easy and fast: design system as software – Co-design hardware only if necessary – Fast overall design cycle – Lower performance

slide-4
SLIDE 4

4

Raw Performance Loss

  • Soft-processor vs. underlying FPGA (Stratix IV)

– Logic Fabric: 800 MHz – Block RAM: 550 MHz – DSP Block: 480 MHz – Nios II/f: 240 MHz

slide-5
SLIDE 5

5

CPU Internal Overhead

  • CPU vs. custom hardware

– Sequential excution vs. Spatial parallelism – Address/Loop calculations vs. Counters – Branching vs. Multiplexers

  • FSMs
slide-6
SLIDE 6

6

Reducing CPU Overhead

  • CPU pipelining and multi-threading

– Raw speed increase, but no effect on overhead

  • Loop unrolling

– Code bloat – Regular code/data

  • Code vectorizing

– Challenging – Regular code/data

slide-7
SLIDE 7

7

A Partial Solution: Octavo

  • Exceeds 500 MHz on Stratix IV (550 MHz max!)
  • 8 threads (fixed round-robin dispatch)
  • Easily extensible with hardware accelerators

“Octavo: An FPGA-Centric Processor Family”, FPGA 2012

slide-8
SLIDE 8

8

Enabling Overhead-Free Execution

  • Problems

– Speedup ultimately limited by execution overhead – Addressing and flow-control overhead (per thread) – Worsened by hardware accelerators

slide-9
SLIDE 9

9

Enabling Overhead-Free Execution

  • Problems

– Speedup ultimately limited by execution overhead – Addressing and flow-control overhead (per thread) – Worsened by hardware accelerators

  • Solutions

– Extract overhead as “sub-programs” (per thread) – Execute them in parallel along the pipeline – Decreases Fmax 6.1%, increases area 73%*

slide-10
SLIDE 10

10

Sequential Sub-Programs in MIPS

  • uter: seed_ptr = ptr_init

inner: temp = MEM[seed_ptr] if (temp < 0): goto outer temp2 = temp & 1 if (temp2 == 1): temp = (temp * 3) + 1 else: temp = temp / 2 MEM[seed_ptr] = temp seed_ptr += 1 OUTPUT = temp goto inner

  • Flow-control
  • Addressing
  • Useful work
slide-11
SLIDE 11

11

Sequential Sub-Programs in Octavo

  • uter: ADD seed_ptr, ptr_init, 0

inner: LW temp, seed_ptr BLTZn outer, temp BEVNn even, temp MUL temp, temp, 3 ADD temp, temp, 1 JMP output even: SRA temp, temp, 1

  • utput: SW temp, seed_ptr

ADD seed_ptr, seed_ptr, 1 SW temp, OUTPUT JMP inner

  • Flow-control
  • Addressing
  • Useful work
slide-12
SLIDE 12

12

Removing Flow-Control Overhead

  • uter: ADD seed_ptr, ptr_init, 0

inner: LW temp, seed_ptr BLTZn outer, temp BEVNn even, temp MUL temp, temp, 3 ADD temp, temp, 1 JMP output even: SRA temp, temp, 1

  • utput: SW temp, seed_ptr

ADD seed_ptr, seed_ptr, 1 SW temp, OUTPUT JMP inner

  • Flow-control
  • Addressing
  • Useful work
slide-13
SLIDE 13

13

Parallel Sub-Programs in Octavo

  • uter: ADD seed_ptr, ptr_init, 0

inner: LW temp, seed_ptr BLTZn outer, temp BEVNn even, temp MUL temp, temp, 3 ADD temp, temp, 1 JMP output even: SRA temp, temp, 1

  • utput: SW temp, seed_ptr

ADD seed_ptr, seed_ptr, 1 SW temp, OUTPUT JMP inner

  • Flow-control
  • Addressing
  • Useful work
slide-14
SLIDE 14

14

Parallel Sub-Programs in Octavo

  • uter: ADD seed_ptr, ptr_init, 0

inner: LW temp, seed_ptr MUL temp, temp, 3 ; BEVNn even ; BLTZn outer ADD temp, temp, 1 ; JMP output even: SRA temp, temp, 1

  • utput: SW temp, seed_ptr

SW temp, OUTPUT ; JMP inner

  • Flow-control (folded, cancelling, multi-way)
  • Addressing (indirect with post-increment)
  • Useful work
slide-15
SLIDE 15

15

Parallel Sub-Programs in Octavo

  • uter: ADD seed_ptr, ptr_init, 0

inner: LW temp, seed_ptr MUL temp, temp, 3 ; BEVNn even ; BLTZn outer ADD temp, temp, 1 ; JMP output even: SRA temp, temp, 1

  • utput: SW temp, seed_ptr

SW temp, OUTPUT ; JMP inner

  • Flow-control (folded, cancelling, multi-way)
  • Addressing (indirect with post-increment)
  • Useful work
slide-16
SLIDE 16

16

Original Octavo Soft-Processor

slide-17
SLIDE 17

17

Reduced-Overhead Octavo

slide-18
SLIDE 18

18

Reduced-Overhead Octavo

(Branches not in fetched instructions!)

Branch Trigger Module (BTM)

slide-19
SLIDE 19

19

Reduced-Overhead Octavo

Address Offset Module (AOM)

(One entry for each instruction operand)

slide-20
SLIDE 20

20

AOM and BTM Entries

  • Each AOM entry: one pointer
  • Each BTM entry: one branch
slide-21
SLIDE 21

21

AOM and BTM Entries

  • Each AOM entry: one pointer
  • Each BTM entry: one branch
  • Currently: up to 4 pointers and 8 branches

– Per thread! (32 pointers and 64 branches total) – While still reaching 500 MHz peak on Stratix IV

slide-22
SLIDE 22

22

AOM and BTM Entries

  • Each AOM entry: one pointer
  • Each BTM entry: one branch
  • Currently: up to 4 pointers and 8 branches

– Per thread! (32 pointers and 64 branches total) – While still reaching 500 MHz peak on Stratix IV

  • Benchmarking: 2 pointers and 4 branches

– Reaches 495 MHz avg., 510 MHz peak – Shows behaviour with partial AOM/BTM support

slide-23
SLIDE 23

23

Hailstone Increment Reverse FIR FSM 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 Unrolled ("perfect" MIPS) Looping (modified Octavo)

Benchmark Speedup

slide-24
SLIDE 24

24

Hailstone Increment Reverse FIR FSM 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 Unrolled ("perfect" MIPS) Looping (modified Octavo)

Benchmark Speedup

slide-25
SLIDE 25

25

Benchmark Efficiency Increase

Hailstone Increment Reverse FIR FSM 1 1.1 1.2 1.3 1.4 1.5 1.6 Unrolled ("perfect" MIPS) Looping (modified Octavo)

slide-26
SLIDE 26

26

Benchmark Efficiency Increase

Hailstone Increment Reverse FIR FSM 1 1.1 1.2 1.3 1.4 1.5 1.6 Unrolled ("perfect" MIPS) Looping (modified Octavo) (0.828)

slide-27
SLIDE 27

27

  • BTM: additional branch conditions

– Programmable loop counters

Future Improvements

slide-28
SLIDE 28

28

  • BTM: additional branch conditions

– Programmable loop counters

  • AOM: extend pointer increments

– Negative steps – Strided and modulo addressing

Future Improvements

slide-29
SLIDE 29

29

  • BTM: additional branch conditions

– Programmable loop counters

  • AOM: extend pointer increments

– Negative steps – Strided and modulo addressing

  • Both: improve area usage

– More efficient use of internal memories

Future Improvements

slide-30
SLIDE 30

30

Ongoing Work

https://github.com/laforest/Octavo

Clip art by Angela Melick, http://www.wastedtalent.ca/

slide-31
SLIDE 31

31

Extra Slides

slide-32
SLIDE 32

32

slide-33
SLIDE 33

33

slide-34
SLIDE 34

34

Octavo Soft-Processor

  • Reaches 550 MHz on Stratix IV FPGA
  • 8 threads (fixed round-robin)
  • 1024 36-bit integer words for each I/A/B memory

T7 T6 T5 T4 T3 T2 T1 T0 T7 T6 (Previous Round)

slide-35
SLIDE 35

35

Instruction Memory

slide-36
SLIDE 36

36

Empty Pipeline Stages

  • Necessary for high frequency operation
  • Used for special functions later...
slide-37
SLIDE 37

37

A and B Data Memories

  • Memory-mapped I/O ports
  • Can attach custom hardware to ports
slide-38
SLIDE 38

38

Controller

  • Computes next PC for each thread (8 Pcs)
  • Calculates jumps and branches
slide-39
SLIDE 39

39

ALU

  • Calculates ADD, XOR, MUL, etc...
  • Output written to all memories
slide-40
SLIDE 40

40

Data Path

  • 8 stages (2 read, 4 compute, 2 write)
slide-41
SLIDE 41

41

Control Path

  • 8 stages to match Data Path
  • Offset due to empty stages (1,2,3)
  • 1-cycle RAW hazard from ALU to Instr. Mem.
slide-42
SLIDE 42

42

Branch Trigger Module

slide-43
SLIDE 43

43

Address Offset Module

slide-44
SLIDE 44

44

AOM/BTM Configurations