Memory is an interesting and potentially challenging portion of a digital system design. One of the benefits of decades of commercial solid-state memory development is the great variety of memory products available for use. Chances are that there is an off-the-shelf memory product that fits your specific application. A downside to the modern, ever-changing memory market is rapid obsolescence of certain products. DRAM is tied closely to the personal computer market. The best DRAM values are those devices that coincide with the sweet spot in PC memory configurations. As the high-vol- ume PC market moves on to higher-density memory ICs, that convenient DRAM that you used in your designs several years ago may be discontinued so that the manufacturer can retool the factory for parts that are in greater demand.
Rapid product development means that memory capabilities improve dramatically each year. Whether it’s higher density or lower power that an application demands, steady advances in technol- ogy put more tools at an engineer’s disposal. SRAM and flash EPROM devices have more stable production lives than DRAM. In part, this is because they are less dependent on the PC market, which requires ever increasing memory resources for ever more complex software applications.
Memory is a basic digital building block that is used for much more than storing programs and data for a microprocessor. Temporary holding buffers are used to store data as it is transferred from one interface to another. There are many situations in networking and communication systems where a block of data arrives and must be briefly stored in a buffer until the logic can figure out exactly what to do with it. Lookup tables are another common use for memory. A table may store precom- puted terms of a complex calculation so that a result can be rapidly determined when necessary. This chapter discusses the predominant synchronous memory technologies, SDRAM and SSRAM, and closes with a presentation of CAM, a technology that is part RAM and part logic.
No book can serve as an up-to-date reference on memory technology for long, as a result of the industry’s rapid pace. This chapter discusses technologies and concepts that are timeless, but specif- ics of densities, speeds, and interface protocols change rapidly. Once you have read and understood the basics of high-performance memory technologies, you are encouraged to browse through the lat- est manufacturers’ data sheets to familiarize yourself with the current state of the art. Corporations such as Cypress, Hynix, Infineon, Micron, NEC, Samsung, and Toshiba provide detailed data sheets on their web sites that are extremely useful for self-education and selecting the right memory device to suit your needs.
8.1
SYNCHRONOUS DRAM
As system clock frequencies increased well beyond 50 MHz, conventional DRAM devices with asynchronous interfaces became more of a limiting factor in overall system performance. Asynchro- -Balch.book Page 173 Thursday, May 15, 2003 3:46 PM
174 Advanced Digital Systems
nous DRAMs have associated pulse width and signal-to-signal delay specifications that are tied closely to the characteristics of their internal memory arrays. When maximum bandwidth is desired at high clock frequencies, these specifications become difficult to meet. It is easier to design a sys- tem in which all interfaces and devices run synchronously so that interface timing becomes an issue of meeting setup and hold times, and functional timing becomes an issue of sequencing signals on discrete clock edges.
Synchronous DRAM, or SDRAM, is a twist on basic asynchronous DRAM technology that has been around for more than three decades. SDRAM can essentially be considered as an asynchronous DRAM array surrounded by a synchronous interface on the same chip, as shown in Fig. 8.1. A key architectural feature in SDRAMs is the presence of multiple independent DRAM arrays—usually either two or four banks. Multiple banks can be activated independently and their transactions inter- leaved with those of other banks on the IC’s synchronous interface. Rather than creating a bottle- neck, this functionality allows higher efficiency, and therefore higher bandwidth, across the interface. One factor that introduces latency in random accesses across all types of DRAM is the row activation time: a row must first be activated before the column address can be presented and data read or written. An SDRAM allows a row in one bank to be activated while another bank is actively engaged in a read or write, effectively hiding the row activation time in the other bank. When the current transaction completes, the previously activated row in the other bank can be called upon to perform a new transaction without delay, increasing the device’s overall bandwidth.
The synchronous interface and internal state logic direct interleaved multibank operations and burst data transfers on behalf of an external memory controller. Once a transaction has been started, one data word flows into or out of the chip on every clock cycle. Therefore, an SDRAM running at 100 MHz has a theoretical peak bandwidth of 100 million words per second. In reality, of course, this number is somewhat lower because of refresh and the overhead of beginning and terminating transactions. The true available bandwidth for a given application is very much dependent on that application’s data transfer patterns and the capabilities of its memory controller.
Rather than implementing a DRAM-style asynchronous interface, the SDRAM’s internal state logic operates on discrete commands that are presented to it. There are still familiar sounding signals such as RAS* and CAS*, but they function synchronously as part of other control signals to form commands rather than simple strobes. Commands begin and terminate transactions, perform refresh operations, and configure the SDRAM for interface characteristics such as default burst length.
SDRAM can provide very high bandwidth in applications that exploit the technology’s burst transfer capabilities. A conventional computer with a long-line cache subsystem might be able to fetch 256 words in as few as 260 cycles: 98.5 percent efficiency! Bursts amortize a fixed number of overhead cycles across the entire transaction, greatly improving bandwidth. Bandwidth can also be improved by detecting transactions to multiple banks and interleaving them. This mode of operation
Column Address Counters Control Signal and Row Address Buffers DRAM Array (Four Banks) DRAM Array (Four Banks) DRAM Array (Four Banks) DRAM Array (Four Banks) Row strobes Column strobes Write enables Row Addresses Column Addresses Synchronous State Logic Synchronous Data Interface DQM[] Data[] CLK CKE CS* RAS* CAS* WE* Address[]
FIGURE 8.1 Basic SDRAM architecture. -Balch.book Page 174 Thursday, May 15, 2003 3:46 PM
High-Performance Memory Technologies 175
allows some new burst transfers to be requested prior to the current burst ending, thereby hiding the initial startup latency of the subsequent transaction.
Most of the input signals to the state logic shown in Fig. 8.1 combine to form the discrete com- mands listed in Table 8.1. A clock enable, CKE, must be high for normal operation. When CKE is low, the SDRAM enters a low-power mode during which data transactions are not recognized. CKE can be tied to logic 1 for applications that are either insensitive to power savings or require continual access to the SDRAM. Interface signals are sampled on the rising clock edge. Many SDRAM de- vices are manufactured in multibyte data bus widths. The data mask signals, DQM[], provide a con- venient way to selectively mask individual bytes from being written or being driven during reads. Each byte lane has an associated DQM signal, which must be low for the lane to be written or to en- able the lane’s tri-state buffers on a read.
Some common functions include activating a row for future access, performing a read, and pre- charging a row (deactivating a row, often in preparation for activating a new row). For complete de- scriptions of SDRAM interface signals and operational characteristics, SDRAM manufacturers’ data sheets should be referenced directly. Figure 8.2 provides an example of how these signals are used to implement a transaction and serves as a useful vehicle for introducing the synchronous interface. CS* and CKE are assumed to be tied low and high, respectively, and are not shown for clarity.
The first requirement to read from an SDRAM is to activate the desired row in the desired bank. This is done by asserting an activate (ACTV) command, which is performed by asserting RAS* for one cycle while presenting the desired bank and row addresses. The next command issued to con- tinue the transaction is a read (RD). However, the controller must wait a number of cycles that trans- lates into the DRAM array’s row-activate to column-strobe delay time. The timing characteristics of the underlying DRAM array is expressed in nanoseconds rather than clock cycles. Therefore, the in- teger number of delay cycles is different for each design, because it is a function of the clock period and the internal timing specification. If, for example, an SDRAM’s RAS* to CAS* delay is 20 ns, and the clock period is 20 ns or slower, an RD command could be issued on the cycle immediately TABLE 8.1 Basic SDRAM Command Set
Command CS* RAS* CAS* WE* Address AP/A10
Bank activate L L H H Bank, row A10
Read L H L H Bank, column L
Read with auto-precharge L H L H Bank, column H
Write L H L L Bank, column L
Write with auto-precharge L H L L Bank, column H
No operation L H H H X X
Burst terminate L H H L X X
Bank precharge L L H L X L
Precharge all banks L L H L X H
Mode register set L L L L Configuration Configuration
Auto refresh L L L H X X
Device deselect H X X X X X
176 Advanced Digital Systems
following the ACTV. Figure 8.2 shows an added cycle of delay, indicating a clock period less than 20 ns but greater than 10 ns (a 50–100 MHz frequency range). During idle cycles, a no-operation (NOP) command is indicated by leaving RAS*, CAS*, and WE* inactive.
The RD command is performed by asserting CAS* and presenting the desired bank select and column address along with the auto-precharge (AP) flag. A particular bank must be selected, be- cause the multibank SDRAM architecture enables reads from any bank. AP is conveyed by address bit 10 during applicable commands, including reads and writes. Depending on the type of command, AP has a different meaning. In the case of a read or write, the assertion of AP tells the SDRAM to automatically precharge the activated row after the requested transaction completes. Precharging a row returns it to a quiescent state and also clears the way for another row in the same bank to be ac- tivated in the future. A single DRAM bank cannot have more than one row active at any given time. Automatically precharging a row after a transaction saves the memory controller from explicitly pre- charging the row after the transaction. If, however, the controller wants to take full advantage of the SDRAM’s back-to-back bursting capabilities by leaving the same row activated for a subsequent transaction, it may be worthwhile to let the controller decide when to precharge a row. This way, the controller can quickly reaccess the same row without having to issue a redundant ACTV command. AP also comes into play when issuing separate precharge commands. In this context, AP determines if the SDRAM should precharge all of its banks or only the bank selected by the address bus.
Once the controller issues the RD command (it would be called RDA if AP is asserted to enable auto-precharge), it must wait a predetermined number of clock cycles before the data is returned by the SDRAM. This delay is known as CAS latency, or CL. SDRAMs typically implement two latency options: two and three cycles. The example in Fig. 8.2 shows a CAS latency of two cycles. It may sound best to always choose the lower latency option, but as always, nothing comes for free. The SDRAM trades off access time (effectively, tCO) for CAS latency. This becomes important at higher
clock frequencies where fast tCO is crucial to system operation. In these circumstances, an engineer
is willing to accept one cycle of added delay to achieve the highest clock frequency. For example, a Micron Technology MT48LC32M8A2-7E 256-Mb SDRAM can operate at 143 MHz with a CAS la- tency of three cycles, but only 133 MHz with a CAS latency of two cycles.* One cycle of additional delay will be more than balanced out by a higher burst transfer rate. At lower clock rates, it is often possible to accept the slightly increased access time in favor of a shorter CAS latency.
* 256MSDRAM_D.p65-RevD; Pub. 1/02, Micron Technologies, 2001, p. 11. Address DQM CAS* WE* RAS* (command) CLK Data
ACTV NOP RD NOP B,R x B,AP,C x
D0 D1 D2 D3 tRAS to CAS CAS Latency=2
FIGURE 8.2 Four-word SDRAM burst read (CL = 2, BL = 4). -Balch.book Page 176 Thursday, May 15, 2003 3:46 PM
High-Performance Memory Technologies 177
Once the CAS latency has passed, data begins to flow on every clock cycle. Data will flow for as long as the specified burst length. In Fig. 8.2, the standard burst length is four words. This parameter is configurable and adds to the flexibility of an SDRAM. The controller is able to set certain param- eters at start-up, including CAS latency and burst length. The burst length then becomes the default unit of data transfer across an SDRAM interface. Longer transactions are built from multiple back- to-back bursts, and shorter transactions are achieved by terminating a burst before it has completed. SDRAMs enable the controller to configure the standard burst length as one, two, four, or eight words, or the entire row. It is also possible to configure a long burst length for reads and only single- word writes. Configuration is performed with the mode register set (MRS) command by asserting the three primary control signals and driving the desired configuration word onto the address bus.
As previously mentioned, DQM signals function as an output disable on a read. The DQM bus (a single signal for SDRAMs with data widths of eight bits or less) follows the CAS* timing and, therefore, leads read data by the number of cycles defined in the CAS latency selection. The preced- ing read can be modified as shown in Fig. 8.3 to disable the two middle words.
In contrast, write data does not have an associated latency with respect to CAS*. Write data be- gins to flow on the same cycle that the WR/WRA command is asserted, as shown in Fig. 8.4. This
Address DQM CAS* WE* RAS* (command) CLK Data
ACTV NOP RD NOP B,R x B,AP,C x
D0
D1 D2 D3
FIGURE 8.3 Four-word SDRAM burst read with DQM disable (CL = 2, BL = 4).
CLK
Data
ACTV NOP WR NOP B,R x B,AP,C x
D0 x x D3
FIGURE 8.4 Four-word SDRAM burst write with DQM masking (BL = 4). -Balch.book Page 177 Thursday, May 15, 2003 3:46 PM
178 Advanced Digital Systems
example also shows the timing of DQM to prevent writing the two middle words. Since DQM fol- lows the CAS* timing, it is also directly in line with write data. DQM is very useful for writes, espe- cially on multibyte SDRAM devices, because it enables the uniform execution of a burst transfer while selectively preventing the unwanted modification of certain memory locations. When working with an SDRAM array composed of byte-wide devices, it would be possible to deassert chip select to those byte lanes that you don’t want written. However, there is no such option for multibyte de- vices other than DQM.
When the transaction completes, the row is left either activated or precharged, depending on the state of AP during the CAS* assertion. If left activated, the controller may immediately issue a new RD or WR command to the same row. Alternatively, the row may be explicitly precharged. If auto- matically precharged, a new row in that bank may be activated in preparation for other transactions. A new row can be activated immediately in most cases, but attention must be paid to the SDRAM’s specifications for minimum times between active to precharge commands and active to active com- mands.
After configuring an SDRAM for a particular default burst length, it will expect all transactions to be that default length. Under certain circumstances, it may be desirable to perform a shorter transac- tion. Reads and writes can be terminated early by either issuing a precharge command to the bank that is currently being accessed or by issuing a burst-terminate command. There are varying restric- tions and requirements on exactly how each type of transaction is terminated early. In general, a read or write must be initiated without automatic precharge for it to be terminated early by the memory controller.
The capability of performing back-to-back transactions has been already mentioned. In these situ- ations, the startup latency of a new transaction can be accounted for during the data transfer phase of the previous transaction. An example of such functionality is shown in Fig. 8.5. This timing diagram uses a common SDRAM presentation style in which the individual control signals are replaced by their command equivalent. The control signals are idle during the data portion of the first transac- tion, allowing a new request to be asserted prior to the completion of that transaction. In this exam- ple, the controller asserts a new read command for the row that was previously activated. By asserting this command one cycle (CAS latency minus one) before the end of the current transaction, the controller guarantees that there will be no idle time on the data bus between transactions. If a the second transaction was a write, the assertion of WR would come the cycle after the read transaction ended to enable simultaneous presentation of write data in phase with the command. However, when following a write with a read, the read command cannot be issued until after the write data com- pletes, causing an idle period on the data bus equivalent to the selected CAS latency.