Apache License 2.0

项目介绍

zf3/psram-tang-nano-9k 是一个托管在 GitHub 上的开源项目,主要使用 Verilog 编写,采用 Apache License 2.0 许可证,目前获得 109 个 Star、15 次 Fork。

仓库全名
zf3/psram-tang-nano-9k
开源许可证
Apache License 2.0
Star 数
109
Fork 数
15
未关闭 Issue
5

README 摘要

PSRAM/HyperRAM controller for Tang Nano 9K This is an open source PSRAM/HyperRAM controller for the Tang Nano 9K FPGA board. The chip is Gowin GW1NR-LV9QN88PC6/15. Overview Supports both word (16-bit) and byte based access. No bursting is used. 1:1 clock design. Memory and main logic work under the same clock. Max clock frequency is 83Mhz. I'm mostly aiming for low access latency. Write latency is 7 cycles (1x) or…

完整内容见 GitHub 原始 README 或本页 。

常见问题

psram-tang-nano-9k 用什么语言开发?

主要使用 Verilog 编写,采用 Apache License 2.0 许可证,目前有 109 个 Star。

psram-tang-nano-9k 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 psram-tang-nano-9k 的源码?

可以直接克隆仓库:git clone https://github.com/zf3/psram-tang-nano-9k.git,默认分支为 main;安装与运行步骤见仓库 README。

psram-tang-nano-9k 最近还在维护吗?

仓库最近一次更新为 2022年10月11日,当前有 5 个未关闭 Issue;Star 数为 109,可作为社区活跃度的参考。

关于

An open source PSRAM/HyperRAM controller for Sipeed Tang Nano 9K / Gowin GW1NR-LV9QN88PC6/15 FPGA

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
143
价值分
70
活跃状态
活跃

README

PSRAM/HyperRAM controller for Tang Nano 9K

This is an open source PSRAM/HyperRAM controller for the Tang Nano 9K FPGA board. The chip is Gowin GW1NR-LV9QN88PC6/15.

Overview

  • Supports both word (16-bit) and byte based access. No bursting is used.
  • 1:1 clock design. Memory and main logic work under the same clock. Max clock frequency is 83Mhz.
  • I’m mostly aiming for low access latency. Write latency is 7 cycles (1x) or 10 cycles (2x). Read latency is 12 cycles (1x) or 15 cycles(2x). HyperRAM needs 2x latency now and then for automatic DRAM refreshes. In my test, 2x latency happens about 0.05% of time.
  • Uses Gowin’s ODDR/IDDR primitives. This removes the need to use double frequency clocks. A PLL is used to generate the phase-shifted clock needed by HyperRAM.
  • Code is simple. 200 lines of Verilog. Resource usage: <200 logic units, vs ~1000 for official IP.

Usage

  • psram_controller.v is the controller. See comments for usage.
  • Also read the test bench psram_test_top.v for an actual example. It works at 81 Mhz, uses byte-based access, and writes its results to UART at 115200 bps.

Quick discussion about going above 83Mhz

  • The LATENCY parameter specifies the tACC (initial latency) cycles. Setting it to 4 to 6 allows higher frequency on the RAM side. However currently this does not work due to failing to achieve timing closure on the FPGA side. This is probably due to the speed grade of the chip as similar code works at higher frequencies on Tang Primer 20K (with C8/17 speed grade). I conjecture this to be the reason why the official PSRAM HS IP uses a 1:2 gear ratio design. Eseentially that controller runs at half the memmory clock speed. You can confirms this by building the official IP and check its resource usage. In my case it uses 1 CLKDIV, 16 IDES4 and 23 OSER4, but no IDDR/ODDR. So for memory speed of 160Mhz, the controller is running at 80Mhz (thus the CLKDIV) and sending/receiving 4 bits every cycle on one signal line (IDES4/OSER4). So one could adopt a similar approach to achieve higher memory speed. This GW2A DDR3 controller using ISER8/OSER8 primitives may be of value if anyone is interested in implementing such a HyperRAM controller.

See also

  • An example using the official Gowin HyperRAM IP. The official IP uses bursting access (writes/reads >= 16 bytes a time). So it is higher throughput, but also higher latency. And it is encrypted verilog. :(
  • Tang 20K official examples, where the UART module comes from.

Feng Zhou, 2022.8

评论

暂无评论