Dram bandwidth?


(RONGRONG CAO) #1

Hi
Is there anyone tested the dram bandwidth? I simply tested it by following command, it seems the dram bandwidth is so slow…

From sysfs, I got the core frequency is about 1GHz, but what’s the dram clock frequency?

For Write:
root@HiFiveU:/tmp/RAM_test# dd if=/dev/zero of=data_tmp bs=1M count=512
512+0 records in
512+0 records out
536870912 bytes (537 MB, 512 MiB) copied, 5.99626 s, 89.5 MB/s

For Read:
root@HiFiveU:/tmp/RAM_test# dd if=data_tmp of=/dev/null bs=1M count=512
512+0 records in
512+0 records out
536870912 bytes (537 MB, 512 MiB) copied, 3.64083 s, 147 MB/s
root@HiFiveU:/tmp/RAM_test#


(Jim Wilson) #2

The cpu frequency is /sys/devices/platform/soc/10000000.prci/rate and you can write new values in there to change the clock speed. It resets back to 1GHx when power cycled. The board should be reliable at 1.4GHz, and might be reliable at 1.5Gz. it is definitely reliable at 1GHz which is why that is the default.

I’m not a hardware or kernel guy, but I believe the DRAM is 1866. If you have the original 4.15 kernel that the board shipped with, then there could be software issues. A lot of kernel bugs have been fixed since then, including driver bugs, and I know that there have been problems with the dma drivers that have been fixed, someone which have improved dma performance. I don’t think that the dma driver work is finished yet. Otherwise, the problem might be that this is our first ever board that has DRAM support, and you don’t always get it exactly right the first time. If there is a hardware problem it will likely be fixed in our next board.


(RONGRONG CAO) #3

Thanks for reply!
I measured the ddr4 clock by oscilloscope directly, the ddr clock is 933MHz indeed.
However, it’s very unreasonable that HiFive Unleashed uses 64bits width dram and running at 933MHz, but the dram bandwidth is so poor.

So I want to double confirm, is my test result reasonable on this HiFive Unleashed board?


(Paul Walmsley) #4

‘dd’ is not a good DRAM bandwidth benchmark. You can prove this on your own system by comparing the output of a CPU DRAM bandwidth benchmark package, such as STREAM, with the results you get from ‘dd’. STREAM can be downloaded from here: https://www.cs.virginia.edu/stream/ref.html

Something else to bear in mind is that, in general, CPU DRAM benchmarks usually can’t reach the full system DRAM throughput. Usually GPUs or display controllers are better for measuring this. Of course, the FU540 doesn’t have these on-chip devices, so it may be that testing CPU DRAM bandwidth or possibly Platform DMA DRAM bandwidth may be the best options for now.