SpinalHDL
1 / 1
View past submissionsLeaderboard

Description

Redline Telemetry

The racing team's replacement ECU floods cylinder four while reporting a perfectly healthy fuel system. The exhaust glows hotter on every lap. Build an independent telemetry unit that measures each injector command and catches pulses long enough to reveal a stuck-open injector.

A fuel injector control line is high for the duration of each injection. Measure every complete high pulse in the sampled input stream.

Count consecutive high samples. On the first low sample after a high run, pulse valid and report the measurement. width saturates at 255 and overflow is 1 only when the true width exceeded 255; all three outputs are zero on cycles without a completed pulse.

Hardware I/O Encoding

  • injector is a stream of unsigned 1-bit samples with at most 320 elements
  • each output element is (valid, width, overflow)
  • valid and overflow are unsigned 1-bit values
  • width is an unsigned 8-bit value
  • the output contains one element per input sample

Example

Input [0, 1, 1, 1, 0, 1, 0] produces [(0, 0, 0), (0, 0, 0), (0, 0, 0), (0, 0, 0), (1, 3, 0), (0, 0, 0), (1, 1, 0)].

Input

injector

Stream of 1-bit Unsigned Integer (up to 320 elements)
Sampled fuel-injector control signal.

Output

Stream of (1-bit Unsigned Integer, 8-bit Unsigned Integer, 1-bit Unsigned Integer)
Measurement-valid pulse, saturated pulse width, and overflow flag after each sample.