SlideShare a Scribd company logo
vincent@cteq.eu https://www.linkedin.com/in/vincentclaes/ 1
Abstract—R is a programming language for statistical
computing. It has many built in functions for statistical
calculations of large datasets and even more available libraries to
expand this functionality. R is however fundamentally single
threaded. As the size of the used datasets increases, so does the
processing time. This limits the use of R in real-time applications
with large amounts of data where statistical analysis is necessary.
By offloading intensive calculations to an FPGA with massive
parallel processing power these calculations can be sped up to
make R valid for real-time processing. This paper proposes a
simple way to send data from an application in R to the digital
logic in an FPGA and back. In this way applications like sensor
fusion systems, machine learning algorithms for “Internet-of-
things” applications can be realized in the future on this Xilinx
Zynq embedded systems platform. In this way intelligent IoT
Gateways could be realized.
Index Terms— R-project, R, FPGA, Statistical computing,
hardware acceleration, Xillybus, Xilinx, Zynq, zedboard, machine
learning, sensor fusion
I. INTRODUCTION
He last few years we have seen a massive increase in
interest in using FPGAs (Field Programmable Gate Arrays)
to offload difficult calculation from processors. By
leveraging custom digital logic with its parallel potential
processes, which are normally run solely on a processor, can be
sped up and power consumption decreased. At first sight,
combining software with digital logic seems like a daunting
task. Besides software design and digital logic design an
interface has to be created between the two. For these reasons
it is often avoided unless absolutely necessary. Fortunately
there exist tools to simplify this design process, especially the
interface between the application software and digital logic. To
illustrate this, this paper provides a solution to interface an
application written on R and running on a Linux host with
digital logic on an FPGA. With this interface hardware
acceleration for intensive calculations can be implemented on
the FPGA while the ease of use and native support for statistical
computing of R is retained.
II. TOOLS AND SOFTWARE
A zedboard was used as development board. It is a board with
T. Nulens is a student at Hasselt University, Faculty of Engineering
Technology, Diepenbeek, Belgium. E-mail: tom.nulens@student.uhasselt.be.
a Xilinx Zynq system-on-chip and various inputs and outputs
like USB, VGA and much more. The Zynq system-on-chip
consists of a 32bit ARM dual core processor and a large amount
of programmable logic.
Figure 1 Top and bottom view of the zedboard
The application software runs on the processor and
communicates with the programmable logic as required. A
special distribution of Ubuntu, named Xillinux, is installed on
the processor. Xillinux is a version of Ubuntu LTS 12.04 for
ARM with Xillybus drivers preinstalled. The operating system
runs from a SD card which acts as hard drive for the zedboard.
Finally, R version 3.1.2 was installed. Since Xillybus is already
supported on this device, it’s the obvious choice to use as
interface between the processor and digital logic. Xillybus takes
care of both the digital logic implementation and the software
drivers for the interface. It also works with both AXI (Advanced
eXtensible Interface) and PCIe (Peripheral Component
Interconnect Express) which makes it possible to transfer the
application on the Zynq system-on-chip to a full desktop
without worrying about those interfaces.
III. XILLYBUS
Xillybus is a combination of an IP core for the FPGA as well as
a driver for the operating system on the processor. Together it
allows a simple interface between the digital logic and the
application software. The IP core implements the digital logic
required to send and receive data from the processor with First
In First Out shift (FIFO) registers. It provides the signals to
drive FIFO registers, signals like clock and write enable. These
signals must then be used to drive a user-defined FIFO in the
implementation. The Xillybus IP core then connects to a PCIe
V. Claes is the owner of cteq.eu vincent@cteq.eu
https://www.linkedin.com/in/vincentclaes/
Implementing an interface in R to communicate
with Programmable Fabric in a Xilinx ZYNQ
FPGA
Vincent Claes, Tom Nulens [Project realized in 2015]
T
vincent@cteq.eu https://www.linkedin.com/in/vincentclaes/ 2
interface IP core or AXI (Advanced eXtensible Interface) IP
core, depending on the platform. In the Zynq chip, AXI is used
to connect the digital logic to the processor. The IP core is
generated at the IP factory web interface on the website of
Xillybus. Specifications such as bandwidth, data width and data
direction are defined here. Afterwards the IP core is generated
and available for download. The bandwidth on an AXI interface
is limited to 200 Mbytes/s.
Figure 2 FPGA block diagram with the Xillybus IP core and a PCIe
interface
On the processor side the Xillybus driver allows read and write
operations through a standard input/output file-interface. A data
connection is opened between the application software and
digital logic by simply opening a file defined by the Xillybus
driver and writing to or reading from that file.
Figure 3 Processor host interface block diagram
IV. INTERFACE BETWEEN R AND XILLYBUS
A. Problems with interfacing R with Xillybus
In the previous paragraph I noted that to write to or read from
the FPGA a standard file IO system is everything that is
required. Although R has this functionality, reading or writing
in native R is not very efficient for real-time applications for
two reasons: First, an R application is single threaded. This
means that when transferring data back and forth between the
processor and FPGA, no other calculation can be performed by
the processor. With large datasets a significant amount of time
would be lost due to this data transferring. By doing the reading
and writing in background threads the host application can
continue with different calculations regardless of what is
happening in the digital logic. There are some solutions for
parallelism in R, they are however aimed at dividing
calculations over multiple cores instead of doing different tasks
concurrently. Second, as a high level programming language,
datatype manipulation is less transparent than it is in languages
like C. Depending on the digital logic you have designed, the
interface will expect anything ranging from 32bit doubles to
8bit unsigned integers. For this reason it is advantageous to use
a language with explicit datatypes.
B. Proposed solution
By using the R library Rcpp, C++ functions and classes can be
called from R. Rcpp provides a C++ header file with the
definition for an R object. This object along with a short
wrapper allows Rcpp to compile custom C++ classes and
functions that can directly take R objects as argument and return
them too. C++ can then be used to prepare data from R to write
to the FPGA or to read data from the FPGA before returning it
to R. By combining this with the C++ library thread.h read and
write functionality can be given separate threads from the main
R thread. The Xillybus programming guide proposes the
following diagram for an implementation of hardware
acceleration:
Figure 4 Host-FPGA interface with Thread A as writer and Thread B
as reader. Main thread not pictured
In the main thread two threads are started, one to write data to
the FPGA and one to read the calculated results. These two
threads run continuously in the background while different
calculations can still be performed in the main thread. A
continues data flow is possible in this implementation provided
enough data is fed into the write thread to make use of the full
bandwidth. The write thread takes care of the translation of the
R objects to the datatypes the digital logic expects while the
read thread takes care of the reverse.
C. Implementation
First use the Xillybus IP factory to generate an IP core with
separate downstream and upstream device files and implement
this IP core in the FPGA design.
Figure 5 Configuration of an upstream and downstream device file in
the Xillybus IP factory
Afterwards a regular C++ class can be written to open those two
device files to read and write from separate threads. Make sure
to use the R objects defined by the Rcpp header file as
arguments and return values for the methods in this class. The
R wrapper is defined separately from the class definition but it
is placed in the same source file.
vincent@cteq.eu https://www.linkedin.com/in/vincentclaes/ 3
Figure 6 Example of the R wrapper for a C++ class called ‘Manager’
In the wrapper definition the chosen class is given along with
the names for all the exposed methods as well as function
pointers to the corresponding methods in their C++ class. This
source file is then ready to be compiled through Rcpp with the
command: sourceCpp(“/path/class.cpp”). At that point the class
is ready to be used in R. The following R script illustrates the
implementation of the interface.
Figure 7 R script with FPGA interface. Green are comments, red are
the outputs
In the above script a loopback is implemented in the FPGA. The
Class Manager was written in C++. The object u is an instance
of Manager.
V. CONCLUSION
An interface between an R application and an FPGA has been
made. The processor and FPGA reside on the same system-on-
chip and are connected by AXI. By using Xillybus the
complexity on the software side that comes from AXI is
completely removed. The Xillybus driver also works regardless
of whether the interface is AXI or PCIe which means that the
whole application can be moved to a desktop computer with an
FPGA board connected on a PCIe slot in case this becomes
desirable. On the FPGA side the IP core governs the interface
and requires only a read and write FIFO in the user logic. The
complexity of AXI or PCIe on the FPGA is reduced to
connecting the right signals from the Xillybus IP core to the
fitting Xilinx or Altera IP core. This interface is therefore ideal
for rapid prototyping.
VI. ACKNOWLEDGEMENT
This project was realized for cteq.eu [http://www.cteq.eu] with
support from Hasselt University. I would like to thank V. Claes
for technical support.
VII. REFERENCES
[1] "Xillybus Product Brief," Xillybus Ltd., 7 March 2014.
[Online]. Available:
http://xillybus.com/downloads/xillybus_product_brief.p
df. [Accessed April 2015].
[2] "ZedBoard," Avnet, [Online]. Available:
http://zedboard.org/product/zedboard. [Accessed April
2015].
[3] Radford M. Neal, University of Toronto, "Speeding up R
with Multithreading,," 29 November 2013. [Online].
Available: http://www.cs.utoronto.ca/~radford/ftp/pqR-
guelph.pdf. [Accessed April 2015].
[4] Xillybus Ltd, "Getting started with the FPGA demo
bundle for Xilinx," [Online]. Available:
http://xillybus.com/downloads/doc/xillybus_getting_star
ted_xilinx.pdf. [Accessed April 2015].
[5] Xillybus Ltd., "Getting started with Xillinux for Zynq-
7000 EPP," [Online]. Available:
http://xillybus.com/downloads/doc/xillybus_getting_star
ted_zynq.pdf. [Accessed April 2015].
[6] Xillybus Ltd., "Getting started with Xillybus on a Linux
host," [Online]. Available:
http://xillybus.com/downloads/doc/xillybus_getting_star
ted_linux.pdf. [Accessed April 2015].
[7] Xillybus Ltd., "Xillybus FPGA designer’s guide,"
[Online]. Available:
http://xillybus.com/downloads/doc/xillybus_fpga_api.pd
f. [Accessed April 2015].
[8] Xillybus Ltd., "The guide to defining a custom Xillybus
IP core," [Online]. Available:
http://xillybus.com/downloads/doc/xillybus_custom_ip.
pdf. [Accessed April 2015].
[9] Xillybus Ltd., "Xillybus host application programming
guide for Linux," [Online]. Available:
http://xillybus.com/downloads/doc/xillybus_host_progra
mming_guide_linux.pdf. [Accessed April 2015].
[10] The R Core Team, "R: A Language and Environment for
Statistical Computing - Reference Index," 9 March 2015.
[Online]. Available: http://cran.r-
project.org/manuals.html. [Accessed April 2015].
[11] R Core Team, "Writing R Extensions," 9 March 2015.
[Online]. Available: http://cran.r-
project.org/doc/manuals/r-release/R-exts.html.
[Accessed April 2015].
[12] Dirk Eddelbuettel and Romain François, "Exposing C++
functions and classes with Rcpp modules," 4 March
2015. [Online]. Available: http://cran.r-
project.org/web/packages/Rcpp/vignettes/Rcpp-
modules.pdf. [Accessed April 2015].

