• Stars
    star
    260
  • Rank 157,189 (Top 4 %)
  • Language Verilog
  • Created over 4 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A DDR3 memory controller in Verilog for various FPGAs

Lightweight AXI-4 DDR3 Controller

Github: https://github.com/ultraembedded/core_ddr3_controller

This IP is a compact DDR3 memory controller in Verilog aimed at FPGA projects where the bandwidth required from the memory is lower than DDR3 DRAMs can provide, and where simplicity and LUT usage are more important than maximising the DDR performance.
It currently supports Xilinx 7 series (Artix, Kintex) and Lattice ECP5 FPGAs, but other FPGA specific DFI compatible PHYs might be added later.

The idea with this project is to run DDR3 at a much slower clock frequency than the maximum supported by the DDR part, reducing the complexity required in the DDR3 controller by giving the bus interface much more margin and tolerance.
This can make sense for some FPGA projects where the fabric speed is limiting factor in the design, rather than the external DDR memory interface speed, and where typically an SDR DRAM could have been used but wasn't (for reasons of availability, capacity, cost per bit).

DDR3 has a very high signalling rate, and in order for this to work reliably, it has added complexity such as;

  • Read/write levelling
  • ZQ calibration

In normal operating mode (DLL-on mode), DDR3 has a minimum clock frequency (300MHz+). However, it is possible to turn the DDR3 DLL off (in most DRAM parts) and run at frequencies <= 125MHz.

DLL-off mode (which this memory controller utilises) is listed as an optional feature for DDR3 parts to implement, however it seems that the popular DDR3 parts do implement it (and testing proves that it works well)!

Design Targets
  • Run at a reduced DDR clock speed (< 125MHz) to decrease the complexity of the DDR3 PHY, ease timing closure, reduce design LUT usage.
  • Support multiple FPGA vendors/toolchains.
  • Achieve high performance (for the clock speed) sequential read/write performance.
  • Support an AXI-4 target port with burst capabilities.
  • To be substantially smaller (using fewer FPGA LUTs) than commercial DDR3 cores (such as Xilinx MIG).
  • To be open-source, free to use, free to modify.
Features
  • 32-bit AXI-4 target port supporting INCR bursts.
  • Support up to 8 open rows, allowing back-to-back read/write bursts within an open row.
  • Standardized DFI interface between memory controller core and PHY.
  • PHYs: Xilinx 7 series, Lattice ECP5
Performance / Area

Performance for sequential burst accesses is good, as a burst of the same type - read or write, will be pipelined to an already open row.
Currently, there is no capability for read/write re-ordering/coalescing, so random read/write performance will not be optimal (this might be addressed in future releases).

On the Digilent Arty A7 running at 100MHz (max 400MBytes/s of bandwidth available), performing sequential reads / writes;
Performance

As for area, on the Xilinx Artix 7 (XC7A35T), the area used by the core (plus a small UART to AXI-4 bridge);
Area

It should be noted that the same project using the Xilinx MIG DDR3 controller takes 33% of the FPGA LUTs (vs 9% with this core).

Testing

Verified under simulation, then exercised on the following FPGA boards;

  • Digilent Arty A7 (Xilinx Artix + MT41K128M16JT-125)
  • LambaConcept ECPIX-5 (Lattice ECP5 + MT41K256M16RE-125)

The performance and error checking was done using this RAM Tester.
These boards have also booted Linux reliably with this DDR core, at the same time as been stressed by video frame buffer accesses to DDR.

Future Work

Weaknesses/areas of improvements;

  • ECP5 PHY is sub-optimal - relies on aligning the read data capture to the internal clock instead of capturing on the DQS input. This works reliably on the board/clock speeds tested, but really could do with fixing!
  • Support for AXI-4 WRAP bursts - these are often used with cache controllers which do critical word first fetches.
  • Add optional DDR scheduler logic on the frontend of the core to improve read/write thrashing performance (re-order and coalesce).
  • The PHY modules have tuneable delays, it would be good if these were automatically tuned at startup to simplify integration efforts (although this would increase LUT usage).
Integration

If you would like help with getting this core integrated into your FPGA project, contact me:

More Repositories

1

riscv

RISC-V CPU Core (RV32IM)
Verilog
984
star
2

biriscv

32-bit Superscalar RISC-V CPU
Verilog
701
star
3

cores

Various HDL (Verilog) IP Cores
Verilog
598
star
4

FPGAmp

720p FPGA Media Player (RISC-V + Motion JPEG + SD + HDMI on an Artix 7)
C
237
star
5

core_jpeg

High throughput JPEG decoder in Verilog for FPGA
Verilog
166
star
6

openlogicbit

