RTL Studio Open IDE

Arithmetic & Math

Min/Max Pulse Width Measure 8-bit — L2 Upgrade

Tracks min/max of 8-bit input stream with configurable window-based sticky IRQ generation.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Min/Max Pulse Width Measure 8-bit — L2 Upgrade is a Verilog reference block in the Arithmetic & Math catalog. Adders, multipliers, dividers, ALUs, and arithmetic datapaths. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

The minmax_pulse_window_irq_8 module is a synchronous 8-bit digital IP designed to track the minimum and maximum values of an incoming data stream. It features a configurable window comparator that generates a sticky interrupt request (IRQ) when valid input data falls outside specified lower and upper bounds. This module is intended for L2 difficulty verification and synthesis, providing a robust solution for signal amplitude monitoring.

This IP provides a robust solution for monitoring signal amplitude ranges by combining simple min/max tracking with flexible window-based interrupt generation. The design is fully verified, covering reset initialization, boundary condition checks, and sticky interrupt logic. It is ready for integration into larger systems requiring real-time signal amplitude monitoring with configurable alert thresholds.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Min/Max Pulse Width Measure 8-bit — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Tracks min/max of 8-bit input stream with configurable window-based sticky IRQ generation.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Features

  • Synchronous Operation: Operates on a synchronous clock domain with an active-low asynchronous reset.
  • Min/Max Tracking: Continuously updates running minimum (min_val) and maximum (max_val) values only when the valid_in signal is asserted.
  • Configurable Window: Supports user-defined lower (window_min) and upper (window_max) bounds via input ports.
  • Sticky IRQ Logic: Asserts irq_out when valid input falls outside the defined window. The IRQ is cleared when window_en is deasserted and a new valid pulse occurs, ensuring the interrupt state reflects the most recent windowed check.
  • Reset Behavior: On reset, min_val initializes to 0xFF (maximum possible value) and max_val initializes to 0x00 (minimum possible value), ensuring the first valid sample always updates both registers.

Ports

DirectionWidthNameDescription
Input1clkClock input
Input1rst_nActive-low asynchronous reset
Input1valid_inValid data pulse indicator
Input8data_inInput data sample
Input1window_enWindow comparison enable
Input8window_minLower bound of the valid window
Input8window_maxUpper bound of the valid window
Output1irq_outSticky interrupt request flag
Output8min_valCurrent minimum value
Output8max_valCurrent maximum value

Verification

The testbench performs five key verification cases to ensure correct functionality:

  1. Reset Behavior: Verifies that min_val initializes to 0xFF and max_val to 0x00.
  2. Basic Tracking: Confirms that min_val and max_val update correctly upon receiving valid pulses.
  3. Low Out-of-Window: Triggers irq_out when input values are below window_min.
  4. High Out-of-Window: Triggers irq_out when input values are above window_max.
  5. IRQ Clearing: Verifies that irq_out is cleared when window_en is disabled and a new valid pulse occurs.
  6. In-Window: Ensures irq_out remains deasserted for values within the window bounds.
Test CaseDescriptionResult
TC1Reset values correctPASS
TC2Min/Max trackingPASS
TC3Out-of-window IRQPASS
TC4IRQ clear on window disablePASS
TC5In-window no IRQPASS

More in Arithmetic & Math

All Arithmetic & Math blocks