More Related Content

What's hot

A Common Backend for Hardware Acceleration of DSLs on FPGA
A Common Backend for Hardware Acceleration of DSLs on FPGAA Common Backend for Hardware Acceleration of DSLs on FPGA
A Common Backend for Hardware Acceleration of DSLs on FPGA
NECST Lab @ Politecnico di Milano
 
R programming presentation
R programming presentationR programming presentation
R programming presentation
Akshat Sharma
 
Performance Evaluation of IPv4 Vs Ipv6 and Tunnelling Techniques Using Optimi...
Performance Evaluation of IPv4 Vs Ipv6 and Tunnelling Techniques Using Optimi...Performance Evaluation of IPv4 Vs Ipv6 and Tunnelling Techniques Using Optimi...
Performance Evaluation of IPv4 Vs Ipv6 and Tunnelling Techniques Using Optimi...
IOSR Journals
 
R language
R languageR language
R language
Kìshør Krîßh
 
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core ArchitecturesPerformance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Dr. Fabio Baruffa
 
FPGA Implementation of LDPC Encoder for Terrestrial Television
FPGA Implementation of LDPC Encoder for Terrestrial TelevisionFPGA Implementation of LDPC Encoder for Terrestrial Television
FPGA Implementation of LDPC Encoder for Terrestrial Television
AI Publications
 
