f Pga Programming Block Set Guide
f Pga Programming Block Set Guide
Guide
For FPGA Programming Blockset 2024-A
If possible, always provide the serial number of the hardware, the relevant dSPACE License
ID, or the serial number of the CmContainer in your support request.
Important Notice
This publication contains proprietary information that is protected by copyright. All rights
are reserved. The publication may be printed for personal or internal use provided all the
proprietary markings are retained on all printed copies. In all other cases, the publication
must not be copied, photocopied, reproduced, translated, or reduced to any electronic
medium or machine-readable form, in whole or in part, without the prior written consent
of dSPACE GmbH.
This publication and the contents hereof are subject to change without notice.
Contents
3
May 2024 FPGA Programming Blockset Guide
Contents
Using a Watchdog.................................................................................................. 86
How to Implement the Watchdog................................................................. 86
How to Configure the Condition when the Watchdog Expires....................... 88
4
FPGA Programming Blockset Guide May 2024
Contents
5
May 2024 FPGA Programming Blockset Guide
Contents
Preprocessing and Postprocessing the Signals Between the FPGA and the
Processor Model................................................................................................... 155
Basics on Preprocessing and Postprocessing the Processor
Communication.......................................................................................... 156
Characteristics of Scaling Subsystems.......................................................... 158
Limitations Concerning Scaling Subsystems................................................. 160
How to Prepare FPGA Models to Use Scaling Subsystems............................ 162
How to Implement the Interfaces of Scaling Subsystems.............................. 164
How to Implement Data Exchange Between Scaling Subsystems.................. 167
How to Implement the Interfaces for Offline Simulation.................... .......... 168
How to Update an FPGAC File with Modified Scaling Subsystems................ 170
6
FPGA Programming Blockset Guide May 2024
Contents
7
May 2024 FPGA Programming Blockset Guide
Contents
Troubleshooting 259
Problems and Their Solutions....................................................................... 259
Index 269
8
FPGA Programming Blockset Guide May 2024
About This Guide
Content This guide provides basic information about the FPGA Programming Blockset,
including the entire software environment and the supported hardware. You will
also learn how to apply the main features of the blockset.
Symbol Description
Indicates a hazardous situation that, if not avoided,
V DANGER
will result in death or serious injury.
Indicates a hazardous situation that, if not avoided,
V WARNING could result in death or serious injury.
Indicates a hazardous situation that, if not avoided,
V CAUTION could result in minor or moderate injury.
Indicates a hazard that, if not avoided, could result in
NOTICE
property damage.
Indicates important information that you should take
Note
into account to avoid malfunctions.
Indicates tips that can make your work easier.
Tip
9
May 2024 FPGA Programming Blockset Guide
About This Guide
Symbol Description
Indicates a link that refers to a definition in the
glossary, which you can find at the end of the
document unless stated otherwise.
Follows the document title in a link that refers to
another document.
Naming conventions dSPACE user documentation uses the following naming conventions:
RTI block name conventions All I/O blocks have default names based on
dSPACE's board naming conventions:
§ Most RTI block names start with the board name.
§ A short description of functionality is added.
§ Most RTI block names also have a suffix.
Suffix Meaning
M Module number (for MicroAutoBox II)
C Channel number
G Group number
CON Converter number
BL Block number
P Port number
I Interrupt number
Special Windows folders Windows‑based software products use the following special folders:
10
FPGA Programming Blockset Guide May 2024
About This Guide
Accessing dSPACE Help and After you install and decrypt Windows‑based dSPACE software, the
PDF files documentation for the installed products is available in dSPACE Help and as PDF
files.
dSPACE Help (local) You can open your local installation of dSPACE Help:
§ On its home page via Windows Start Menu
§ On specific content using context-sensitive help via F1
PDF files You can access PDF files via the icon in dSPACE Help. The PDF
opens on the first page.
11
May 2024 FPGA Programming Blockset Guide
About This Guide
12
FPGA Programming Blockset Guide May 2024
Introduction to the FPGA Programming Blockset
Basic feature of the blockset The FPGA Programming Blockset is a Simulink® blockset that allows you to
program an FPGA in a dSPACE system.
FPGA Basics............................................................................................. 13
General information on FPGAs.
FPGA Basics
FPGA architecture FPGA stands for Field Programmable Gate Array. It is used in digital technology
to allow modifications in a circuit's functionality without replacing hardware. A
specific circuit is implemented as a specific configuration of the internal logic
13
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
cells. The configurable logic blocks (CLBs) are connected with each other via
switch boxes. The external connection is realized by I/O pins.
Reasons for using FPGAs The main advantages of an FPGA are its flexibility and high speed for signal
processing:
§ Flexibility
You can implement any kind of circuit, from a simple counter to an entire
microprocessor.
You can reconfigure your implementation in the development phase without
hardware changes.
§ Speed
The specific implementations are usually concentrated on one functionality
without any overhead.
The bit architecture is often more efficiently than the word architecture with a
fix data width.
Execution can be done in parallel which results in a high throughput.
Control loops (input of data, result calculation, output of data) can usually
be performed at higher overall sample rates on an FPGA than on non-FPGA
platforms.
Fields of application All of the above-mentioned features of an FPGA are very useful for function
prototyping, which can be performed with dSPACE hardware and software.
FPGAs are used, if you have a task that cannot be solved by standard
implementations. They are used for tasks that require high performance, for
example, for complex signal processing, or if you want to move some of your
model's functionality to a separate application.
14
FPGA Programming Blockset Guide May 2024
Basics on the System Architecture
Introduction The system architecture determines the signals your FPGA applications can read,
process, and update. It shows the data flow to download applications and to
analyze data.
Components of a dSPACE The following illustration shows you the components and the signal connections
system and their connections of a dSPACE system, such as a MicroAutoBox III.
dSPACE system
Real-time I/O
Host PC processor channels
External
device
FPGA I/O
channels
15
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
§ External device
Device that can be connected to the dSPACE system, such as an ECU.
Introduction The FPGA Programming Blockset is a Simulink blockset for integrating an FPGA
application into a dSPACE system. It provides Simulink blocks for implementing
the interface between the FPGA and the I/O channels of the dSPACE I/O board
on which the FPGA is mounted, and the interface between the FPGA and the
real-time processor. Furthermore, script functions let you execute functions via
command line or M file.
board-specific bus
FPGA_XDATA_WRITE_BL PROC_XDATA_READ_BL
Processor
model
FPGA_XDATA_READ_BL PROC_XDATA_WRITE_BL
FPGA logic
FPGA_IO_WRITE_BL
I/O channel
FPGA_IO_READ_BL
FPGA interface The blocks of the FPGA Interface library are used to model the interface of an
FPGA application in the FPGA model. The blocks let you configure the interface
between the FPGA and the I/O channels of the FPGA board that provides access
to external I/O signals. The blocks also provide access to data storage that is used
for exchanging data with the real-time processor.
The data exchange and all other communication between the FPGA board and
the processor board runs via the board‑specific bus:
§ Intermodule bus when the MicroAutoBox II/III is used.
§ Local bus when MicroLabBox is used.
§ IOCNET when SCALEXIO or MicroLabBox II is used.
16
FPGA Programming Blockset Guide May 2024
Basics on Exchanging Data Between Processor and FPGA
specific bus. These blocks in the processor model are the counterparts of the
related FPGA_XDATA blocks in the FPGA model. They access the data storage
that you configured in the FPGA model. The setup block of the Processor
Interface library lets you automatically generate the interface blocks for the
processor model.
Available script functions The FPGA Programming Blockset comes with script functions for executing
functions via command line or M file. You can use them, for example, to execute
scheduled build processes at night. For more information on the available script
functions, refer to Introduction to the Script Interface of the FPGA Programming
Software (FPGA Programming Software Script Interface Reference ).
Introduction Only the processor application initiates a data exchange between the real-time
processor and the FPGA. To be able to exchange data, the FPGA and processor
interfaces provide different data storages.
Provided data storage You can choose the data storage that you want to use for the data exchange
with the following access types:
§ Register
Registers are implemented as flip-flops to exchange scalar values.
§ Register group
Register groups are implemented as flip-flops to exchange a data package
with synchronized elements.
§ Buffer
Buffers are implemented in the FPGA RAM to exchange data packages with a
buffer size of up to 32,768 elements.
For board-specific details on, such as data width or data format, refer to
Exchanging Data With the Processor Model on page 130.
17
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
Details on the access types Register access Register access lets you access a scalar value in the register.
The data is identified by the specified channel number. The values are
transmitted element by element.
Register group access You can group registers to a register group via a
common Register Group ID. All the values that belong to the same Register
Group ID are synchronously updated in the FPGA subsystem.
For read access, the registers of a register group are read from the board-specific
bus sequentially and then provided to the FPGA application simultaneously. For
write access, the registers of a register group are sampled simultaneously in the
FPGA application. These values form a consistent data group that is written to
the board-specific bus.
Buffer access Buffer access lets you access a vector value in the data buffer.
One specific value of the data is identified by the specified channel number and
the position within the buffer.
Data exchange is implemented via a FIFO buffer that works as a swinging buffer.
This means that there are two separate buffers for reading and writing, and
one buffer that switches between reading and writing. Only the pointer has to
be changed to switch the buffer so that no buffer has to be copied from one
position to another.
Free buffer
Processing the data exchange Only the processor application can initiate data exchange between the real-time
processor and the FPGA. The following illustration shows you the main steps that
a processor task performs.
Processor task
From external device To external device
Read Process Update
inputs model outputs
FPGA
The FPGA executes its operations in parallel because the FPGA application is a
logic implementation: i.e., the execution time of an FPGA is much faster than the
execution time of the real-time processor.
18
FPGA Programming Blockset Guide May 2024
Software Tools for Working with the FPGA Programming Blockset
Several processor tasks with different task periods can request read/write access
to the FPGA at different points in time. These read/write requests are executed
by the FPGA in parallel. The following illustration shows you the read/write
requests of a real-time application with two processor tasks.
Read Read Read Compute Write Read Read Read Compute Write Read
Processor FPGA FPGA FPGA model of
Write
FPGA FPGA FPGA FPGA model of
Write
FPGA FPGA
Idle Idle
task 1 FPGA FPGA
Reg1 Reg3 Reg7 task 1 Reg9 Reg1 Reg3 Reg7 task 1 Reg9 Reg1
Reg4 Reg4
t Task 1 t Task 1
Processor Read Read Compute Write Read Read Compute Write Read Read Compute Write
FPGA FPGA model of FPGA Idle FPGA FPGA model of FPGA Idle FPGA FPGA model of FPGA Idle
task 2 Reg2 Reg4 task 2 Reg8 Reg2 Reg4 task 2 Reg8 Reg2 Reg4 task 2 Reg8
Introduction To model and build an FPGA application for dSPACE hardware, several software
tools are necessary.
Tools from The MathWorks® MATLAB®, Simulink® and Simulink® CoderTM are required for modeling and
simulating the application.
19
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
Tools from AMD AMD provides several tools for designing applications for AMD FPGAs. The
Vivado® Design Suite covers all the aspects of designing FPGAs. Working with
the FPGA Programming Blockset requires the following products:
Vivado Design Suite The Vivado Design Suite provides a logic design
environment for AMD FPGAs. It contains tools and wizards, for example, for I/O
assignment, power analysis, timing-driven design closure, and HDL simulation.
With the Vivado software, you can build the FPGA application according to the
implemented FPGA model.
The FPGA Programming Blockset uses the Vivado software in the background
without the GUI.
AMD Vitis Model Composer AMD® VitisTM Model Composer for modeling
FPGA applications with Simulink is the unified AMD add-on for MATLAB
Simulink.
The following items of the AMD Vitis Model Composer are required for modeling
and generating the FPGA application:
§ The AMD Vitis Model Composer Blockset.
The AMD Vitis Model Composer Blockset is a Simulink block library that lets
you graphically model FPGA applications. The AMD Vitis Model Composer
Blockset requires a separate license.
The FPGA Programming Blockset supports only the HDL library of the AMD
Vitis Model Composer.
§ The code generator that is included in the AMD Vitis Model Composer.
The code generator is used to generate the HDL code based on blocks of the
FPGA Programming Blockset and the AMD Vitis Model Composer Blockset.
Tip
To use the AMD Vitis Model Composer with a specific MATLAB version, the
-matlab "<matlabdir>" parameter must be specified. You can add this
parameter to the Vitis Model Composer icon on the desktop, for example.
Xilinx System Generator for DSP (XSG) As of Vivado 2021.1, the AMD
Vitis Model Composer includes the functionality of the Xilinx System Generator
for DSP (XSG). For licensing issues related to this change, refer to AMD Answer
Record 76039 (https://support.xilinx.com/s/article/76039).
20
FPGA Programming Blockset Guide May 2024
Software Tools for Working with the FPGA Programming Blockset
Ordering AMD software Currently, you cannot order the AMD software
from dSPACE. Install the AMD software before or after installing dSPACE
software and follow the installation instructions from the AMD manuals.
Supported software versions The following table shows you the supported products and their software
versions for the current version of the FPGA Programming Blockset.
For software versions that are compatible with older versions of the FPGA
Programming Blockset, refer to https://www.dspace.com/faq?295.
Required blocksets for the The MicroLabBox II, MicroAutoBox III, and SCALEXIO require the dSPACE Model
processor model Interface Package for Simulink to implement the interface between the real-
time processor and the FPGA. The Model Interface Package for Simulink is the
blockset for specifying all interfaces of processor models (behavior models) used
in ConfigurationDesk.
21
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
ControlDesk ControlDesk is the dSPACE software tool for experimenting with a dSPACE
system. It can be used to register the connected hardware, to manage the
simulation platform, to download the real-time application (processor and FPGA
application), and to control the experiment. The great variety of instruments
allows you to access and visualize variables of the processor application.
Step 1: How to Install the Required Software (FPGA Programming Blockset Getting
Started )
Introduction The FPGA Programming Blockset is not board-specific. Here is an overview of the
supported hardware.
MicroLabBox Internally, MicroLabBox consists of the two boards DS1202 and DS1302. The
DS1302 board provides the FPGA capabilities.
MicroLabBox's I/O FPGA module provides channels for analog input and
output, digital input and output, and bus communication. The DS1302 board
of MicroLabBox provides an FPGA unit with an AMD FPGA that can be
programmed by using the FPGA Programming Software.
Note
dSPACE also provides RTI blocksets for MicroLabBox. To use blocks from the
FPGA Programming Blockset and the RTI blocksets in the same model, you
have to use the flexible I/O framework for MicroLabBox. Refer to Features of
the MicroLabBox Flexible I/O Framework on page 61.
22
FPGA Programming Blockset Guide May 2024
Hardware Supported by the FPGA Programming Blockset
The following table shows the main features of MicroLabBox's I/O FPGA:
Feature Description
Programmable FPGA § AMD® Kintex®-7 XC7K325T
§ 326,080 logic cells
§ 50,950 slices
§ 4,000 kbit distributed RAM (max.)
§ 840 DSP slices
§ 16,020 kbit block RAM
§ 100 MHz hardware clock frequency
§ Multiple clock domains: Up to ten clock domains can be used to process FPGA subsystems
with individual clock periods.
Analog input § ADC (Class 1): 24 parallel A/D converters with 16-bit resolution and a sample rate of
1 MS/s.
§ ADC (Class 2): 8 parallel A/D converters with 16-bit resolution and a sample rate of
10 MS/s.
Analog output DAC (Class 1): 16 parallel D/A converters with 16-bit resolution.
Digital I/O § Digital InOut (Class 1): 48 digital bidirectional channels, single‑ended.
§ Digital InOut (Class 2): 8 digital bidirectional channels, differential.
Resolver interface 2 resolver interfaces that support resolvers with an excited single coil.
Serial interface 2 UART (RS232) and 2 UART (RS422/485) interfaces.
The UART (RS422/485) function supports full‑duplex mode and half‑duplex mode.
Feedback elements § Status In: State of the initialization sequence that is started after programming the FPGA.
§ LED Out: 4 customizable LEDs.
§ Proc App Status: Execution state of the loaded executable application.
For further information on the software features, refer to Block Settings for
the MicroLabBox Frameworks (FPGA Programming Blockset - FPGA Interface
Reference ).
MicroLabBox II Internally, the MicroLabBox II consists of the two boards DS1203 Processor Board
and DS1303 Multi-I/O Board. The DS1303 Multi-I/O Board provides the FPGA
capabilities.
The following table shows the main features of the MicroLabBox II:
Feature Description
Programmable § AMD® Kintex® UltraScale+TM XCKU15P-2FFVE1517E
FPGA § 1,143,450 system logic cells
§ 1,045,440 FlipFlops
§ 1,968 DSP slices
§ 9.8 Mbit maximum distributed RAM
23
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
Feature Description
§ 34.6 Mbit block RAM
§ 36.0 Mbit Ultra RAM
§ 125 MHz hardware clock frequency
§ Multiple clock domains: Up to ten clock domains can be used to process FPGA subsystems
with individual clock periods.
Analog input § Analog In 23: Input channel to measure differential analog voltage signals in the range ±10 V
with max. 2 MS/s.
Number of channels: 24
§ Analog In 24: Input channel to measure differential analog voltage signals in the range ±1 V or
±10 V with max. 5 MS/s.
Number of channels: 6
§ Analog In 25: Input channel to measure differential analog voltage signals in the range ±1 V or
±10 V with max. 5 MS/s. A load can be activated.
Number of channels: 2
Analog output § Analog Out 19: Output channel to generate ground-based analog voltage signals in the range
±10 V with max. 2 MS/s.
Number of channels: 14
§ Analog Out 20: Output channel to generate analog signals. Each channel can be configured to
generate a ground-based signal (±10 V) or a transformer-coupled signal (±20 V AC) with max.
5 MS/s.
Number of channels: 2
Digital I/O § Digital In/Out 14: Bidirectional channels to measure or generate ground-based digital signals.
Number of channels: 48
§ Digital In/Out 15: Bidirectional channels to measure or generate differential digital signals.
Number of channels: 12
Feedback § Status In: State of the initialization sequence that is started after programming the FPGA.
elements § LED Out: 1 customizable LED.
§ Proc App Status: Execution state of the loaded executable application.
For further information on the software features, refer to Block Settings for
the MicroLabBox II Framework (FPGA Programming Blockset - FPGA Interface
Reference ).
MicroAutoBox II/III The MicroAutoBox II/III consists of a board with the real-time processor and at
least one I/O board. An FPGA base board provides the FPGA and the interfaces
for adding different I/O modules.
DS1514 FPGA Base Board The DS1514 FPGA Base Board provides an FPGA.
The following table shows the main features of the DS1514 FPGA Base Board.
Feature Description
Programmable § AMD Kintex®-7 XC7K325T
FPGA § 326,080 logic cells
§ 50,950 slices
24
FPGA Programming Blockset Guide May 2024
Hardware Supported by the FPGA Programming Blockset
Feature Description
§ 4,000 kbit distributed RAM (max.)
§ 840 DSP slices
§ 80 MHz hardware clock frequency.
§ Multiple clock domains: Up to ten clock domains can be used to process FPGA subsystems
with individual clock periods.
I/O interfaces I/O interfaces are provided by I/O modules that are installed to the FPGA base board. Refer to
I/O modules available for MicroAutoBox II/III on page 25.
Feedback elements § Status In: State of the initialization sequence that is started after programming the FPGA.
§ Temperature: Sensor to measure the FPGA's die temperature.
§ LED Out: 1 FPGA Status LED.
For further information on the hardware, refer to the following data sheets:
§ MicroAutoBox II 1401/1511/1514: General Data (MicroAutoBox II Hardware
Reference )
§ MicroAutoBox II 1401/1513/1514: General Data (MicroAutoBox II Hardware
Reference )
§ MicroAutoBox III: DS1514 FPGA Base Board Data Sheet (MicroAutoBox III
Hardware Installation and Configuration )
I/O modules available for I/O modules provide the I/O interface for the DS1514 FPGA Base Board. The
MicroAutoBox II/III following table shows the main features of the supported I/O modules:
25
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
Note
dSPACE also provides an RTI blockset for the DS1552 Multi-I/O Module.
You cannot use blocks from the FPGA Programming Blockset and the RTI
DS1552 I/O Extension Blockset in the same model.
For further information on the hardware, refer to the following data sheets.
§ MicroAutoBox II:
§ Data Sheet DS1552 Multi-I/O Module (MicroAutoBox II Hardware
Reference )
§ Data Sheet DS1554 Engine Control I/O Module (MicroAutoBox II Hardware
Reference )
§ MicroAutoBox III:
§ DS1552 Multi-I/O Module Data Sheet (MicroAutoBox III Hardware
Installation and Configuration )
§ DS1554 Engine Control I/O Module Data Sheet (MicroAutoBox III Hardware
Installation and Configuration )
For more information on the software features, refer to the following framework
references.
§ MicroAutoBox II
§ Block Settings for the FPGA1401Tp1 with Multi-I/O Module Frameworks
(FPGA Programming Blockset - FPGA Interface Reference )
§ Block Settings for the FPGA1401Tp1 with Engine Control I/O Module
Framework (FPGA Programming Blockset - FPGA Interface Reference )
§ MicroAutoBox III
§ Block Settings for the FPGA1403Tp1 with Multi‑I/O Module Frameworks
(FPGA Programming Blockset - FPGA Interface Reference )
26
FPGA Programming Blockset Guide May 2024
Hardware Supported by the FPGA Programming Blockset
§ Block Settings for the FPGA1403Tp1 with Engine Control I/O Module
Framework (FPGA Programming Blockset - FPGA Interface Reference )
SCALEXIO system A SCALEXIO system consists of SCALEXIO processing hardware and a selection
of I/O boards. The SCALEXIO processing hardware, such as a SCALEXIO Real-
Time PC, provides the computation power of the system.
I/O boards are available for the various requirements, for example, for accessing
analog input and output signals, digital input and output signals, and bus
communication.
With the SCALEXIO FPGA base boards, you can integrate an FPGA application
into a SCALEXIO system. The board provides an FPGA that you can program
using the FPGA Programming Blockset.
The following table shows the main features of the supported SCALEXIO FPGA
base boards.
27
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
I/O modules available for I/O modules provide the I/O interface for the SCALEXIO FPGA base boards
SCALEXIO FPGA base board DS2655, DS6601, and DS6602. The following table shows the main features
of the supported I/O modules:
28
FPGA Programming Blockset Guide May 2024
Hardware Supported by the FPGA Programming Blockset
29
May 2024 FPGA Programming Blockset Guide
Introduction to the FPGA Programming Blockset
§ Block Settings for the DS2655M2 I/O Module Framework (FPGA Programming
Blockset - FPGA Interface Reference )
§ Block Settings for the DS6651 Multi-I/O Module Framework (FPGA
Programming Blockset - FPGA Interface Reference )
30
FPGA Programming Blockset Guide May 2024
New Features and Migration
Introduction New FPGA Programming Blockset features of the current and historical versions
and information on using and updating existing FPGA models to use them in
your current project.
31
May 2024 FPGA Programming Blockset Guide
New Features and Migration
General enhancements to the Enhanced resource utilization reports The FPGA Programming Blockset
FPGA Programming Blockset now provides resource utilization reports including the resources required for
HDL Coder subsystems. This means that the total resource utilization of an FPGA
model that uses Simulink blocks in addition to AMD® VitisTM Model Composer
and FPGA Programming Blockset blocks is now reported.
For more information, refer to Features of the dSPACE Utilization Analyzer on
page 181.
32
FPGA Programming Blockset Guide May 2024
Features History of the FPGA Programming Blockset
General enhancements to the Incremental build The FPGA Programming Blockset now lets you enable the
FPGA Programming Blockset incremental build feature of Vivado to help in consistently achieving successful
builds at high FPGA utilizations. A known good reference build is used as a
starting point for implementation, so that new builds can assume a working
FPGA configuration and only the actual changes need to be implemented. An
incremental build increases the likelihood of successful FPGA builds and reduces
build times for rather small changes in the FPGA model.
Refer to How to Build FPGA Applications Incrementally on page 205.
dSPACE Timing Analyzer The new dSPACE Timing Analyzer helps you to fix
timing errors that are detected during the build process.
The timing analyzer helps you with the following features:
§ Shows the most critical FPGA signal paths of the built FPGA application
independently of the used block libraries (HDL library of the AMD Vitis Model
Composer and/or standard Simulink library (HDL Coder subsystems)).
The number of FPGA signal paths is limited to 1,000 bits of signals. For
example, 50 20-bit wide data paths can be displayed.
33
May 2024 FPGA Programming Blockset Guide
New Features and Migration
New MicroLabBox II The MicroLabBox II provides an FPGA on the DS1303 Multi-I/O Board that can be
framework programmed with the FPGA Programming Blockset. The FPGA custom function
block type built with the FPGA Programming Blockset replaces the standard
I/O functionality of the I/O board. In ConfigurationDesk, you can either use
the FPGA custom function block type or the function block types provided by
ConfigurationDesk to implement the I/O functionality.
For an overview of the provided I/O functionality, refer to Block Settings for
the MicroLabBox II Framework (FPGA Programming Blockset - FPGA Interface
Reference ).
If you handcode the FPGA application, use the provided Tcl script to build
the FPGA application. Refer to How to Build the FPGA Application (FPGA
Programming Handcode Framework Guide ).
Enhancements to The frameworks now provide clock signals and additional information for
the SCALEXIO and subsystems using a user clock domain:
MicroAutoBox III frameworks § Clock signal with the base rate of the FPGA.
§ Clock signal of another subsystem using a user clock domain.
§ System information on the FPGA application, the processor application, and an
optional MGT module.
For more information, refer to Using Clock Signals of Different Clock Domains in
the Same Subsystem on page 82.
General enhancements to the Support of Simulink blocks to model parts of the FPGA model The FPGA
FPGA Programming Blockset Programming Blockset now supports MathWorks© HDL CoderTM for modeling
parts of the FPGA model with SimulinkTM blocks. This feature lets you use
existing Simulink models directly as part of your FPGA application. For example:
34
FPGA Programming Blockset Guide May 2024
Features History of the FPGA Programming Blockset
You can use a Simulink model of a controller for first functionality tests before
you optimize the FPGA utilization of the controller.
The FPGA Programming Blockset provides gateway blocks to transfer the signals
and buses between the separated model parts. During the build process, the
following tools generate the HDL code:
§ MathWorks HDL Coder generates the VHDL code from blocks of the Simulink
blockset.
§ AMD Vitis Model Composer generates the VHDL code from blocks of the HDL
library and the FPGA Programming Blockset.
The build process merges the individual VHDL codes into a synthesizable overall
model. For instructions, refer to How to Use Simulink Blocks for Modeling the
FPGA Functionality on page 68.
Using MathWorks HDL coder does not affect the MATLAB compatibility of the
FPGA Programming Blockset, because only parts of the FPGA model can be
modeled with Simulink blocks.
Enhancements to the More comfortable transfer of the FPGA container After the FPGA build,
MicroAutoBox III/SCALEXIO a publish link in the MATLAB Command Window and a Publish button on
frameworks the ConfigurationDesk Interface page of the FPGA Setup block now let you
publish the path of the built FPGA container file to the global user location file
of ConfigurationDesk. This makes the build FPGA application available as FPGA
custom function block types in the Function Browser of ConfigurationDesk.
35
May 2024 FPGA Programming Blockset Guide
New Features and Migration
New method to provide clock domains The new User Clock Out block
lets you use a customized clocking circuit (user clock) as clock domain source.
For example, you can use the clock of the MGT interface to process the data
synchronous to the MGT transceivers.
For instructions, refer to How to Use a Customized Clocking Circuit as Clock
Domain Source on page 84.
The user clock feature is available only for modeling the FPGA application, not
for handcoding.
Enhancements to the New watchdog feature The frameworks of the DS6601/DS6602 FPGA base
SCALEXIO frameworks boards now provide a Watchdog block to check if the processor application is
alive.
For more information, refer to Using a Watchdog on page 86.
New bus data transmission method for the Bus Out block The Bus Out
block now supports the User acknowledged bus data transmission method.
This method lets you acknowledge the data to be transmitted to the processor
application, for example, to trigger the processing of some data before it is
transmitted to the processor application.
For instruction, refer to How to Configure the Bus Data Transmission Method on
page 144.
New MGT In Opto Ready block The MGT In Opto Ready block indicates
whether the MGT module is ready for data exchange.
The MGT In Opto Ready block replaces the Opto_Ready port of the MGT In
block, because the signal of the Opto_Ready port cannot be provided in a user
clock domain.
Rework is necessary if you migrate an FPGA model using a MGT In block. Refer
to Updating FPGA Frameworks to the Current Version on page 42.
Enhancements to the script New script function for MicroAutoBox III/SCALEXIO The script interface is
interface enhanced with a script function to publish the path of the built FPGA container
file to the global user location file of ConfigurationDesk. This makes the build
FPGA application available as FPGA custom function block types in the Function
Browser of ConfigurationDesk.
For more information, refer to PublishFPGACustomFunction (FPGA Programming
Software Script Interface Reference ).
Enhancement to the A new Getting Started document introduces you to the first steps in FPGA
documentation programming with the FPGA Programming Blockset. A tutorial introduces you
to the basic steps of modeling and building an FPGA application when using a
MicroAutoBox III or SCALEXIO.
36
FPGA Programming Blockset Guide May 2024
Features History of the FPGA Programming Blockset
Enhancements to the Preprocessing and postprocessing of processor signals The SCALEXIO and
MicroAutoBox III/SCALEXIO the MicroAutoBox III blocksets now support scaling subsystems as a part of
frameworks the FPGA model. Scaling subsystems lets you specify the preprocessing and
postprocessing of the signals between the FPGA and the real-time processor.
Scaling subsystems are executed on the real-time processor even though they are
part of the FPGA model.
Scaling subsystems can be used for the following points:
§ Scaling the signals.
§ Implementing complex algorithms to process the signals. For example, an
FPGA input signal can be calculated from several processor output signals.
§ Grouping of signals for more clarity.
For more information, refer to Basics on Preprocessing and Postprocessing the
Processor Communication on page 156.
New container file format for the build result files The FPGA
Programming Blockset now supports the FPGAC file format for the build results.
FPGAC files let you manage FPGA applications in repositories. If you add or
update an FPGAC file to a search path of ConfigurationDesk, ConfigurationDesk
adds the FPGA custom function block type to the Functions browser and
updates instantiated function blocks if you open the ConfigurationDesk
application or you reload the custom functions.
For more information, refer to How to Import FPGA Custom Function Block Types
Provided by an FPGAC File (ConfigurationDesk I/O Function Implementation
Guide ).
Enhancements to the 64-bit fixed-point support for processor communication The data types
SCALEXIO frameworks without a binary position (Fix_64_0 and UFix_64_0) for the Register64 and
Buffer64 access types now support the full 64-bit fixed-point resolution.
All other 64-bit fixed-point data types are still converted to double and their
fixed-point resolution is restricted to 53 bits. This also applies to the Bus access
types.
Note
37
May 2024 FPGA Programming Blockset Guide
New Features and Migration
General enhancements to the Backup of the build results Before you build an FPGA application, you
FPGA Programming Blockset can now enable and configure the automatic backup of the FPGA application,
models, and reports that are generated and used during the build process. A link
to the backup folder is provided in the MATLAB Command Window after the
build process finished.
For configuring the automatic backup, refer to Backing Up the Build Results on
page 225.
New reports about the model and build results The framework now
provides model and build reports that are generated at the end of an FPGA
build.
The model report contains information about the FPGA channels, software and
tools used. The build report contains information about the FPGA utilization and
the build duration.
Links to the reports are provided in the MATLAB Command Window after the
build process finished. The reports are located in the build folder or in the
backup folder.
Word length calculator dialog The word length calculator now lets you
calculate an optimal fixed-point data type for a user-defined floating-point value.
Refer to Word Length Calculator (FPGA Programming Blockset - FPGA Interface
Reference ).
Enhancement to the FPGA The FPGA Build Monitor 2022-B now provides the warning messages, if any
Build Monitor were issued during the build process.
General enhancement for the The FPGA Scope block now lets you connect up to 16 FPGA signals that can be
SCALEXIO FPGA base boards captured. Nevertheless, only 8 FPGA signals can be displayed in ControlDesk at
the same time. You can select the signals to be displayed in ControlDesk.
Enhancement to the FPGA The FPGA Build Monitor 1.2 now supports the following features:
Build Monitor § A Reset button to reset defective builds.
§ A Clear Caches button to clear the build caches.
§ A sort functionality to display the monitored build processes by date, name, or
state.
38
FPGA Programming Blockset Guide May 2024
Features History of the FPGA Programming Blockset
Framework enhancements New function blocks for the processor communication The new
Bus In/Bus Out blocks for the MicroAutoBox III/SCALEXIO frameworks replace
the transfer mode of the Buffer64 In/Buffer64 Out blocks.
The new Blocks support the following new features:
§ You can copy a Simulink bus topology from a corresponding Data
Inport/Data Outport block of the processor model.
§ A bus editor lets you change the bus topology, including the bus signals of the
Simulink bus used.
For more information, refer to Using Simulink Buses for Modeling the Processor
Communication on page 135.
New ports for the MGT interfaces The Aurora 64b66b In and Aurora
64b66b 128 Bit In blocks now provide a Ready port to specify that the
communication channel is ready to read new data. The new port lets you prevent
data overflow.
Furthermore, the MGT In block now provides an Opto_Ready port. The port
indicates whether the MGT module is ready for data exchange.
Handcoding interface only: The Aurora 64b66b I/O functions provide a
mgt_user_clk_156 clock port. You can use the clock port to implement parts
of your FPGA application synchronously with the clock frequency of the MGT
module, i.e., with 156.25 MHz.
Working with synchronous frequencies has the following benefits:
§ Less latency because there is no clock transition between the clock frequencies
of the FPGA and the MGT module.
§ No need for clock compensation due to drifting clocks. The Aurora protocol
automatically synchronizes the different clocks.
Enhancements to the script New script function for MicroAutoBox III/SCALEXIO The script interface is
interface enhanced with a script function to configure a Bus In/Bus Out block with the
bus configuration of the coresponding processor block.
For more information, refer to CopyProcFPGAXDATABus (FPGA Programming
Software Script Interface Reference ).
Framework enhancements The MicroAutoBox III and SCALEXIO frameworks now provide the following
enhancements:
§ When using the bus transfer mode, you can select the following bus data
transmission methods to transmit data to the processor application:
§ The Synchronous to Read_Req method to transmit data that is captured
synchronously to the processor task.
39
May 2024 FPGA Programming Blockset Guide
New Features and Migration
Enhancements to the script The following table shows the new script functions of the script interface.
interface
Script Function Purpose
AnalyzeFPGAXDATAWriteBus To trigger the bus analysis of the Simulink bus
that is connected to a Bus Out FPGA block. This
script function supports only MicroAutoBox III
and SCALEXIO system models.
CopyFPGAXDATAReadBus To copy an existing FPGA bus topology
from a specified Simulink Bus Creator block,
subsystem inport block, or subsystem outport
block to the Data port of the Bus In
FPGA block. This script function supports only
MicroAutoBox III and SCALEXIO system models.
GetFPGAXDATABusSettings To get the bus settings of a Bus In/Bus Out
FPGA block. This script function supports only
MicroAutoBox III and SCALEXIO system models.
GetMCSubsystems To get the Simulink subsystems that provide the
access for the processor cores of a multicore
system. This script function supports only
MicroAutoBox III and SCALEXIO system models.
GetTraceSubsystems To get the Simulink subsystems that are
traceable with your experiment software.
ResetFPGAXDATABus To clear the bus settings of a Bus In
FPGA block. This script function supports only
MicroAutoBox III and SCALEXIO system models.
SetFPGAXDATABusSettings To set the bus settings of a Bus In/Bus Out
FPGA block. This script function supports only
MicroAutoBox III and SCALEXIO system models.
SetMCSubsystems To set the Simulink subsystems that provide the
access for the processor cores of a multicore
system. This script function supports only
MicroAutoBox III and SCALEXIO system models.
SetTraceSubsystems To set the Simulink subsystems that are
traceable with your experiment software.
For more information, refer to Script Functions Supporting the FPGA Interface
Sublibrary (FPGA Programming Software Script Interface Reference ).
40
FPGA Programming Blockset Guide May 2024
Migrating and Updating Existing FPGA Models
41
May 2024 FPGA Programming Blockset Guide
New Features and Migration
Introduction If you have implemented your FPGA application using an older version of
the FPGA Programming Blockset, and you want to use it with a current
version, the FPGA framework must be updated. This involves only a few
internal modifications that do not affect the blocks' inputs and outputs or their
parameters.
Migrating from previous The FPGA Programming Blockset automatically updates existing FPGA models
FPGA Programming Blocksets to the current framework version. The update affects all subsystems in the
model/subsystem. The parameters of the blocks stay the same after updating
to the current framework version.
You can also use a script to migrate processor interface blocks, for example, to
migrate RTI processor models without the FPGA model. For more information,
refer to MigrateToModelPortBlocks (FPGA Programming Software Script Interface
Reference ).
Note
Changed interface to modify analog output signals FPGA scaling lets you
modify analog output signals. As of Release 2022-B, the interface scales the
signal values that are replaced with FPGA test access.
The following illustration shows the analog output interface. For more
information on FPGA test access and scaling, refer to Basics on FPGA Test Access
and Scaling on page 248.
42
FPGA Programming Blockset Guide May 2024
Migrating and Updating Existing FPGA Models
Analog output
I/O logic
channel
Scaling
FPGA test access Saturation
and offset
FPGA_IO_WRITE_BL
Up to Release 2022-A, the interface scales signal values first and then you can
replace the scaled values with FPGA test access.
Introduction The FPGA Programming Blockset supports different dSPACE FPGA boards and
hardware platforms. If you want to use an existing FPGA model on another
platform, it might be not sufficient to select the hardware-specific framework.
Some modifications are required.
Intended use cases The automatic migration mechanism is intended primarily to migrate from one
framework to another framework of the same platform:
§ From one SCALEXIO FPGA base board framework to another. For example:
§ From the DS2655 (7K160) FPGA Base Board framework to the DS2655
(7K410) FPGA Base Board framework.
§ From the DS2655 (7K160) FPGA Base Board framework to the DS6601
(KU035) FPGA Base Board framework.
43
May 2024 FPGA Programming Blockset Guide
New Features and Migration
Tip
All FPGA models of the DS2655 (7K160) FPGA Base Board framework can
be migrated to the DS6601 (KU035) FPGA Base Board/DS6602 (KU15P)
FPGA Base Board frameworks. The DS6601 and DS6602 FPGA base
boards are compatible and provide more FPGA resources.
However, you have to use the same I/O modules and to consider the I/O
slot assignments.
§ Before you start a migration, you should make a backup of your model.
§ To build and run a migrated FPGA model, the new FPGA board must have
sufficient FPGA resources.
The parameterization of the found incompatible blocks is empty. You are not
able to reparameterize the blocks concerning the selected framework. While
you have not replaced the incompatible blocks, you can switch back to the
framework used for the configuration to reset the block parameters to their
former values.
44
FPGA Programming Blockset Guide May 2024
Migrating and Updating Existing FPGA Models
Tip
Result The framework analyzes the FPGA custom function and imports the FPGA
parameter settings. At the end of the import process, the FPGA Update dialog
opens. The dialog displays the settings that have been updated.
45
May 2024 FPGA Programming Blockset Guide
New Features and Migration
Introduction The System Generator setup block remains in the FPGA model, but all the
settings for the setup functionality are specified in the FPGA_SETUP_BL block
46
FPGA Programming Blockset Guide May 2024
Migrating and Updating Existing FPGA Models
(it is assumed that you do not use System Generator blocks in various model
hierarchies).
Setup block in the FPGA The FPGA_SETUP_BL block assumes control about the blocks used in the FPGA
subsystem model.
Specifying the framework Before you can configure the blocks from the
FPGA Programming Blockset in your FPGA subsystem, you must specify the FPGA
hardware to be used.
Tracing FPGA signals You can activate the tracing of FPGA signals and
tuning of FPGA constants at run time. Refer to Using Multiple Clock Domains
for FPGA Modeling on page 78.
Using multiple clock domains You can specify subsystems that are
processed with different clock periods. Refer to Using Multiple Clock Domains
for FPGA Modeling on page 78.
Introduction Gateway In/Gateway Out blocks from the HDL library of the AMD Vitis Model
Composer must be replaced by blocks from the FPGA Interface library.
AMD Gateway blocks The Gateway blocks provide the interface between the Simulink inports and
outports and the signals processed within the FPGA model.
A Gateway Out block provides an outport from your FPGA model. It converts
the AMD Vitis Model Composer fixed-point data type into the Simulink double
data type.
Reading a signal with FPGA If the FPGA model reads a signal, you usually have a Simulink Inport block
Interface blocks followed by a Gateway In block that realizes the specified data type conversion.
If the input signal comes from the processor model, you must replace the
Gateway In block with an FPGA_XDATA_READ_BL block. The Simulink Inport
47
May 2024 FPGA Programming Blockset Guide
New Features and Migration
block must also be removed because the counterpart in the processor model
(PROC_XDATA_WRITE_BL block) communicates with the FPGA block without a
signal line.
The replaced blocks from the FPGA Interface library also implement the
necessary data type conversion.
If the input signal comes from an external hardware signal, you must replace
the Gateway In block with an FPGA_IO_READ_BL block. The Simulink Inport
block must also be removed because it is no longer required. The configuration
of the block depends on the signal type, for example, on whether the hardware
delivers an analog or digital input signal.
Writing a signal with FPGA If the FPGA model writes a signal, you usually have a Gateway Out block that
Interface blocks realizes the specified data type conversion, followed by a Simulink Outport.
If the output signal is to be written to the processor model, you must replace
the Gateway Out block with an FPGA_XDATA_WRITE_BL block. The Simulink
Outport must also be removed because the counterpart in the processor model
(PROC_XDATA_READ_BL block) communicates with the FPGA block without a
signal line.
The replaced blocks from the FPGA Interface library also implement the
necessary data type conversion.
If the output signal is used for an external hardware signal, you must replace the
Gateway Out block with an FPGA_IO_WRITE_BL block. The Simulink Outport
must also be removed because it is no longer required. The configuration of the
block depends on the signal type, for example, on whether the hardware expects
an analog or digital output signal.
Introduction With the script interface, you can reset the block parameters of the FPGA
framework to the initial values.
48
FPGA Programming Blockset Guide May 2024
Migrating and Updating Existing FPGA Models
Resetting to the initial values The FPGA Programming Blockset provides a script interface that you can use
to reset the block parameters of the FPGA framework to the initial values by
executing the FPGAFrameworkUpdate script function in the MATLAB Command
Window.
rtifpga_scriptinterface('FPGAFrameworkUpdate',
<SimulinkHandle>, 'ReInit')
The script considers all subsystems that are contained in the model/subsystem
which is specified by the Simulink handle. The parameters of the blocks are reset
to the initial values.
Example: The following script will reset the FPGA framework for any FPGA
subsystems found in the processor model that is called MyProcModel. The
specified values of the block parameters will be set to the initial values.
ProcModelHandle = get_param('MyProcModel','handle')
rtifpga_scriptinterface('FPGAFrameworkUpdate',
ProcModelHandle,'ReInit')
49
May 2024 FPGA Programming Blockset Guide
New Features and Migration
50
FPGA Programming Blockset Guide May 2024
Modeling Aspects and Implementation Workflow
Introduction Introduces to the features of the FPGA Programming Blockset and how you
implement an FPGA application.
Modeling Aspects.................................................................................... 54
Describes general modeling aspects that have no particular context.
Introduction The FPGA Programming Blockset provides dynamically configured dialog settings
and an interface to some development features of the AMD Vitis Model
Composer Blockset.
51
May 2024 FPGA Programming Blockset Guide
Modeling Aspects and Implementation Workflow
Supported third party For modeling the FPGA functionality, the following third-party blockstes are
blocksets supported:
§ The AMD Vitis Model Composer Blockset.
The AMD Vitis Model Composer Blockset is a Simulink block library that lets
you graphically model FPGA applications. The AMD Vitis Model Composer
Blockset requires a separate license.
The FPGA Programming Blockset supports only the HDL library of the AMD
Vitis Model Composer.
§ Simulink blocks to model parts of the FPGA model.
To use Simulink blocks, the Mathworks HDL Coder is required and
the used Simulink blocks must be supported by the HDL Coder.
Refer to https://www.mathworks.com/help/comm/ug/find-blocks-and-system-
objects-supporting-hdl-code-generation.html.
The use of Simulink blocks to model parts of the FPGA model requires
special handling, refer to How to Use Simulink Blocks for Modeling the FPGA
Functionality on page 68.
Hardware-specific settings You can specify the hardware to be used in the block dialog of
the FPGA_SETUP_BL block. After you selected the hardware, the FPGA
Programming Blockset loads the hardware-specific framework. The framework
provides the following interfaces:
§ Communication with the real-time processor via the hardware-specific bus,
such as IOCNET.
§ Access to the I/O channels of the FPGA board.
§ Interrupt handling.
ADC unit
dSPACE
User application framework DAC unit
Function-specific settings The block dialogs have several pages. The Parameters and the Description
pages are empty until you select a function by specifying the access type for
board communication or specifying the I/O type for an I/O access on the Unit
page of a block dialog. These pages are dynamically filled with text and settings
according to the selected function.
52
FPGA Programming Blockset Guide May 2024
Features of the FPGA Programming Blockset
Flexible signal handling To model data exchange via the external I/O pins,
you must only add the I/O block for a specific access direction (read or write)
to the model. The signal type (analog or digital) can be configured in the block
dialog. The availability of the signal types depends on the selected framework.
Interaction with the AMD If you implemented the required functionality of the FPGA application by using
Vitis Model Composer the HDL library of the AMD Vitis Model Composer only, you have direct access
to all its features for configuring, debugging and building the application. If you
want to integrate the FPGA model in a dSPACE system, certain blocks of the
HDL library must be replaced by blocks from the FPGA Programming Blockset.
Most of the above-mentioned features are now available indirectly by using the
blocks from the FPGA Programming Blockset, for example, the timing analysis for
debugging purposes.
53
May 2024 FPGA Programming Blockset Guide
Modeling Aspects and Implementation Workflow
Modeling Aspects
General notes Code generation and the build process are managed by the FPGA Programming
Software. The software uses the AMD Vitis Model Composer to generate
VHDL code and starts the Vivado implementation process, including synthesis,
mapping, routing, and generating the bitstream file.
Notes on the build process The effort required to successfully place and
route an FPGA model increases with the FPGA model content. Starting with an
FPGA utilization of approx. 70%, the probability that an FPGA model cannot
be placed and routed increases exponentially. High FPGA utilization can lead
to unpredictable build aborts. Even the smallest change can lead to an abort.
Therefore, dSPACE recommends to leave enough FPGA resources for changes in
the FPGA model, libraries, or dSPACE FPGA framework.
There are several aspects that determine whether an FPGA model can be
successfully placed and routed. These include:
§ The effectiveness of optimization methods during the build process. The
performance of different versions of the AMD Design Tools increases in
general, but optimizing most FPGA models can impair the performance of
a specific FPGA model.
§ The design of the FPGA model itself:
§ Used libraries might be changed and need more FPGA resources.
§ The FPGA model cannot be mapped to the FPGA architecture efficiently.
For more information, refer to Measuring Device Performance and Utilization: A
Competitive Overview (https://docs.xilinx.com/v/u/en-US/wp496-comp-perf-util)
and UG906 Design Analysis and Closure Techniques (https://docs.xilinx.com/r/en-
US/ug906-vivado-design-analysis).
One subsystem for one FPGA The FPGA application which you implement for one FPGA board must be
board encapsulated in a Simulink subsystem. If the dSPACE hardware provides several
54
FPGA Programming Blockset Guide May 2024
Modeling Aspects
FPGA boards, you must provide a subsystem for each FPGA board you want to
use.
Name of the FPGA application You can specify the name of the FPGA application via the dialog of the
FPGA_SETUP_BL block. The name is used as a description for the built
FPGA application and can be displayed in your experiment software, such
as ControlDesk. For MicroLabBox II, MicroAutoBox III, and SCALEXIO systems,
the FPGA application name is used as the custom function block type in
ConfigurationDesk.
By default, the name of the subsystem is automatically used as the first part of
the application name when you build the FPGA application.
Tip
If you use the same FPGA application name for variants of the FPGA model
for the MicroLabBox II, MicroAutoBox III, or SCALEXIO systems, all the
variants have the same custom function block type. This helps you reuse
FPGA variants in ConfigurationDesk, because you can exchange the FPGA
application without changing the custom function block in the signal chain.
Implementing data exchange Application data that you want to process in the processor model or other
between FPGA application subsystems of your Simulink model must be exchanged via the board-specific
and processor application bus.
You implement the data exchange between the processor application and the
FPGA application by generating processor interface blocks which uses the blocks
from the FPGA Programming Blockset's Processor Interface library.
Note
55
May 2024 FPGA Programming Blockset Guide
Modeling Aspects and Implementation Workflow
Synchronizing FPGA data If different data paths have different length, the data is valid at different points
in time and the outputs are asynchronous. This might cause an unexpected
behavior of your application.
Modeling FPGA tasks with You can set multiple clock domains inside one FPGA model to adapt the clock
individual clock periods period of specific parts of your FPGA application to your requirements.
For instructions, refer to Using Multiple Clock Domains for FPGA Modeling on
page 78.
Methods to access the FPGA You can enable access to the FPGA application with your experiment software
application via experiment when the FPGA application runs on the platform.
software
The following methods to trace and tune FPGA signals are supported:
§ FPGA signal tracing.
§ SCALEXIO systems only: Scope for FPGA signals.
§ Tunable FPGA constants.
§ FPGA test access.
§ FPGA scaling:
§ Scaling of analog I/O signals.
§ Inverting digital I/O signals.
§ Inverting RS232/485 signals.
Modifying models for If you use a MicroLabBox II, MicroAutoBox III, or a SCALEXIO system, you should
a MicroLabBox II, modify the FPGA model or the processor model only in the entire model. If you
MicroAutoBox III, or a export the FPGA build results and the processor model to a ConfigurationDesk
SCALEXIO system project, the project will automatically be updated. You cannot update the entire
model to updates that are done outside of it. Refer to How to Export Build
Results and Processor Models to ConfigurationDesk Projects on page 191.
If you do not use the export functionality, you have to update the model
modifications in ConfigurationDesk.
56
FPGA Programming Blockset Guide May 2024
Typical Workflow for FPGA Modeling
Introduction When you use the FPGA Programming Blockset, there is a typical workflow
which you can follow.
Graph of the workflow The following image shows the workflow that branches for SCALEXIO and
non‑SCALEXIO platforms for integrating the built FPGA application in the
processor application.
57
May 2024 FPGA Programming Blockset Guide
Modeling Aspects and Implementation Workflow
Experiment
Workflow when using It is assumed that you start with a new empty Simulink model.
a MicroLabBox II, 1. Create at least two subsystems in the Simulink model:
MicroAutoBox III, or § A subsystem for the processor model that is executed on the processor
SCALEXIO system board.
§ One subsystem for each FPGA board that you want to use with your
processor model.
2. Implement the FPGA functionality. Refer to Modeling FPGA Functionality on
page 67.
58
FPGA Programming Blockset Guide May 2024
Typical Workflow for FPGA Modeling
Do not use the Gateway In and the Gateway Out blocks in the subsystem.
If you use an existing FPGA model, you have to replace the Gateway In and
Gateway Out blocks with blocks from the FPGA Programming Blockset.
3. Specify the interface of the FPGA.
You must firstly add the FPGA_SETUP_BL block to the FPGA subsystem
and specify general settings such as the framework and the I/O modules
to be used with the block's dialog. Then you can add the required blocks
from the FPGA Programming Blockset to the FPGA subsystem to implement
read/write access to external I/O and to exchange data with the behavior
model.
Note
59
May 2024 FPGA Programming Blockset Guide
Modeling Aspects and Implementation Workflow
12. Execute the entire model on the real-time hardware for experimenting. For
further information, refer to Experimenting with an FPGA Application on
page 229.
Workflow when using a It is assumed that you start with a new empty Simulink model.
MicroAutoBox II or a 1. Create a subsystem in the Simulink model.
MicroLabBox There must be always a root model that is executed on the processor board
and one FPGA subsystem for each FPGA board that you want to use for your
processor application.
2. Implement the desired FPGA functionality. Refer to Modeling FPGA
Functionality on page 67.
Do not use the Gateway In and the Gateway Out blocks in the subsystem.
If you use an existing FPGA model, you have to replace the Gateway In and
Gateway Out blocks with blocks from the FPGA Programming Blockset.
3. Specify the interface of the FPGA
You must first add the FPGA_SETUP_BL block to the FPGA subsystem and
specify general settings such as the framework to be used with the block's
dialog. Then you can add the required blocks from the FPGA Programming
Blockset to the FPGA subsystem to implement read/write access to external
I/O and to exchange data with the processor model.
Note
60
FPGA Programming Blockset Guide May 2024
Features of the MicroLabBox Flexible I/O Framework
You can integrate the programming of the FPGA into the processor
application or generate a separate burn application to integrate the
programming. For further information, refer to How to Build Single-Core
Processor Applications (MicroAutoBox II, MicroLabBox) on page 200 and
How to Create Burn Applications for MicroAutoBox II on page 203.
9. Simulate the entire model in Simulink simulation mode or execute it on
the real-time hardware for experimenting. For further information, refer to
Simulating a Processor Model on page 175 and Experimenting with an FPGA
Application on page 229.
Introduction The DS1202 FPGA IO Type 1 (Flexible I/O) framework lets you model real-time
applications for MicroLabBox together with the RTI1202 and the RTI Electric
Motor (EMC) blocksets.
Features of the DS1202 FPGA The framework provides the following features:
I/O Type 1 (Flexible I/O) § During the build process of the custom FPGA application, the standard I/O
framework features for remaining I/O channels are added. The standard I/O features let
you use the remaining I/O channels with the RTI1202 and the EMC blocksets.
§ The framework provides the same blocks as the DS1202 FPGA I/O Type 1
framework.
§ The framework is compatible with the DS1202 FPGA I/O Type 1 framework.
You can switch between the DS1202 FPGA I/O Type 1 (Flexible I/O) and the
DS1202 FPGA I/O Type 1 frameworks. The compatibility lets you save time
when you model and test the the FPGA application. Refer to Workflow when
Using MicroLabBox Flexible I/O Framework on page 62.
61
May 2024 FPGA Programming Blockset Guide
Modeling Aspects and Implementation Workflow
§ I/O channels that are used by the DS1202 FPGA I/O Type 1 (Flexible I/O)
framework are marked within the RTI1202 and the EMC blocksets with an
asterisk.
You must not access the same channel with the DS1202 FPGA I/O Type 1
(Flexible I/O) framework and the RTI1202 or EMC blocksets.
Note
Overview of the RTI Electric Motor Control Blockset (RTI Electric Motor Control
Blockset Reference )
References
Introduction Building FPGA applications with the DS1202 FPGA I/O Type 1 framework is
substantially faster than building FPGA applications with the DS1202 FPGA
I/O Type 1 (Flexible I/O) framework. The implementation of the standard I/O
features, which let you use the remaining I/O channels with the RTI1202 and the
EMC blocksets, takes additional FPGA resources and more build time.
The compatibility of the frameworks lets you use the DS1202 FPGA I/O Type 1
framework for modeling and testing and the DS1202 FPGA I/O Type 1 (Flexible
I/O) framework for building the final FPGA application including the standard I/O
features for the remaining I/O channels.
62
FPGA Programming Blockset Guide May 2024
Workflow when Using MicroLabBox Flexible I/O Framework
Recommended workflow 1. Model, test, and build the FPGA application with the DS1202 FPGA I/O
Type 1 framework until you have the final version.
2. Open the FPGA SETUP BL dialog and select the DS1202 FPGA I/O Type 1
(Flexible I/O) framework.
A Framework Incompatibilities confirmation prompt and a Framework
Upgrade confirmation prompt are displayed. Confirm both prompts.
3. Build the final FPGA application. Refer to How to Build FPGA Applications
(MicroAutoBox II, MicroLabBox) on page 195.
4. Generate the processor interface for the processor model. Refer to How to
Generate a Processor Interface on page 148.
5. Use the RTI1202 and the EMC blocksets to access the remaining I/O
channels. Refer to MicroLabBox RTI Reference and RTI Electric Motor
Control Blockset Reference .
6. Build the processor application. Refer to How to Build Single-Core Processor
Applications (MicroAutoBox II, MicroLabBox) on page 200.
The build process makes sure that no I/O channel is accessed multiple times,
for example, by the FPGA application and the processor application.
7. Download the application to MicroLabBox.
Modifying the FPGA I/O The DS1202 FPGA I/O Type 1 (Flexible I/O) framework cannot display whether
interface an I/O channel is already used by a processor application. If you modify the FPGA
I/O interface, you must ensure that no I/O channel is used multiple times.
63
May 2024 FPGA Programming Blockset Guide
Modeling Aspects and Implementation Workflow
64
FPGA Programming Blockset Guide May 2024
Modeling the FPGA Functionality and the Access to I/O Channels
Introduction The FPGA Programming Blockset is a Simulink blockset for using an FPGA model
created with the AMD Vitis Model Composer Blockset on a dSPACE FPGA board.
Using a Watchdog................................................................................... 86
Implementing a watchdog to check if the processor application is alive.
65
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
66
FPGA Programming Blockset Guide May 2024
Modeling FPGA Functionality
You model the FPGA functionality with blocks of the HDL library of the AMD
Vitis Model Composer. Alternatively, you can use Simulink blocks. Refer to Using
Simulink blocks for FPGA modeling on page 68.
The FPGA interface to the board-specific bus and I/O channels is provided by the
FPGA Programming Blockset. Do not use the Gateway In and Gateway Out
blocks of the AMD Vitis Model Composer blockset. For more information on
the HDL library of the AMD Vitis Model Composer, refer to the AMD user
documentation.
The dSPACE FPGA boards provide multiple clock domains for modeling specific
parts of your FPGA design with an individual clock period. For instructions, refer
to How to Use Multiple Clock Domains for FPGA Modeling on page 81.
Reusing existing FPGA models You can adapt existing FPGA models based on the HDL library of the AMD
Vitis Model Composer to use them on the dSPACE hardware. Refer to Adapting
Existing FPGA Models to be Used on dSPACE Hardware on page 46.
67
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Using Simulink blocks for The FPGA Programing Blockset supports subsystems in the FPGA model that
FPGA modeling are modeled with Simulink blocks (HDL coder subsystems). This feature lets you
directly use existing Simulink models in your FPGA application. For example: You
can use a Simulink model of a controller for first functionality tests before you
optimize the FPGA utilization of the controller.
The use of Simulink blocks to model parts of the FPGA model requires
special handling, refer to How to Use Simulink Blocks for Modeling the FPGA
Functionality on page 68.
Note on modeling with AMD If you use Black Box blocks from the AMD Toolbox to incorporate hardware
Black Box blocks description language models, the files of the incorporated models must be
located in special folders before you start the FPGA build process. The following
table lists the folders that you can use.
The special folders are mandatory for the build process, because the FPGA
Programming Blockset automatically copy all files to the build folder before the
build starts. If the files are outside the given folders, they are not available for the
build process.
HowTos
Objective Using subsystems based on Simulink blocks (HDL coder subsystems) to model
parts of the FPGA model.
68
FPGA Programming Blockset Guide May 2024
Modeling FPGA Functionality
Basics The FPGA Programming Blockset provides gateway blocks to use Simulink
models directly as part of your FPGA model. The gateway blocks transfer the
signals and buses between the separated model parts.
During the build process, the following tools generate the HDL code:
§ The MathWorks© HDL CoderTM generates the VHDL code from blocks of the
Simulink blockset.
§ The AMD Vitis Model Composer generates the VHDL code from blocks of the
HDL library of the AMD Vitis Model Composer and the FPGA Programming
Blockset.
The build process merges the individual VHDL codes into a synthesizable overall
model. Using MathWorks HDL coder does not affect the MATLAB compatibility
of the FPGA Programming Blockset, because only parts of the FPGA model can
be modeled with Simulink blocks.
Demo The DemoHDLCoder model shows how to use the gateway blocks. Double-click
the Demo button in the blockset to open the library containing the demo
models.
69
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
The following illustration shows you an example with a Simulink bus and
two signals as inputs.
When you start the build process, the process automatically detects the different
parts of the FPGA model to select the correct code generator for VHDL code
generation.
70
FPGA Programming Blockset Guide May 2024
Modeling FPGA Functionality
DSPs can cause timing Adding a DSP with a latency greater than z-0 to a down-sampled path can result
problems in down-sampled in a timing problem.
paths
Note
100 MHz
C Q C Q
CE 42 ns CE
D D
DFF Combinatorial logic DFF
50 ns
DSP problem The normal mechanism of simply increasing block latency for
DSPs does not work in down-sample paths due to its mechanisms:
§ An n-time down-sample path enables each element on its path using the chip
enable (CE) port only at every n-th clock cycle.
§ Additionally, a timing constraint is generated that allows n-times the time
between two flip-flops on the down-sample path for all elements with a CE
port.
DSPs do not have a CE port, so they cannot support the normal mechanism. This
means that DSPs cannot transfer the timing constraint to their flip-flops.
The following illustration shows the problem. In the example, a DSP is added to
the down-sampled path.
100 MHz
C Q C Q
CE 42 ns z-3 47 ns CE
D D
DFF DSP DFF
10 ns 10 ns
Remedy Take the flip-flops out of the DSP into the down-sample path,
because the flip-flops themselves have a CE-port. This can be done by a
modeling trick: Add a Delay block from the HDL library of the AMD Vitis Model
71
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Composer after the DSP and Vivado automatically moves the flip-flops behind
the time-critical object within the DSP. The latency of the Delay block must
match the latency of the DSP.
The following illustration shows the modified DSP in the down-sample path. The
timing constraints are now effective between flip-flops.
100 MHz
C Q C Q
CE 42 ns z-0 z-3 47 ns CE
D D
DFF DSP Delay DFF
50 ns 50 ns
Troubleshooting For known build problems and their solution, refer to Building an FPGA
application on page 262
72
FPGA Programming Blockset Guide May 2024
Modeling External I/O Access
Introduction The FPGA Programming Blockset provides a block for accessing input channels of
the FPGA board.
Type and number of input The FPGA_IO_READ_BL block provides read access to an input channel of the
channels hardware used. You can select different types of input channels depending on
the framework for the FPGA board or piggyback module.
The channel list only provides input channels that are not already assigned to a
block.
Note
73
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
I/O mapping for the input For the mapping between the input channels and the I/O connector pins,
channels refer to the hardware-specific description in the FPGA Programming Blockset -
FPGA Interface Reference . For example, for the I/O mapping of the input
channels defined by the DS1303 (KU15P) Multi-I/O Board framework, refer
to Parameters Page (FPGA_IO_READ_BL) (FPGA Programming Blockset - FPGA
Interface Reference ).
Function-specific settings of After you have selected an input channel, the function-specific settings
the FPGA_IO_READ_BL block are loaded on the Parameters page where you can configure them. For
detailed information, refer to the FPGA Programming Blockset - FPGA Interface
Reference .
Tip
You can copy & paste previously configured interface blocks of the FPGA
Programming Blockset. The blockset automatically analyzes the FPGA model
and reassigns new hardware resources.
You can speed up the copy & paste process for the current
session by deactivating the automatic reassignment of new hardware
resources. Open the Advanced Preferences dialog and set the
PASTE_KEEP_CHANNEL_NUM preference to false. Refer to Dialog
Settings of the Advanced Preferences Dialog (FPGA Programming Blockset -
FPGA Interface Reference ).
Introduction The FPGA Programming Blockset provides a block for accessing output channels
of the FPGA board.
Type and number of output The FPGA_IO_WRITE_BL block is providing write access to an output channel
channels of the hardware used. Depending on the framework for the FPGA board or
piggyback module, you can select different types of output channels.
74
FPGA Programming Blockset Guide May 2024
Modeling External I/O Access
The channel list provides only output channels that are not already assigned to a
block.
Note
I/O mapping for the output For the mapping between the output channels and the I/O connector pins,
channels refer to the hardware-specific description in the FPGA Programming Blockset -
FPGA Interface Reference . For example, for the I/O mapping of the output
channels defined by the DS1303 (KU15P) Multi-I/O Board framework, refer
to Parameters Page (FPGA_IO_WRITE_BL) (FPGA Programming Blockset - FPGA
Interface Reference ).
Function-specific settings of After you have selected an output channel, the function-specific settings
the FPGA_IO_WRITE_BL block are loaded to the Parameters page, where you can configure them. For
detailed information, refer to the FPGA Programming Blockset - FPGA Interface
Reference .
Tip
You can copy & paste previously configured interface blocks of the FPGA
Programming Blockset. The blockset automatically analyzes the FPGA model
and reassigns new hardware resources.
You can speed up the copy & paste process for the current
session by deactivating the automatic reassignment of new hardware
resources. Open the Advanced Preferences dialog and set the
PASTE_KEEP_CHANNEL_NUM preference to false. Refer to Dialog
Settings of the Advanced Preferences Dialog (FPGA Programming Blockset -
FPGA Interface Reference ).
Introduction Read and write accesses to external devices depend on the platform.
75
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Demo model The demo model below contains some FPGA_IO_READ_BL and
FPGA_IO_WRITE_BL blocks configured with different I/O functions to show
how they will be connected to the hardware.
Effects in a MicroLabBox II, The FPGA_IO_READ_BL and FPGA_IO_WRITE_BL blocks provide different
a MicroAutoBox III, or a types of I/O functions for the MicroLabBox II, MicroAutoBox III, or SCALEXIO
SCALEXIO system system:
§ I/O functions without external connection, for example, Status In, LED
Out or APU Slave, are not represented in the FPGA custom function in
ConfigurationDesk and can only be handled within the FPGA subsystem.
§ I/O functions with external connection provide their signals as signal ports in
ConfigurationDesk.
76
FPGA Programming Blockset Guide May 2024
Modeling External I/O Access
FPGA
77
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Using multiple clock domains When you use multiple clock domains, the FPGA application must be partitioned
in one application into subsystems, where each subsystem has an individual clock period.
The subsystems are decoupled via logic blocks from the HDL library of the AMD
Vitis Model Composer. The following logic blocks can be used for decoupling:
FIFO block, Dual Port RAM block, Register block, or Black Box block. As a
result, only the FPGA_Setup_BL block and the listed logic blocks for decoupling
can be added to the top level of your FPGA model as shown in the following
illustration.
78
FPGA Programming Blockset Guide May 2024
Using Multiple Clock Domains for FPGA Modeling
Note
Customizing the update rate The update rate of digital I/O functions depend on the FPGA clock period. Digital
of digital I/O I/O functions of a SCALEXIO system or a MicroAutoBox II/III can be used with an
individual clock period to customize the update rate.
A higher update rate increases the time resolution to generate or sample a digital
signal. A higher update rate does not affect the minimum pulse duration or
frequency of the digital channel.
If you implement a UART communication, you can adapt the update rate to the
require baud rate.
For maximum update rates of digital I/O, refer to Limitations on Using Multiple
Clock Domains on page 80.
Specifying clock domains The FPGA Programming Blockset supports the following methods to specify the
clock period for clock domains:
§ In the FPGA_Setup_BL block dialog, you can specify clock periods for up to
ten subsystems. The specified clock periods are derived from the FPGA clock.
79
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
For instructions, refer to How to Use Multiple Clock Domains for FPGA
Modeling on page 81.
§ MicroAutoBox III and SCALEXIO systems only: You can use a customized
clocking circuit (user clock) as clock domain source. For example, you can use
the user clock of the MGT interface to process the data synchronous to the
MGT transceiver.
For instructions, refer to How to Use a Customized Clocking Circuit as Clock
Domain Source on page 84.
More information on using For more information on the hardware design for using multiple independent
multiple clock domains clocks, refer to https://docs.xilinx.com/r/en-US/ug897-vivado-sysgen-user/Timing-
and-Clocking.
Limitations § Only the following I/O blocks of the FPGA Programming Blockset can be used
with individual clock periods:
§ DS2655M1: All digital I/O blocks, except Digital InOut
§ DS2655M2: All I/O blocks, incl. UART
§ DS6651: All digital I/O blocks, including the Trigger I/O block.
§ DS1552: All digital I/O blocks, incl. UART
§ DS1554: All digital I/O blocks
All other blocks must be used with the base rate of the FPGA base board, such
as blocks for analog I/O and processor communication.
Maximum update rate of The update rate (FPGA clock frequency) can theoretically be increased up to the
digital I/O maximum frequency of the clock buffers (BUFG) and IO buffers (BUFIO) of the
FPGA. However, this theoretical value cannot be implemented. The following
table gives an indication of configurable update rates.
80
FPGA Programming Blockset Guide May 2024
Using Multiple Clock Domains for FPGA Modeling
Objective You can use multiple clock domains for modeling parts of your FPGA design with
individual clock periods.
Preconditions The FPGA_SETUP_BL block is added to the FPGA model and a suitable
framework is selected.
81
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
5 Specify the clock and simulation period for the selected subsystem:
§ The value for the offline simulation period must be greater than or equal
to the clock period of the selected subsystem.
§ Set the clock period of subsystems with I/O functions that do not support
individual clock periods to the FPGA clock period. Refer to Limitations on
Using Multiple Clock Domains on page 80.
The FPGA clock period is displayed on the Analysis tab of the
FPGA_SETUP_BL block.
After entering the clock period, the dialog recalculates all clock periods for
a clock setup with a minimum error for all clock periods. After recalculation,
the dialog immediately updates the clock period's values to the calculated
values in double precision.
6 Repeat steps 4 ... 5 until you specified the clock period for all subsystems.
7 Verify all recalculated clock periods.
Result Subsystems of the FPGA model are driven with individual clock periods.
Introduction The FPGA Programming Blockset provides the system clock signal and clock
signals of other subsystems to use Black Box blocks of the AMD Vitis Model
Composer that require multiple clock signals.
82
FPGA Programming Blockset Guide May 2024
Using Multiple Clock Domains for FPGA Modeling
Framework support The SCALEXIO and the MicroAutoBox III frameworks provide the System Clock
and Subsystem Clock blocks to provide clock signals of another clock domain.
Block Description
Outputs the clock signal of the FPGA (base clock rate).
Example The following example shows a part of a MGT communication model using a
customized protocol.
A user clock is used as the clock domain for the subsystem to process MGT data
synchronous to the MGT transceiver. To generate the user clock, the AURORA
Black Box block requires the clock of the MGT transceiver (MGT In block) and
the FPGA base clock rate (System Clock 1 block).
83
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Objective Using a customized clocking circuit (user clock) as clock domain source, for
example, to process MGT data synchronous to the MGT transceiver.
84
FPGA Programming Blockset Guide May 2024
Using Multiple Clock Domains for FPGA Modeling
3 Open the subsystem and add a User Clock Out block of the FPGA
Interface sublibrary.
4 Connect the user clock of your Black Box block to the User Clock port of
the User Clock Out block.
5 Open the User Clock Out block dialog.
6 On the Parameters page, enter the following clock values:
§ The expected user clock period.
The value is used during the build process when no user clock is available,
for example, to specify timing constraints.
§ The clock period during offline simulation.
Result The subsystem of the FPGA model is driven with the user clock period.
85
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Using a Watchdog
Introduction Implementing a watchdog to check if the processor application is alive.
Limitation Only the following FPGA boards support the watchdog functionality:
§ DS6601 FPGA Base Board
§ DS6602 FPGA Base Board
§ MicroLabBox II
Basics on the watchdog timer There are two timeout modes to configure the expiration of the watchdog timer:
§ You can use a fixed timeout, i.e., you specify a time interval in seconds that
does not change.
The fixed timeout is useful if a periodic task triggers the keep-alive signal.
§ You can use an adaptive timeout, i.e., you specify a factor by how much
longer than the last task execution time to wait for the keep-alive signal. In
this mode, the watchdog measures the time interval between the last two
keep-alive signals and multiplies it by the specified factor to constantly adjust
the timeout value.
The adaptive timeout is useful if an asynchronous task triggers the keep-alive
signal.
If the specified time interval expires without a keep-alive signal being transmitted
to the FPGA application, the watchdog timer expires and outputs a timeout.
86
FPGA Programming Blockset Guide May 2024
Using a Watchdog
If the watchdog timer expires before the processor application transmits the
keep-alive signal, the Status port changes from 1 to 0.
2 Add the FPGA functionality that is executed when the watchdog expires.
Trigger the execution of the FPGA functionality with the Status port of the
watchdog.
Interim result You added the watchdog to the FPGA model and implemented the functionality
if the watchdog expires.
87
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Result You added the watchdog functionality to the FPGA model and the generation of
the keep-alive signal to the FPGA model.
Tip
Next steps After you built the FPGA application and exported it to ConfiguratinDesk, you
can map the trigger signal to the FPGA custom function block and specify the
trigger condition for the watchdog. Refer to How to Configure the Condition
when the Watchdog Expires on page 88.
Basics on the watchdog timer For basics on the watchdog timer, refer to How to Implement the Watchdog on
page 86.
88
FPGA Programming Blockset Guide May 2024
Using a Watchdog
2 In the Properties Browser, select the timeout mode for the watchdog.
3 If you selected the fixed timeout mode, enter a fixed timeout in seconds.
4 If you selected an adaptive timeout, enter an integer factor by how much
longer than the last task execution time the watchdog timer waits for the
keep-alive signal.
5 To activate the watchdog feature, map the Trigger function inport to the
Trigger model port of the behavior model.
Result You configured the timeout for the watchdog timer. If the specified time interval
expires without a keep-alive signal being transmitted to the FPGA application,
the watchdog timer expires and outputs a timeout to trigger the implemented
FPGA functionality.
If a timeout occurs, you must restart the real-time application to reset the
watchdog.
Tip
89
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Introduction The DS6602 FPGA Base Board provides a 4 GB DDR4 RAM that can be used by
the FPGA application.
The RAM interface always handles 512 bits at once. Therefore, the FPGA
application can read/write 16 x 32 bits data or 8 x 64 bits data within one
memory access.
You can select different I/O types to access the DDR4 RAM:
§ DDR4 32 Mode 1 and DDR4 64 Mode 1 to read/write 32/64-bit values.
These I/O types use the memory access mode 1.
§ DDR4 32 Mode 2 and DDR4 64 Mode 2 to read/write 32/64-bit values.
These I/O types use the memory access mode 2.
Tip
The DDR4 RAM processes the data values as raw data. To use certain data
types, such as single, you have to add Reinterpret blocks from the HDL
library of the AMD Vitis Model Composer to the FPGA model.
90
FPGA Programming Blockset Guide May 2024
Modeling DDR4 RAM Access
Memory access modes The FPGA Programming Blockset provides two memory access modes:
§ Mode 1
Mode 1 addresses one memory area of 512 bits, each with read/write access.
§ Mode 2
Mode 2 addresses two memory areas of 256 bits, each with read/write access.
The following example shows the memory areas addressed by the different
access modes.
Mode 1 Mode 2
2 1024 4 1024
768 3 768
1 512 2 512
256 1 256
Note
The memory areas are addressed differently by the different access modes.
Optimizing read/write access To decrease the read/write time, use consecutive addresses for read/write
accesses. A random address access approximately triples the read/write time:
References
91
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Introduction You can provide a workspace variable with initial values for the RAM memory to
simulate the FPGA application with defined DDR4 RAM data values.
Generating an initialization The initialization variable is a MATLAB workspace variable. You can use one of
variable the following MATLAB scripts to generate an initialization variable.
Initializing the RAM with the To initialize the RAM at the beginning of the offline simulation, you have to
variable enter the variable name to the Simulation init variable parameter on the
Parameters page of the used DDR4 block.
92
FPGA Programming Blockset Guide May 2024
Modeling DDR4 RAM Access
Introduction You can provide a file with initial values for the RAM memory to start the FPGA
application with defined DDR4 RAM data values. The processing hardware writes
the initial values from a SCALEXIO SSD to the FPGA base board during the
initialization phase of the SCALEXIO system.
Generating an initialization The initialization file is a binary file. You can use the following MATLAB script to
file generate an initialization file with MATLAB.
% generate sample 32 bit values (4GB – 1 Word) 1..2^30-1 (2^30*4 Byte = 4 GB)
% generate sample 64 bit values (4GB – 1 Word) 1..2^29-1 (2^29*8 Byte = 4 GB)
ddr4_4gb = 1:2^30-1;
% open, write, close file
fid = fopen('ddr4_4gb.bin', 'w');
fwrite(fid, ddr4_4gb, 'uint32');
% or as different data type
% fwrite(fid, ddr4_4gb, 'single');
% fwrite(fid, ddr4_4gb, 'double');
% 64 bit -> use only half as many elements
…
fclose(fid)
Note
You can use any data type to initialize the DDR4 RAM.
93
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Providing the initialization You download the initialization file to a SCALEXIO SSD to provide the initial
file to the SCALEXIO system values. For instructions, refer to How to Initialize the DDR4 RAM of the DS6602
(ConfigurationDesk I/O Function Implementation Guide ).
94
FPGA Programming Blockset Guide May 2024
Modeling UART Communication
95
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Accessing the demo Open the block library and select Demos – DemoFPGAuart –
DS2655_XC7K160T.
Demo overview The following illustration shows the FPGA model with the subsystem of a
RS232_UART model block.
The demo model provides eight UART communication interfaces: Four RS232
interfaces and four RS485 interfaces. The main component for all interfaces is
the Buffer UART model block that resides in every UART subsystem.
Using the demo You can use the Buffer UART model block in your FPGA application to
implement a UART communication interface in your project.
96
FPGA Programming Blockset Guide May 2024
Modeling UART Communication
§ Controls the sequential write to a Buffer Out block to send received UART
frames to the processor application.
I/O characteristics The following table describes the ports of the block:
Port Description
Input
rst Resets the model block.
Value range:
§ 0: No reset
§ 1: Reset
din Receives new data value to be sent with an UART frame.
Data type: UFix_32_0
Value range: Depends on the specified number of data bits of the UART frame.
data_new Indicates a change in the buffer status of a connected Buffer In interface block.
Data type: UFix_1_0
data count Specifies the current number of elements in the buffer of a connected Buffer In interface block.
Data type: UFix_16_0
RX Receives the UART frame as a sequence of bits.
Data type: UFix_1_0
divider Specifies the clock divider value to set the baud rate of the UART interface. You can calculate the
value for the clock divider to set the baud rate as follows:
1
Clock divider = −1
Baud rate · 32 ns
For values to set common baud rates, refer to Settings for common baud rates on page 98.
Data type: Fix_32_0
The value range depends on the maximum baud rate of the UART interface hardware:
§ RS232: 125 ... nmax
§ RS485: 1 ... nmax
97
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Port Description
data_bits Specifies the number of data bits. The data bits include optional parity bits and exclude the start bit
of the UART frame.
Data type: Fix_32_0
Value range: 5 ... 9
stop_half_bits Specifies the number of stop half-bits of the UART frame. The number value specifies the number of
half bits. For example: 2 specifies 1 stop bit in the frame.
Data type: Fix_32_0
Value range: 1 ... 5
Output
addr Outputs the buffer address of the next element in a Buffer In interface block to be sent with the
next frame.
Data type: UFix_16_0
dout Outputs the data value of the received UART frame at the RX port.
Data type: UFix_32_0
Value range: Depends on the specified number of data bits of the UART frame.
we Specifies that the current value of the dout port is valid to control a connected Buffer Out interface
block.
Data type: UFix_1_0
TX Outputs the UART frame as a sequence of bits.
Data type: UFix_1_0
Settings for common baud The following table gives you clock divider values for the divider port to set the
rates UART interface to a common baud rate:
98
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
99
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Overview of inter-FPGA The following table shows the different types of inter-FPGA communication
communication between between SCALEXIO FPGA base boards.
SCALEXIO boards
Inter-FPGA via I/O Module Inter-FPGA via MGT Inter-FPGA via IOCNET
Slots Module
Topology 1:1 1:1 1:n
FPGA stack1) Next to each other No restriction § Within the same IOCNET
location segment2)
§ Other I/O boards must not
be connected to this IOCNET
segment.
Number of direct 2 4 Not directly limited
connections
Data rate Max. 582.3 Mbit/s with default Max. 10.3125 Gbit/s with § 1.25 Gbit/s IOCNET:
values Aurora 64b66b 128 Bit Approx. 800 Mbit/s
block § 2.5 Gbit/s IOCNET:
Typ. 1 Gbit/s, max.
1.6 Gbit/s3)
Latency 72 ns … 96 ns with default Typ. 384 ns, max. 472 ns Typ. 1.0 µs per network hop,
values for single words including onboard hops
Supported FPGA § DS2655 § DS6601 § DS2655
base boards § DS6601 § DS6602 § DS6601
§ DS6602 § DS6602
Required accessory SCLX_INT_FPGA_CAB1 DS6601_MGT1 or –
DS6602_MGT1
1) FPGA base board with installed I/O modules.
2) Refer to Implementing Inter-FPGA Communication via IOCNET on page 101.
3) Theoretical maximum
Implementing the inter-FPGA To implement an inter-FPGA communication bus, you have to implement the
interface functionality to the FPGA model.
100
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
Introduction IOCNET can be used to transfer data directly between FPGA boards of a
SCALEXIO system.
Basic interface characteristics You have to consider the following interface characteristics if you implement
inter-FPGA communication via IOCNET.
§ Up to 32 channels to transmit 32-bit values and up to 32 channels to transmit
64-bit values can be implemented.
§ The data rate depends on the IOCNET data rate:
§ 1.25 Gbit/s IOCNET:
About 800 Mbit/s
§ 2.5 Gbit/s IOCNET:
Typ. 1 Gbit/s, max. 1.6 Gbit/s theoretical
§ The latency is typ. 1 µs per network hop. Refer to Calculating the Latency
(IOCNET) on page 103.
§ Each 32-bit channel can address up to 1024 data values.
§ Each 64-bit channel can address up to 512 data values.
§ The data type is a raw data type: UFix_32_0 or UFix_64_0.
You can transfer any data type with a matching bit width via inter-FPGA over
IOCNET. Use the Reinterpret block from the HDL library of the AMD Vitis
Model Composer to change your data type to UFix_32_0 or UFix_64_0 and
vice versa. Reinterpreting data types does not cost any hardware or latency.
Restrictions on the IOCNET Inter-FPGA via IOCNET can only be used for FPGA base boards if the following
topology requirements on the IOCNET topology are fulfilled:
§ The boards are installed to the same IOCNET segment. An IOCNET segment
are the IOCNET nodes (I/O unit/LabBox/AutoBox) that are linked in serial to the
processing hardware. The following illustrations shows an example.
101
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Downlink
Downlink
IOCNET segment
Tip
§ Other I/O boards must not be connected to the used IOCNET segment.
Adding the inter-FPGA The frameworks of the FPGA base boards provide inter-FPGA blocks to add the
communication functionality inter-FPGA communication functionality to the FPGA application.
to the FPGA application
For more information, refer to the following topics:
§ Block Settings for the DS2655 FPGA Base Board Framework (FPGA
Programming Blockset - FPGA Interface Reference )
§ Block Settings for the DS6601 FPGA Base Board Framework (FPGA
Programming Blockset - FPGA Interface Reference )
§ Block Settings for the DS6602 FPGA Base Board Framework (FPGA
Programming Blockset - FPGA Interface Reference )
Specifying the inter-FPGA After you added the FPGA application to the signal chain in ConfigurationDesk,
connections you can reference the Inter-FPGA In blocks to the Inter-FPGA Out blocks to
specify the communication bus.
102
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
Latency calculation The latency depends on the network hops between the FPGA base boards. A
network hop occurs when a data packet is passed from one network connection
to the next. Each hop takes about 1.0 µs.
To calculate the latency, you have to count the IOCNET routers between the
FPGA base boards, including the onboard routers.
Tip
Example #1 The following illustration shows a topology with 3 network hops between the
FPGA base boards.
Example #2 The following illustration shows a topology with 5 network hops between the
FPGA base boards.
103
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Introduction Multi-gigabit transceiver (MGT) modules can be used to transfer data directly
between FPGA boards of a SCALEXIO system.
Basic interface characteristics You have to consider the following interface characteristics if you implement
inter-FPGA communication via MGT modules.
§ MGT modules are optional modules that must be installed to the FPGA base
board.
§ Up to 4 channels to transmit data values to up to 4 FPGA base boards.
§ The maximum data rate is 10.3125 Gbit/s if you use an Aurora 64b66b 128
Bit block.
§ The typical latency is 384 ns for single words. The maximum latency is 472 ns.
§ Each 64-bit channel can address up to 512 data values.
§ The data type is a raw data type: UFix_32_0 or UFix_64_0.
You can transfer any data type with a matching bit width via inter-FPGA over
IOCNET. Use the Reinterpret block from the HDL library of the AMD Vitis
Model Composer to change your data type to UFix_32_0 or UFix_64_0 and
vice versa. Reinterpreting data types does not cost any hardware or latency.
Adding the inter-FPGA The DS660X_MGT framework provides I/O functions to transmit and receive data
communication functionality via an installed MGT module using the Aurora protocol, but you can also use
to the FPGA application customized protocols.
104
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
Introduction With the Inter-FPGA Interface framework, the I/O module slots of the SCALEXIO
FPGA base boards can be used to establish an inter-FPGA communication bus.
105
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Basic interface characteristics You have to consider the following interface characteristics if you implement
inter-FPGA communication via I/O module slots.
§ The inter-FPGA communication bus is a point-to-point one-way
communication. It is implemented directly between the connected FPGA
boards without using IOCNET.
§ An inter-FPGA communication cable can only connect FPGA base boards that
are installed next to each other. Therefore, up to two FPGA base boards can be
directly connected to an FPGA base board. For an example, refer to Inter-FPGA
communication between multiple SCALEXIO FPGA base boards on page 109.
§ The maximum data rate is 582.3 Mbit/s with default values. Refer to
Calculating the Data Rate and Latency (SCALEXIO) on page 114.
§ The latency is 72 ns … 96 ns with default values. Refer to Calculating the Data
Rate and Latency (SCALEXIO) on page 114.
§ The maximum data width for inter-FPGA communication with bus
synchronization is 27 bits.
The interface provides a 28‑bit parallel data bus. One data bit of each subbus
is reserved for synchronization purposes.
In expert mode, the Inter-FPGA Interface framework provides inter-FPGA
communication without bus synchronization. In this mode, the maximum data
width for inter-FPGA communication is 28 bits.
§ You can configure up to eight subbuses for each inter-FPGA communication
bus.
§ Inter-FPGA communication between different types of SCALEXIO FPGA boards
is supported. For example: A DS2655 FPGA Base Board can be connected to a
DS6601 FPGA Board and a DS6602 FPGA Base Board.
Adding the inter-FPGA The Inter-FPGA Interface framework provides the functionality to implement the
communication functionality inter-FPGA communication. You must select the framework on the Platform
to the FPGA application tab of the FPGA_SETUP_BL block. With the selection you also specify the I/O
module slot that supports the inter-FPGA communication.
106
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
For instructions, refer to How to Specify I/O Module Slots of SCALEXIO FPGA
Base Boards as Inter-FPGA Interfaces on page 110.
Specifying the inter-FPGA The I‑FPGA In and I‑FPGA Out I/O blocks let you specify the inter-FPGA
communication communication.
The blocks' dialogs let you enable an expert mode. In expert mode, you can
implement an inter-FPGA communication bus without bus synchronization or
you can change the default values for clock, bit length, and filter depth. For
robust communication, it is not recommended to activate expert mode if you do
not have enough experience with configuring buses and knowledge of checking
whether the configured transmission is correct with regard to the observed signal
integrity at the applicable temperature range.
For more information on the inter-FPGA I/O functions, refer to Block Settings
for the Inter-FPGA Interface Framework (FPGA Programming Blockset - FPGA
Interface Reference ).
Configuring subbuses Eight communication channels let you use up to eight subbuses. If you configure
subbuses, you can access a specific subbus by specifying a bit range with the
related start bits and end bits in the Parameters pages of the inter-FPGA I/O
block dialogs. The bit ranges of the subbuses must not overlap. One bit has to be
reserved for synchronization purposes for each configured subbus. The maximum
data width of a synchronized subbus is therefore Endbit ‑ Startbit.
You cannot use two I/O blocks that use the same communication channel within
the same FPGA application. For example, you cannot use an I‑FPGA In 1 block if
there is already an I‑FPGA Out 1 block, but you can add an I‑FPGA In 2 block.
Note
If you send and receive data with the same inter-FPGA interface, you have
to consider limitations on the bit ranges for the subbuses. Refer to How
to Determine the Bit Ranges for Inter-FPGA Subbuses Between SCALEXIO
FPGA Base Boards on page 111.
107
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Application examples The hardware connections, the implemented model, and the block settings for
the bus configuration have to match to get the required data transfer.
Inter-FPGA
Board 1 communication Board 2
I-FPGA I-FPGA
Start bit: 0 Master 1 Slave 1 Start bit: 0
27 bit data + 1 bit sync.
End bit: 27 End bit: 27
108
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
Inter-FPGA
Board 1 communication Board 2
I-FPGA Bus 2
Start bit: 0 Master 2 Board 3
End bit: 27
I-FPGA
Slave 2 Start bit: 0
End bit: 27
More than three boards can be connected via inter-FPGA communication cables,
but only the boards that are located next to each other can be connected with
an inter-FPGA communication cable.
109
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
The following illustration shows the assembly of four FPGA stacks (FPGA base
board with I/O modules) that are used for inter-FPGA communication.
Inter-FPGA communication cables
Rear
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
Base board 1
...
Base board 2
Base board 3
Base board 4
...
Stack 1 Stack 2 Stack 3 Stack 4
Front
HowTos
How to Determine the Bit Ranges for Inter-FPGA Subbuses Between SCALEXIO FPGA
Base Boards............................................................................................................................ 111
How to Specify I/O Module Slots of SCALEXIO FPGA Base Boards as Inter-FPGA
Interfaces............................................................................................................................... 110
How to Specify I/O Module Slots of SCALEXIO FPGA Base Boards as Inter-
FPGA Interfaces
Objective You have to specify the inter-FPGA connector only if you use the inter-FPGA
communication on SCALEXIO FPGA base boards.
110
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
Method To specify I/O module slots of a SCALEXIO FPGA base board as inter-FPGA
interface
1 Via the Platform Manager in ConfigurationDesk, for example, check the
I/O module slots that are used for inter-FPGA communication.
2 On the Platform tab of the FPGA_SETUP_BL block dialog, make sure that a
SCALEXIO FPGA base board is selected.
3 Select Inter-FPGA Interface for the I/O module slot that is connected to
another FPGA board for inter-FPGA communication.
4 Repeat step 3 to specify other I/O module slots as inter-FPGA interface.
Result You specified the I/O module slots that support inter-FPGA communication.
Now, the I/O function blocks to implement the inter-FPGA communication are
available.
Objective When you implement subbuses to send and receive data via an inter-FPGA
communication bus between SCALEXIO FPGA base boards, you must observe
limitations for the bit ranges of subbuses.
Limitations For a robust communication, the wires of the interface cable are grouped to six
cable segments. Within a cable segment, data can only be sent in one direction.
That means, you cannot use the same cable segment to send and receive data.
Furthermore, the interface cable supports only two cable segment ranges that
transmit data as shown in the example below.
111
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Data Data
Subbus 2 Cable segment 3...6 Subbus 2
Data Data
Subbus 2 Cable segment 3...4 Subbus 2
Data Data
Subbus 3 Cable segment 5...6 Subbus 3
Note
If you use the inter-FPGA communication bus only in one direction, you can
specify the bit ranges of subbuses without limitations. You must consider
the limitations only if you send and receive data with the same inter-FPGA
interface.
Bit ranges supported by the The following table shows which cable segment supports which bit range:
cable segments
Cable Segment Bit range
1 0 ... 5
2 6 ... 7
3 8 ... 13
4 14 ... 19
5 20 ... 21
6 22 ... 27
Method To determine the bit ranges for inter-FPGA subbuses between SCALEXIO
FPGA base boards
1 Choose one continuous range of cable segments that can be used to send
data and one continuous range that can be used to receive data. The
ranges must not overlap. For examples, refer to Configuration examples on
page 113.
2 Identify the bit range that is supported by the chosen cable segment range
for sending data. This bit range can be used by subbuses to send data.
For example: The cable segments 1 ... 3 support the bit range 0 ... 13.
112
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
3 Use the identified bit range to determine the bit ranges of subbuses to
send data. You can determine multiple subbuses, as shown by Example 2 on
page 113.
4 Identify the bit range that is supported by the chosen cable segment range
for receiving data. This bit range can be used by subbuses to receive data.
5 Use the identified bit range to determine the bit ranges of subbuses to
receive data.
Next step Add the I-FPGA In and I-FPGA Out function blocks to the FPGA model to
implement the inter-FPGA communication and configure their start and end bits
with the determined bit ranges.
Configuration examples The examples help you configure the bit ranges of your subbuses and show you
possible configuration errors.
Example 1 The following table shows you an example for bit ranges of two
subbuses.
Example 2 The following table shows you an example for bit ranges of four
subbuses.
113
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Block Settings for the Inter-FPGA Interface Framework (FPGA Programming Blockset
- FPGA Interface Reference )
Calculating data rate The data rate of an inter-FPGA (sub)bus depends on the block settings for the
clock, the bit length and the data width.
Resulting data rate for data transfer with bus synchronization The
maximum data rate with the default values is 562.5 Mbit/s for the entire bus
or 20.83 Mbit/s per bit.
DataRateMax,Bus = 125 MHz · (28 ‑ 1) Bit / 6
DataRateMax,Bit = 125 MHz · 1 Bit / 6
Resulting data rate for data transfer without bus synchronization The
maximum data rate with the default values is 582.3 Mbit/s for the entire bus or
20.83 Mbit/s per bit.
DataRateMax,Bus = 125 MHz · 28 Bit / 6
DataRateMax,Bit = 125 MHz · 1 Bit / 6
Calculating latency The latency consists of a constant value and dependencies on the clock rate of
the inter-FPGA bus, filter depth, and on whether jitters and spikes occur.
114
FPGA Programming Blockset Guide May 2024
Modeling Inter-FPGA Communication
Tinter-FPGA Master: Latency of the inter-FPGA component to write data to the inter-FPGA bus.
Tinter-FPGA Master = ClockPeriodinter-FPGA · 2 ClockCycles
Tinter-FPGA Slave: Latency of the inter-FPGA component to read data from the inter-FPGA bus.
Tinter-FPGA Slave depends on the filter depth, and jitter and spikes on the bus lines:
§ Filter depth >0 and jitter and spikes on the bus lines:
Tinter-FPGA Slave = ClockPeriodinter-FPGA · (3 ClockCycles +
(FilterDepth + 1 + [0 … FilterDepth]))
With the range [0 … FilterDepth] as the latency caused by spikes.
Latency calculation examples The following examples display the resulting latency for different applications.
115
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Note
Use the expert mode only if you have enough experience of configuring
buses and knowledge of checking the correctness of the configured
transmission with regard to the observed signal integrity at the applicable
temperature range.
The default values for the bit length, clock, and filter depth have been
tested by dSPACE.
116
FPGA Programming Blockset Guide May 2024
Modeling FPGA Applications Supporting Multicore Processor Applications
Platforms for FPGA FPGA applications of MicroLabBox, MicroLabBox II, MicroAutoBox III and
application with multicore SCALEXIO systems can support multicore processor applications (multicore real-
support time applications).
Multicore support for There are no special aspects you have to consider when you are modeling an
MicroLabBox FPGA application with multicore support. Keep in mind, that the assignment
to the processor interface must be unique. You cannot access the same FPGA
interface block from different processor interface blocks.
Multicore support ConfigurationDesk lets you implement and build processor applications for
for MicroLabBox II, MicroLabBox II, MicroAutoBox III, and SCALEXIO systems. In ConfigurationDesk,
MicroAutoBox III, and model port blocks represent the interfaces of processor models and FPGA
SCALEXIO systems function blocks represent the FPGA application. Model port blocks let you
connect FPGA function blocks with the processor model, but model port blocks
that reside in different processor models must not be mapped to the same
function block as shown below.
117
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Model B
FPGA model
Subsystem 2
Subsystem 3
The following illustrations show FPGA interfaces that are not supported in
ConfigurationDesk.
FPGA model
Subsystem 1
118
FPGA Programming Blockset Guide May 2024
Modeling FPGA Applications Supporting Multicore Processor Applications
FPGA model
References
FPGA application with To support multicore processor applications, at least three function block
multicore support in types represent the entire FPGA application in ConfigurationDesk. The
ConfigurationDesk separation of the FPGA application into one FPGA Setup function block type
(<application name>_Setup) and at least two FPGA custom function block
types let you use one FPGA application by at least two processor models
(behavior models in ConfigurationDesk).
In ConfigurationDesk, the FPGA Setup function block lets you configure and
initialize the access to the FPGA base board. At least two FPGA custom function
blocks provide the interfaces to map different processor models and external
devices.
119
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
models of the different processor cores (behavior models) and assigned to the
FPGA Setup block.
assigned to
Block of behavior
model B
assigned to
FPGA Setup
Possible methods You can use the following methods to select the subsystems for multicore
support:
§ Using tags. Refer to Method 1.
§ Selecting the subsystems in a tree view. Refer to Method 2.
120
FPGA Programming Blockset Guide May 2024
Modeling FPGA Applications Supporting Multicore Processor Applications
Result The Interface tab of the FPGA_SETUP_BL block dialog displays the number of
function block types that will be defined by the build process. The tree view
grouped the subsystems according to the FPGA custom function block types
they belong to. The top level of the FPGA model and all unselected subsystems
belong to one FPGA custom function block.
The following example shows you which FPGA custom function block type
represents which part of the FPGA model.
121
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
122
FPGA Programming Blockset Guide May 2024
Modeling MGT Communication Using a Customized Protocol
Block diagram of the The MicroLabBox II, DS6601 FPGA Base Board, and the DS6602 FPGA Base
interface Board provide a connector to insert an optical adapter for MGT (MGT module).
The following illustration shows the basic components to support the MGT
communication bus.
Reference
GTH transceiver clock
(master)
GTH transceiver
FPGA (slave 1)
MGT module
GTH transceiver
(slave 2)
GTH transceiver
(slave 3)
Components description The following table shows the description of the components.
Component Description
FPGA The FPGA processes the build FPGA application.
GTH The GTH transceivers are configurable transceivers that are integrated with the logic resources of
transceiver the FPGA. The GTH transceivers support line rates from 500 Mbit/s … 16.375 Gbit/s. The master
123
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
Component Description
transceiver receives the differential reference clock signal and provide it to the slave transceivers.
Master or slave has no influence on the MGT communication.
The GTH transceivers can be configured by the FPGA application to support different protocols, line
rates, etc.
For details on the GTH transceiver, refer to
https://www.xilinx.com/support/documentation/user_guides/ug576-ultrascale-gth-transceivers.pdf.
Reference This clock provides the configured reference frequency for the GTH transceivers.
clock
MGT module The MGT module is an optical adapter that can be connected to the FPGA base board. The MGT
module provides four channels for communication.
The order number of the SCALEXIO MGT modules are as follows:
§ DS6601_MGT1 for the DS6601 FPGA Base Board.
§ DS6602_MGT1 for the DS6602 FPGA Base Board.
For MicroLabBox II, the recommended and tested MGT module is the QSFP28-SR4-100G module
manufactured by FS (https://www.fs.com)
Overview of the DS6601 FPGA Base Board (SCALEXIO Hardware Installation and
Configuration )
Overview of the DS6602 FPGA Base Board (SCALEXIO Hardware Installation and
Configuration )
References
Accessing the demo Open the block library and select Demos – DemoFPGAurora8b10b –
DS6601_XCKU035 or DS6602_XCKU15P.
Use case The Aurora8b10b demo uses a customized transfer protocol to send data values
in a loop via the MGT interface. The customized transfer protocol is the Aurora
8b10b protocol for data transmission.
The demo measures the latency, lets you inject errors and provides
status information about the communication bus. Backup projects for
ConfigurationDesk and ConrolDesk let you directly experiment with the demo.
124
FPGA Programming Blockset Guide May 2024
Modeling MGT Communication Using a Customized Protocol
Demo overview The following table shows the top level of the Simulink model with the
subsystems.
Subsystem Description
AURORA 8b10b Provides the interface and configuration of the GTH transceiver to support a
customized protocol.
For more information, refer to AURORA 8b10b subsystem on page 126.
125
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
AURORA 8b10b subsystem The following illustration shows the components of the AURORA 8b10b
subsystem.
Block Description
Black Box1) Instantiates the GTH transceivers and defines the used transfer protocol.
The MGT module provides four channels for communication. Each channel is connected to one
GTH transceiver.
To customize the protocol, the Black Box must be changed.
MGT In Receives the provided data from the MGT module and lets you specify the reference clock
frequency.
MGT In is a block of the FPGA Programming Blockset.
MGT In Indicates whether the MGT module is ready for data exchange.
Opto Ready MGT In Opto Ready is a block of the FPGA Programming Blockset.
MGT Out Outputs the provided data to the MGT module.
MGT Out is a block of the FPGA Programming Blockset.
1) HDL library of the AMD Vitis Model Composer
Using a customized protocol You can use the IP Catalog of Vivado to customize a predefined protocol.
The IP Catalog provides a list of IP cores that can be customized. For more
information, refer to https://docs.xilinx.com/r/en-US/ug896-vivado-ip.
The IP Catalog lets you generate a net list that you can integrate in a Black Box.
You can also include optional features like FIFOs for the inports and outports, or
a reset logic for the GTH transceiver.
Required settings The following parameters depend on the FPGA base board and must be set to a
specific value in the VHDL file:
§ The low power mode of the equalizer must be enabled.
gt_rxlpmen => (others => '1')
126
FPGA Programming Blockset Guide May 2024
Modeling MGT Communication Using a Customized Protocol
Provided demo files The table shows the files that are provided with the demo. You can use these
files to experiment with the demo, to change the demo, or to specify a new
Black Box.
HowTos
References
127
May 2024 FPGA Programming Blockset Guide
Modeling the FPGA Functionality and the Access to I/O Channels
File ending of net lists The file ending of net list files must be .edn if you use net lists for the Black Box
from the HDL library of the AMD Vitis Model Composer.
Offline simulation of the During offline simulation, the data types of the Black Box outports can lead to
Black Box error messages.
To avoid the error messages, you can provide a dummy design with the outports
set to 0 for offline simulation. The aurora_8b10b_top_sim.vhd file of the
Aurora8b10b demo is an example for such a dummy design.
Aurora-specific transmission The last frame of a Aurora transmission must be flagged, for example, with the
TX_LAST flag in the Aurora8b10b demo.
The receiver outputs a frame when it receives a new frame. If the last frame is
not flagged, the frame remains in the memory of the receiver.
Using a user clock domain for If you are using a clock domain that is synchronous to the GTH transceivers, you
MGT communication must add the MGT In Opto Ready block outside the subsystem into a clock
domain at the base rate of the FPGA.
For more information on using multiple clock domains, refer to Using Multiple
Clock Domains for FPGA Modeling on page 78.
128
FPGA Programming Blockset Guide May 2024
Modeling the Communication Between the FPGA and the Real-Time Processor
Introduction You must implement interfaces to the FPGA model and the processor model to
exchange data between the FPGA application and the processor application.
129
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Introduction The FPGA Programming Blockset provides blocks for exchanging data between
the FPGA subsystem and the processor model.
130
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
Basics on the processor The data is exchanged via the communication line between MicroLabBox's
communication using base board and the I/O FPGA module mounted on the DS1302 board.
MicroLabBox/MicroLabBox II For MicroLabBox, communication runs via the local bus. For MicroLabBox II,
communication runs via IOCNET.
The 32‑bit parallel data bus enables a complete 32‑bit word to be transferred in
a single operation. For transferring a 64‑bit word, two operations are internally
required.
The data is transmitted via the local bus to specific data storage areas. The
implementation details of these storage areas are defined in the framework.
Basics on the processor The data is exchanged via the communication line between the real-time
communication using processor of the MicroAutoBox II/III and the FPGA module mounted on the
MicroAutoBox II/III DS1514 I/O board. The communication runs via the intermodule bus of the
MicroAutoBox II/IIII.
The 16‑bit parallel data bus enables a complete 16‑bit word to be transferred in
a single operation.
The data is transmitted via the intermodule bus to specific data storage areas.
The implementation details of these storage areas are defined in the framework.
131
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Basics on the processor The internal communication between the real-time processor and a SCALEXIO
communication using a FPGA base board runs via IOCNET (I/O carrier network). IOCNET lets you connect
SCALEXIO system more than 100 I/O nodes and even place the parts of your SCALEXIO system
long distances apart. IOCNET is dSPACE's proprietary protocol that gives you
real-time performance plus time and angular clocks.
The data is transmitted via IOCNET to specific data storage areas. The
implementation details of these storage areas are defined in the framework.
132
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
Access types You can select different access types for data exchange.
Register access type If you have to exchange certain data and high
performance is not required, it is recommended to use the register access type.
Note
Buffer access type If you have to exchange a lot of data with high
performance, it is recommended to use the buffer access type. However, to
access a specific data item within the buffer, you have to address it explicitly.
Bus access type The bus access type lets you use Simulink buses to model the
data exchange between the processor and the FPGA. The bus access type uses
buffer to exchange data.
The bus access type is available only for MicroLabBox II, MicroAutoBox III, and
SCALEXIO.
Read/write blocks in the FPGA You can use the FPGA_XDATA_READ_BL block from the FPGA Interface
subsystem library to read data from the processor bus, and the FPGA_XDATA_WRITE_BL
block to write data to the board-specific bus.
The values in the FPGA subsystem are processed as fixed-point values. The data
exchange with the processor model requires data type conversion between fixed-
point and floating-point values. Automatic data conversion is implemented in
these blocks. The fixed-point format to be used can be set in the blocks' dialogs.
Tip
You can copy & paste previously configured interface blocks of the FPGA
Programming Blockset. The blockset automatically analyzes the FPGA model
and reassigns new hardware resources.
You can speed up the copy & paste process for the current
session by deactivating the automatic reassignment of new hardware
resources. Open the Advanced Preferences dialog and set the
PASTE_KEEP_CHANNEL_NUM preference to false. Refer to Dialog
Settings of the Advanced Preferences Dialog (FPGA Programming Blockset -
FPGA Interface Reference ).
133
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Read/write blocks in the The Processor Interface library of the FPGA Programming Blockset provides the
processor model PROC_XDATA_READ_BL and PROC_XDATA_WRITE_BL blocks to read data
from and write data to the board-specific bus. These blocks must be configured
as counterparts to the related blocks in the FPGA subsystem. The simplest way to
create and configure these blocks in the processor model is to use the Generate
command.
Objective You can use an output signal from the FPGA application to trigger an
asynchronous task in the processor model.
Basics As with the other interface blocks from the FPGA Programming Blockset, you
need an interrupt block in the FPGA subsystem and its counterpart in the
processor model to trigger a function-call subsystem by a value coming from
the FPGA.
Result When the FPGA_INT_BL block in the FPGA subsystem receives the specified
data, it is transferred to the processor model.
Next steps After you implemented the processor interface, you connect the processor
interface block to a function-call subsystem in the processor model. For
instructions on implementing the processor interface, refer to Implementing the
Processor Interface to the Processor Model on page 148.
134
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
Examples The following example shows the resulting processor model implementation of
an interrupt-driven task.
135
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Objective Modeling the processor interface on the basis of Simulink buses of the FPGA
model.
Platforms supporting data The following platforms support the use of Simulink buses for modeling the data
exchange via Simulink buses exchange with the processor interface:
§ MicroLabBox II
§ MicroAutoBox III
§ SCALEXIO
Methods Depending on the data direction, refer to one of the following methods:
§ To write data to the processor model, refer to Method 1.
§ To read data from the processor model, refer to Method 2.
Method 1 To use a Simulink bus of the FPGA model to write data to the processor
model
1 Add an FPGA_XDATA_WRITE_BL block to the FPGA model.
2 Open the Unit page of the block dialog and select the Bus access type.
3 Connect the Simulink bus to the Data inport.
4 Press Ctrl + D to update the model.
5 On the Parameters page, click Analyze bus topology of input.
The FPGA Programming Blockset analyzes the connected Simulink bus and
configures the Data inport.
136
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
Method 2 To use a Simulink bus of the FPGA model to read data from the processor
model
1 Add a FPGA_XDATA_READ_BL block to the FPGA model.
2 Open the Unit page of the block dialog and select the Bus access type.
3 If the Simulink bus is not already implemented in the FPGA model,
implement a temporary Simulink bus:
§ Add a Simulink Bus Creator block to the FPGA model.
§ Connect FPGA blocks to the input with matching data types, for example,
Counter blocks from the HDL library of the AMD Vitis Model Composer.
4 Press Ctrl + D to update the model.
5 Select the Simulink bus to be copied by selecting a Bus Creator block,
subsystem inport block, or subsystem outport block.
6 On the Parameters page, click Copy bus topology from gcb.
The FPGA Programming Blockset analyzes the selected Simulink bus and
configures the Data outport.
7 You can delete the temporary Simulink bus from step 3.
Result You modeled the processor communication with Simulink buses. The buffer
block displays the used subchannel and the number of signals that must be
connected to the Data port. The following example shows a Bus In block.
Next step To use the Simulink bus in the processor model, open the Unit page and click
Generate. The generated processor interface use the same Simulink.bus object
as the Bus In/Bus Out block.
HowTos
137
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
References
How to Use Simulink Buses of the Processor Model to Model the Processor
Communication
Objective Modeling the processor interface on the basis of Simulink buses of the processor
model.
Platforms supporting data The following platforms support the use of Simulink buses for modeling the data
exchange via Simulink buses exchange with the processor interface:
§ MicroLabBox II
§ MicroAutoBox III
§ SCALEXIO
Methods Depending on the data direction, refer to one of the following methods:
§ To write data to the processor model, refer to Method 1.
§ To read data from the processor model, refer to Method 2.
138
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
Method 1 To use a Simulink bus of the processor model to write data to the
processor model
1 Open the Signal Configurations page of the Data Inport block dialog that
is connected to a Simulink bus.
2 Select the root signal and check the Type signal property.
139
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Method 2 To use a Simulink bus of the processor model to read data from the
processor model
1 If not already implemented, add a Data Outport block from the Model
Interface Package for Simulink to the FPGA model and connect it to the
Simulink bus.
2 From the context menu of the Data Outport block, select Model Port
Blocks - Update Selected Outport block from Input Signals.
3 Open the Signal Configuration page of the Data Outport block dialog.
4 Select the root signal and check the Type signal property.
140
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
Result You modeled the processor communication with Simulink buses. The bus block
displays the used subchannel and the number of signals that must be connected
to the Data port. The following example shows a Bus In block.
Next step In the FPGA model, change the data types of the signals to FPGA data types.
Refer to How to Specify the Data Type Conversion for Processor Communication
on page 141.
HowTos
Objective Specifying the data type conversion between the processor model and the FPGA
model, for example, after you copied the bus topology from a corresponding
processor block.
Basics Data transmitted from the processor to the FPGA is converted from the double
to an FPGA data type and vice versa. If processor communication is based on a
Simulink bus of the processor model, you have to specify the data types that are
used on the FPGA for each bus signal. Double is the default data type if you copy
the bus topology from a corresponding processor block.
141
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Result You specified the data type that is used in the FPGA model. Data values that are
exchanged between the processor and the FPGA are converted from the double
data type used in the processor application and the specified data type used in
the FPGA application.
142
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
3 In the Signals table, use the buttons to add or delete bus signals.
For more information on the buttons, refer to Bus Editor Dialog
- FPGA_XDATA_READ_BL/FPGA_XDATA_WRITE_BL (FPGA Programming
Blockset - FPGA Interface Reference ).
To add a subbus, select a signal and click . A new signal is added to the
bus with the configuration of the selected signal and the data type of the
selected signal changes to the bus data type.
The following illustration shows the result.
4 Click Ok.
143
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Result You changed the Simulink bus in the FPGA model. The changes are automatically
propagated to the corresponding Data Inport/Data Outport block in the
processor model.
Objective Configuring the method for writing data to the processor application when
using a Bus Out block.
Supported platforms The platforms support different bus data transmission methods.
§ MicroLabBox II:
The Synchronous to Read_Req and the Free running methods.
§ MicroAutoBox III:
The Free running method.
§ SCALEXIO:
The Synchronous to task, the Free running, and the User acknowledged
methods.
Basics To transmit data from the FPGA to the processor, the processor application
makes a read request. The currentness of the transmitted data depends on the
bus data transmission method:
§ Synchronous to task method
Select this method to transmit data that is captured synchronously to the
processor task.
The FPGA application writes data to the swinging buffer when the processor
application makes a read request. After the data is written to the buffer, the
buffer swings and sends the data to the processor application.
§ Synchronous to Read_Req method
Select this method to transmit data that is captured synchronously to the read
request.
The FPGA application writes data to the swinging buffer when the processor
application makes a read request. After the data is written to the buffer, the
buffer swings and sends the data to the processor application.
§ Free running method
Select this method if the transmission time is crucial.
144
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
The FPGA application continuously writes data to the swinging buffer. A read
request of the processor application immediately transmits the last complete
data set of the swinging buffer to the processor application.
§ User acknowledged method
Select this method to acknowledge the data to be transmitted to the processor
application, for example, to trigger the processing of some data before it is
transmitted to the processor application.
The FPGA application writes data to the swinging buffer when you
acknowledge the data with the Send_Ack port. After the data is written to
the buffer, the buffer swings and sends the data to the processor application.
You must acknowledge each data transmission request so that data transfer is
synchronous to the processor task, as with the Synchronous to task method.
A data transmission request that is not acknowledged by Send Ack leads to
task overrun in the processor application. A task overrun will be logged as an
I/O error in the Messages page of the . The FPGA buffer that caused the task
overrun will also be logged.
For more information on the swinging buffer, refer to Basics on Exchanging Data
Between Processor and FPGA on page 17.
Limitation The selected bus data transmission method applies to all subchannels of a
Bus Out channel. To use different bus data transmission methods, you must
use different Bus Out channels.
Result You configured the bus data transmission method. If you use subchannels, the
selected method applies to all subchannels of the selected Bus Out channel.
HowTos
How to Use Simulink Buses of the FPGA Model to Model Processor Communication.............. 136
145
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Introduction The MicroLabBox II, MicroAutoBox III, and SCALEXIO frameworks support
subchannels to implement the communication between a task of the processor
application and the FPGA application.
With subchannels, you can use a single buffer to exchange data via several
Simulink buses. This gives you the flexibility of registers with the performance of
buffers with the support of Simulink buses.
Implementing subchannels After you enabled the bus transfer mode for a Bus Out/Bus In function, you can
set the buffer to a channel that is in use and select a different subchannel. You
have to add a Bus Out/Bus In function for each subchannel.
Data Inport
Channel number: 1
Bus Out channel 1 Subchannel number: 1
How to Use Simulink Buses of the FPGA Model to Model Processor Communication.............. 136
How to Use Simulink Buses of the Processor Model to Model the Processor
Communication...................................................................................................................... 138
146
FPGA Programming Blockset Guide May 2024
Modeling Processor Model Access
Using Simulink data The FPGA Programming Blockset can use a data dictionary instead using the
dictionaries base workspace for the bus elements.
Using models that are linked to data dictionaries If the model is already
linked to a data dictionary, the FPGA Programming Blockset automatically uses
this data dictionary for the bus elements.
Observing bus elements The Simulink bus editor lets you observe Simulink bus elements.
To use the bus editor, open the Simulink Model Explorer, select a bus element,
and click Launch Bus Editor.
For more information on the bus editor, refer to the Simulink help.
How to Use Simulink Buses of the FPGA Model to Model Processor Communication.............. 136
How to Use Simulink Buses of the Processor Model to Model the Processor
Communication...................................................................................................................... 138
147
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Objective The interface blocks in the processor model for exchanging data with the FPGA
application can be generated with all the relevant settings
Basics Usually, you implement the FPGA subsystem first, and then the interface to the
processor model. This means that all information required for the data exchange
is already specified in the FPGA interface blocks. It therefore makes sense to
148
FPGA Programming Blockset Guide May 2024
Implementing the Processor Interface to the Processor Model
Possible methods The method to generate the processor interface depends on the platform used:
§ To generate a processor interface for a MicroLabBox II, MicroAutoBox III or a
SCALEXIO system, refer to Method 1.
§ To generate a processor interface for a MicroAutoBox II or a MicroLabBox,
refer to Method 2.
149
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
If you already built the FPGA application, you can also specify the FPGA
model INI file after you have added the file to the FPGA model INI files list on
the Advanced page.
4 On the Interface page, click Generate to generate the interface blocks
required for the processor interface.
Result You have created a new model containing interface blocks to implement the
processor interface to the processor model. The blocks are configured with all
the relevant settings of their counterparts in the FPGA subsystem.
Buffer
Interrupt
150
FPGA Programming Blockset Guide May 2024
Implementing the Processor Interface to the Processor Model
1) Model port blocks of the dSPACE Model Interface Package for Simulink.
2) Processor interface blocks of the Processor Interface sublibrary of the FPGA
Programming Blockset
Next steps Copy the generated blocks to your processor model and connect them to the
other Simulink blocks. You must not reconfigure these blocks manually. The
settings for data type conversion (floating-point to fixed-point and vice versa) are
implicit and can only be modified in the appropriate FPGA blocks.
After you copy the generated processor model interface blocks to the processor
model, you can close the generated interface model without saving.
HowTos
References
Multicore processor The RTI-MP Blockset allows you to assign parts of your processor model to
applications for MicroLabBox different CPU cores. MicroLabBox provides two cores, so the processor model is
separated into one master model and one slave model. You must implement the
slave model as a subsystem of the master model. The inports and outports of the
151
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Processor model containing the FPGA model Either the master or the
slave model must contain the FPGA model INI file with the FPGA bitstream.
However, both models must contain a PROC_SETUP_BL block when you build
the processor application.
Multicore processor You can implement an application where several single processor models can
applications for be linked to ConfigurationDesk. With this, you can build a multicore processor
MicroLabBox II, application (multicore real-time application) which can be downloaded to
MicroAutoBox III and dSPACE real-time hardware to execute the models in parallel on single cores
SCALEXIO systems of the processor.
How to Transfer 64-Bit Fixed-Point Data with Full Resolution (MicroLabBox II,
SCALEXIO)
Objective Transferring fixed-point data with a word length of 64 bits without converting
the data to double.
152
FPGA Programming Blockset Guide May 2024
Implementing the Processor Interface to the Processor Model
Basics on the processor 64-bit fixed-point data types are usually converted to double. Therefore, the
communication fixed-point resolution of fixed-point data types is restricted to 53 bits.
The exception is Register64 and Buffer64 blocks, which can transfer 64-bit
fixed-point data values with the full resolution. For this, the binary point position
must be set to zero.
Note
Result You configured the processor interface to transfer 64-bit fixed-point data with
full resolution.
153
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
HowTos
154
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
155
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Platforms supporting the The following platforms support the preprocessing and postprocessing of
processing of processor processor communication via scaling subsystems:
communication § MicroLabBox II
§ MicroAutoBox III
§ SCALEXIO
Introduction Scaling subsystems that are a part of the FPGA model are flexible interfaces
which let you adapt the signals between the FPGA model and the processor
model. The following overview shows the implementation of scaling subsystems
and the resulting data flow between the FPGA application and the processor
application.
Entire model
FPGA model
FPGA function A
signal1 signal1
Processor model
(behavior model)
From processor To processor
signal1 signal1
FPGA function B
signal1 signal1
signal1 signal1
FPGA model The FPGA model is a Simulink subsystem that includes the
FPGA Setup block and one or more FPGA functions.
156
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
Benefits of scaling subsystems A scaling subsystem supports the iterative development of a real-time
application:
§ Scaling subsystems separate the development of the FPGA functionality and
the functionality of the processor interface.
Changes or complex adaptions in the processor communication can be
processed in the scaling subsystem.
§ Scaling subsystems can be changed and developed without changing the
FPGA subsystem or the processor model. This significantly reduces the build
time during the development process.
§ You can automatically update changes in the scaling subsystems in all
instances of the FPGA custom function in ConfigurationDesk.
HowTos
157
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Features of scaling subsystems These are the main features of scaling subsystems:
§ In ConfigurationDesk, scaling subsystems belong to the FPGA custom function
block type. This has the following advantages:
§ You can use the same scaling subsystems with different applications.
§ You can instantiate the function block type multiple times.
§ An update of the FPGA container automatically updates the instantiated
function blocks and their scaled interfaces.
§ Scaling subsystems can be updated independently from the FPGA subsystem.
Modifications do not require an FPGA build.
§ Mask parameters of a scaling subsystem can be used to adjust scaling
subsystems in ConfigurationDesk and in ControlDesk at run time.
Element Naming
1 The default function block name is the FPGA application name.
You specify the FPGA application name when you build the FPGA
application.
2 The function name is the name of the scaling subsystem in Simulink.
3 The function port name is the signal name of the model port block
that provides the interface to the processor model (behavior model).
158
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
Simulink ConfigurationDesk
FPGA model
FPGA function A
signal1 signal1
FPGA function B
signal1 signal1
Tuning scaling subsystems of You can use mask parameters for scaling subsystems to make the scaling
built FPGA applications subsystem tunable, for example, to support different processor models (behavior
models) in ConfigurationDesk. In ConfigurationDesk, the mask parameters are
provided as function block properties. In ControlDesk, the mask parameters are
tunable parameters that can be changed at run time.
Tagging the subsystems to use The FPGA model consists of several subsystems that are executed on the FPGA or
scaling subsystems the real-time processor. Tags are used to distinguish the different subsystems:
§ Scaling subsystems must be tagged to make clear that they are not part of the
FPGA application.
§ FPGA functions are tagged to make clear that the subsystem is represented in
ConfigurationDesk by one function block type.
159
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
The following illustration shows the Tag property in the Block Properties dialog
of a subsystem.
You can tag the subsystems manually or you can use templates. For instructions
on using templates, refer to How to Prepare FPGA Models to Use Scaling
Subsystems on page 162.
Limitations Observe the following limitations when you implement a scaling subsystem:
§ A scaling subsystem executes either input signals or output signals. You cannot
use the same scaling subsystem for input and output signals.
§ A scaling subsystem can exchange data only with the processor model, the
FPGA subsystem, and other scaling subsystems within an FPGA function. At
least one connection to the FPGA subsystem must be implemented. Data
exchange between scaling subsystems of different FPGA functions is not
160
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
FPGA model
FPGA function A
signal1 signal1
FPGA function B
signal1 signal1
However, on the FPGA a data exchange between the FPGA subsystems of the
FPGA functions can be implemented.
§ A scaling subsystem does not support ungrouped registers, i.e., registers
whose Register group ID is set to zero.
§ A scaling subsystem must include all registers of a register group, i.e., all
registers with the same Register group ID and the same data direction
(Register In or Register Out) must be handled by the same scaling
subsystem.
§ Scaling subsystems must be independent from the sample time, because
model ports of the processor model can use different sample times.
To build the scaling subsystem without a specific sample time, the FPGA
Programming Blockset sets the solver type to Fixed-step and the periodic
sample time constraint to Ensure sample time independent. This limits the use
of certain blocks, e.g., you cannot use Simulink Integrator blocks.
If the scaling subsystem does not satisfy the specified constraints, Simulink
displays an error message during the build process.
§ The function ports of a function block can be mapped only to the same
application process of the processor model (behavior model). Therefore, the
interface of an FPGA subsystem must provide signals only for one processor
application process.
For more information on processor application processes, refer to Terms and
Definitions for Building Executable Applications (ConfigurationDesk Real-Time
Implementation Guide ).
§ The following limitations apply for mask parameters that are provided as
function block properties in ConfigurationDesk and as tunable parameters in
ControlDesk:
§ Only the edit and checkbox mask parameter types are supported.
§ The Evaluate parameter attribute must be selected.
§ The mask parameter must be tunable.
§ The mask parameter value must not be modified in the block's mask
initialization.
161
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Basics To distinguish the scaling subsystem from the FPGA subsystem, you have to
tag the subsystem with the direction tag. Refer to Characteristics of Scaling
Subsystems on page 158.
Methods You can use the following methods to prepare an FPGA model:
§ If you model an FPGA model from scratch, use templates to prepare the FPGA
model. Refer to Method 1.
§ If you adapt an existing FPGA model, prepare the existing FPGA model. Refer
to Method 2.
162
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
2 Drag & drop the FPGA Function subsystem of the Model Structure
Templates to the FPGA model.
3 Drag & drop the Scale In and Scale Out subsystems of the Model
Structure Templates to the FPGA model.
Add at least one Scale In or Scale Out subsystem for each FPGA subsystem.
4 Add the FPGA subsystem of step 1 and the scaling subsystems of step 3 to
one subsystem (FPGA function).
5 Open the block dialog of the FPGA function subsystem and add
fpgafunction=1 to the Tag property.
6 If necessary, repeat steps 1 to 5 for other FPGA functions.
By using templates for preparing the subsystems, the subsystems are tagged with
the matching tags. Refer to Characteristics of Scaling Subsystems on page 158.
163
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Objective Adding the interface blocks to scaling subsystems that provide the interfaces to
the processor model and the FPGA subsystem.
Part 1 To add the blocks that provide the interface to the FPGA subsystem
1 In the FPGA model, double-click the FPGA_SETUP_BL block to open its
dialog.
2 On the Interface tab, click Generate corresponding processor blocks for
FPGA XDATA blocks to generate the model port blocks required for the
interface.
3 Open the FPGA function subsystem.
164
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
4 Drag the generated Data Outport blocks to the Scale In subsystem and the
generated Data Inport blocks to the Scale Out subsystem.
For special use cases, you can add a Data Inport block to the Scale In
subsystem instead of the Scale Out subsystem. This way the processor does
not write the processor signal to the FPGA application at the end of a
processor task as usual, but only at the beginning. The same applies to the
Data Outport blocks.
Interim result You added the interface blocks to the FPGA subsystem.
Before you add the interface blocks to the processor model, implement the
functionality to scale the processor signals.
165
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Part 2 To add the blocks that provide the interface to the processor model
1 Open the Model Interface Blockset.
2 Add at least one Data Inport block to the Scale In subsystem and connect
it to the scaling functionality.
3 Configure the added Data Inport block. Refer to How to Configure Data
Port Blocks (Model Interface Package for Simulink - Modeling Guide ).
4 Add at least one Data Outport block to the Scale Out subsystem and
connect it to the scaling functionality.
5 Select the added Data Outport block and select Model Port Blocks -
Update All Selected Outport Blocks from Input Signals.
Result You added the interfaces to the scaling subsystems. The following illustration
shows a simple example of a Scale In subsystem.
Note
166
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
Objective Directly exchanging signal values between scaling subsystems. The data
exchange takes place on the real-time processor and does not use any FPGA
resources.
Limitation You can exchange data only between scaling subsystems of the same FPGA
function. Refer to Limitations Concerning Scaling Subsystems on page 160.
Precondition You prepared the FPGA model to use scaling subsystems. Refer to How to
Prepare FPGA Models to Use Scaling Subsystems on page 162.
Result The FPGA application exchanges signal values between the scaling subsystems.
167
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Objective Connecting the processor model (behavior model) with the scaling subsystems
for offline simulation.
Precondition In the scaling subsystems, the model port blocks providing the interface to the
processor model are added and configured. Refer to How to Implement the
Interfaces of Scaling Subsystems on page 164.
1 In the scaling subsystem, select a model port block that provides the
interface to the processor model. This is a model port block that has no
block connection to the FPGA subsystem.
2 Open the block dialog and select the Signal Configuration page.
168
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
4 If the scaling subsystems has further model port blocks that form the
interface to the processor model, repeat steps 1 … 3 with these model port
blocks.
5 Select all model port blocks that form the interface to the processor model.
6 Select Model Ports Blocks - Create Inverse Model Port Block.
7 Add the generated model port blocks to the processor model (behavior
model).
Result You added the processor interface in the processor model (behavior model).
The Signal Configuration page of the model port block dialog displays the
Connection Tag and the corresponding model port blocks. The model ports
with the same Connection Tag correspond to each other.
169
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
Objective Updating the scaling subsystems of an FPGAC file without rebuilding the FPGA
application.
Basics The FPGA build process adds all build result files to an FPGAC file. The
building of the FPGA application takes a long time. If you changed only scaling
subsystems, you do not have to rebuild the FPGA subsystem.
The FPGA build process inserts all build result files into an FPGAC file. Building
the FPGA application takes a lot of time. If you have changed only scaling
subsystems, you do not need to rebuild the FPGA subsystem.
To save time, you can replace the scaling subsystem only to update the
preprocessing and/or postprocessing of the processor signals. The FPGA
application remains unchanged.
170
FPGA Programming Blockset Guide May 2024
Preprocessing and Postprocessing the Signals Between the FPGA and the Processor Model
2 Click dSPACE FPGA - Update All Scaling Subsystems for Last Build.
Placeholder Description
<FPGACpath> File path to the FPGAC file to be updated. For example:
C:\FPGAApplications\
DemoFPGApipt1_E97E9F7D35F047.fpgac.
<SubsystemPath> Path to the modified scaling subsystem
in the Simulink model. For example:
DemoFPGApipt1/DemoFPGApipt1/
FPGA Function.
The script rebuilds all scaling subsystems that exist at
the specified path and replaces the build result files in
the specified FPGAC file. This means that if the path to
the FPGA model is specified, all scaling subsystems will
be updated.
To save time, update only a specific scaling subsystem
by specifying the path to the modified subsystem.
Next step To update the function blocks in ConfigurationDesk, replace the FPGAC file in
the ConfigurationDesk search path folder.
171
May 2024 FPGA Programming Blockset Guide
Modeling the Communication Between the FPGA and the Real-Time Processor
References
172
FPGA Programming Blockset Guide May 2024
Simulating and Debugging Processor and FPGA Applications
Introduction You can run the processor model and its FPGA subsystems in different simulation
modes.
173
May 2024 FPGA Programming Blockset Guide
Simulating and Debugging Processor and FPGA Applications
Introduction Before you execute the FPGA application on the real-time hardware, you should
test its behavior in a simulated I/O environment.
Providing ports for simulation In a Simulink simulation (also called offline simulation), the implemented FPGA
data subsystem runs without connection to the external hardware. The simulation is
based on the Simulink model and not on the generated model code. The input
signals and output signals of the model interface must be simulated within the
model. For this purpose, the FPGA Interface blocks provide simulation ports
that you can enable for simulation. The simulation ports and their connected
model components are ignored when you build the FPGA application.
Specifying the offline In the Analysis tab of the FPGA_SETUP_BL block dialog, you can specify the
simulation period offline simulation period. This is the step size that will be used for the simulation.
174
FPGA Programming Blockset Guide May 2024
Running Processor Models and FPGA Subsystems in Simulink Simulation Mode
If you have specified fixed step size, the offline simulation period must be an
integer multiple of the fixed step size specified in the Simulink Configuration
Parameters. Officially, the AMD Vitis Model Composer supports only variable
step size.
Example If you have specified a fixed step size of 1 µs in the Simulink
Configuration Parameters, the offline simulation period can be greater than or
equal to 1 µs, for example 1 ms.
Note
There are some blocks from the HDL library of the AMD Vitis Model
Composer, for example, the Constant and Counter blocks, for which you
can specify a sampling rate in their block dialogs.
If there is a difference between the specified offline simulation period and
the block's explicit period, the block period is calculated by:
HWBlockPeriod = SimulinkBlockPeriod · HWClockPeriod /
OfflineSimulationPeriod
For example, if you have specified the explicit period of a Counter block
with 10 µs and the offline simulation period with 1 µs, the hardware block
period is 100 ns for a hardware clock period of 10 ns.
Starting the simulation You can start the simulation in the model window of the FPGA subsystem by
clicking the Start simulation toolbar button, choosing Simulation - Run from
the menu bar or using the Ctrl+T shortcut.
The simulation is executed for the specified simulation time or until you stop it.
Introduction Before you execute the processor application on the real-time hardware, you
should test its behavior in a simulated environment.
Simulating a MicroLabBox II, You can simulate the interaction between the processor model and the FPGA
MicroAutoBox III, or a model in offline mode without modifying the models. The simulation data is
SCALEXIO systems delivered by the specified simulation ports or, if these ports are not available, by
the corresponding interface blocks in the model.
175
May 2024 FPGA Programming Blockset Guide
Simulating and Debugging Processor and FPGA Applications
Simulating a MicroAutoBox II If you simulate the processor model of a MicroAutoBox II or a MicroLabBox, you
or MicroLabBox can do this in different model modes.
Starting the simulation You can start the simulation in the model window of the processor model by
clicking the Start simulation toolbar button, choosing Simulation - Run from
the menu bar or using the Ctrl+T shortcut.
The simulation is executed for the specified simulation time or until you stop it.
176
FPGA Programming Blockset Guide May 2024
Debugging Processor Models and FPGA Subsystems
Introduction AMD Vivado and dSPACE provide tools for timing analysis, resource utilization
analysis, and HDL simulation.
Timing analysis If the build process for your FPGA subsystem has detected timing problems, use
the Vivado timing analysis tool or the dSPACE Timing Analyzer.
177
May 2024 FPGA Programming Blockset Guide
Simulating and Debugging Processor and FPGA Applications
Timing analysis of the custom FPGA model On the Analysis tab of the
FPGA_SETUP_BL block, you can click Timing Analysis to start the timing
analysis of the FPGA model. This timing analysis considers only the FPGA model
that is modeled with blocks from the HDL library of the AMD Vitis Model
Composer. FPGA model parts that are modeled with Simulink blocks and the
dSPACE platform framework are not considered.
The result of the analysis is displayed in VivadoTiming Analyzer and saved to
the <ModelName>_timing folder in the working folder.
To show the last report, click Show Last Timing Report on the Analysis tab of
the FPGA_SETUP_BL block.
Tip
Use the timing analysis of the custom FPGA model to fix timing problems
with model parts that use the HDL library of the AMD Vitis Model
Composer.
Resource utilization analysis If the build process for your FPGA subsystem has detected FPGA resource
problems, use the resource utilization analysis tool from the AMD Vitis Model
Composer.
Resource analysis of the custom FPGA model You can start the resource
analysis on the Analysis tab of the FPGA_SETUP_BL block by clicking Resource
Analysis. This resource analysis considers only the custom FPGA model without
the framework of the platform that is automatically added to your FPGA model
during the build process.
178
FPGA Programming Blockset Guide May 2024
Debugging Processor Models and FPGA Subsystems
The result of the analysis is displayed in the Resource Analyzer and saved to the
<ModelName>_resource folder in the working folder. To show the last report,
click Show Last Timing Report on the Analysis tab of the FPGA_SETUP_BL
block.
HDL simulation If you completed a Simulink simulation and are satisfied with the behavior of the
model, the next step is to compare the simulation data from the FPGA model
with the simulation data from generated HDL code. To do so, you can start the
HDL Simulation on the Analysis tab of the FPGA_SETUP_BL block.
Note
The HDL simulation only starts if the simulation time is not infinite.
When the simulation has finished, you can look at a textual report. The results
are also stored in the HDLAnalysis folder in the working folder.
Further information For more information on timing analysis, resource utilization analysis, and HDL
simulation, refer to the Vivado Design Suite User Guide.
Introduction The dSPACE Timing Analyzer helps you fix timing errors that are detected during
the build process.
179
May 2024 FPGA Programming Blockset Guide
Simulating and Debugging Processor and FPGA Applications
Opening the dSPACE Timing After the build process finishes, click dSPACE Timing Analyzer in the MATLAB
Analyzer Command Window to open the analyzer.
User interface elements The dSPACE Timing Analyzer has the following elements.
180
FPGA Programming Blockset Guide May 2024
Debugging Processor Models and FPGA Subsystems
Tip
Introduction The dSPACE Utilization Analyzer provides information on the utilization of FPGA
resources for the complete FPGA application:
§ Resources for the FPGA model part that is modeled with blocks of the HDL
library of the AMD Vitis Model Composer.
§ Resources for the FPGA model part that is modeled with blocks of the Simulink
blockset (HDL coder subsystems).
§ Resources used by the dSPACE framework.
Opening the dSPACE After the build process finishes, click dSPACE Utilization Viewer in the
Utilization Analyzer MATLAB Command Window to open the viewer.
181
May 2024 FPGA Programming Blockset Guide
Simulating and Debugging Processor and FPGA Applications
User interface elements The dSPACE Utilization Analyzer has the following elements.
Tip
182
FPGA Programming Blockset Guide May 2024
Debugging Processor Models and FPGA Subsystems
183
May 2024 FPGA Programming Blockset Guide
Simulating and Debugging Processor and FPGA Applications
184
FPGA Programming Blockset Guide May 2024
Building FPGA and Processor Applications
Introduction If the behavior of your model in Simulink simulation fulfills your requirements,
you can generate the model code and build the executable files from the
processor model and the FPGA subsystems.
185
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Objective Before you can execute the FPGA model on a MicroLabBox II, MicroAutoBox III,
or SCALEXIO system, you must build an application from its generated code.
Basics The code generation and the build process are managed by the FPGA
Programming Blockset. It uses the AMD Vitis Model Composer to generate VHDL
code and starts the FPGA implementation process, including synthesis, mapping,
routing and generating the bitstream file.
186
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroLabBox II, MicroAutoBox III, SCALEXIO)
Even if no errors occurred during modeling, simulating, and building, your FPGA
application is not guaranteed to work correctly. Some combination of factors
might prohibit the execution of your FPGA application, e.g., combinations of the
operating temperature, the power of the entire hardware system, technological
limitations of the FPGA, the sample rate, etc. Some FPGA applications do not
start at all, others start correctly but fail during operation.
Due to the complexity of FPGA applications and their dependency on the used
FPGA hardware, the AMD Design Tools cannot ensure that all possible design
problems are detected during the analysis and simulation of the FPGA model.
To solve the problem, you have to modify the FPGA model and make sure that
you consider generally accepted FPGA design rules to ensure a stable and reliable
FPGA application (refer to Audience profile on page 9). For more information,
contact dSPACE Support.
Backing up build results Before you build an FPGA application, you can enable and configure the
automatic backup of the build FPGA application, models, and reports that are
generated and used during the build process. Refer to Backing Up the Build
Results on page 225.
Note
187
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Result The FPGA Build Monitor opens that displays status information and the build
progress. For more information, refer to FPGA Build Monitor 2024-A Reference
on page 218.
During the build, the FPGA Programming Blockset opens a temporary model
<FPGAModelName>_rtiFPGAtmp and closes the temporary model when the
FPGA application is built.
Next step You have the following options to further process the build results:
§ You can prepare the entire model to export the build results and the processor
model to ConfigurationDesk. Refer to How to Prepare the Processor Models
for Separating (MicroLabBox II, MicroAutoBox III, SCALEXIO) on page 189.
§ You can directly use the build results in ConfigurationDesk, for example, to
update an existing FPGA custom function block type without changing the
processor model.
Click the publish link in the MATLAB Command Window or press the Publish
button on the Interface tab of the FPGA Setup block dialog to publish
the path of the built FPGA container file to the global user location file of
ConfigurationDesk.
188
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroLabBox II, MicroAutoBox III, SCALEXIO)
Objective You have to prepare the processor models in the entire model so that the
framework can automatically separate the processor models from other parts of
the entire model, such as the FPGA model.
Required preparations Before the framework can export the processor models, you have to specify the
following:
§ Specify the processor models in the entire model.
In a ConfigurationDesk project, the processor interfaces are a part of the
behavior model. Other parts of the entire model, such as the FPGA application
or stimulus signals of external I/O signals, are not part of the behavior model.
Therefore, the framework separates the processor models from the entire
model. To do this, you have to specify the processor models in the entire
model.
§ Specify a name and a folder for the separated processor models.
In ConfigurationDesk, the separated processor models are implemented
outside ConfigurationDesk in a Simulink model. When the framework
exports the processor models to ConfigurationDesk, it implements the
separated processor models that are saved at the specified location to
ConfigurationDesk.
Separating multicore For more information on separating multicore processor models, refer to
processor models Workflow for Creating a Multicore Real-Time Application Using One Overall
Behavior Model (ConfigurationDesk Real-Time Implementation Guide ).
189
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
4 In the Model name edit field, enter a name for the Simulink model that
includes a processor model that must be separated.
5 In the Model folder edit field, enter a folder name or path for the separated
processor model to be saved when the framework exports the processor
model.
If you do not enter a folder or path, the framework saves the separated
processor model to the folder of the entire model.
6 From the Unassigned subsystems list, select the subsystems of the
processor model and click to assign the subsystems to the model entry.
7 If the entire model includes more than one processor model to be separated,
repeat steps 3 ... 6.
8 Click Save to save the configuration to the source model.
9 Click Close to close the dialog.
Result Now the model is prepared for separating. The framework is able to process the
following steps when you export the processor model:
§ To separate the processor models from the entire model.
§ To save the separated processor models as Simulink models with the specified
name to the specified folder.
190
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroLabBox II, MicroAutoBox III, SCALEXIO)
Next step Now you can export the FPGA build results and the processor models to
ConfigurationDesk. Refer to How to Export Build Results and Processor Models
to ConfigurationDesk Projects on page 191.
Objective You have to add the processor model and the FPGA application to a
ConfigurationDesk application before you can build the real-time application.
Steps of the export process The framework mainly performs the following steps when it exports the build
results and the processor model to ConfigurationDesk:
§ Opens ConfigurationDesk.
§ Creates a new project in ConfigurationDesk.
§ Adds the file path of the current build results to the global user location file.
The global user location file is located at
%LOCALAPPDATA%\dSPACE\ConfigurationDesk\Settings\<ReleaseVersion>
(<ProductVersion>)
When you add the file paths to the global user location file, the
FPGA application is available as FPGA custom function block types in all
ConfigurationDesk projects.
Different versions of FPGAC files differ only in the application ID
(<FPGAApplicationName>_<ApplicationID>.fpgac). When updating the
FPGAC file, the FPGA Programming Blockset adds an application ID so that
ConfigurationDesk can find the latest version first and ignores the other
FPGAC files. In ConfigurationDesk, the Message Viewer displays the found
FPGAC files and the ignored FPGAC files.
The following illustration shows messages of the Message Viewer concerning
the registration of FPGA custom function block types.
§ Adds instances of the added custom function block types to the signal chain.
191
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
The framework performs the following steps only if the processor model can be
separated and the processor interface is implemented:
§ Separates and saves the processor models according to the settings of the
Model Separation Setup block.
In ConfigurationDesk, the processor models are implemented outside
ConfigurationDesk in Simulink models.
§ Exports the model interface of the processor models to ConfigurationDesk.
§ Maps the function ports of the added FPGA custom function blocks to the
model ports of the processor model (behavior model).
Result You exported all build FPGA applications of the entire model and the processor
model to ConfigurationDesk. In ConfigurationDesk, the processor model is a part
of the behavior model.
Tip
192
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroLabBox II, MicroAutoBox III, SCALEXIO)
Note
Next step You can map the device ports of the external devices to the signal ports of
the FPGA function blocks, assign the hardware resources, enable the angular
processing unit, and specify the task priority of interrupts. Refer to Handling
FPGA Custom Function Blocks in ConfigurationDesk (ConfigurationDesk I/O
Function Implementation Guide ).
References
Objective Before you can execute the behavior model including the processor model on the
real-time hardware, you must build an application from its generated code.
Basics The code generation and the build process are managed by ConfigurationDesk.
Note
Before you start the build process for the processor application, you must
set the Fixed-step size setting on the Solver page to a value, which is the
multiple of the offline simulation period specified in the FPGA_SETUP_BL
block. Check also the compatibility of the solver settings used for FPGA-
based offline simulation, for example, the solver type.
193
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Result If the build process finished successfully, you will find the build results,
such as the processor application file and the variable description file, in
ConfigurationDesk's Build Results folder. The FPGA application is automatically
programmed to the RAM of the FPGA when the processor application is loaded.
For example, if you built the MyDemo application for a MicroLabBox II,
MicroAutoBox III, or a SCALEXIO system, you will find the executable RTA file
called MyDemo.rta in the Build Results folder.
194
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroAutoBox II, MicroLabBox)
Objective Before you can execute the FPGA model on the real-time hardware, you must
build an application from its generated code.
Basics The code generation and the build process are managed by the FPGA
Programming Blockset. It uses the AMD Vitis Model Composer to generate
VHDL code and starts the FPGAlinx implementation process, including synthesis,
mapping, routing and generating the bitstream file.
Even if no errors occurred during modeling, simulating, and building, your FPGA
application is not guaranteed to work correctly. Some combination of factors
might prohibit the execution of your FPGA application, e.g., combinations of the
operating temperature, the power of the entire hardware system, technological
limitations of the FPGA, the sample rate, etc. Some FPGA applications do not
start at all, others start correctly but fail during operation.
195
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Due to the complexity of FPGA applications and their dependency on the used
FPGA hardware, the AMD Design Tools cannot ensure that all possible design
problems are detected during the analysis and simulation of the FPGA model.
To solve the problem, you have to modify the FPGA model and make sure that
you consider generally accepted FPGA design rules to ensure a stable and reliable
FPGA application (refer to Audience profile on page 9). For more information,
contact dSPACE Support.
Backing up build results Before you build an FPGA application, you can enable and configure the
automatic backup of the build FPGA application, models, and reports that are
generated and used during the build process. Refer to Backing Up the Build
Results on page 225.
Using the script interface for The FPGA Programming Blockset provides a script interface that you can use to
building an FPGA application start the FPGA build process in the MATLAB Command Window.
The script considers all subsystems that are contained in the model/subsystem
which is specified by the Simulink handle.
Note
196
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroAutoBox II, MicroLabBox)
197
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Result The FPGA Build Monitor opens that displays status information and the build
progress. For more information, refer to FPGA Build Monitor 2024-A Reference
on page 218.
During the build, the FPGA Programming Blockset opens a temporary model
<FPGAModelName>_rtiFPGAtmp and closes the temporary model when the
FPGA application is built.
Used coder The code generation and the build process are managed by the Simulink Coder.
For general information, refer to Building and Downloading the Model (RTI and
RTI-MP Implementation Guide ).
Note
Before you start the build process for the processor application, you must
set the Fixed-step size setting on the Solver page to a value that is the
multiple of the offline simulation period specified in the FPGA_SETUP_BL
block.
Model separation The processor model that you want to build must not contain an FPGA
subsystem. Otherwise the build process will terminate with an error message.
198
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroAutoBox II, MicroLabBox)
Note
Using the script interface for separating the processor model The script
interface of the FPGA Programming Blockset can be used to separate the
processor model before you start the build process. It works in the same way
as the model mode switch via the PROC_SETUP_BL block dialog.
The syntax for separation is:
[errorcode, path] = rtifpga_scriptinterface('Separation',
<ProcModelHandle>)
§ errorcode = 0: Operation finished successfully
§ errorcode != 0: Operation terminated with an error
§ path: Returns the path of the separation file
You can get the handle of the processor model by using:
ProcModelHandle = get_param(<ProcessorModelName>,'handle')
You can restore the processor model by using Deseparation instead of
Separation as the first argument.
The syntax for deseparation is:
[errorcode] = rtifpga_scriptinterface('Deseparation',
<ProcModelHandle>)
§ errorcode = 0: Operation finished successfully
§ errorcode != 0: Operation terminated with an error
The script interface can also be used for building the FPGA application (see How
to Build FPGA Applications (MicroAutoBox II, MicroLabBox) on page 195).
INI files used with the FPGA There are two kinds of initialization files:
Programming Blockset § Framework INI file
A framework INI file contains the interface definitions for the FPGA, the FPGA
board's I/O and the processor. It also contains the function-specific settings
199
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
that are displayed in the dialogs of the FPGA interface blocks according to
the specified function. It is therefore mainly used for configuring the FPGA
interface blocks.
§ FPGA model INI file
An FPGA model INI file is created when you build an FPGA application. It
allows you to include built FPGA applications in your processor application
without specifying the corresponding FPGA model. For example, in the setup
block for the processor model, you can specify either an FPGA subsystem or an
FPGA model INI file for further actions.
FPGA model INI files are only used for build results of MicroLabBox and
MicroAutoBox II.
Objective To build a single-core processor application that includes and supports your FPGA
application.
Basics For information on building the processor application, refer to Basics on Building
the Processor Application (MicroAutoBox II, MicroLabBox) on page 198.
200
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroAutoBox II, MicroLabBox)
Result If the build process finishes successfully, you will find the build results, such as
the processor application file and the variable description file, in the working
folder. If you have specified to program the FPGA application into flash or
RAM, the flash or the FPGA is automatically programmed when the processor
application is loaded. For more information on programming the FPGA, refer to
How to Create Burn Applications for MicroAutoBox II on page 203.
For example, if you built the MyDemo application for a MicroLabBox, you
will find the executable PPC file in the working folder and a subfolder called
MyDemo_rti1202 containing the generated code and all the intermediate build
results.
How to Build Processor Applications (MicroLabBox II, MicroAutoBox III, SCALEXIO)................. 193
References
Objective To build a multicore processor application that includes and supports your FPGA
application.
Basics For information on building the processor application, refer to Basics on Building
the Processor Application (MicroAutoBox II, MicroLabBox) on page 198.
Effects on FPGA signal tracing The processor model that programs the FPGA triggers the data acquisition
of FPGA signals with the task period of the subsystem in which the
201
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Preconditions § The FPGA model INI file must be available before you start the build process.
§ The master model and the slave model must contain the PROC_SETUP_BL
block.
§ The working folder must be set to the model path.
§ The processor model to be built must be opened in MATLAB.
§ If you want to download the processor application after the build process, the
real-time hardware must be registered, for example, via the Platform Manager
in ControlDesk.
Result If the build process finishes successfully, you will find the build results, such as
the processor application file and the variable description file, in the working
folder. The FPGA is automatically programmed when the processor application is
loaded.
202
FPGA Programming Blockset Guide May 2024
Building the Applications (MicroAutoBox II, MicroLabBox)
Objective You can explicitly program the FPGA of the MicroAutoBox II with a burn
application.
Basics A burn application is used to load an FPGA application to the FPGA. Usually, the
FPGA programming is included in the processor application and there is no need
to use a burn application. But in some cases, it is useful to program the FPGA
explicitly.
Note
Programming into flash If you use the flash memory of the FPGA board,
you must execute the burn application only once. Each time you start the FPGA
board, the FPGA application is loaded to the FPGA automatically. In this case, the
processor application should be built without specifying a programming option.
This gives you the shortest startup time for your system. If you want to load a
new FPGA application to the flash, you must execute the burn application to
replace the flash contents and restart the system to program the FPGA from the
flash with the new application.
Note
When programming into flash, you must consider the Autoboot features of
your hardware.
§ The Autoboot feature can be enabled and
disabled via the MicroAutoBox Configuration Tool
(<RCP_HIL_InstallationPath>/Exe/DS1401_ConfigGUI.exe) or via
RTLib, refer to fpga_tp1_enable_autoboot (MicroAutoBox II RTLib
Reference ) and fpga_tp1_disable_autoboot (MicroAutoBox II RTLib
Reference ).
Programming into RAM If you use the RAM memory of the FPGA board,
the FPGA must be programmed every time you start the system. It is therefore
recommended to build the processor application with the RAM programming
option to program the FPGA application automatically when loading the
processor application. A burn application for the RAM is useful if you want
to test the FPGA application only. If you program into the RAM memory, any
running FPGA application is immediately stopped and replaced with the new
FPGA application, unlike flash programming, where you must restart the board
to activate the new FPGA application.
203
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Result If the build process succeeded, the build result can be found in
<ModelName>_rtiFPGA/burnapplication. The executable is not
automatically downloaded to the processor board. The intermediate build results
can be found in
<ModelName>_rtiFPGA/burnapplication/<ModelName>_burnapplication
_rti1401.
References
204
FPGA Programming Blockset Guide May 2024
Achieving Successful Builds at High FPGA Utilization
Basics The FPGA Programming Blockset lets you enable the incremental build feature of
Vivado to help in consistently achieving successful builds at high FPGA utilization.
A known good reference build is used as a starting point for implementation
so that new builds can use a working FPGA configuration and only the actual
changes have to be implemented. An incremental build increases the likelihood
of successful FPGA builds and reduces build times for rather small changes in the
FPGA model.
205
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Result The FPGA Programming Blockset builds the FPGA application based on the
results of the referenced build results.
206
FPGA Programming Blockset Guide May 2024
Using an FPGA Build Server
How to Prepare the Computer for the FPGA Build Server....................... 209
To install the software and exchange folder required to run the FPGA
Build Server.
Introduction The dSPACE FPGA Build Server can execute the FPGA build that was started with
the FPGA Programming Blockset.
Use cases Main use cases for the FPGA Build Server:
§ To continue modeling after you started the build process.
The FPGA Build Server can run on the same PC as the FPGA Programming
Blockset.
§ To provide high computing capacity to build FPGA applications faster for
several modeling workstations.
207
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
One computer with optimized computing capacity builds the FPGA application
for several modeling workstations.
A common build folder is used to exchange the source files to build the FPGA
application and the resulting FPGA build file.
§ The FPGA Programming Blockset provides the source files for building the
FPGA application.
§ The FPGA Build Server builds the FPGA application and provides the FPGA
build file.
The FPGA Build Server can build multiple FPGA applications at the same time.
§ The FPGA Build Monitor displays the build progress of all builds that are
executed in the build folder.
208
FPGA Programming Blockset Guide May 2024
Using an FPGA Build Server
Tip
3 FPGA Build
Servers on one
computer
Objective To install the software and exchange folder required to run the FPGA Build
Server.
Required software The following software is required to run the FPGA Build Server.
§ Windows operating system that is supported by the RCP and HIL software of
the current Release.
For a list of supported operating systems, refer to Operating System (New
Features and Migration ). The listed Windows Server operating systems are
not supported by AMD.
§ The Vivado version that is used for FPGA modeling. Refer to Software Tools for
Working with the FPGA Programming Blockset on page 19.
209
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
§ Python 3.11
It is recommended that you use the Python distribution provided
by the dSPACE Release. This Python distribution contains the latest
packages with some bugfixes and security updates. For information on
avoiding or solving conflicts with other Python distributions, refer to
https://www.dspace.com/faq?094.
§ Microsoft .NET Framework 4.7.2
Precondition You have access to the source media of the required software.
Tip
2 Create an exchange folder as a common build folder. The folder must meet
the following requirements:
§ The build server and the modeling workstations have read/write access to
exchange the files for the build process.
§ The path to the build folder is the same for the FPGA Build Server and for
the modeling workstations.
The same path is required, because absolute paths are used in the FPGA
models.
§ The path length of the build folder is short to avoid errors during the build
process.
During the build process, the path length can exceed the maximum path
length specified by Windows. This might lead to error messages during
file system operations. For more information, refer to AMD Answer Record
52787 (https://support.xilinx.com/s/article/52787?language=en_US).
For information on creating an exchange folder with read/write access, refer
to the documentation of the operating system.
Result You prepared the computer for running the FPGA Build Server.
210
FPGA Programming Blockset Guide May 2024
Using an FPGA Build Server
Objective The FPGA Build Server must be configured and run before you start the build
process in the FPGA_SETUP_BL block.
Precondition The computer for the FPGA Build Server must be prepared. Refer to How to
Prepare the Computer for the FPGA Build Server on page 209.
3 Enter the path of the build folder. Use one of the following characters to
separate the directories of the path.
§ Use / to enter the path:
"BuildDirectory" : "<root>/.../<BuildFolder>"
§ Use \\ to enter the path:
"BuildDirectory" : "<root>\\...\\<BuildFolder>"
The other configuration parameters are optionally. Refer to FPGA Build
Server Configuration File Reference on page 214.
4 Save the configuration file.
5 Execute the FpgaBuildServer.exe batch file to start the FPGA Build
Server. Location of the batch file:
<ServerFolder>\FPGABuildServer\FPGABuildServer\
211
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Tip
HowTos
How to Prepare the Computer for the FPGA Build Server........................................................ 209
References
Basics You start the build process with the FPGA_SETUP_BL block of the FPGA model.
The build process is automatically started and managed by the FPGA Build Server.
The FPGA Build Server starts the implementation process, including synthesizing,
mapping, routing and generating the bitstream file.
Even if no errors occurred during modeling, simulating, and building, your FPGA
application is not guaranteed to work correctly. Some combination of factors
might prohibit the execution of your FPGA application, e.g., combinations of the
operating temperature, the power of the entire hardware system, technological
limitations of the FPGA, the sample rate, etc. Some FPGA applications do not
start at all, others start correctly but fail during operation.
Due to the complexity of FPGA applications and their dependency on the used
FPGA hardware, the AMD Design Tools cannot ensure that all possible design
problems are detected during the analysis and simulation of the FPGA model.
To solve the problem, you have to modify the FPGA model and make sure that
you consider generally accepted FPGA design rules to ensure a stable and reliable
212
FPGA Programming Blockset Guide May 2024
Using an FPGA Build Server
FPGA application (refer to Audience profile on page 9). For more information,
contact dSPACE Support.
Note
The FPGA Build Server must use the same path for the build folder,
because the FPGA model uses absolute paths.
Result The FPGA Build Monitor opens that displays status information and the build
progress. For more information, refer to FPGA Build Monitor 2024-A Reference
on page 218.
The FPGA Programming Blockset starts the AMD Vitis Model Composer and
a temporary model: <FPGAModelName>_rtiFPGAtmp. The AMD Vitis Model
Composer generates and synthesizes the files for the build process and saves
them to the build folder. The temporary model automatically closes.
You can continue FPGA modeling after the required files for the build process are
available and saved to the build folder. The FPGA Build Server automatically starts
the build process after the server detected the new build job.
Next step The build process can take a long time. You can use the FPGA Build Monitor
to monitor the build progress. Refer to How to Monitor the Build Process on
page 216.
213
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
HowTos
Syntax The following example shows the syntax of the configuration file.
{
"BuildDirectory" : "<root>\\...\\<BuildFolder>",
"ConcurrentJobs" : 4,
"LogFile" : "FpgaBuildServer.log"
}
BuildDirectory parameter Lets you enter the path of the build folder. This parameter must be set.
Use one of the following characters to separate the folders of the path.
§ Use / to enter the path:
"BuildDirectory" : "<root>/.../<BuildFolder>"
§ Use \\ to enter the path:
"BuildDirectory" : "<root>\\...\\<BuildFolder>"
ConcurrentJobs parameter Lets you set the maximum number of concurrent build jobs. If the maximum
number has been reached, new jobs are not started until old jobs are completed.
If this parameter is not used, the maximum number of concurrent build jobs is
set to four.
The ConcurrentJobs parameter affects only the number of build jobs and not
the number of build threads that are set via the FPGA_SETUP_BL block.
LogFile parameter Lets you enter a file name of a log file in the build folder to record status
information on the build server and build error messages.
The FPGA Build Server adds a new file with the entered name to the build folder
if the entered file does not exist.
214
FPGA Programming Blockset Guide May 2024
Using an FPGA Build Server
If this parameter is not used, the FPGA Build Server does not use a log file.
215
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Basics The FPGA Build Monitor monitors build processes that are available in the
selected build folder. The FPGA Build Monitor displays status information and
the build progress. For more information, refer to FPGA Build Monitor 2024-A
Reference on page 218.
216
FPGA Programming Blockset Guide May 2024
Monitoring the Build Process
2 Drag & drop the build folder to the FPGA Build Monitor.
The FPGA Build Monitor displays all build processes that are available in the
selected folder.
Result The FPGA Build Monitor displays information on the monitored build processes.
Next step When the FPGA build is complete, you can build the processor application.
Refer to Building the Applications (MicroAutoBox II, MicroLabBox) on page 195
or Building the Applications (MicroLabBox II, MicroAutoBox III, SCALEXIO) on
page 186.
HowTos
217
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Basic user interface elements The following illustration shows the basic elements of the FPGA Build Monitor
user interface.
1 2
5 4
218
FPGA Programming Blockset Guide May 2024
Monitoring the Build Process
MATLAB messages Displays the steps and messages that the MATLAB®
Command Window outputs during the build process.
Reset button Lets you reset the build state to not yet started.
Build complete The build file is available. Depending on the platform, the build file is an FPGA
model INI file or an FPGAC file.
219
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
MATLAB messages Displays the steps and messages that the MATLAB®
Command Window outputs during the build process.
Build complete with warnings The build file is available, but warning messages were output during the build
process.
220
FPGA Programming Blockset Guide May 2024
Monitoring the Build Process
MATLAB messages Displays the steps and messages that the MATLAB®
Command Window outputs during the build process.
Build failed with errors The build process cannot be finished due to errors.
221
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
MATLAB messages Displays the steps and messages that the MATLAB®
Command Window outputs during the build process.
Reset button Lets you reset the build state to not yet started.
Build not yet started The files for building the FPGA application are available in the build folder, but
the FPGA Build Server has not started building the FPGA application.
If the build does not start, the FPGA Build Server might not be running or is
observing another build folder. Check the settings and restart the server. Refer to
How to Install and Start the FPGA Build Server on page 211.
MATLAB messages Displays the steps and messages that the MATLAB®
Command Window outputs during the build process.
222
FPGA Programming Blockset Guide May 2024
Monitoring the Build Process
Build stage The Build server executes the build process and the Build Monitor displays the
current build stage.
MATLAB messages Displays the steps and messages that the MATLAB®
Command Window outputs during the build process.
Cancel Build button Lets you cancel the build process before it has been
completed.
Waiting for code generation The FPGA build process waits until the AMD Vitis Model Composer generates
and synthesizes the files for the build process and saves them to the build folder.
The MATLAB messages show the preparatory steps for code generation.
223
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
MATLAB messages Displays the steps and messages that the MATLAB®
Command Window outputs during the build process.
224
FPGA Programming Blockset Guide May 2024
Backing Up the Build Results
Introduction Before you build an FPGA application, you can enable and configure the
automatic backup of the build FPGA application, models, and reports that are
generated and used during the build process.
225
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
Configuring the backup The Build tab of the FPGA_SETUP_BL block dialog lets you configure the
options backup of the build results.
Configuring the backup The FPGA_SETUP_BL block dialog lets you enter a file path to back up the build
directory results.
To use different directories for each backup, you can add the following wildcards
to the file path:
§ %APPID adds a directory with the name of the application ID.
§ %TIMESTAMP adds a directory with the current time. The name format is
yyyy-mm-dd_HH-MM-SS.
If you do not use a wildcard, the backup process uses the same directory for all
backups.
Backing up the Simulink The backup process can automatically back up the Simulink model of the entire
model model. In addition, you can configure to generate a web view (HTML model) of
the Simulink model to display the entire model with any Internet browser.
Note
Before you select Copy model to build directory, make sure that all
users with read permission to the common build directory are entitled to
see the model.
226
FPGA Programming Blockset Guide May 2024
Backing Up the Build Results
A copy of the model is required to enable the build server to generate reports
and to back up the model.
Cleaning the build directory It can be useful to save memory, for example, if you use a build server. Therefore
you can enable the cleaning of the build directory after the FPGA application
is built and backed up. Then, the FPGA Programming Blockset removes all
deletable files from the build directory.
Introduction M-scripts are provided in the backup folder to open the backed-up timing and
utilization reports.
227
May 2024 FPGA Programming Blockset Guide
Building FPGA and Processor Applications
228
FPGA Programming Blockset Guide May 2024
Running Processor and FPGA Applications on the Real-Time Hardware
Introduction When you have built the executable applications for the processor and the FPGA
board, you can load them to the real-time hardware for experimenting.
Introduction You can observe the behavior of the real-time application and change
application‑specific parameters by using ControlDesk.
Downloading processor and To run a processor application, the built executable file must only be
FPGA application downloaded to the real-time hardware. The real-time hardware must be
registered beforehand, for example, via the Platform Manager in ControlDesk
or ConfigurationDesk. Any running application is stopped and overwritten by the
newly loaded application. If the processor application contains the programming
of the FPGA, the FPGA application is loaded to the FPGA automatically. If it does
not, and there is no FPGA application running, you must first download the burn
application to program the FPGA and afterwards the processor application.
Note
Before you download the processor application, the flash process started
by the burn application must be finished. For more information on burn
applications, refer to How to Create Burn Applications for MicroAutoBox II
on page 203.
229
May 2024 FPGA Programming Blockset Guide
Running Processor and FPGA Applications on the Real-Time Hardware
Note
Required files For experimenting, i.e., changing application-specific parameters during run time
and displaying the behavior, you need files that are created during the build
process, for example, the processor application (.x86, .ppc or .rta), the variable
description file (.trc), the system description file (.sdf), and the mapping file
(.map).
Accessing FPGA signals with You use the SDF file to access the FPGA signals and constants with your
an experiment software experiment software, for example, with ControlDesk.
In ControlDesk, you can access the signals and constants for FPGA tracing and
FPGA scaling in the Variables controlbar under
Signal Chain/IO Function View/FPGA Custom Functions/FPGA Applic
ation Name/….
230
FPGA Programming Blockset Guide May 2024
Experimenting with an FPGA Application
Note
Running applications might stop, if too many FPGA signals are traced
If you trace more than 100 signals with 32-bit values (or 50 signals with 64-
bit values) every millisecond with your experiment software, tracing might
cause a task overrun that stops the application.
These measures reduce the number of traced FPGA signals per millisecond:
§ Disable signal tracing if there is no need to trace FPGA signals.
§ Reduce the number of traceable signals. Refer to Basics on Tracing FPGA
Signals on page 237.
§ Reduce the number of signals that that you trace with the experiment
software. Only the values of signals traced with an experiment software
are sent to the real-time processor and can cause a task overrun.
Triggering the data acquisition The data acquisition of all traceable FPGA
signals is triggered by one trigger source, so all signals of an FPGA application
are captured at the same time. It is not possible to capture signals at different
points in time.
The experiment software can trace only FPGA signals with integer multiples of
the trigger period for tracing FPGA signals.
For the MicroLabBox II, MicroAutoBox III, and SCALEXIO systems, you must map
the Trigger inport of the FPGA custom function block (FPGA Setup block) to
the behavior model. This enables the triggering of the data acquisition with the
shortest task period of the mapped behavior model. Refer to Basics on Tracing
FPGA Signals on page 237.
For MicroAutoBox II and MicroLabBox, the data acquisition is automatically
triggered with the task period of the subsystem in which the FPGA_SETUP_BL
block is located. If you implement a multicore processor application for the
MicroLabBox, the data acquisition is triggered with the task period of the
subsystem in which the FPGA_SETUP_BL block is located that programs the
FPGA.
Related documents § ControlDesk Introduction and Overview for information on working with
ControlDesk.
§ ConfigurationDesk Real-Time Implementation Guide for detailed
information on working with ConfigurationDesk.
231
May 2024 FPGA Programming Blockset Guide
Running Processor and FPGA Applications on the Real-Time Hardware
232
FPGA Programming Blockset Guide May 2024
Accessing FPGA Applications with your Experiment Software
Introduction You can build FPGA applications that provide access to FPGA signals and
constants with your experiment software.
233
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Use cases To access an FPGA application with your experiment software is useful in the
following cases, for example:
§ To trace signals and adjust control parameters for optimization.
§ To use the FPGA application with various settings, e.g., you can scale analog
I/O signals to support different sensors and actors.
§ To debug the application, e.g., you can test the cable harness by switching the
I/O interface to defined values.
Possible elements to access You can access elements of the FPGA logic that includes the FPGA functionality
and elements of the FPGA interface.
Accessing elements of the FPGA logic You can access FPGA signals and
tunable FPGA signals. The illustration below show you the possible methods to
access the elements.
1
Adjusting tunable FPGA FPGA signal FPGA
FPGA constant block tracing block
FPGA signal
tracing
Accessing the FPGA interface You can access the signals of the FPGA
interface to scale and or substitute them. The illustration below show you the
possible methods to access the elements.
234
FPGA Programming Blockset Guide May 2024
Accessing Elements of FPGA Applications
I/O logic
board-specific bus
FPGA test access
FPGA_XDATA_WRITE_BL
I/O logic
FPGA_XDATA_READ_BL
Analog output
I/O logic
channel
Scaling
FPGA test access Saturation
and offset
FPGA_IO_WRITE_BL
Analog input
I/O logic
channel
Scaling
Saturation FPGA test access
and offset
FPGA_IO_READ_BL
Digital output
I/O logic
channel
Inverting FPGA test access
FPGA_IO_WRITE_BL
Digitial input
I/O logic
channel
FPGA test access Inverting
Methods to access the FPGA The following methods to trace and tune FPGA signals are supported:
application § FPGA signal tracing.
§ SCALEXIO systems only: Scope for FPGA signals.
§ Tunable FPGA constants.
235
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
The following table gives you an overview of the platforms that support the
access of FPGA applications and the methods that are supported.
FPGA Scope
SCALEXIO ✓1) ✓ ✓ ✓ ✓ ✓ ✓
MicroLabBox ✓ ✓ ✓ ✓ ✓ – –
MicroLabBox II ✓ ✓ ✓ ✓ ✓ – –
MicroAutoBox II ✓ ✓ ✓ ✓ ✓ – –
MicroAutoBox III ✓ ✓ ✓ ✓ ✓ – –
1) ✓ = Supported, – = Not supported
236
FPGA Programming Blockset Guide May 2024
Tracing FPGA Signals
Basics on FPGA tracing FPGA signals can be traced via FPGA variables that are added to the FPGA
application during the build process. These variables provide the read access for
the experiment software. The implementation of FPGA variables uses resources
of the FPGA (flip-flops). Building the FPGA application with traceable signals also
takes more time. Keep in mind that 1000 traceable FPGA signals increase the
build time for about 10%, 4000 traceable FPGA signals roughly doubles the
build time.
237
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Selecting signals for tracing The number of signals that can be traced with your experiment software is
limited (refer to Limitations on page 238).
There are two ways to reduce the number of traceable FPGA signals and both
can be used at the same time:
§ Tracing of selected model parts only.
§ Excluding model parts from tracing.
Tracing of selected model parts You can enable FPGA tracing for selected
subsystems of the entire FPGA model via the FPGA_SETUP_BL block. For
instructions, refer to How to Make FPGA Signals Traceable on page 240.
Excluding model parts from tracing You can exclude a subsystem from
the TRC file by using the subsystem omission tag (DsVdOmit). You must enter
238
FPGA Programming Blockset Guide May 2024
Tracing FPGA Signals
DsVdOmit=1 in the Tag edit field in the Block Properties dialog of the
subsystem.
Exclusion is applied recursively through the model hierarchy. To reinclude
subsystems, you can enter DsVdOmit=0. By this, you can include the variables
of a specific subsystem hierarchy. You can set the DsVdOmit tag by using
workspace variables. For example, if WSVar1 is a workspace variable, you
can use set_param(subsystemHandle,'Tag','DsVdOmit=$(WSVar1)') to
let the DsVdOmit tag value being evaluated during build process.
If you set DsVdOmit=-1, the DsVdOmit settings in the included subsystems are
ignored.
Setting Description
DsVdOmit tag is The subsystem contents including all blocks beneath this subsystem do not appear in the
set to 1 generated SDF file. Use set_param(gcb,'Tag', 'DsVdOmit=1').
DsVdOmit tag is The subsystem contents including all blocks beneath this subsystem appear in the generated
set to 0 SDF file, even if a subsystem above this subsystem has set the DsVdOmit tag to 1. Use
set_param(gcb,'Tag', 'DsVdOmit=0').
DsVdOmit tag is The subsystem contents including all blocks beneath this subsystem do not appear in the
set to -1 generated SDF file. DsVdOmit settings of subsystems included in this subsystem are ignored.
Use set_param(gcb,'Tag', 'DsVdOmit=-1').
The following example shows how the DsVdOmit tags can control the exclusion
of subsystem variables. The variables of the grayed subsystems are not generated
in the SDF file.
Model Root
Subsystem1
Subsystem2 (DsVdOmit = 1)
Subsystem3
Subsystem4 (DsVdOmit = 0)
Subsystem5
Subsystem6 (DsVdOmit = 1)
Subsystem7
Subsystem8
Subsystem9
Subsystem10
For instructions, refer to How to Exclude FPGA Signals from Tracing on page 242.
Making FPGA signals Before you can trace FPGA signals with your experiment software, you must
traceable enable the generation of FPGA variables so that the FPGA signals are traceable.
You enable the tracing mechanisms via the FPGA_SETUP_BL block. For
instructions, refer to How to Make FPGA Signals Traceable on page 240.
239
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Trigger source for tracing The data acquisition of traced signals is triggered with the task period of the
processor application.
MicroLabBox The processor application of the processor core that programs the FPGA triggers the data
acquisition. You specify this processor application during the build configuration. Refer to How
to Build Multicore Processor Applications for MicroLabBox on page 201.
MicroAutoBox II The processor application triggers the data acquisition.
HowTos
References
Objective If you want to build an FPGA application that support the tracing of FPGA
signals, you must enable the feature before you build the application.
Limitations For limitations on tracing FPGA signals, refer to Basics on Tracing FPGA Signals
on page 237.
240
FPGA Programming Blockset Guide May 2024
Tracing FPGA Signals
Tip
Update lets you trigger the analysis of the number of elements that will
be accessable for the current FPGA model.The Summary area display
the result of the analysis.
For analyzing, the dialog opens a temporary model
<FPGAModelName>_rtiFPGAtmp. The dialog closes the temporary
model at the end of the analysis.
241
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Note
Result You enabled that the FPGA application will provide variables for tracing FPGA
signals. The variables will be added during the build process of the FPGA
application.
HowTos
Objective You can reduce the number of traceable signals by excluding parts of the model
from tracing.
242
FPGA Programming Blockset Guide May 2024
Tracing FPGA Signals
2 Open the Block Properties dialog of the subsystem and enter DsVdOmit=1 in
the Tag edit field.
For more information on the DsVdOmit tag, refer to Basics on Tracing FPGA
Signals on page 237.
Result You reduced the number of traceable FPGA signals. The signals of the excluded
subsystems cannot be traced with an experiment software.
HowTos
243
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Adjusting tunable FPGA If you enable the tracing of FPGA signals, you can also enable that tunable FPGA
constants constants are provided.
Tunable FPGA constants FPGA constants are tunable only if they are added
to a subsystem that you selected for FPGA signal tracing. If you enable
that tunable FPGA constants are provided, the FPGA constants inside these
subsystems are tunable.
For more information on selecting subsystems for tracing, refer to Basics on
Tracing FPGA Signals on page 237.
244
FPGA Programming Blockset Guide May 2024
Adjusting Values of FPGA Constants
Making FPGA constants Before you can tune FPGA constants with your experiment software, you
tunable must enable the generation of additional FPGA variables to support tunable
FPGA constants. You enable this feature via the FPGA_SETUP_BL block. For
instructions, refer to How to Make FPGA Constants Tunable on page 245.
HowTos
Objective If you want to build an FPGA application that supports tunable FPGA constants,
you must enable the feature before you build the application.
Supported platforms For platforms that can provide tunable FPGA constants, refer to Methods to
access the FPGA application on page 235.
245
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Limitations For limitations on adjusting tunable FPGA constants, refer to Basics on Tunable
FPGA Constants on page 244.
FPGA constants are tunable only if they reside in a subsystem that you
selected for FPGA signal tracing. For more information on selecting signals
for FPGA signal tracing, refer to Selecting signals for tracing on page 238.
Tip
Update lets you trigger the analysis of the number of elements that will
be accessable for the current FPGA model.The Summary area display
the result of the analysis.
For analyzing, the dialog opens a temporary model
<FPGAModelName>_rtiFPGAtmp. The dialog closes the temporary
model at the end of the analysis.
Result You enabled that the FPGA application will provide variables for tuning FPGA
constants. The variables will be added during the build process of the FPGA
application.
Example for tunable FPGA The following example shows you the SDF file of a DemoFPGApipt1 demo
constants project in ControlDesk. The FPGA constants Ki and Kp are added to the demo to
246
FPGA Programming Blockset Guide May 2024
Adjusting Values of FPGA Constants
replace the values that are sent from the processor model. The demo is built with
tunable FPGA constants.
247
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Introduction FPGA test access and scaling are two methods to access and modify the interface
signals of the FPGA application. If you enable FPGA test access and scaling, the
build process adds additional FPGA variables to the FPGA application to support
the features.
FPGA test access An FPGA application with FPGA test access provides intervention points at the
FPGA interface. These intervention points let you substitute values that are
exchanged with the FPGA interface.
248
FPGA Programming Blockset Guide May 2024
Enabling the FPGA Test Access and Scaling
board-specific bus
Replace value
FPGA_XDATA_WRITE_BL Processor
model
Interface logic
Replace value
Interface logic
Replace value
FPGA_IO_READ_BL
With the experiment software, you can set a value that replaces the original
signal. A replace value becomes active when you switch the input or output from
the original signal to the replace value.
FPGA Scaling FPGA scaling lets you modify the signal of the FPGA interface as follows:
§ Scaling of analog signals with a scaling factor.
§ Adding signal offsets to analog signals.
§ Saturating analog signals.
§ Inverting digital I/O signals, including RS232/485 signals.
249
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Analog output
I/O logic
channel
Scaling
FPGA test access Saturation
and offset
FPGA_IO_WRITE_BL
Analog input
I/O logic
channel
Scaling
Saturation FPGA test access
and offset
FPGA_IO_READ_BL
Digital output
I/O logic
channel
Inverting FPGA test access
FPGA_IO_WRITE_BL
Digitial input
I/O logic
channel
FPGA test access Inverting
With the experiment software, you can set variables to scale the I/O signals.
Methods to scale analog signals There are two methods to scale analog
signals with different intentions:
§ To access and modify the analog signals with your experiment software, you
enable FPGA test access and scaling.
§ To conveniently handle the analog values, you scale the Bit values of the
analog converter to the physical unit millivolt.
250
FPGA Programming Blockset Guide May 2024
Enabling the FPGA Test Access and Scaling
Using the experiment The following table shows you the types of FPGA variables that are added to the
software for access SDF file to support FPGA test access and scaling:
ControlDesk instruments Intruments to modify analog signals of an FPGA application at run time are
available in ControlDesk. Refer to ControlDesk Instrument Handling .
HowTos
251
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Objective If you want to build an FPGA application with FPGA test access and scaling, you
must enable the feature before you build the FPGA application.
Tip
Update lets you trigger the analysis of the number of elements that will
be accessable for the current FPGA model.The Summary area display
the result of the analysis.
For analyzing, the dialog opens a temporary model
<FPGAModelName>_rtiFPGAtmp. The dialog closes the temporary
model at the end of the analysis.
Result You enabled that the FPGA application includes variables to provide the signal
ports and function ports with FPGA test access and scaling. The variables will be
added during the build process of the FPGA application.
To access the variables for FPGA test access and scaling, you use the SDF file that
is generated when you build the real-time application.
For an overview of the added FPGA variables, refer to Using the experiment
software for access on page 251.
Example for FPGA test access The following example shows you the added variables for the
and scaling FPGA_XDATA_READ_BL1 interface block for FPGA test access and scaling in
ControlDesk. The example application is built with FPGA test access and scaling.
252
FPGA Programming Blockset Guide May 2024
Enabling the FPGA Test Access and Scaling
Objective To scale and use analog signals with the required precision and value range.
Precondition FPGA test access and scaling must be enabled. Refer to How to Enable FPGA Test
Access and Scaling on page 252.
253
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
The Scaling page displays the scaling parameters that are supported for the
selected I/O function.
2 On the Scaling page, specify the format and the bit width of analog signal
values.
For more information on the parameters, open the Description page and
click the Help for <block name> button.
Result You changed the data type that is used by the selected I/O function for analog
signal values.
Objective To specify scaling presettings for offline simulation and for the build FPGA
application.
Supported platforms For platforms that support the scaling of I/O signals, refer to Methods to access
the FPGA application on page 235.
254
FPGA Programming Blockset Guide May 2024
Enabling the FPGA Test Access and Scaling
Precondition FPGA test access and scaling must be enabled. Refer to How to Enable FPGA Test
Access and Scaling on page 252.
The Scaling page displays the scaling parameters that are supported for the
selected I/O function.
2 On the Scaling page, specify the settings for the scaling parameters.
Note
For more information on the parameters, open the Description page and
click the Help for <block name> button.
Result You specified the scaling presettings for the selected I/O function. The settings
are used for offline simulation and for the build of the FPGA application.
255
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
Introduction The FPGA Scope block lets you connect up to 16 FPGA signals that can be
captured. Nevertheless, only 8 FPGA signals can be displayed in ControlDesk at
the same time. You can select the signals to be displayed in ControlDesk.
Basics on capturing If a trigger event occurs, the FPGA Scope block captures a time sequence of
the connected FPGA signals. The scope depth indicates the number of captured
data values. As an alternative, you can use the video mode to capture the FPGA
signals without triggering.
Time sequence length The scope depth limits the number of signal
values in a captured time sequence. The highest time resolution
to capture the FPGA signal is the FPGA clock period. You can
downsample the signal capturing to capture a longer time sequence
with a reduced time resolution. The length of a time sequence is
tsequence = Scope deptℎ ⋅ Downsampling factor ⋅ FPGA clock period
Configuring the scope You can specify the scope depth in the block dialog. Refer to FPGA Scope (FPGA
Programming Blockset - FPGA Interface Reference ).
The FPGA Scope instrument in ControlDesk lets you configure the signal
capturing at run time, such as the trigger conditions and downsampling factor.
Refer to FPGA Scope (ControlDesk Instrument Handling ).
After you build the FPGA application, the FPGA custom function lets you
specify an initial scope configuration in ConfigurationDesk. Refer to Configuring
the Basic Functionality (FPGA) (ConfigurationDesk I/O Function Implementation
Guide ).
256
FPGA Programming Blockset Guide May 2024
Displaying FPGA Signals in ControlDesk
257
May 2024 FPGA Programming Blockset Guide
Accessing FPGA Applications with your Experiment Software
258
FPGA Programming Blockset Guide May 2024
Troubleshooting
Troubleshooting
Introduction When working with the FPGA Programming Software there are some problems
which can arise.
Overview Known problems and their solution are grouped by their occurrence:
§ General modeling issues on page 259
§ Implementing the FPGA model on page 260
§ Building an FPGA application on page 262
§ Building a processor application on page 266
§ Running the FPGA application on a dSPACE system on page 267
General modeling issues Copying of model parts takes a long time Copying the FPGA
Programming Blockset's function blocks might take too long. As of FPGA
Programming Blockset 3.3, the blockset automatically analyzes the FPGA model
and reassigns new hardware resources. The analysis might take too long.
You can speed up the copy & paste process for the current session by
deactivating the automatic reassignment of new hardware resources:
§ Open the Advanced Preferences dialog and set the
PASTE_KEEP_CHANNEL_NUM preference to false. Refer to Dialog Settings
of the Advanced Preferences Dialog (FPGA Programming Blockset - FPGA
Interface Reference ).
259
May 2024 FPGA Programming Blockset Guide
Troubleshooting
Implementing the FPGA The following errors might occur in implementing the FPGA model via the HDL
model library of the AMD Vitis Model Composer and trying to perform actions like
offline simulation or FPGA build. The messages appear in the MATLAB command
prompt and/or in a MATLAB or Simulink error dialog box.
260
FPGA Programming Blockset Guide May 2024
Problems and Their Solutions
build process, etc. The error message is reported by an FPGA interface block of
the FPGA Programming Blockset.
§ Control the data path driving the reporting FPGA interface block.
§ If a Down Sample block from the HDL library of the AMD Vitis Model
Composer was used in this path, make sure that there is always a
corresponding Up Sample block before driving the FPGA interface block.
§ Make sure that the downsampling factor of the whole path exactly matches
the upsampling factor. For example, there could be two cascaded Down
Sample blocks each with factor 2 and one Up Sample block with factor 4.
§ If a block of teh HDL library of the AMD Vitis Model Composer defining
its own sample period, for example, a Counter block, drives the FPGA
interface block, make sure that the defined sample period matches the offline
simulation period specified in the FPGA_SETUP_BL block.
§ If the sample period must be higher than the system period, for example, if the
counter has to run at a lower rate to count slower, use an Up Sample block
before driving the FPGA interface block. The factor by which the driving block
runs slower must be upsampled precisely.
261
May 2024 FPGA Programming Blockset Guide
Troubleshooting
Building an FPGA application The following errors might occur in building an FPGA application. They appear in
the MATLAB Command Window and/or in a MATLAB or Simulink error dialog.
262
FPGA Programming Blockset Guide May 2024
Problems and Their Solutions
Path length exceeds maximum length During the build process the path
length can get unpredictably long, as shown by the following example:
<model_folder>\<modelname>_rtiFPGA\
<modelname>_<ApplicationID\sysgen\hdl_netlist\cm.runs\
cm_c_counter_binary_v12_0_0_synth_1\
cm_c_counter_binary_v12_0_0*.*
It is not possible to specify a maximum build path length that is guaranteed to
work.
The windows operating system limits the maximum path length to
260 characters. This limitation might lead to miscellaneous error messages
during file system operations.
1. Minimize the total length of the working folder, the FPGA build
folder, the model name, and the name of the FPGA subsystem
to be built. For details on specifying the FPGA build folder, refer
to Parameters Page (FPGA_SETUP_BL) (FPGA Programming Blockset -
FPGA Interface Reference ). For details on minimizing the total
length of the working folder, refer to AMD Answer Record 52787
(https://support.xilinx.com/s/article/52787?language=en_US).
2. Restart the build process.
263
May 2024 FPGA Programming Blockset Guide
Troubleshooting
1. Check the CORE Generator log file to determine the exact error reason.
§ Use a file search to find the log file second_pass_coregen.txt
in the subfolders of the FPGA interface build folder
<WorkingDir>/<ModelName>_rtiFPGA/...
§ Open the log file and find the following error: ERROR:sim -
PortBWidth: Value '1' is out of range '[2..64]'
2. Replace all CMult blocks configured as described above by Delay blocks.
This results in the same behavior, but a Delay block only needs one register
entry, whereas a CMult block allocates a DSP block.
264
FPGA Programming Blockset Guide May 2024
Problems and Their Solutions
This error appears if the FPGA application cannot run on the FPGA due to timing
issues. The design cannot run at the FPGA’s clock frequency.
§ Run a Timing Analysis to determine exactly which data path of your model
does not meet timing constraints.
§ Make the path a multicycle path by downsampling. Use the Down Sample
and Up Sample blocks of the HDL library of the AMD Vitis Model Composer
in the data path.
§ When using DSPs in a multicycle path, refer to Notes on Using Multicycle Paths
on page 71.
§ Add additional latency to the data path by:
§ Inserting dedicated Register or Delay blocks in the data path.
§ Increasing the Latency parameter of blocks within the data path.
§ Change the implementation-specific settings for each FPGA block. Several
blocks, for example, the Mult, Counter, CMult or AddSub blocks, provide an
Implementation page in their block dialogs:
§ Use Cores instead of behavioral HDL.
§ Use optimization for speed instead of area.
§ Enable pipelining.
265
May 2024 FPGA Programming Blockset Guide
Troubleshooting
§ When processing different signals, ensure that the signal transmission time is
the same.
For example: Three values of an analog converter are processed to one signal.
To process the values of the same point in time, the delay of the signals must
be the same.
Building a processor The following errors might occur when performing a Simulink Coder build
application to generate a processor application. They appear in the MATLAB Command
Window and/or in a MATLAB or Simulink error dialog.
266
FPGA Programming Blockset Guide May 2024
Problems and Their Solutions
This error appears when you try to start a Simulink Coder build process for a
model that still contains FPGA subsystems.
§ Switch the model mode from FPGA-Build / Offline Simulation to Processor-
Build by using the Processor Setup block (PROC_SETUP_BLx). This step
temporarily removes all FPGA blocks from the model.
Running the FPGA application The following errors might occur in running the built FPGA application on a
on a dSPACE system dSPACE system. You can find the source of the errors by experimenting with
dSPACE's ControlDesk.
267
May 2024 FPGA Programming Blockset Guide
Troubleshooting
268
FPGA Programming Blockset Guide May 2024
Index
I
Index
feature overview 25
A DS2655 FPGA Base Board
I/O access 73
feature overview 27
accessing FPGA signals I/O mapping of input channels 74
DS2655M1 Multi-I/O Module
experiment software 230 I/O mapping of output channels 75
feature overview 28
SDF file 230 I/O modules
DS2655M2 Digital I/O Module
adjusting FPGA constants for MicroAutoBox II 25
feature overview 28
adjusting mechanism 244 for MicroAutoBox III 25
DS6601 FPGA Base Board
basics 244 for SCALEXIO DS2655 28
feature overview 27
limitations 244 input channel number 73
DS6602 FPGA Base Board
AMD Design Suite 20 input channel types 73
feature overview 27
AMD Vitis Model Composer 20
DS6651 Multi-I/O Module
feature overview 28 L
B Local Program Data folder 11
best practise 54 E
building FPGA application
effects of modeling external I/O access 75 M
FPGA Build Server
exchanging data with the processor model 55, MAP file 230
basics 212
130 MicroAutoBox II
MicroAutoBox II 195
experimenting with FPGA application 229 building FPGA application 195
MicroAutoBox III 186
exporting to ConfigurationDesk feature overview 24
separating the processor model 189
build result 191 MicroAutoBox III
MicroLabBox 195
processor model 191 feature overview 24
MicroLabBox II 186
MicroLabBox
SCALEXIO system 186
separating the processor model 189 F building FPGA application 195
feature overview 22
building multicore processor application features
MicroLabBox II
MicroLabBox 201 new features 32
feature overview 23
building processor application Release 2021-A 39
migrating
MicroAutoBox III 193 Release 2021-B 39
framework 43
MicroLabBox II 193 Release 2022-A 38
platform 43
SCALEXIO system 193 Release 2022-B 37
modeling
building single-core processor application Release 2023-A 34
multiple clock domains 81
MicroAutoBox II 200 Features
user clock domains 84
MicroLabBox 200 Release 2023-B 33
burnapplication folder 204 FPGA application name 55
FPGA architecture 13 N
C FPGA board assignment 54 new features
FPGA data synchronization 56 FPGA Programming Blockset 32
clock domain
FPGA interface 16
multiple 81
FPGA Programming Blockset
user clock 84 O
components 16
clock period output channel number 74
hardware support 22
multiple clock domains 81 output channel types 74
new features 32
user clock domains 84
FPGA scaling
Common Program Data folder 11
basics 249 P
components of the FPGA Programming
FPGA test access Parameters page
Blockset 16
basics 248 empty 52
creating a burn application 203
enabling 252 processor communication
FPGA tracing MicroAutoBox II 131
D basics 237 MicroAutoBox III 131
Description page enabling 240 MicroLabBox 131
empty 52 excluding signals 242 MicroLabBox II 131
deseparating a model 199 limitations 238 SCALEXIO 132
Documents folder 11 processor interface 16
downloading FPGA application 229 G implementing 148
downloading processor application 229 programming FPGA 203
generating a processor interface 148
DS1514 programming into flash 203
feature overview 24 programming into RAM 203
DS1552 Multi-I/O Module H providing simulation ports 174
feature overview 25 hardware support 22
DS1552B1 Multi-I/O Module
R
feature overview 25
DS1554 Engine Control I/O Module reading an FPGA signal 47
269
May 2024 FPGA Programming Blockset Guide
Index
S
SCALEXIO FPGA base board
feature overview 27
SDF file 230
separating a model 199
simulating FPGA subsystem 174
simulating processor model 175
specifying offline simulation period 174
supported AMD design tools 21
supported MATLAB versions 21
supported operating systems 21
switching model mode 199
T
tracing FPGA signals
basics 237
excluding model parts 238
limitations 238
subsystem omission tag (DsVdOmit) 238
tracing mechanism 237
TRC file 230
troubleshooting 259
building FPGA application 262
building processor application 266
copying FPGA model 259
implementing FPGA model 260
no FPGA model actions 259
path length 263
running FPGA application 267
too much asynchronous logic 265
unsafe clock interactions 265
viewing sample time information 260
Vitis Model Composer Hub 259
tunable FPGA constants
basics 244
enabling 245
limitations 244
U
updating FPGA framework 42
W
workflow 57
using a MicroAutoBox II 60
using a MicroAutoBox III 58
using a MicroLabBox 60
using a MicroLabBox II 58
using a SCALEXIO system 58
writing an FPGA signal 48
writing to output channels 74
X
Xilinx System Generator for DSP 20
270
FPGA Programming Blockset Guide May 2024