Skip to content
RetroCore Labs

The card's DDR3 memory: what it is, how to use it, what exists

The ND-120 build does NOT use the DDR3 yet - its 2 MB main memory is in block RAM (00-plan.md). This page collects what is known for the day a design needs more memory, for example an ND-500 CPU with 32-bit addresses. Every fact names its source; anything not found says so.

What is on the card

Item Value Source
Chips 9 x SK Hynix H5TC4G83BFR, 4 Gbit each, DDR3L 1.35 V community part list: https://github.com/ruurdk/storey-peak/blob/main/BOM.md
Bus 72 bits: 64 data + 8 ECC, 9 strobe pairs, pins SSTL-135 https://github.com/ruurdk/storey-peak README; pin file https://github.com/j-marjanovic/pp-sp-reference-design/blob/master/project/otma_bringup.qsf
Size 4.5 GB raw, 4 GB of data with ECC (= 2^32 bytes) arithmetic from the above; also https://github.com/corundum/corundum/issues/213
Chip speed rating 1866 MT/s according to one distributor listing; the speed letters on the card's chips were not read by anyone listing only, NOT checked in Hynix's datasheet; NOT FOUND for this card
Pins every DDR3 pin is in j-marjanovic's .qsf above (the file is shared by Pikes Peak and Storey Peak) not checked against this card

How it would be driven

  • Altera's own controller: for Stratix V the vendor path is the UniPHY DDR3 controller ("High Performance Memory Controller II" with the UniPHY PHY), generated in Quartus. Its user side is an Avalon-MM port, clocked at a fraction of the memory clock (half or quarter rate). Source: Intel's External Memory Interface Handbook (UniPHY), vol. 3, https://www.intel.com/content/www/us/en/docs/programmable/683841/17-0/uniphy-based-external-memory-interface.html.
  • It needs Quartus Prime Standard, so the same paid licence as the rest of the build (00-plan.md, "Building the bitstream").
  • The Stratix V device overview lists DDR3 x72 interfaces per device (4 for the D5, Table 4) - Altera Stratix V Device Overview, SV51001.

How fast

  • The memory clock: Intel's Stratix V handbook table of external memory performance gives DDR3 at 933 MHz, without saying for which speed grade. The limit for our speed grade (the stand-in is grade 3) is NOT FOUND: Intel's per-grade article returned 403/404 (https://community.altera.com/kb/knowledge-base/emif-maximum-frequency-specification-update-for-stratix-v/347520). Intel's EMIF Spec Estimator or a Quartus run gives the real number.
  • Intel also notes Stratix V DDR3 can have trouble closing timing at the top frequencies (support article 000086977).
  • How quick the ND logic can run and still use it: the DDR3 speed does NOT set the CPU clock. The controller runs on its own clock; the CPU talks to it through a cache and a request/answer port, and on a cache miss the CPU is simply held until the answer comes. That is exactly how this repo already runs the ND-120 on the Nexys 4 DDR: DDR2 behind a block-RAM cache, CPU deployed at 33.333 MHz (CLAUDE.md, Nexys status). So the CPU clock is limited by the CPU's own logic and the miss cost shows up as wait time, not as a lower clock. How many CPU cycles a miss costs on this card is NOT measured.

Code that already reads and writes it, or can be reused

  • On this card: nothing that works end to end was found. devops.lol (https://devops.lol/azure-fpga/) generated the Altera UniPHY DDR3 controller and says "the DDR3 is technically working but not accessible by the CPU": joining its Avalon-MM port to LiteX's Wishbone bus made the soft CPU hang, and that was not solved. No code link for the DDR3 part is given.
  • j-marjanovic's reference design (link above) documents the DDR3 pins but no DDR3 controller or test was found in its README.
  • thinkoco/microsoft_fpga (https://github.com/thinkoco/microsoft_fpga) has a DDR test, but for Catapult V3 (DDR4), not this card.
  • No LiteX board file for Storey Peak was found.
  • In this repo - the parts to reuse:
    • Verilog/fpga/nexys4ddr/ddr2/MEM_RAM_49_DDR2.v - the block-RAM cache in front of an external memory, with the CPU hold (MEM_HOLD) that absorbs any latency. Proven: the Nexys boots SINTRAN through it.
    • Verilog/fpga/nexys4ddr/ddr2/nd_ddr2_port.v - the request/answer contract that cache talks to.
    • Verilog/fpga/mega65/rtl/nd_avalon_port.v - that same contract on an Avalon-MM master, which is the kind of port the UniPHY controller has. Used by the MEGA65 R3 build for its HyperRAM. This is the closest thing to a ready adapter: it would need a wider data bus (the UniPHY port is wider than 16 bits) and a check against UniPHY's burst rules.
    • The Nexys's Xilinx memory controller itself (MIG) cannot be ported - it is Xilinx-only.

For an ND-500 with 32-bit addresses

  • 4 GB of data is exactly 2^32 bytes, so a byte address of 32 bits would cover the whole memory. Whether the ND-500's 32-bit addresses count bytes or something else is NOT checked here - look it up in the ND-500 reference manual before sizing anything.
  • Using ECC (the 9th chip) or not is a controller setting; with ECC off the 64 data bits still give 4 GB.

What to do first, when it is needed

  1. Generate a UniPHY DDR3 controller for the stand-in part in Quartus and read its maximum speed and user-port width from the generated report.
  2. Put Altera's memory test (the example design the generator makes) on the card to prove the pins and timing.
  3. Join it to MEM_RAM_49_DDR2's cache through an Avalon adapter based on nd_avalon_port.v, keeping one operation at a time - the deadlock devops.lol hit came from joining two bus types, so the adapter needs its own testbench against a model of the UniPHY port before any board run.