Hardware interview practice
Throttle with temperature hysteresis
A GPU control block throttles at 90 degrees C and stays throttled until temperature falls to 80 degrees C. Implement the synchronous SystemVerilog hysteresis controller.
Starting point
Question code
input logic clk, rst_n;
input logic [9:0] temp_c;
output logic throttle;Reviewed example
Work through one case
Input
Start unthrottled and sample temp_c = 89.Expected output
throttle remains 0.The controller asserts throttle only at 90 or above, so 89 lies below the entry threshold.
What to cover
Requirements
- When not throttled, set throttle on a rising edge whose sampled temp_c is at least 90.
- When throttled, clear throttle on a rising edge whose sampled temp_c is at most 80.
- Hold the current state for sampled temperatures from 81 through 89, creating deterministic hysteresis.
- When rst_n=0 at a rising edge, clear throttle regardless of temp_c.
