> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hypersim/examples/how-to/fpga-scope.md).

# FPGA Scope

## Description

The **FPGA Scope** example, located in **File > Open an Example File > How To**, demonstrates how to use the FPGA Scope to visualize high‑speed internal FPGA signals at acquisition rates higher than the simulation step. The example generates sine waves and pulse‑width modulated signals, drives them to the simulator’s analog and digital output interfaces, and loops them back into the corresponding inputs.

The objective is to measure Analog I/O latency and noise, compare the precision of FPGA‑based and Simulink‑based pulse‑width modulators, and measure Digital I/O latency.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-c6fa8299b281a2d507b6cb93fe195515e02410da%2Fimage%20(520).png?alt=media" alt=""><figcaption></figcaption></figure>

## Requirements

This example requires a real-time simulator equipped with FPGA capability and Digital I/O modules. A digital loopback connection must be configured on the simulator, linking Digital Input channels 0–15 to the corresponding Digital Output channels and between Analog Outputs and Analog Inputs (channels 0–15).

An **Gen5 eHSx128** solver license is needed.

A supported simulator (OP4610XG, or OP4510 with firmware provided for OP4510‑325T \[TE0741\_3] or OP4510‑410T \[TE0741\_4]).- A PCIe‑based OPAL-RT Board with an OPBIN-format bitstream that includes the FPGA-based Acquisition Module (RT‑XSG).- I/O interfaces (or compatible): OP5353 Digital Input board (32 channels), OP5360‑2 Digital Output board (32 channels), OP5340 Analog Input board (16 channels), OP5330‑3 Analog Output board (16 channels).

## Detailed explanation

The FPGA Scope leverages the RT‑XSG FPGA-based Acquisition Module available on PCIe‑based OPAL‑RT Boards. It streams selected internal FPGA signals to the workstation over PCIe.

A list of internal FPGA signals available for acquisition is generated during bitstream creation and provided to the FPGA Scope. From this list, subset of signals are selected prior to loading the model onto the simulator for visualization

The maximum number of simultaneously recorded signals is bitstream‑dependent (typically up to 32). The minimum acquisition period depends on the number of selected signals (N) and the FPGA user‑model clock period. In general, the minimal acquisition period is equal to N+1 clock cycles.

The acquisition rate can be adjusted on the fly.

