Top Banner
VOLK and GNU Radio Tom Rondeau GNU Radio maintainer Boston, MA October 1, 2011 NEWSDR’11
15

VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

Apr 18, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

VOLK and GNU Radio

Tom Rondeau

GNU Radio maintainer

Boston, MA October 1, 2011

NEWSDR’11

Page 2: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

What’s the problem we are trying to solve?

F. Ge, C. J. Chiang, Y. M. Gottlieb, and R. Chadha, “GNU Radio-Based Digital Communications: Computational Analysis of a GMSK Transceiver,” IEEE GLOBECOM, 2011. 2

Page 3: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

VOLK: Vector-Optimized Library of Kernels

Better than he was before. Better… stronger… faster. 3

Page 4: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

Single Instruction, Multiply Data (SIMD) Basics

4

xi

yi

zi

Traditional (scalar) math. Only one multiply.

Page 5: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

Single Instruction, Multiply Data (SIMD) Basics

5

xi

Vectorized math. One instruction does four multiplies

yi yi+1 yi+2 yi+3

xi+1 xi+2 xi+3

zi zi+1 zi+2 zi+3

Page 6: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

SIMD Registers in x86 chips Holds doubles, floats, ints, shorts, and chars

6

64 64

128-bits

32 32 32 32

16 16 16 16 16 16 16 16

8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8

Page 7: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

Other SIMD architectures

• Intel: SIMD (SSE, AVX)

– AVX extends to 256-bit registers

• PowerPC: AltiVec

• AMD: 3DNow!

• ARM: NEON

• Others, but mostly on dead architectures

7

Page 8: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

VOLK: Set of architecture-specific kernels

8

Some Math Function

generic

Some Math Function

Some Math Function

Some Math Function

Some Math Function

Architecture 1

Architecture 3

Architecture 5

Architecture 2

Architecture 4

Page 9: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

Runtime engine finds best architecture for the processor and selects it.

9

Some Math Function

generic

Some Math Function

Some Math Function

Some Math Function

Some Math Function

Architecture 1

Architecture 3

Architecture 5

Architecture 2

Architecture 4

Page 10: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

If no suitable architecture kernel has been written, fall back on the generic kernel.

10

Some Math Function

generic

Some Math Function

Some Math Function

Some Math Function

Some Math Function

Architecture 1

Architecture 3

Architecture 5

Architecture 2

Architecture 4

Page 11: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

Naming Convention: http://gnuradio.org/redmine/projects/gnuradio/wiki/Volk

Page 12: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

GNU Radio Implementation Issues Memory Alignment

• SIMD instructions (generally) want to have some byte alignment – SSE: 16-byte aligned loads

– AVX: 32-byte aligned loads

• Loading unaligned data can cause a seg fault.

• Using special unaligned load instructions is very time consuming – Aligned memory in an unaligned load is not

guaranteed to be promoted

12

Page 13: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

GNU Radio Implementation Issues Memory Alignment

13

gnuradio buffer

Initially page aligned

gnuradio buffer

work() function given a start pointer

What’s the alignment?

Page 14: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

GNU Radio Implementation Issues Memory Alignment

14

gnuradio buffer

Initially page aligned

gnuradio buffer

Given an output multiple commensurate with the alignment and data type, we can keep alignment.

Use set_output_mutliple(x) to ensure alignment

Always properly aligned

Page 15: VOLK and GNU Radio - Boston Universitypeople.bu.edu/mrahaim/NEWSDR/Presentations/NEWSDR_Rondeau2.pdfGNU Radio Implementation Issues Memory Alignment 14 gnuradio buffer Initially page

fin

15