AN 994: Drive-on-Chip Design Example for Intel Agilex® 7 Devices

ID 780361
Date 6/26/2023
Public
Document Table of Contents

7.3.6.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 Platform Designer, 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 32. FOC Model integrated in Simulink* with Avalon memory-mapped Register Map

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.