RTL Studio Open IDE

Memory & FIFOs

8x16 Single-Port Sync RAM

8x16 Single-Port Synchronous RAM with byte write enable. Depth: 8 words, Width: 16 bits. Read is synchronous (data available on next clock edge after address). Write is synchronous (data written on rising edge if we_n is low).

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

8x16 Single-Port Sync RAM is a Verilog reference block in the Memory & FIFOs catalog. SRAM models, FIFOs, register files, and memory-style storage. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This 8x16 single-port synchronous RAM is ideal for small, fast on-chip storage requirements.

It supports byte-level write granularity for efficient data manipulation.

The synchronous read latency of one cycle simplifies timing analysis in pipelined designs.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for 8x16 Single-Port Sync RAM.
  2. Read the Verilog module in the editor. The catalog line for this block: 8x16 Single-Port Synchronous RAM with byte write enable. Depth: 8 words, Width: 16 bits. Read is synchronous (data available on next clock edge after address). Write is synchronous (data written on rising edge if we_n is low).
  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.

Interface

The module exposes a standard synchronous interface with the following signals.

SignalDirectionWidthDescription
clkInput1Clock input for synchronous operations.
rst_nInput1Active-low asynchronous reset signal.
addrInput3Address input selecting one of the 8 memory locations.
dinInput16Data input for write operations.
we_nInput1Active-low write enable; low triggers a write on the clock edge.
beInput2Byte enable mask; 2'b01 writes lower byte, 2'b10 writes upper byte, 2'b11 writes both.
doutOutput16Data output registered on the clock edge corresponding to the address input.

Architecture

The design uses an internal register array to store the 8x16 memory content. A separate output register ensures synchronous read behavior by delaying the data by one clock cycle. Byte enable logic allows partial word updates without affecting the other byte lanes.

Verification

The provided testbench covers reset behavior, basic read/write cycles, byte enable masking, and back-to-back access patterns. All tests passed successfully during simulation with Icarus Verilog.

Test CaseDescriptionResult
TC1Reset TestPASS
TC2Basic Write and ReadPASS
TC3Byte Enable TestPASS
TC4Back-to-Back AccessPASS

More in Memory & FIFOs

All Memory & FIFOs blocks