JCC  Vol.8 No.7 , July 2020
Design and Verification of SDRAM Controller Based on FPGA
Abstract: SDRAM (Synchronous DRAM) has become the memory standard in many digital system designs, because of low price and high read/write speed. In this paper, Based on the analysis of the working principle and characteristics of SDRAM, an SDRAM controller design method is proposed based on field programmable logic gate array FPGA. In order to reduce resource consumption and increase the read and write speed of SDRAM, the performance control of SDRAM is further optimized. We designed SDRAM controller by using Verilog HDL and Altera Quartus II 14.1 software, and simulated about this design with Model Sim-Altera 10.3c software. Then we verified this design by using Cyclone V 5CSEMA5F31C6 FPGA in DE1-SoC development board. The verification results show that the SDRAM is initialized successfully, the input and output data are completely consistent, and it has stable refresh and read and write functions. The SDRAM controller design meets the requirements.

1. Introduction

SDRAM is a memory chip to use widely for embedded real-time systems and high-speed data transmission [1] [2].

In the development of computer systems, in order to give full play to the processor's ability to process data at high speed and improve the efficiency of the entire computer system, it is necessary to use cache technology to store input and output data, intermediate calculation results and temporary data exchanged with external memory Final Results. Most CPUs integrate a cache internally as a matching buffer between the processor and main memory. Cache generally uses SRAM, but although SRAM is high speed, but its capacity is small, so to complete a large amount of data cache generally uses DRAM as the main memory. The core of modern computer technology is an integrated circuit with transistors as the basic unit. For a long time, in the process manufacturing of computers, processors and main memories were manufactured using different production technology lines, so that they can meet the design to the maximum Demand [3].

The processor process line is manufactured on the basis of logic technology, using high-speed transistors and multilayer metals to achieve high system performance and operating frequency; and the main memory production line is manufactured on the basis of DRAM technology, using units as much as possible Small area capacitors, low leakage current transistors and multilayer polysilicon interconnects to achieve large capacity, low cost and low refresh intervals. With the gradual progress of integrated circuit technology, the average annual growth rate of processor performance from 1986 to 2004 is about 52%, and the average annual growth rate after 2004 is about 20% [4], but the average of main memory. The growth rate is only about 7% per year [5] [6], the performance difference between the processor and the main memory is increasing, and the performance of the main memory has become an important factor restricting the performance of the processor [7] [8], which is the famous “Memory Wall” problem [9].

In designing the SDRAM controller, Seiji Miura and Satoru Akiyamma focused on solving the latency problem in order to improve data transmission efficiency. Finally, two solutions, address queue and virtual cache, were proposed to reduce latency [10]. Bonatto, Soates, et al. in order to generate a smaller delay in the encoding of the management macro definition module based on the H.264/AVC video decoder, use a four-layer module structure to implement a multi-channel SDRAM controller [11].

2. Design of SDRAM Controller

This SDRAM Controller is designed to interface to standard microprocessors. The controller is independent of processor type. This design supports two 16 MB memory regions configured as 4 M × 32 bits. Changing byte enable inputs and address inputs will change the width and size of this design. For example, if a 64 bit wide data bus is desired, increase the byte enable signals from 4 to 8. If a larger memory space is required, add address inputs and reconfigure the row and column address appropriately or add more chip selects. An overview of the state machine of the SDRAM is shown in Figure 1.

The output signals of SDRAM controller depend on the kind of SDRAM command to perform. Table 1 lists all SDRAM commands and output signals ( CS ¯ : Chip Select, RAS ¯ : Row Address Strobe, CAS ¯ : Column Address Strobe, WE ¯ : Write Enable, DQM: Data Qualifier Mask, ADD: Address).

Figure 1. State machine diagram.

Table 1. Table type styles.

2.1. Design of Top Level Module

Table 2 shows the input/output signals of the SDRAM Controller. Signals ending with “_L” indicate an active low signal. This convention is used throughout the design. All input signals except SDRAM_EN must be synchronous to the clock. SDRAM_EN is synchronized internally. The name of top level module is SD_TOP.

2.2. Design of Sub-Modules

The SDRAM Controller is comprised of a top-level module called SD_TOP as shown in Figure 2. This top-level module instantiates the four sub-modules: SD_CONFIG, SD_REFRESH, SD_STATE, SD_SIGNAL.

2.2.1. SD_CONFIG Module

The SD_CONFIG module performs the configuration and initialization of the SDRAMs. When the reset signal becomes inactive, and if the SDRAM_EN signal

Figure 2. SDRAM block diagram.

Table 2. SDRAM signals.

is active, this module sends requests to the state machine module to initialize the SDRAM. The SDRAM_EN signal could be removed from the design or can be tied high if this feature is not needed. If tied high, the controller will initialize the SDRAM sub-system when the reset signal becomes false.

The parameters for the mode register are stored in this module. These can be modified to suit the user’s specific needs. Some of the bits are reserved and must be kept as “0”. The parameters CAS LATENCY, BURST MODE, BURST LENGTH and BURST TYPE can be changed in this module.

