Giter VIP home page Giter VIP logo

sdram-controller's Introduction

Generic Synchronous DRAM Controller

Build Status

Why?

The code in this repository lets you control an SDRAM chip without licensing IP from anyone.

Demo: test pattern on an LG 24UD58-B Monitor

Test pattern shown correctly

Usage

  1. Take files from src/ and add them to your own project. If you use hdlmake, you can add this repository itself as a remote module.
  2. Other helpful modules are also available in this GitHub organization.
  3. See top/mkrvidor4000_quartus/mkrvidor4000_top.sv for a usage example with clock domain crossing. A dual-clock FIFO is used to move data from the SDRAM to HDMI to display a test pattern. The test pattern is composed only of red and green. If you see blue, the pattern is incorrect.
  4. Read through the parameters in sdram_controller.sv and tailor any instantiations to your situation.
  5. Please create an issue if you run into a problem or have any questions. Make sure you have consulted the troubleshooting section first.

Terminology

  • CAS latency: the time (in clocks) after the column-address is set for the command to return data
  • Precharge: a required step in DRAM operation that sets the line voltage to Vcc / 2 (3.3V / 2) in anticipation of the next operation
  • Refresh: restores the charge in the cells by rewriting them, preventing the loss of data
  • Self Refresh: a low power mode where the SDRAM chip is able to refresh itself
  • DQM: turning on DQ-masking disables the output during a read and masks the input during a write. Used to avoid I/O contention.

Troubleshooting

  • Make sure you've set the IO standard for the pins connected to the DRAM chip as LVTTL 3.3V
  • SystemVerilog users: make sure you are using wire instead of logic for DQ and the clock. This caused synthesis issues for me where the pins were stuck at GND or VCC when they were clearly being driven.
  • If you see noise or data corruption, check your FPGA driver strength, check if the SDRAM chip has configurable driver strength, and try lowering the clock

To-do List

  • Self Refresh Mode
  • Optimizations
    • Conditionally avoid manual precharging
      • Manual precharging can assume spatial locality by only precharging if the next command is for a different column-address
    • Bank activation: if the row address and bank are the same, can you do a repeated read/write? (yes until tmax bank active)
    • Command pipelining: you could activate another bank while a write/read is being done (some overhaul of the state machine is needed here)

Reference Documents

These documents are not hosted here! They are available directly from Alliance Memory.

sdram-controller's People

Contributors

sameer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.