Module 10: Capstone Projects · Project 4 — Synchronous SRAM Controller

Project 4, Part 1: What an SRAM Datasheet Demands

Static Random-Access Memory (SRAM) provides fast, volatile memory storage. Unlike processor cores or serial transceivers, SRAM controllers have simple internal datapaths. The primary engineering challenge involves strict timing discipline: converting datasheet nanosecond constraints into synchronous clock wait cycles.

Interpreting SRAM Timing Diagrams

Asynchronous SRAM chips specify operational limits using detailed timing diagrams:

SRAM read and write timing: address, CE_n, OE_n, WE_n, data, with t_AA, t_OE and t_WP marked
Figure 1: Asynchronous SRAM read and write timing

Two timing parameters dictate read cycle performance:

  • $t_{\text{AA}}$ (Address Access Time): Delay from stable address presentation to valid read data output.
  • $t_{\text{OE}}$ (Output Enable Time): Delay from active-low Output Enable (OE_n) assertion to valid data bus output.

A controller must maintain stable addresses and active control strobes for these specified intervals before sampling data. Sampling the bus before access periods elapse captures invalid transient data.

Converting Timing Delays into Wait Cycles

Digital controllers operate from discrete system clocks. Convert nanosecond datasheet constraints into clock cycles using the mathematical ceiling function:

$$\text{Wait Cycles} = \left\lceil \frac{t_{\text{parameter}}}{T_{\text{clk}}} \right\rceil$$

Assume an access time $t_{\text{AA}} = 15,\text{ns}$ with a 100 MHz clock ($T_{\text{clk}} = 10,\text{ns}$):

$$\text{Wait Cycles} = \left\lceil \frac{15,\text{ns}}{10,\text{ns}} \right\rceil = \lceil 1.5 \rceil = 2,\text{cycles}$$

The controller must insert two full wait cycles before capturing data. Never round timing calculations down to the nearest integer. Rounding down violates physical setup margins and causes intermittent memory corruption.

Read and Write Sequence Protocols

The controller state machine sequences control signals through structured protocols:

Read Transaction Protocol

  1. Drive the memory target address onto the address bus.
  2. Assert active-low Chip Enable (CE_n) and Output Enable (OE_n).
  3. Maintain stable control signals for the calculated wait cycles.
  4. Latch valid data from the memory data bus.
  5. Deassert CE_n and OE_n to release the bus.

Write Transaction Protocol

  1. Drive the memory target address onto the address bus.
  2. Present valid write data on the memory data bus.
  3. Assert active-low Chip Enable (CE_n) and Write Enable (WE_n).
  4. Maintain WE_n asserted for the required write pulse duration ($t_{\text{WP}}$).
  5. Deassert WE_n while maintaining CE_n active to satisfy write hold requirements.
  6. Deassert CE_n to complete the transaction.

Timing-Accurate Verification Models

Testbenches verify memory controllers using behavioral simulation models. Extend the basic RAM model from Section 7.1 to enforce timing checks. If the controller deasserts control lines early or violates $t_{\text{AA}}$, the model outputs x states. This timing-accurate checking catches latent timing bugs during simulation.

Practice Exercise

An SRAM datasheet specifies a minimum write pulse width $t_{\text{WP}} = 25,\text{ns}$. The controller operates at a clock frequency of 133 MHz. Calculate the minimum integer wait cycles required to satisfy this write pulse constraint.

Solution

Calculate the clock period:

$$T_{\text{clk}} = \frac{1}{133,\text{MHz}} \approx 7.52,\text{ns}$$

Calculate the required wait cycles using the ceiling function:

$$\text{Wait Cycles} = \left\lceil \frac{25,\text{ns}}{7.52,\text{ns}} \right\rceil = \lceil 3.32 \rceil = 4,\text{cycles}$$

Holding WE_n active for three cycles yields $3 \times 7.52 = 22.56,\text{ns}$, which violates the 25 ns specification. The controller must hold WE_n asserted for four full clock cycles (30.08 ns) to guarantee compliant write operations.

SRAM controllers convert datasheet timing specifications into discrete clock wait states. Applying the ceiling function guarantees compliant read access times and write pulse widths. The next article designs the address decoding logic and the memory controller FSM.

← Project 3, Part 3: The Mode-Configurable Master, Verified Project 4, Part 2: An FSM Built From Wait States →