RTL Studio Open IDE

Coding & Line Codes

8-Bit Run-Length Decoder (RLE)

An 8-bit Run-Length Decoder that repeats an input value for a specified count.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

8-Bit Run-Length Decoder (RLE) is a Verilog reference block in the Coding & Line Codes catalog. Line codes, serializers, and digital encoding/decoding blocks. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements an 8-bit Run-Length Decoder (RLE). It accepts a count and a value on input. It outputs the value repeatedly for the specified count cycles. The decoder supports asynchronous reset and synchronous control.

This IP provides a simple and efficient 8-bit Run-Length Decoder. It is suitable for basic data compression or decompression tasks. The design is fully verified with a comprehensive testbench.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 8-Bit Run-Length Decoder (RLE).
  2. Read the Verilog module in the editor. The catalog line for this block: An 8-bit Run-Length Decoder that repeats an input value for a specified count.
  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

  • 8-bit data path width.
  • 8-bit run count support.
  • Synchronous valid output signaling.
  • Asynchronous active-low reset.
  • Simple control interface.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Asynchronous reset, active low
valid_inInput1Input data valid signal
countInput[7:0]Number of times to repeat the value
valueInput[7:0]Data value to be repeated
valid_outOutput1Output data valid signal
doutOutput[7:0]Decoded output data

Architecture

The design uses a down-counter to track remaining repetitions. When valid_in is asserted, the counter loads the count input. The output dout is driven by the value input. On subsequent cycles, the counter decrements until it reaches zero. The valid_out signal remains high while the counter is greater than zero.

Verification

The testbench verifies the following scenarios:

Test CaseDescriptionResult
TC1Basic Single Pulse (Count=1)PASS
TC2Multi-Cycle Run (Count=3)PASS
TC3Zero Count HandlingPASS
TC4Reset During RunPASS

All tests passed successfully. Simulation uses Icarus Verilog. VCD dump is available at sim/dump.vcd. Use the RtlStudio Waveform tab to view signals.

More in Coding & Line Codes

All Coding & Line Codes blocks