R programming
R programmingR programming
R programming
Shantanu Patil
 
2016 IEEE VLSI TITES FROM MSR PROJECTS-9581464142
2016 IEEE VLSI TITES FROM MSR PROJECTS-95814641422016 IEEE VLSI TITES FROM MSR PROJECTS-9581464142
2016 IEEE VLSI TITES FROM MSR PROJECTS-9581464142
MSR PROJECTS
 
0507036
05070360507036
0507036
meraz rizel
 
Track A-Compilation guiding and adjusting - IBM
Track A-Compilation guiding and adjusting - IBMTrack A-Compilation guiding and adjusting - IBM
Track A-Compilation guiding and adjusting - IBMchiportal
 
R Programming
R ProgrammingR Programming
R Programming
Abhishek Pratap Singh
 
Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to r
JigsawAcademy2014
 
Networking models tcp
Networking models tcpNetworking models tcp
Networking models tcp
Bhaskar Karimuri
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
hemasri56
 
How to get started with R programming
How to get started with R programmingHow to get started with R programming
How to get started with R programming
Ramon Salazar
 
R programming
R programmingR programming
R programming
Nandhini G
 
R programming
R programmingR programming
R programming
TIB Academy
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
Victor Ordu
 

What's hot (19)

A Common Backend for Hardware Acceleration of DSLs on FPGA
A Common Backend for Hardware Acceleration of DSLs on FPGAA Common Backend for Hardware Acceleration of DSLs on FPGA
A Common Backend for Hardware Acceleration of DSLs on FPGA
 
R programming presentation
R programming presentationR programming presentation
R programming presentation
 
Performance Evaluation of IPv4 Vs Ipv6 and Tunnelling Techniques Using Optimi...
Performance Evaluation of IPv4 Vs Ipv6 and Tunnelling Techniques Using Optimi...Performance Evaluation of IPv4 Vs Ipv6 and Tunnelling Techniques Using Optimi...
Performance Evaluation of IPv4 Vs Ipv6 and Tunnelling Techniques Using Optimi...
 
R language
R languageR language
R language
 
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core ArchitecturesPerformance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
 
FPGA Implementation of LDPC Encoder for Terrestrial Television
FPGA Implementation of LDPC Encoder for Terrestrial TelevisionFPGA Implementation of LDPC Encoder for Terrestrial Television
FPGA Implementation of LDPC Encoder for Terrestrial Television
 
R programming
R programmingR programming
R programming
 
2016 IEEE VLSI TITES FROM MSR PROJECTS-9581464142
2016 IEEE VLSI TITES FROM MSR PROJECTS-95814641422016 IEEE VLSI TITES FROM MSR PROJECTS-9581464142
2016 IEEE VLSI TITES FROM MSR PROJECTS-9581464142
 
0507036
05070360507036
0507036
 
Track A-Compilation guiding and adjusting - IBM
Track A-Compilation guiding and adjusting - IBMTrack A-Compilation guiding and adjusting - IBM
Track A-Compilation guiding and adjusting - IBM
 
R Programming
R ProgrammingR Programming
R Programming
 
Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to r
 
Networking models tcp
Networking models tcpNetworking models tcp
Networking models tcp
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
 
How to get started with R programming
How to get started with R programmingHow to get started with R programming
How to get started with R programming
 
R programming
R programmingR programming
R programming
 
R programming
R programmingR programming
R programming
 
DrazenGrasovec_CV
DrazenGrasovec_CVDrazenGrasovec_CV
DrazenGrasovec_CV
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 

Similar to Implementing an interface in r to communicate with programmable fabric in a xilinx zynq fpga

Automatically partitioning packet processing applications for pipelined archi...
Automatically partitioning packet processing applications for pipelined archi...Automatically partitioning packet processing applications for pipelined archi...
Automatically partitioning packet processing applications for pipelined archi...
Ashley Carter
 
