RTL Studio Open IDE

Memory & FIFOs

32-Bit Register with Byte Writes

A 32-bit register with independent byte-write enables for partial updates.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

32-Bit Register with Byte Writes is a Verilog reference block in the Memory & FIFOs catalog. SRAM models, FIFOs, register files, and memory-style storage. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

This IP implements a 32-bit register with independent byte-write enables. It allows partial updates to the register without affecting other bytes. The module is suitable for memory-mapped I/O or configuration registers.

This IP provides a simple and efficient byte-writeable 32-bit register. It is verified with a comprehensive self-checking testbench. The design is synthesizable and ready for integration.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 32-Bit Register with Byte Writes.
  2. Read the Verilog module in the editor. The catalog line for this block: A 32-bit register with independent byte-write enables for partial updates.
  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

Supports 32-bit data width. Provides 4-bit write enable signal for byte-level control. Synchronous reset to zero. Positive clock edge triggered.

Ports

PortDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low reset
weInput4Write enable per byte [3:0]
dinInput32Data input
doutOutput32Data output

Verification

The testbench performs self-checking verification. It covers reset behavior and individual byte writes. It verifies partial writes preserve upper bytes. It verifies all-byte writes overwrite the full register.

Test CaseDescriptionResult
TC1Reset checkPASS
TC2Byte 0 writePASS
TC3Byte 1 writePASS
TC4Byte 2 writePASS
TC5Byte 3 writePASS
TC6All bytes writePASS
TC7Partial writePASS

More in Memory & FIFOs

All Memory & FIFOs blocks