StepĀ 2: How to Model the Processor Communication

Objective

Modeling the communication within the dSPACE hardware between the real-time processor and the FPGA.


Method: Modeling the processor communication

  1. In the FPGA model subsystem, open the dialog of the FPGA Setup block.

  2. On the Interface tab, click Generate Processor Blocks for FPGA XDATA Blocks to generate all processor interface blocks.

    A Simulink model opens including the generated Register Out processor interface block. The generated block is the counterpart to the Register In FPGA interface block.

  3. Move the generated block to the Processor model subsystem.

  4. Add a Simulink Signal Generator block to the processor model with the following settings:

    • Waveform parameter: square

    • Amplitude: 1,000

    • Frequency: 100

    • Units: Hertz

  5. Connect the Signal Generator block with the Register Out processor interface block.

  6. Press Ctrl+S to save the model.


Result

You modeled the interface to the FPGA and added the signal generation to the processor model.

Tip

The dialogs of the interface blocks let you show the corresponding interface block in the other subsystem.

  • In the Processor model subsystem, open the dialog of the of the Register Out processor interface block. On the FPGA Block Connections page of the dialog, the dialog provides a link to the corresponding interface block in the FPGA model after you clicked the update button.

  • In the FPGA model subsystem, right-click on the Register In block and select dSPACE FPGA - Show Corresponding Block.


Next step

For the next step, refer to StepĀ 3: How to Simulate the Entire Model.


Redaction