A STUDY OF AN ENTRENCHED SYSTEM USING INTERNET OF THINGS
A STUDY OF AN ENTRENCHED SYSTEM USING INTERNET OF THINGSA STUDY OF AN ENTRENCHED SYSTEM USING INTERNET OF THINGS
A STUDY OF AN ENTRENCHED SYSTEM USING INTERNET OF THINGS
International Journal of Technical Research & Application
 
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIESSTUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
ijdpsjournal
 
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
STUDY ON EMERGING APPLICATIONS ON DATA  PLANE AND OPTIMIZATION POSSIBILITIES STUDY ON EMERGING APPLICATIONS ON DATA  PLANE AND OPTIMIZATION POSSIBILITIES
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
ijdpsjournal
 
Project report of 2016 Trainee_final
Project report of 2016 Trainee_finalProject report of 2016 Trainee_final
Project report of 2016 Trainee_finalAkash Chowdhury
 
NETWORK TRAFFIC ANALYSIS: HADOOP PIG VS TYPICAL MAPREDUCE
NETWORK TRAFFIC ANALYSIS: HADOOP PIG VS TYPICAL MAPREDUCENETWORK TRAFFIC ANALYSIS: HADOOP PIG VS TYPICAL MAPREDUCE
NETWORK TRAFFIC ANALYSIS: HADOOP PIG VS TYPICAL MAPREDUCE
cscpconf
 
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
Intel® Software
 
Applications of Fuzzy Logic in Image Processing – A Brief Study
Applications of Fuzzy Logic in Image Processing – A Brief StudyApplications of Fuzzy Logic in Image Processing – A Brief Study
Applications of Fuzzy Logic in Image Processing – A Brief Study
Computer Science Journals
 
maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_Magazine
Max Kleiner
 
Cockatrice: A Hardware Design Environment with Elixir
Cockatrice: A Hardware Design Environment with ElixirCockatrice: A Hardware Design Environment with Elixir
Cockatrice: A Hardware Design Environment with Elixir
Hideki Takase
 
