Calculate Threshold Counts

Versal Adaptive SoC Technical Reference Manual (AM011)

Document ID
AM011
Release Date
2023-10-05
Revision
1.6 English

The settings for the threshold NCLKMON_THRESH registers depends on the following parameters:

  • Frequency of the base clock, FBASE_CLK
  • Number of base clocks programmed for the base time period, NBASE_CLK_CYCLES
  • Frequency threshold of the monitored clock, FMON_CLK

A threshold setting can be calculated using the following equation:



Example

In this example, the following is assumed:

  • REF_CLK is used with a 33 MHz clock frequency
  • CLKMON0_BASE [CLK_CYCLES] is set = 10000
  • Desired lower threshold frequency for the APU clock is 1000 MHz

Because the APU clock is divided by 4 before being presented to the ClkMon channel (see table in Monitored Clocks), the FMON_CLK is actually 250 MHz.

From the equation, the clock threshold is 127EDh (75,757d). Bound the accuracy using ClkMon 0 by programming the CLKMON0_THRESH_L and CRP.CLKMON0_THRESH_H registers.

The result is a sampling time of approximately 303 μs.