Real Time and FPGA
Real Time and FPGA
2014
based on real time and FPGA circuit AD and DA convertors, digital/timing IO = fixed hardware)
Flexibility only in software: General purpose OS (e.g., W7) + flexible application software (measurement functions)
Large, high energy consumption, limited flexibility given by software and fixed hardware, problematic in real time
signal processing, exact and fast timing (multitask in windows), and similar applications
Jn aliga Easy maintained (software development and installation), multitask, data presentation and archiving.
Technical university of Koice, Slovakia Typical convenient applications:
Single purpose instrumentation (oscilloscope, basic spectrum analyzers, logic and network analyzers, etc.)
(based on different sources mainly from National Instruments) Typical inconvenient applications:
Distributed systems (sensor network), control systems of machines, robust and reliable systems
continuously working for a long time, fast signal processing in real time, reconfigurable measurement
system (reconfigurable signal and pattern generation, signal analyzers, etc. that cannot be processed by
software in real time)
Jitter - Variation from the desired loop cycle Priority - Defines when a VI or loop should
time. execute relative to other VIs and loops
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
3 4
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
In general, real time systems are based on real time OS Multitasking = Processor time is shared between
(RTOS) programs
What is RTOS? Can preempt high priority programs
Any OS is responsible for managing the hardware resources
of a computer and hosting applications that run on the Many programs run in the backgroundscreen
computer savers, disk utilities, antivirus software, etc.
RTOS is specially designed to run applications with very Must service interruptskeyboard, mouse,
precise timing and a high degree of reliability Ethernet, etc.
To be considered "real-time", an operating system must have
a known maximum time for each of the critical operations
High amount of jitter
that it performs Cannot guarantee determinism
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
5 6
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
1
17. 12. 2014
GPOS such a Windows is excellent platform for developing and running your
non-critical measurement and control applications but not the ideal
Multitasking - Ensure that high-priority tasks platform for running applications that require precise timing or extended
execute first up-time.
Priorities:
Generally do not require user input from GPOS is fair all running tasks (threads) will achieve a processor time
RTOS behavior is given by programmer decision on tasks priorities (static, dynamic)
peripherals and on environment requirements
Interrupts latency - measured as the amount of time between when a device
generates an interrupt and when that device is serviced:
LabVIEW Real-Time Module executes VIs on the following real-time operating systems: GPOS: variable amount of time
NI ETS (Embedded Tool Suite) RTOS must guarantee that all interrupts will be serviced within a certain maximum
Wind River VxWorks amount of time (interrupt latency must be bounded)
Linux Performance actual performance is given mostly by hardware
GPOS virtually decreased by multitasking
RTOS - can provide much more precise and predictable timing characteristics
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
7 8
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Components of RT system:
RTOS that can absolutely guarantee a maximum time for
operations are commonly referred to as hard real-time
RTOS that can only guarantee a maximum most of the time are
referred to as soft real-time When I need RT system?
If I need a precise timing:
Perform tasks within a guaranteed worst-case timeframe
Carefully prioritize different sections of my program
Run loops with nearly the same timing each iteration (typically within
microseconds)
Detect if a loop missed its timing goal
If I need a high reliability:
System should run reliably for days, months, or years without stopping
(watchdog system may be useful)
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
9 10
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
NI Single-Board RIO
Develop Execute NI myRIO
Reconfigurable single circuit board form factor
Deploy Education
Desktop PC running RTOS
Determinism for PCI systems
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
11 12
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
2
17. 12. 2014
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
13 14
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Target Application
Inter-task
Non-deterministic Communication Deterministic
Loop Loop
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
15 16
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Field-programmable gate arrays (FPGAs) are FPGA chip adoption across all industries is driven by the fact that FPGAs
combine the best parts of application-specific integrated circuits (ASICs)
reprogrammable silicon chips. and processor-based systems.
In contrast to processors that you find in your PC, These benefits include the following:
Faster I/O response times and specialized functionality
programming an FPGA rewires the chip itself to Exceeding the computing power of digital signal processors
implement your functionality rather than run a Rapid prototyping and verification without the fabrication process of
software application. custom ASIC design
Implementing custom functionality with the reliability of dedicated
Ross Freeman, the cofounder of Xilinx, deterministic hardware
invented the first FPGA in 1985. Field-upgradable eliminating the expense of custom ASIC re-design and
maintenance
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
17 18
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
3
17. 12. 2014
I/O Blocks
Note: Most applications do not require
detailed knowledge of these components
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
19 20
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
21 22
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
A A
B B
C C
D D
Z
W X Y
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
23 24
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
4
17. 12. 2014
Benefits:
Reprogrammable silicon also has the same flexibility of software running on a Fast real time signal processing:
processor-based system, but it is not limited by the number of processing cores
available. Fast digitizers with onboard signal processing, e.g. Agilent
Unlike processors, FPGAs are truly parallel in nature, so different processing Reconfigurable signal analyzers with demodulation and analysis in real
operations do not have to compete for the same resources. time (e.g., wireless networks with different standards)
Each independent processing task is assigned to a dedicated section of the chip, and
can function autonomously without any influence from other logic blocks. Robust components of sensor network, smart sensors
As a result, the performance of one part of the application is not affected when you Reliable data acquisition and control systems for industry
add more processing. technologies, robots, , including marine technology, space and
FPGA based applications have high execution speed, reliability, and flexibility aeronautic systems, etc.
Adding a new task does not affect the other tasks
Low costs in comparison with other HW realization (ASIC)
Reconfigurable tester for product inspection and new products
Drawback:
development,
Missing OS for easy adding tasks, connecting disk, drivers for IO, etc.
Difficult design of FPGA internal structure
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
25 26
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Traditional tools:
Hardware description languages
(HDLs) such as VHDL and Verilog Many functions correspond directly to VHDL primitives
Text oriented describing internal FPGA compiler implements logic on hardware
structure a mapping chip IO to
internal signals
To verify the design a test bench
needs to be developed simulating
input signal and acquiring outputs
Verified design is compiled into bit
form describing internal structure of
FPGA
Intellectual Properties (IP) are key
building blocks of Xilinx Targeted
Design Platforms
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
27 28
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Schematic
Schematic Hardware
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
29 30
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
5
17. 12. 2014
Schematic
Bitfile
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
31 32
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
LabVIEW FPGA
VHDL
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
33 34
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
``
Desktops and PXI and Modular RIO and Custom Open Connectivity
Personal Computers PXI Systems CompactRIO Single-Board RIO Custom Design
PC-Based DAQ Instruments Designs with 3rd Party I/O
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
35 36
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
6
17. 12. 2014
Integrating Elements
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
37 38
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Host Computer
Real time application is always developed on PC
Displays front panel of
Real time hardware (target) must be first detected and configured by MAX RT Target VI
Project in LabVIEW must be created
Real time target must be added into the project User Interface
Under the target a new VI running in the real Communication
time environment must be created only for
developement
RT Target
Executes the block
diagram logic of
RT Target VI
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
39 40
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
7
17. 12. 2014
Creating a stand-alone application (executable) Front panel Property Nodes and control references
of a LabVIEW Real-Time Module application using the LabVIEW Dialog functions
Application Builder VI Server front panel functions
Benefits of deploying your RT Application: Do Not Use OS-Specific Technologies
Embed executable in non-volatile memory on the target Examples:
Launch executable automatically when target boots ActiveX VIs Call Library Nodes that access an operating
.NET VIs system API other than ETS or VxWorks
Review the code for unsupported functions Windows Registry Access VIs Graphics and Sound VIs
Functions that modify front panel objects TestStand VIs (ActiveX-based) Database Connectivity Toolset
Report Generation Toolkit VIs XML DOM Parser and
Functions that use technologies specific to other operating systems G Web Server for CGI Support
Cursor VIs
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
43
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
45 46
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
47 48
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
8
17. 12. 2014
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
49 50
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Real-Time Reconfigurable
User Interface Processor FPGA
table
configuring FPGA and
optionally including
digital signal preprocessing,
LabVIEW LabVIEW LabVIEW control, timing, fast complex
FPGA Host Interface LabVIEW FPGA
for Real-Time FPGA calculations, etc.). VI
Windows
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
53 54
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
9
17. 12. 2014
www.ni.com/myrio
Direct writing/reading from virtual front panel of FPGA VI
Simple data transfer without memory myRIO
FIFO DMA transfer with buffered data transfer
Register
Handshake
Memory
FPGA I/O variable
National Instruments
Nonvolatile memory ...........256 MB
DDR3 memory......................512 MB
DDR3 clock frequency .........533 MHz
DDR3 data bus width............16 bits
myRIO-1900 is a portable FPGA .................Xilinx Z-7010 (28,000 programmable
logic cells)
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
57 58
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
Processor
NEON & Single / Double Precision Floating Point for each processor
Extensions
L2 Cache 512 KB
On-Chip
256 KB
Memory
Memory
DDR3, DDR3L, DDR2, LPDDR2, 2x Quad-SPI, NAND, NOR
Interfaces
28K 85K
Logic Cells 74K 125K 350K 444K
up to
Transceiver up to 4 (12.5 up to 16 (12.5
4 (6.25 Gb/s) 16 (10.3125
Count Gb/s) Gb/s)
Gb/s)
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
59 60
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
10
17. 12. 2014
4 AI MXP A MXP B
6 DIO 2 AO 1 UART
1 SPI
1 Quad Encoder
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
61 62
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
www.ni.com/myrio
www.ni.com/labview
www.ni.com/crio
www.ni.com/flexrio
www.ni.com/...
Summer School on Marine Technology Instrumentation, UPC Summer School on Marine Technology Instrumentation, UPC
63 64
Barcelona, Spain, July 2014 Barcelona, Spain, July 2014
11