Open-source Logic Analyzer gateware for various FPGA dev boards/replacement gateware for commercially available logic analyzers.
Verilog
87
star
7

core_usb_host

Basic USB 1.1 Host Controller for small FPGAs
C
77
star
8

riscv_soc

Basic RISC-V Test SoC
Verilog
76
star
9

exactstep

Instruction set simulator for RISC-V, MIPS and ARM-v6m
C++
74
star
10

core_ft60x_axi

FTDI FT600 SuperSpeed USB3.0 to AXI bus master
C++
73
star
11

libhelix-mp3

Fixed-point MP3 decoder (RISC-V port)
C
66
star
12

core_dvi_framebuffer

Minimal DVI / HDMI Framebuffer
Verilog
65
star
13

core_audio

Audio controller (I2S, SPDIF, DAC)
Verilog
64
star
14

core_usb_cdc

Basic USB-CDC device core (Verilog)
Verilog
61
star
15

core_sdram_axi4

SDRAM controller with AXI4 interface
C++
59
star
16

usb_sniffer

High Speed USB 2.0 capture device based on miniSpartan6+
C
56
star
17

core_soc

Basic Peripheral SoC (SPI, GPIO, Timer, UART)
Verilog
51
star
18

core_uriscv

Another tiny RISC-V implementation
Verilog
49
star
19

fat_io_lib

Small footprint, low dependency, C code implementation of a FAT16 & FAT32 driver.
C
48
star
20

usb2sniffer

USB2Sniffer: High Speed USB 2.0 capture (for LambdaConcept USB2Sniffer hardware)
Verilog
42
star
21

core_dbg_bridge

UART -> AXI Bridge
Verilog
41
star
22

riscv-linux-boot

Trivial RISC-V Linux binary bootloader
C
38
star
23

core_usb_fs_phy

USB Full Speed PHY
Verilog
35
star
24

core_spiflash

SPI-Flash XIP Interface (Verilog)
Verilog
33
star
25

core_usb_bridge

USB -> AXI Debug Bridge
Verilog
32
star
26

core_usb_uart

USB serial device (CDC-ACM)
Verilog
27
star
27

core_jpeg_decoder

HW JPEG decoder wrapper with AXI-4 DMA
Verilog
24
star
28

core_axi_cache

128KB AXI cache (32-bit in, 256-bit out)
Verilog
24
star
29

riscv_sbc

A RISC-V SBC based around the LambdaConcept USB2Sniffer FPGA board.
Verilog
24
star
30

fpga_test_soc

A small test SoC for various soft-CPUs (Cortex-M0, RISC-V)
C
22
star
31

core_enet

Ethernet MAC 10/100 Mbps
Verilog
21
star
32

core_mmc

MMC (and derivative standards) host controller
Verilog
21
star
33

minispartan6-audio

miniSpartan6+ (Spartan6) FPGA based MP3 Player
Verilog
21
star
34

core_ftdi_bridge

FTDI FT245 Style Synchronous/Asynchronous FIFO Bridge
Verilog
20
star
35

core_ulpi_wrapper

ULPI Link Wrapper (USB Phy Interface)
C++
19
star
36

core_usb_sniffer

USB capture IP
Verilog
18
star
37

riscv32_linux_from_scratch

RISC-V 32-bit Linux From Scratch
Makefile
18
star
38

librtos

Very basic real time operating system for embedded systems...
C
14
star
39

ecpix-5

Projects for the ECPiX-5 - a ECP5 FPGA board.
Verilog
12
star
40

minispartan6

Projects for the Scarab Minispartan6+ FPGA board
VHDL
12
star
41

core_ram_tester

AXI-4 RAM Tester Component
Verilog
11
star
42

altor32

AltOr32 - Alternative Lightweight OpenRisc CPU
Verilog
11
star
43

armv6m-sim

Simple instruction set simulator for ARMv6-M (Cortex M0)
C++
10
star
44

core_mpx

MPX is a open-source CPU which can execute code compiled for MIPS-I ISA
Verilog
9
star
45

xc6_bus_pirate

XC6 Bus Pirate (FPGA based multi-tool)
Verilog
7
star
46

orangecrab

Test projects for the OrangeCrab ECP5 FPGA board
Verilog
6
star
47

ecpix5-test

Test code / bitstreams for the LambdaConcept ECPIX-5 FPGA board
Verilog
6
star
48

riscv-sw-test

C++
5
star
49

riscv-linux-prebuilt

RISC-V Linux prebuilt images
5
star
50

embedded_httpd

Embedded HTTP Server
C
3
star
51

rp2040_blinky

Simple blinky example for the RP2040 that does not require cmake
C++
3
star