AN 773: Drive-On-Chip Design Example for Intel® MAX® 10 Devices

ID 683072
Date 7/26/2023
Public
Document Table of Contents

7.11.2. Avalon Memory-Mapped Interface

The Drive-on-Chip Design's DSP Builder-generated VHDL has a signal interface that matches the connections in Simulink. Feedback currents, position feedback, torque command, and gain parameters are all parallel inputs into the system and voltage commands are parallel outputs.

To allow direct connectivity in Qsys , the top-level DSP Builder for Intel FPGAs design adds blocks to terminate the parallel inputs and outputs and handshaking logic with an Avalon memory-mapped register map.

Figure 45. FOC Model integrated in Simulink* with Avalon memory-mapped Register MapThe calculation in the yellow block is in DSP Builder for fixed-point designs and in software for floating-point designs

DSP Builder generates a .h file that contains address map information for interfacing with the DSP Builder model.

To run the DSP Builder model as part of the drive algorithm, a C function passes the data values between the processor and DSP Builder. The handshaking logic ensures synchronization between the software and hardware. The software sets up any changes to hardware parameters such as PI gains, writes new feedback currents, position feedback and torque command input data before starting the DSP Builder calculation. The software then waits for the DSP Builder calculation to finish before reading out the new voltage command data.

The ISR that runs the FOC algorithm calls the C function with an option to switch between software and DSP Builder implementations at runtime.