Table 3 describes the input and output signals of this module.

2.2.2. SD_REFRESH Module

The SD_REFRESH module provides a refresh request signal to the state machine module. The refresh module has a 12 bit counter that is clocked by the system clock. The output of the counter is set so that a request occurs every 15.6 µsec. The parameter value “count” can be changed depending on the clock frequency. The counter doesn’t start counting until after the SDRAM has been initialized.

Table 4 describes the input and output signals of this module.

2.2.3. SD_STATE Module

The SD_STATE module takes requests from:

• The processor to perform data cycles.

• The SD_CONFIG module to perform command cycles.

• The SD_REFRESH module to perform refresh cycles.

Table 3. SD_CONFIG signals.

Table 4. SD_REFRESH signals.

It outputs a state type vector as well as a state bit vector. The type vector indicates what type of cycle is being performed. The bit vector indicates the state cycle. Table 5 describes the input/output signals for this module.

2.2.4. SD_SIGNAL Signals

The SD_SIGNAL module outputs the appropriate SDRAM signals depending on what type of cycle is occurring and where the state machine is at in the cycle. Table 6 describes the input and output signals for this module.

3. Synthesis of SDRAM Controller

This design was synthesized by using Altera Quartus II 14.1 and Altera’s Cyclone V 5CSEMA5F31C6 FPGA. The results of systhesis about each module of SDRAM controller shown below in Figure 3.

Table 7 lists all resource consumption used to synthesis of SDRAM controller.

Table 5. SD_STATE signals.

Figure 3. The synthesis result of SDRAM controller.

Table 6. SD_SGINAL signals.

Table 7. The resource consumption of SDRAM controller.

4. Simulation and Verification of SDRAM Controller

This design was simulated by using Model Sim-Altera 10.3c software. For simulation, it used 100 MHz clock frequency to be provided by PLL (Phase Locked Loop). The results of simulation about read and write cycle of SDRAM controller shown below in Figure 4 and Figure 5.

Figure 4. The read cycle of SDRAM controller.

Figure 5. The write cycle of SDRAM controller.

5. Conclusion

We verified accuracy of design through the simulation and downloaded code at Cyclone V 5CSEMA5F31C6 FPGA in DE1-SoC development board. Then we linked with display unit by VGA bus and showed image stored to SDRAM at scene. The result shows that the SDRAM controller designed in this paper satisfy requirement of design.

Cite this paper: Kil, S. , Kim, D. and Ri, H. (2020) Design and Verification of SDRAM Controller Based on FPGA. Journal of Computer and Communications, 8, 14-22. doi: 10.4236/jcc.2020.87002.

[1]   Anup, P. and Ramana Reddy, R. (2012) A Low Power DDR SDRAM Controller Design. International Journal of Computer Science and Information Technologies, 3, 4270-4274.

[2]   Sharma, D. and Bhargava, S. (2011) Design and VLSI Implementation of DDR SDRAM Controller for High Speed Applications. International Journal of Computer Science and Information Technologies, 2, 1625-1632.

[3]   Upadhyay, P., Kar, R., et al. (2019) A Design of Highly Stable and Low-Power SRAM Cell. Advances in Computer Communication and Computational Sciences, 759, 281-289.

[4]   Wulf, W.A. and McKee, S.A. (1995) Hitting the Memory Wall: Implications of the Obvious. Computer Architecture News, 23, 20-24.

[5]   Wilkes, M.V. (1995) The Memory Wall and the CMOS End-Point. Computer Architecture News, 23, 4-6.

[6]   Burger, D.C., Goodman, J.R. and Kagi, A. (1995) The Declining Effectiveness of Dynamic Caching for General-Purpose Microprocessors. Technical Report 1261, Computer Sciences Department, University of Wisconsin, Madison, WI.

[7]   Kagi, A., Goodman, J.R. and Burger, D. (1996) Memory Bandwidth Limitations of Future Microprocessors. 23rd Annual International Symposium on Computer Architecture (ISCA 1996), Philadelphia, PA, 24 May 1996, 78-89.

[8]   Huh, J., Burger, D. and Keckler, S.W. (2001) Exploring the Design Space of Future CMPs. International Conference on Parallel Architectures and Compilation Techniques (PACT 2001), Barcelona, Spain, 8-12 September 2001, 199-210.

[9]   Rogers, B., Krishna, A., Bell, G., et al. (2009) Scaling the Bandwidth Wall: Challenges in and Avenues for CMP Scaling. 36th Annual International Symposium on Computer Architecture (ISCA 2009), Austin, TX, 20-24 June 2009, 371-382.

[10]   Miura, S. and Akiyama, S. (2005) A Memory Controller That Reduces Latency of Cached SDRAM. 2005 IEEE International Symposium on Circuits and Systems, Kobe, Japan, 23-26 May 2005, 5250-5253.

[11]   Bonatto, A.C., Soares, A.B. and Susin, A.A. (2011) Multichannel SDRAM Controller Design for H.264/AVC Video Decoder. 2011 VII Southern Conference on Programmable Logic (SPL), Cordoba, Argentina, 137-142.