Configurable threshold comparator module ======================================== This comparator is designed to generate a digital interlock signal for fast protection systems based on the value of an analog protection variable. To provide the needed flexibility to adapt this function to most control applications, the module supports the following runtime configuration options: - Signed or unsigned comparison. - Choosing whether the allowed range for the control variable is above or below the assertion threshold. - Two thresholds: one for the assertion of the alarm and a different one for its release. - A time margin that must elapse before a value past the assertion threshold can raise the alarm. - A time margin that must elapse before a value within the release threshold can release the alarm. Time margins can be set to zero if the module should react immediately to a change in the input. The dual threshold feature is also optional and can be disabled by setting both thresholds to the same value. .. note:: If dual threshold is used, the user is responsible to select the two values so that the assertion threshold is more permissive than the release threhsold, to obtain the desired hysteresis effect. If the two values are swapped, the module may become incapable of raising alarms. The width of the input variable can be selected at compile-time with the `width_g` generic. The digital output of the module is active low, meaning that a low value represents the assertion of the interlock signal, while a high value represents normal operation of the system. The module shall be kept in reset mode by maintaining `rstn_i` low while the configuration inputs are modified. The configuration inputs are unregistered, as they are meant to be stored in a register tree. False paths may be declared from the registers where the configuration inputs are stored to this module's output if needed for timing closure. The meaning of each configuration input is listed in the section below. VHDL interface description -------------------------- .. vhdlentity:: :file: ../Firmware/Source/modules/threshold_comparator/hdl/threshold_comparator.vhd :entity: threshold_comparator