Design and Verification of SDRAM Controller Based on FPGA

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.


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 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

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

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.

SD_CONFIG Module
The SD_CONFIG module performs the configuration and initialization of the   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.

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.

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.  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.

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.

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.

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.