> 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/ehs/3.7/first-steps/integrate-ehs-into-rt-lab-and-hypersim-models/prepare-an-hypersim-model.md).

# Prepare an HYPERSIM Model

## Overview

In HYPERSIM, the electrical circuit is designed in **Schematic Editor** and executed on the FPGA through the **FPGA-based circuit** block.

The HYPERSIM model must include the required **FPGA-based circuit** block to:

* Select and load an eHS firmware.
* Open and manage the Schematic Editor circuit.
* Exchange signals between the FPGA and CPU models.

All circuit, firmware, hardware, and signal configuration information is stored in a single **`.ehs3`** project file. This page explains how to add the required block and associate an HYPERSIM model with an eHS project.

## Procedure

{% stepper %}
{% step %}

### Add the eHS solver block to the model

The CPU model must include the **FPGA-based circuit** block.

1. In HYPERSIM, open the CPU model.
2. Navigate to **Network Tools** and drag the **FPGA-based circuit** block into the model.

<figure><img src="https://521571437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo99Izmvvw5eHT4ldzI4g%2Fuploads%2Fgit-blob-7d237b9c4982af372c47f0b24907a9347b6f39ea%2FSE_eHSblock_new_hypersim.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create a new circuit (or choose an existing one)

When the block is added, you will be prompted to:

* **Create New Circuit**\
  Opens the Schematic Editor with a blank circuit.
* **Choose Existing Circuit**\
  Prompts you to select a valid `.ehs3` file or legacy `.ehs` file and automatically configures the block to match the circuit’s inputs and outputs.

Each project includes a **`.ehs3` file**, which serves as the **single source of truth** for the Schematic Editor circuit. This file contains:

* The electrical eHS circuit model (formerly `.ehs`)
* Simulation setups
* Firmware descriptions
* Hardware configurations
* All required signal connections

The `.ehs3` file can be versioned (e.g., Git), edited in the Schematic Editor, and shared across teams.

Once selected or created, the circuit is opened in the **Schematic Editor** and remains continuously synchronized with the filesystem.
{% endstep %}

{% step %}

### Model in Schematic Editor

Follow the guidelines in [Model In Schematic Editor](broken://spaces/nVlkMVXjY5bWbFGd9Gyz/pages/aBK8ZFLlzCBwUYs6t8ws) to create and configure the eHS circuit.
{% endstep %}

{% step %}

### Complete the simulation in HYPERSIM

Finalize the model configuration and simulation in **HYPERSIM** as described in [Power Electronics and Electric Machines with eHS](https://www.opal-rt.com/docs/hypersim/model-and-simulation/power-electronics-and-electric-machines-with-ehs).

This includes completing the model configuration in HYPERSIM, connecting any required external hardware, and executing the model on the simulator.
{% endstep %}
{% endstepper %}

## Open Schematic Editor

To edit the circuit, select an eHS firmware (bitstream), or configure interaction with the CPU model and/or an external device under test (DUT), open Schematic Editor.

To do so, simply double-click the **FPGA-based circuit** block. Alternatively, right-click the block, navigate to **eHS** and select **Open in Schematic Editor**.

## Manage eHS circuit integration

The **FPGA-based circuit** block also provides several management and configuration options that simplify the integration of an eHS circuit with the CPU model. These options allow you to synchronize the block with circuit changes, choose another circuit file, open the circuit file directory in the file explorer and open the **Build Report**.

To access these options, right-click the block and navigate to **eHS**:

<figure><img src="https://521571437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fo99Izmvvw5eHT4ldzI4g%2Fuploads%2Fgit-blob-928a9b2683dbc1647d0bb94bca0a13ca67fd3a1e%2FeHS-block-options-hyp.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/ehs/3.7/first-steps/integrate-ehs-into-rt-lab-and-hypersim-models/prepare-an-hypersim-model.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.
