A Dynamic Memory Allocation Library for High-Level Synthesis - - PowerPoint PPT Presentation

a dynamic memory allocation library for high level
SMART_READER_LITE
LIVE PREVIEW

A Dynamic Memory Allocation Library for High-Level Synthesis - - PowerPoint PPT Presentation

A Dynamic Memory Allocation Library for High-Level Synthesis Nicholas V. Giamblanco and Jason H. Anderson University of Toronto, Canada Dept. of Electrical and Computer Engineering FPL 2019 Dynamic Memory Allocation in HLS: Current Problems


slide-1
SLIDE 1

Nicholas V. Giamblanco and Jason H. Anderson University of Toronto, Canada

  • Dept. of Electrical and Computer Engineering

FPL 2019

A Dynamic Memory Allocation Library for High-Level Synthesis

slide-2
SLIDE 2

Dynamic Memory Allocation in HLS: Current Problems

Where and How Big should the Arena(Heap) Be? Performance & Area Problems Which Allocator?

2

No Obvious Way TO include it!

slide-3
SLIDE 3

Dynamic Memory Allocation in HLS: Why Include it?

3

  • No More Code-Refactoring!
  • Portability
  • Marginal Performance and

Area Impacts!!!

  • No More Memory Over-Provisioning
slide-4
SLIDE 4

The Allocators

Linked-List Allocator.

gnumem bitmem

Bitmap Allocator.

linmem

Linear Allocator.

budmem

Buddy Allocator.

lutmem

Look-Up Table Allocator.

4

slide-5
SLIDE 5

Our Approach

Implement Algorithms in HLS-friendly C Library

Available on Github: https://github.com/ngiambla/libmem

  • Arena (heap) implemented as BRAM

5

Automate Transform with LLVM Pass

  • User can select

○ Allocator Algorithm ○ Heap Size

slide-6
SLIDE 6

Example:

// USER PROGRAM void check_this_out() { int * arr = (int*)malloc(SIZE); //… do stuff here free(arr); } void check_this_out() { int * arr = (int*)gnu_malloc(SIZE); //… do stuff here gnu_free(arr); }

6

#TCL PARAMETERS FOR USER set_parameter HEAP_SZ 65536 set_parameter ALLOC_S gnu

libmem

slide-7
SLIDE 7

Allocator Evaluation

7

slide-8
SLIDE 8

Results: Area

8

slide-9
SLIDE 9

9

Results: Performance

slide-10
SLIDE 10

Benchmarks

Real world apps

Random: random request, random release Square: request-do-release Triangular: iterative-request do iterative-release list priq stack hash dfs

Available on Github: https://github.com/ngiambla/dmbenchhls

10

Typical Memory Request Patterns

slide-11
SLIDE 11

Suggest an allocator based on Memory Pattern AND User Requirements

11

Take-away

slide-12
SLIDE 12

Conclusions

  • One Allocator does not ‘rule them all’
  • Performance and area are marginally affected by

allocators!

  • Allocators within HLS work and are useful

12

slide-13
SLIDE 13

THANKS! SEE ME AT THE POSTER

Downloads: https://github.com/ngiambla/libmem https://github.com/ngiambla/dmbenchhls

13