All Projects → stffrdhrn → Sdram Controller

stffrdhrn / Sdram Controller

Verilog SDRAM memory controller

Labels

Projects that are alternatives of or similar to Sdram Controller

Icesugar
iCESugar FPGA Board (base on iCE40UP5k)
Stars: ✭ 139 (-17.75%)
Mutual labels:  verilog
Learning Nvdla Notes
NVDLA is an Open source DL/ML accelerator, which is very suitable for individuals or college students. This is the NOTES when I learn and try. Hope THIS PAGE may Helps you a bit. Contact Me:[email protected]
Stars: ✭ 150 (-11.24%)
Mutual labels:  verilog
Cnn Fpga
使用Verilog实现的CNN模块,可以方便的在FPGA项目中使用
Stars: ✭ 160 (-5.33%)
Mutual labels:  verilog
Simplevout
A Simple FPGA Core for Creating VGA/DVI/HDMI/OpenLDI Signals
Stars: ✭ 139 (-17.75%)
Mutual labels:  verilog
Scale Mamba
Repository for the SCALE-MAMBA MPC system
Stars: ✭ 147 (-13.02%)
Mutual labels:  verilog
Tinytpu
Implementation of a Tensor Processing Unit for embedded systems and the IoT.
Stars: ✭ 153 (-9.47%)
Mutual labels:  verilog
E200 opensource
This repository hosts the project for open-source hummingbird E203 RISC processor Core.
Stars: ✭ 1,909 (+1029.59%)
Mutual labels:  verilog
Metroboy
MetroBoy - A playable, circuit-level simulation of an entire Game Boy
Stars: ✭ 169 (+0%)
Mutual labels:  verilog
Logic
CMake, SystemVerilog and SystemC utilities for creating, building and testing RTL projects for FPGAs and ASICs.
Stars: ✭ 149 (-11.83%)
Mutual labels:  verilog
Sha256
Hardware implementation of the SHA-256 cryptographic hash function
Stars: ✭ 160 (-5.33%)
Mutual labels:  verilog
Chisel3
Chisel 3: A Modern Hardware Design Language
Stars: ✭ 2,290 (+1255.03%)
Mutual labels:  verilog
Slang
SystemVerilog compiler and language services
Stars: ✭ 145 (-14.2%)
Mutual labels:  verilog
Degate
Open source software for chip reverse engineering.
Stars: ✭ 156 (-7.69%)
Mutual labels:  verilog
Openwifi
open-source IEEE 802.11 WiFi baseband FPGA (chip) design
Stars: ✭ 2,257 (+1235.5%)
Mutual labels:  verilog
Fpga readings
Recipe for FPGA cooking
Stars: ✭ 164 (-2.96%)
Mutual labels:  verilog
Openfpgaduino
All open source file and project for OpenFPGAduino project
Stars: ✭ 137 (-18.93%)
Mutual labels:  verilog
Sv2v
SystemVerilog to Verilog conversion
Stars: ✭ 151 (-10.65%)
Mutual labels:  verilog
Fpga Chip8
CHIP-8 console on FPGA
Stars: ✭ 169 (+0%)
Mutual labels:  verilog
Kryon
FPGA,Verilog,Python
Stars: ✭ 169 (+0%)
Mutual labels:  verilog
Fpg1
PDP-1 FPGA implementation in Verilog, with CRT, Teletype and Console.
Stars: ✭ 159 (-5.92%)
Mutual labels:  verilog

SDRAM Memory Controller

CURRENT STATUS : stable

This is a very a simple sdram controller which works on the De0 Nano. The project also contains a simple push button interface for testing on the dev board.

Basic features

  • Operates at 100Mhz, CAS 3, 32MB, 16-bit data
  • On reset will go into INIT sequnce
  • After INIT the controller sits in IDLE waiting for REFRESH, READ or WRITE
  • REFRESH operations are spaced evenly 8192 times every 32ms
  • READ is always single read with auto precharge
  • WRITE is always single write with auto precharge

 Host Interface          SDRAM Interface

   /-----------------------------\
   |      sdram_controller       |
==> wr_addr                  addr ==>
==> wr_data             bank_addr ==>
--> wr_enable                data <=>
   |                 clock_enable -->
==> rd_addr                  cs_n -->   
--> rd_enable               ras_n -->
<== rd_data                 cas_n -->
<-- rd_ready                 we_n -->
<-- busy            data_mask_low -->      
   |               data_mask_high -->
--> rst_n                        |
--> clk                          |
   \-----------------------------/

From the above diagram most signals should be pretty much self explainatory. Here are some important points for now. It will be expanded on later.

  • wr_addr and rd_addr are equivelant to the concatenation of {bank, row, column}
  • rd_enable should be set to high once an address is presented on the addr bus and we wish to read data.
  • wr_enable should be set to high once addr and data is presented on the bus
  • busy will go high when the read or write command is acknowledged. busy will go low when the write or read operation is complete.
  • rd_ready will go high when data rd_data is available on the data bus.
  • NOTE For single reads and writes wr_enable and rd_enable should be set low once busy is observed. This will protect from the controller thinking another request is needed if left higher any longer.

Build

The recommended way to build is to use fusesoc. The build steps are then:

# Build the project with quartus
fusesoc build dram_controller
# Program the project to de0 nano
fusesoc pgm dram_controller

# Build with icarus verilog and test
fusesoc sim dram_controller --vcd
gtkwave $fusebuild/dram_controller/sim-icarus/testlog.vcd

# Run other test cases 
fusesoc sim --testbench fifo_tb dram_controller --vcd
fusesoc sim --testbench double_click_tb dram_controller --vcd

Timings

Initialization

wave init

Initialization process showing:

  • Precharge all banks
  • 2 refresh cycles
  • Mode programming

Refresh

wave refresh

Refresh process showing:

  • Precharge all banks
  • Single Refresh

Writes

wave write

Write operation showing:

  • Bank Activation & Row Address Strobe
  • Column Address Strobe with Auto Precharge set and Data on bus

Reads

wave read

Read operation showing:

  • Bank Activation & Row Address Strobe
  • Column Address Strobe with Auto Precharge set
  • Data on bus

Test Application

Test Application Figure - test application block diagram

The test application provides a simple user interface for testing the functionality of the sdram controller.

Basics:

  • The clock input should be 50Mhz (a pll multiplies it up to 100Mhz)
  • One push button is used for reset
  • A Second push button is used for read and write
    • single click for write
    • double click for read
  • A 4-bit dip switch is used for inputting addresses and data
    • Upon reset the read/write addresses are read from the dip switch
    • When writing the dip switch is data is written to the sdram
    • Address and data busses are greather than 4 bits, data is duplicated to fill the bus
  • 8 LEDs are used to display the data read from the sdram. The data but is 16-bits, high and low bytes are alternated on the LEDs about every half second.

Project Status/TODO

  • [x] Compiles
  • [x] Simulated Init
  • [x] Simulated Refresh
  • [x] Simulated Read
  • [x] Simulated Write
  • [x] Confirmed in De0 Nano

Project Setup

This project has been developed with altera quartus II.

License

BSD

Further Reading

I didn't look at these when designing my controller. But it might be good to take a look at for ideas.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].