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:
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
- Drive the memory target address onto the address bus.
- Assert active-low Chip Enable (
CE_n) and Output Enable (OE_n). - Maintain stable control signals for the calculated wait cycles.
- Latch valid data from the memory data bus.
- Deassert
CE_nandOE_nto release the bus.
Write Transaction Protocol
- Drive the memory target address onto the address bus.
- Present valid write data on the memory data bus.
- Assert active-low Chip Enable (
CE_n) and Write Enable (WE_n). - Maintain
WE_nasserted for the required write pulse duration ($t_{\text{WP}}$). - Deassert
WE_nwhile maintainingCE_nactive to satisfy write hold requirements. - Deassert
CE_nto 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.