To use the FPGA Scope, follow the steps in [Monitor FPGA Signals with FPGA Scope](https://github.com/Opal-RT-Technologies/product-docs-hypersim/tree/release-2026.4/monitor-fpga-signals-with-fpga-scope.md).

{% stepper %}
{% step %}
**Setup and connections**

The I/O interfaces for this model are as follows:

<table><thead><tr><th width="225.39996337890625">I/O interface</th><th>Description</th></tr></thead><tbody><tr><td>IO Group 1 Section A</td><td>OP5353 Digital Input board (32 channels) or compatible interface</td></tr><tr><td>IO Group 1 Section B</td><td>OP5360-2 Digital Output board (32 channels) or compatible interface</td></tr><tr><td>IO Group 2 Section A</td><td>OP5340 Analog Input board (16 channels) or compatible interface</td></tr><tr><td>IO Group 2 Section B</td><td>OP5330-3 Analog Output board (16 channels) or compatible interface</td></tr></tbody></table>

To reproduce the described behavior, connect loopbacks between digital outputs and inputs for channels 00–15, and between analog outputs and inputs for channels 00–15.
{% endstep %}

{% step %}
**Model preparation**

After opening the model in the HYPERSIM Workspace:

* If you select a new configuration file, confirm the OPAL‑RT Board I/O configuration:
  * **Slot 1A - Digital in/Channels 0 - 7** enabled, Digital type “Pulse width modulated”
  * **Slot 1A - Digital in/Channels 8 - 15** enabled, Digital type “Pulse width modulated”
  * **Slot 1B - Digital out/Channels 0 - 7** enabled, Digital type “Static”
  * **Slot 1B - Digital out/Channels 8 - 15** enabled, Digital type “Pulse width modulated”
  * **Slot 2A - Analog in/Channels 0 - 7** enabled
  * **Slot 2B - Analog out/Channels 0 - 7** enabled
* In I/O Interface Configuration, ensure the OPAL‑RT Board Chassis ID matches your hardware.
* In Simulation Settings, assign the simulation to your simulator.
* Start the simulation.
  {% endstep %}

{% step %}
**Signal selection**

Select signals by editing the FSD file associated with the Bitstream configuration file; also set the trigger signal for acquisition. The FSD file is located in the project’s “firmware” folder.

* The FSD file lists available signals and their data types in JSON. Select signals by setting each signal’s “Selected” field to *true*.
* The maximum number of simultaneously selected signals appears as “max\_count\_selected\_signals” at the top of the FSD file.
* Assign the trigger signal by adding “TriggerSelected”: *true* to the desired signal.

When using the FPGAScope data source in ScopeView, signal selection and trigger configuration update the FSD file, which is then applied on the simulator during runtime.
{% endstep %}

{% step %}
**Acquisition**

To visualize acquired signals in ScopeView:

* In HYPERSIM, start the simulation.
* Open ScopeView.
* Load the ScopeView template located next to the model’s .ecf file.
* In the Data Sources Chooser window, select FPGAScope tab, set the simulator IP address in the “Target” field, then click “Fetch Simulation.”

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-cb329a30e38ee984bb61a2182b8f6324ca5bd6ce%2Fimage%20(1028).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

* In “Signal Groups,” select the simulation matching the model.
* Select the signals to visualize.
* In the oscilloscope view, configure the trigger signal, acquisition period and window size, and trigger characteristics. Start an acquisition by clicking the black “Start” button.
  {% endstep %}
  {% endstepper %}

## Simulation and results

Select analog inputs and outputs for channels 0–3 and superimpose them to observe the latency introduced by the analog conversion cards in the loopback. The Simulink-based sine outputs appear sampled at the model rate. By zooming, you can see latency between each analog output and its corresponding analog input, as well as amplitude differences and noise levels.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-5dcf9335ee4a16cbd51733d9a82a1ffdf30e1456%2Fimage%20(1024).png?alt=media" alt=""><figcaption></figcaption></figure>

### Precision of FPGA-based pulse-width modulators

Select digital outputs for channels 0–15, grouping signals by carrier frequency and duty cycle to compare Simulink-based modulators (channels 0–7) with FPGA-based modulators (channels 8–15). For lower carrier frequencies (channel pairs 0 & 8 and 2 & 10), the precision difference is not evident. At higher carrier frequencies, the superior precision of the FPGA-based modulators is clear.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-c31b059af2911daacbb782a9a60a899803c3ed44%2Fimage%20(1025).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-03453185ab3113a3a2b409bc287128457890e2dd%2Fimage%20(1026).png?alt=media" alt=""><figcaption></figcaption></figure>

### Measurement of digital interface latency

Select digital output channel 0 and digital input channel 0 to evaluate loopback latency through the digital conditioning interfaces. With the default selection of signals, you can reduce the acquisition period to approximately 100 ns. To acquire at a faster rate, follow this procedure:

* In HYPERSIM, stop the simulation.
* Edit the FSD file and set the “Selected” attribute of all analog output and analog input signals to *false*, keeping only the required digital input and output channels set to *true*.
* Restart the simulation in HYPERSIM.
* In ScopeView, lower the acquisition period to as little as 15 nanoseconds.
* Click “Start” to run an acquisition.
* By zooming in, measure latency more precisely. Depending on the digital interface type, latency typically ranges from 30 ns to 600 ns.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-7b001808b7b0aa0101c46cfcaf8dc580fbf40494%2Fimage%20(1027).png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hypersim/examples/how-to/fpga-scope.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