Introduction to HPC Programming Models - EUDAT Summer School (Stefano Markidi...
Introduction to HPC Programming Models - EUDAT Summer School (Stefano Markidi...Introduction to HPC Programming Models - EUDAT Summer School (Stefano Markidi...
Introduction to HPC Programming Models - EUDAT Summer School (Stefano Markidi...
EUDAT
 
Programmable logic controller performance enhancement by field programmable g...
Programmable logic controller performance enhancement by field programmable g...Programmable logic controller performance enhancement by field programmable g...
Programmable logic controller performance enhancement by field programmable g...
ISA Interchange
 
Raspberry pi glossary of terms dictionary extended
Raspberry pi glossary of terms dictionary extendedRaspberry pi glossary of terms dictionary extended
Raspberry pi glossary of terms dictionary extended
WiseNaeem
 
electronics-11-03883.pdf
electronics-11-03883.pdfelectronics-11-03883.pdf
electronics-11-03883.pdf
RioCarthiis
 
IRJET- A Review- FPGA based Architectures for Image Capturing Consequently Pr...
IRJET- A Review- FPGA based Architectures for Image Capturing Consequently Pr...IRJET- A Review- FPGA based Architectures for Image Capturing Consequently Pr...
IRJET- A Review- FPGA based Architectures for Image Capturing Consequently Pr...
IRJET Journal
 
Iirdem design and implementation of finger writing in air by using open cv (c...
Iirdem design and implementation of finger writing in air by using open cv (c...Iirdem design and implementation of finger writing in air by using open cv (c...
Iirdem design and implementation of finger writing in air by using open cv (c...
Iaetsd Iaetsd
 
Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015
Boris Adryan
 
maXbox Arduino Tutorial
maXbox Arduino TutorialmaXbox Arduino Tutorial
maXbox Arduino Tutorial
Max Kleiner
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
Yoni Davidson
 

Similar to Implementing an interface in r to communicate with programmable fabric in a xilinx zynq fpga (20)

Automatically partitioning packet processing applications for pipelined archi...
Automatically partitioning packet processing applications for pipelined archi...Automatically partitioning packet processing applications for pipelined archi...
Automatically partitioning packet processing applications for pipelined archi...
 
A STUDY OF AN ENTRENCHED SYSTEM USING INTERNET OF THINGS
A STUDY OF AN ENTRENCHED SYSTEM USING INTERNET OF THINGSA STUDY OF AN ENTRENCHED SYSTEM USING INTERNET OF THINGS
A STUDY OF AN ENTRENCHED SYSTEM USING INTERNET OF THINGS
 
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIESSTUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
 
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
STUDY ON EMERGING APPLICATIONS ON DATA  PLANE AND OPTIMIZATION POSSIBILITIES STUDY ON EMERGING APPLICATIONS ON DATA  PLANE AND OPTIMIZATION POSSIBILITIES
STUDY ON EMERGING APPLICATIONS ON DATA PLANE AND OPTIMIZATION POSSIBILITIES
 
Project report of 2016 Trainee_final
Project report of 2016 Trainee_finalProject report of 2016 Trainee_final
Project report of 2016 Trainee_final
 
NETWORK TRAFFIC ANALYSIS: HADOOP PIG VS TYPICAL MAPREDUCE
NETWORK TRAFFIC ANALYSIS: HADOOP PIG VS TYPICAL MAPREDUCENETWORK TRAFFIC ANALYSIS: HADOOP PIG VS TYPICAL MAPREDUCE
NETWORK TRAFFIC ANALYSIS: HADOOP PIG VS TYPICAL MAPREDUCE
 
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
 
Applications of Fuzzy Logic in Image Processing – A Brief Study
Applications of Fuzzy Logic in Image Processing – A Brief StudyApplications of Fuzzy Logic in Image Processing – A Brief Study
Applications of Fuzzy Logic in Image Processing – A Brief Study
 
Resume
ResumeResume
Resume
 
maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_Magazine
 
Cockatrice: A Hardware Design Environment with Elixir
Cockatrice: A Hardware Design Environment with ElixirCockatrice: A Hardware Design Environment with Elixir
Cockatrice: A Hardware Design Environment with Elixir
 
Introduction to HPC Programming Models - EUDAT Summer School (Stefano Markidi...
Introduction to HPC Programming Models - EUDAT Summer School (Stefano Markidi...Introduction to HPC Programming Models - EUDAT Summer School (Stefano Markidi...
Introduction to HPC Programming Models - EUDAT Summer School (Stefano Markidi...
 
Programmable logic controller performance enhancement by field programmable g...
Programmable logic controller performance enhancement by field programmable g...Programmable logic controller performance enhancement by field programmable g...
Programmable logic controller performance enhancement by field programmable g...
 
Raspberry pi glossary of terms dictionary extended
Raspberry pi glossary of terms dictionary extendedRaspberry pi glossary of terms dictionary extended
Raspberry pi glossary of terms dictionary extended
 
electronics-11-03883.pdf
electronics-11-03883.pdfelectronics-11-03883.pdf
electronics-11-03883.pdf
 
IRJET- A Review- FPGA based Architectures for Image Capturing Consequently Pr...
IRJET- A Review- FPGA based Architectures for Image Capturing Consequently Pr...IRJET- A Review- FPGA based Architectures for Image Capturing Consequently Pr...
IRJET- A Review- FPGA based Architectures for Image Capturing Consequently Pr...
 
Iirdem design and implementation of finger writing in air by using open cv (c...
Iirdem design and implementation of finger writing in air by using open cv (c...Iirdem design and implementation of finger writing in air by using open cv (c...
Iirdem design and implementation of finger writing in air by using open cv (c...
 
Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015
 
maXbox Arduino Tutorial
maXbox Arduino TutorialmaXbox Arduino Tutorial
maXbox Arduino Tutorial
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
 

More from Vincent Claes

Percepio Tracealyzer for FreeRTOS on MiniZED
Percepio Tracealyzer for FreeRTOS on MiniZEDPercepio Tracealyzer for FreeRTOS on MiniZED
Percepio Tracealyzer for FreeRTOS on MiniZED
Vincent Claes
 
Xilinx Vitis FreeRTOS Hello World
Xilinx Vitis FreeRTOS Hello WorldXilinx Vitis FreeRTOS Hello World
Xilinx Vitis FreeRTOS Hello World
Vincent Claes
 
Programming STM32L432 Nucleo with Keil MDK
Programming STM32L432 Nucleo with Keil MDKProgramming STM32L432 Nucleo with Keil MDK
Programming STM32L432 Nucleo with Keil MDK
Vincent Claes
 
Debugging Xilinx Zynq Project using ILA Integrated Logic Analyzer IP Block
Debugging Xilinx Zynq Project using ILA Integrated Logic Analyzer IP BlockDebugging Xilinx Zynq Project using ILA Integrated Logic Analyzer IP Block
Debugging Xilinx Zynq Project using ILA Integrated Logic Analyzer IP Block
Vincent Claes
 
Using Virtual IO (VIO) on Xilinx ZYNQ FPGA's
Using Virtual IO (VIO) on Xilinx ZYNQ FPGA'sUsing Virtual IO (VIO) on Xilinx ZYNQ FPGA's
Using Virtual IO (VIO) on Xilinx ZYNQ FPGA's
Vincent Claes
 
Profiling Xilinx Zynq Software Applications in SDK (MiniZED board)
Profiling Xilinx Zynq Software Applications in SDK (MiniZED board)Profiling Xilinx Zynq Software Applications in SDK (MiniZED board)
Profiling Xilinx Zynq Software Applications in SDK (MiniZED board)
Vincent Claes
 
Workshop: Introductie tot Python
Workshop: Introductie tot PythonWorkshop: Introductie tot Python
Workshop: Introductie tot Python
Vincent Claes
 
Installation Anaconda Navigator for Python Workshop
Installation Anaconda Navigator for Python WorkshopInstallation Anaconda Navigator for Python Workshop
Installation Anaconda Navigator for Python Workshop
Vincent Claes
 
ZYNQ BRAM Implementation
ZYNQ BRAM ImplementationZYNQ BRAM Implementation
ZYNQ BRAM Implementation
Vincent Claes
 
Implementing a Database and API for your Cloud Service
Implementing a Database and API for your Cloud ServiceImplementing a Database and API for your Cloud Service
Implementing a Database and API for your Cloud Service
Vincent Claes
 
Launching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT ProjectsLaunching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT Projects
Vincent Claes
 
Real Time Filtering on Embedded ARM
Real Time Filtering on Embedded ARMReal Time Filtering on Embedded ARM
Real Time Filtering on Embedded ARM
Vincent Claes
 
R Markdown, Rpubs & github publishing and Shiny by Example
R Markdown, Rpubs & github publishing and Shiny by ExampleR Markdown, Rpubs & github publishing and Shiny by Example
R Markdown, Rpubs & github publishing and Shiny by Example
Vincent Claes
 
Using Texas Instruments Code Composer Studio for The CC3200XL Launchpad
Using Texas Instruments Code Composer Studio for The CC3200XL LaunchpadUsing Texas Instruments Code Composer Studio for The CC3200XL Launchpad
Using Texas Instruments Code Composer Studio for The CC3200XL Launchpad
Vincent Claes
 
Hogeschool PXL Smart Mirror
Hogeschool PXL Smart MirrorHogeschool PXL Smart Mirror
Hogeschool PXL Smart Mirror
Vincent Claes
 
Softcore vs Hardcore processor
Softcore vs Hardcore processorSoftcore vs Hardcore processor
Softcore vs Hardcore processor
Vincent Claes
 
MySQL / PHP Server
MySQL / PHP ServerMySQL / PHP Server
MySQL / PHP Server
Vincent Claes
 
fTales workshop
fTales workshopfTales workshop
fTales workshop
Vincent Claes
 
Maker Revolution
Maker RevolutionMaker Revolution
Maker Revolution
Vincent Claes
 
Debugging IoT Sensor Interfaces (SPI) with Digilent Analog Discovery 2
Debugging IoT Sensor Interfaces (SPI) with Digilent Analog Discovery 2Debugging IoT Sensor Interfaces (SPI) with Digilent Analog Discovery 2
Debugging IoT Sensor Interfaces (SPI) with Digilent Analog Discovery 2
Vincent Claes
 

More from Vincent Claes (20)

Percepio Tracealyzer for FreeRTOS on MiniZED
Percepio Tracealyzer for FreeRTOS on MiniZEDPercepio Tracealyzer for FreeRTOS on MiniZED
Percepio Tracealyzer for FreeRTOS on MiniZED
 
Xilinx Vitis FreeRTOS Hello World
Xilinx Vitis FreeRTOS Hello WorldXilinx Vitis FreeRTOS Hello World
Xilinx Vitis FreeRTOS Hello World
 
Programming STM32L432 Nucleo with Keil MDK
Programming STM32L432 Nucleo with Keil MDKProgramming STM32L432 Nucleo with Keil MDK
Programming STM32L432 Nucleo with Keil MDK
 
Debugging Xilinx Zynq Project using ILA Integrated Logic Analyzer IP Block
Debugging Xilinx Zynq Project using ILA Integrated Logic Analyzer IP BlockDebugging Xilinx Zynq Project using ILA Integrated Logic Analyzer IP Block
Debugging Xilinx Zynq Project using ILA Integrated Logic Analyzer IP Block
 
Using Virtual IO (VIO) on Xilinx ZYNQ FPGA's
Using Virtual IO (VIO) on Xilinx ZYNQ FPGA'sUsing Virtual IO (VIO) on Xilinx ZYNQ FPGA's
Using Virtual IO (VIO) on Xilinx ZYNQ FPGA's
 
Profiling Xilinx Zynq Software Applications in SDK (MiniZED board)
Profiling Xilinx Zynq Software Applications in SDK (MiniZED board)Profiling Xilinx Zynq Software Applications in SDK (MiniZED board)
Profiling Xilinx Zynq Software Applications in SDK (MiniZED board)
 
Workshop: Introductie tot Python
Workshop: Introductie tot PythonWorkshop: Introductie tot Python
Workshop: Introductie tot Python
 
Installation Anaconda Navigator for Python Workshop
Installation Anaconda Navigator for Python WorkshopInstallation Anaconda Navigator for Python Workshop
Installation Anaconda Navigator for Python Workshop
 
ZYNQ BRAM Implementation
ZYNQ BRAM ImplementationZYNQ BRAM Implementation
ZYNQ BRAM Implementation
 
Implementing a Database and API for your Cloud Service
Implementing a Database and API for your Cloud ServiceImplementing a Database and API for your Cloud Service
Implementing a Database and API for your Cloud Service
 
Launching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT ProjectsLaunching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT Projects
 
Real Time Filtering on Embedded ARM
Real Time Filtering on Embedded ARMReal Time Filtering on Embedded ARM
Real Time Filtering on Embedded ARM
 
R Markdown, Rpubs & github publishing and Shiny by Example
R Markdown, Rpubs & github publishing and Shiny by ExampleR Markdown, Rpubs & github publishing and Shiny by Example
R Markdown, Rpubs & github publishing and Shiny by Example
 
Using Texas Instruments Code Composer Studio for The CC3200XL Launchpad
Using Texas Instruments Code Composer Studio for The CC3200XL LaunchpadUsing Texas Instruments Code Composer Studio for The CC3200XL Launchpad
Using Texas Instruments Code Composer Studio for The CC3200XL Launchpad
 
Hogeschool PXL Smart Mirror
Hogeschool PXL Smart MirrorHogeschool PXL Smart Mirror
Hogeschool PXL Smart Mirror
 
Softcore vs Hardcore processor
Softcore vs Hardcore processorSoftcore vs Hardcore processor
Softcore vs Hardcore processor
 
MySQL / PHP Server
MySQL / PHP ServerMySQL / PHP Server
MySQL / PHP Server
 
fTales workshop
fTales workshopfTales workshop
fTales workshop
 
Maker Revolution
Maker RevolutionMaker Revolution
Maker Revolution
 
Debugging IoT Sensor Interfaces (SPI) with Digilent Analog Discovery 2
Debugging IoT Sensor Interfaces (SPI) with Digilent Analog Discovery 2Debugging IoT Sensor Interfaces (SPI) with Digilent Analog Discovery 2
Debugging IoT Sensor Interfaces (SPI) with Digilent Analog Discovery 2
 

Recently uploaded

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 

Implementing an interface in r to communicate with programmable fabric in a xilinx zynq fpga

  • 1. vincent@cteq.eu https://www.linkedin.com/in/vincentclaes/ 1 Abstract—R is a programming language for statistical computing. It has many built in functions for statistical calculations of large datasets and even more available libraries to expand this functionality. R is however fundamentally single threaded. As the size of the used datasets increases, so does the processing time. This limits the use of R in real-time applications with large amounts of data where statistical analysis is necessary. By offloading intensive calculations to an FPGA with massive parallel processing power these calculations can be sped up to make R valid for real-time processing. This paper proposes a simple way to send data from an application in R to the digital logic in an FPGA and back. In this way applications like sensor fusion systems, machine learning algorithms for “Internet-of- things” applications can be realized in the future on this Xilinx Zynq embedded systems platform. In this way intelligent IoT Gateways could be realized. Index Terms— R-project, R, FPGA, Statistical computing, hardware acceleration, Xillybus, Xilinx, Zynq, zedboard, machine learning, sensor fusion I. INTRODUCTION He last few years we have seen a massive increase in interest in using FPGAs (Field Programmable Gate Arrays) to offload difficult calculation from processors. By leveraging custom digital logic with its parallel potential processes, which are normally run solely on a processor, can be sped up and power consumption decreased. At first sight, combining software with digital logic seems like a daunting task. Besides software design and digital logic design an interface has to be created between the two. For these reasons it is often avoided unless absolutely necessary. Fortunately there exist tools to simplify this design process, especially the interface between the application software and digital logic. To illustrate this, this paper provides a solution to interface an application written on R and running on a Linux host with digital logic on an FPGA. With this interface hardware acceleration for intensive calculations can be implemented on the FPGA while the ease of use and native support for statistical computing of R is retained. II. TOOLS AND SOFTWARE A zedboard was used as development board. It is a board with T. Nulens is a student at Hasselt University, Faculty of Engineering Technology, Diepenbeek, Belgium. E-mail: tom.nulens@student.uhasselt.be. a Xilinx Zynq system-on-chip and various inputs and outputs like USB, VGA and much more. The Zynq system-on-chip consists of a 32bit ARM dual core processor and a large amount of programmable logic. Figure 1 Top and bottom view of the zedboard The application software runs on the processor and communicates with the programmable logic as required. A special distribution of Ubuntu, named Xillinux, is installed on the processor. Xillinux is a version of Ubuntu LTS 12.04 for ARM with Xillybus drivers preinstalled. The operating system runs from a SD card which acts as hard drive for the zedboard. Finally, R version 3.1.2 was installed. Since Xillybus is already supported on this device, it’s the obvious choice to use as interface between the processor and digital logic. Xillybus takes care of both the digital logic implementation and the software drivers for the interface. It also works with both AXI (Advanced eXtensible Interface) and PCIe (Peripheral Component Interconnect Express) which makes it possible to transfer the application on the Zynq system-on-chip to a full desktop without worrying about those interfaces. III. XILLYBUS Xillybus is a combination of an IP core for the FPGA as well as a driver for the operating system on the processor. Together it allows a simple interface between the digital logic and the application software. The IP core implements the digital logic required to send and receive data from the processor with First In First Out shift (FIFO) registers. It provides the signals to drive FIFO registers, signals like clock and write enable. These signals must then be used to drive a user-defined FIFO in the implementation. The Xillybus IP core then connects to a PCIe V. Claes is the owner of cteq.eu vincent@cteq.eu https://www.linkedin.com/in/vincentclaes/ Implementing an interface in R to communicate with Programmable Fabric in a Xilinx ZYNQ FPGA Vincent Claes, Tom Nulens [Project realized in 2015] T
  • 2. vincent@cteq.eu https://www.linkedin.com/in/vincentclaes/ 2 interface IP core or AXI (Advanced eXtensible Interface) IP core, depending on the platform. In the Zynq chip, AXI is used to connect the digital logic to the processor. The IP core is generated at the IP factory web interface on the website of Xillybus. Specifications such as bandwidth, data width and data direction are defined here. Afterwards the IP core is generated and available for download. The bandwidth on an AXI interface is limited to 200 Mbytes/s. Figure 2 FPGA block diagram with the Xillybus IP core and a PCIe interface On the processor side the Xillybus driver allows read and write operations through a standard input/output file-interface. A data connection is opened between the application software and digital logic by simply opening a file defined by the Xillybus driver and writing to or reading from that file. Figure 3 Processor host interface block diagram IV. INTERFACE BETWEEN R AND XILLYBUS A. Problems with interfacing R with Xillybus In the previous paragraph I noted that to write to or read from the FPGA a standard file IO system is everything that is required. Although R has this functionality, reading or writing in native R is not very efficient for real-time applications for two reasons: First, an R application is single threaded. This means that when transferring data back and forth between the processor and FPGA, no other calculation can be performed by the processor. With large datasets a significant amount of time would be lost due to this data transferring. By doing the reading and writing in background threads the host application can continue with different calculations regardless of what is happening in the digital logic. There are some solutions for parallelism in R, they are however aimed at dividing calculations over multiple cores instead of doing different tasks concurrently. Second, as a high level programming language, datatype manipulation is less transparent than it is in languages like C. Depending on the digital logic you have designed, the interface will expect anything ranging from 32bit doubles to 8bit unsigned integers. For this reason it is advantageous to use a language with explicit datatypes. B. Proposed solution By using the R library Rcpp, C++ functions and classes can be called from R. Rcpp provides a C++ header file with the definition for an R object. This object along with a short wrapper allows Rcpp to compile custom C++ classes and functions that can directly take R objects as argument and return them too. C++ can then be used to prepare data from R to write to the FPGA or to read data from the FPGA before returning it to R. By combining this with the C++ library thread.h read and write functionality can be given separate threads from the main R thread. The Xillybus programming guide proposes the following diagram for an implementation of hardware acceleration: Figure 4 Host-FPGA interface with Thread A as writer and Thread B as reader. Main thread not pictured In the main thread two threads are started, one to write data to the FPGA and one to read the calculated results. These two threads run continuously in the background while different calculations can still be performed in the main thread. A continues data flow is possible in this implementation provided enough data is fed into the write thread to make use of the full bandwidth. The write thread takes care of the translation of the R objects to the datatypes the digital logic expects while the read thread takes care of the reverse. C. Implementation First use the Xillybus IP factory to generate an IP core with separate downstream and upstream device files and implement this IP core in the FPGA design. Figure 5 Configuration of an upstream and downstream device file in the Xillybus IP factory Afterwards a regular C++ class can be written to open those two device files to read and write from separate threads. Make sure to use the R objects defined by the Rcpp header file as arguments and return values for the methods in this class. The R wrapper is defined separately from the class definition but it is placed in the same source file.
  • 3. vincent@cteq.eu https://www.linkedin.com/in/vincentclaes/ 3 Figure 6 Example of the R wrapper for a C++ class called ‘Manager’ In the wrapper definition the chosen class is given along with the names for all the exposed methods as well as function pointers to the corresponding methods in their C++ class. This source file is then ready to be compiled through Rcpp with the command: sourceCpp(“/path/class.cpp”). At that point the class is ready to be used in R. The following R script illustrates the implementation of the interface. Figure 7 R script with FPGA interface. Green are comments, red are the outputs In the above script a loopback is implemented in the FPGA. The Class Manager was written in C++. The object u is an instance of Manager. V. CONCLUSION An interface between an R application and an FPGA has been made. The processor and FPGA reside on the same system-on- chip and are connected by AXI. By using Xillybus the complexity on the software side that comes from AXI is completely removed. The Xillybus driver also works regardless of whether the interface is AXI or PCIe which means that the whole application can be moved to a desktop computer with an FPGA board connected on a PCIe slot in case this becomes desirable. On the FPGA side the IP core governs the interface and requires only a read and write FIFO in the user logic. The complexity of AXI or PCIe on the FPGA is reduced to connecting the right signals from the Xillybus IP core to the fitting Xilinx or Altera IP core. This interface is therefore ideal for rapid prototyping. VI. ACKNOWLEDGEMENT This project was realized for cteq.eu [http://www.cteq.eu] with support from Hasselt University. I would like to thank V. Claes for technical support. VII. REFERENCES [1] "Xillybus Product Brief," Xillybus Ltd., 7 March 2014. [Online]. Available: http://xillybus.com/downloads/xillybus_product_brief.p df. [Accessed April 2015]. [2] "ZedBoard," Avnet, [Online]. Available: http://zedboard.org/product/zedboard. [Accessed April 2015]. [3] Radford M. Neal, University of Toronto, "Speeding up R with Multithreading,," 29 November 2013. [Online]. Available: http://www.cs.utoronto.ca/~radford/ftp/pqR- guelph.pdf. [Accessed April 2015]. [4] Xillybus Ltd, "Getting started with the FPGA demo bundle for Xilinx," [Online]. Available: http://xillybus.com/downloads/doc/xillybus_getting_star ted_xilinx.pdf. [Accessed April 2015]. [5] Xillybus Ltd., "Getting started with Xillinux for Zynq- 7000 EPP," [Online]. Available: http://xillybus.com/downloads/doc/xillybus_getting_star ted_zynq.pdf. [Accessed April 2015]. [6] Xillybus Ltd., "Getting started with Xillybus on a Linux host," [Online]. Available: http://xillybus.com/downloads/doc/xillybus_getting_star ted_linux.pdf. [Accessed April 2015]. [7] Xillybus Ltd., "Xillybus FPGA designer’s guide," [Online]. Available: http://xillybus.com/downloads/doc/xillybus_fpga_api.pd f. [Accessed April 2015]. [8] Xillybus Ltd., "The guide to defining a custom Xillybus IP core," [Online]. Available: http://xillybus.com/downloads/doc/xillybus_custom_ip. pdf. [Accessed April 2015]. [9] Xillybus Ltd., "Xillybus host application programming guide for Linux," [Online]. Available: http://xillybus.com/downloads/doc/xillybus_host_progra mming_guide_linux.pdf. [Accessed April 2015]. [10] The R Core Team, "R: A Language and Environment for Statistical Computing - Reference Index," 9 March 2015. [Online]. Available: http://cran.r- project.org/manuals.html. [Accessed April 2015]. [11] R Core Team, "Writing R Extensions," 9 March 2015. [Online]. Available: http://cran.r- project.org/doc/manuals/r-release/R-exts.html. [Accessed April 2015]. [12] Dirk Eddelbuettel and Romain François, "Exposing C++ functions and classes with Rcpp modules," 4 March 2015. [Online]. Available: http://cran.r- project.org/web/packages/Rcpp/vignettes/Rcpp- modules.pdf. [Accessed April 2015].