AN 999: Drive-on-Chip with Functional Safety Design Example: Agilex™ 7 Devices

ID 823627
Date 7/04/2024
Public

Visible to Intel only — GUID: gpi1716294809402

Ixiasoft

Document Table of Contents

4.3.3. Interval Timer

The interval timer from the Quartus or Platform Designer IP catalog is the source of synchronization of the FPGA channel and the HPS channel. Calculating the speed in both the channels, the cross comparison, and evaluating the safety function must occur in the interval between the timer timeout and interrupt signals.

The interval timer provides the safety response time. In this design, the safety response time is 1 ms. During that time, the FPGA channel generates a payload, writes the payload to shared memory, retrieves the payload from the HPS, and runs the comparison. Similar for the HPS safety channel. The HPS uses the interrupt line from Linux to start the safety function.

In this design, the timer is set to 1 ms interval by writing a count value according by the clock frequency of the timer (in this case 100 MHz). This IP writes to the registers periodl and periodh. Then, the timer runs in free running mode by writing a 0x7 in the control register. When the count reach 0x0, the timer issues an Interrupt for the Linux system (the timer is registered as a UIO device in the Linux DTS with its corresponding interrupt number) and the design assert the timeout output. These signals trigger the safety function in the FPGA and HPS channel respectively. When the interrupt occurs, the systems clears the interrupt and the timeout signal and sets the timer to free running mode again.

For more information about the operation, functions, registers of the interval timer, refer to <project>/hps_software/src/devices/interval_timer.c/.h and the Interval Timer Core User Guide.