Monthly Archives: February 2020

What are DRAM Timings?: Some Knowledge about Operation of SDRAM and a Brief Memorandum about DRAM Timings

In this article, I will write about DRAM timings. Since a DRAM plays the important role in an operation of the Zen architecture, so it is necessary DRAM tuning when you want to extract better performance of Ryzen. DRAM tuning mainly focuses on the memory frequency and DRAM timings (memory latency). And in Zen2, the optimal memory clock is already determined (3733 MHz or 3800 MHz), so it is important to tune DRAM timings. For better tuning DRAM timings, you should know what it is to some extent. So, I will introduce some of the knowledge about DRAM timings and write down the standards of setting them which I follow, in this article.

今回は,DRAMタイミングについて整理します.Zenアーキテクチャの挙動においてはDRAMが重要な役割を果たすため( https://ocod.home.blog/2019/12/08/why-tuning-ddr4-is-important-for-ryzen/ ),Ryzenの性能をより引き出すためにはDRAMのチューニングを行うことが必要です.DRAMのチューニングは主にメモリクロックとDRAMタイミング(メモリレイテンシ)を対象にしますが,Zen2においては最適なメモリクロックが決まっているため(3733 MHzまたは3800 MHz),DRAMタイミングのチューニングが重要になります.DRAMタイミングのより良いチューニングのためには,それがどのようなものなのかをある程度知っておくのが良いと考えます.そこで,ここではDRAMタイミングにかかわる知識の一部を紹介しつつ,私が個人的に従っている設定基準を記したいと思います.

DRAM timings have the primary timings, the secondary timings, the tertiary timings. The range of tuning is often as far as the secondary timings (DRAM Calculator for Ryzen also cover as far as the secondary timings). Therefore, this article targets the primary timings and the secondary timings.

DRAMタイミングには,ファーストタイミング(プライマリタイミング),セカンドタイミング,サードタイミングがあります.DRAMタイミングのチューニングにおいては,セカンドタイミングまでを対象とすることが多いです(DRAM Calculator for Ryzenでも,対象となっているのはセカンドタイミングまでです).したがって,この記事ではセカンドタイミングまでを対象とします.


Knowledge about Operation of SDRAM for Understanding the Primary Timings

The primary timings consists of tRCD, tRP, tRAS, including tCL (CAS latency) which is the most important DRAM timing (and CR is often included). I will write here the outline of 1st timings with introducing the basic operation of DRAM, especially SDRAM including DDR4.

ファーストタイミングには最も重要なDRAMタイミングであるtCL(CASレイテンシ)をはじめ,tRCD,tRP,tRASから成ります(しばしば,CRが含まれることがあります).ここでは,DRAM,特にDDR4を含むSDRAMの基本的な挙動と合わせて,ファーストタイミングの概略を示します.


SDRAM (Synchronous Dynamic Random Access Memory) operates based on clock signals and has the function that synchronizes with the clock of a memory controller (on a CPU) or system buses (transmission paths connecting the chipset and the CPU), and so on. DDR SDRAM (Double Data Rate SDRAM) including DDR4 achieve twice bandwidth per clock compared to SDR SDRAM (Single Data Rate SDRAM, which sends or receives data only at the rising edges of the clock), due to that a CPU distribute read/write processing to two or more memory banks, and each memory banks send or receive data at two timings, the rising edges and the falling edges of a clock. Also, the next command can be issued without waiting for completing the processing by the previous command (for example, a pre command (described later) can be issued before all memory banks have completed reading the data). In addition, in an operation of DRAM, when determine a cell to be read/written, a row is determined first and a column determined second, and there is the function called burst mode which if once the column is determine, the next column is determined automatically for next read/written, and which can save operation time by omitting command to determine the second and subsequent column.

SDRAM(Synchronous Dynamic Random Access Memory)は,クロック信号に基づき動作し,(CPU上の)メモリコントローラーやシステムバス(チップセットとCPUをつなぐ伝送路)等のクロックと同期する仕組みを持っています.DDR4等のDDR SDRAM(Double Data Rate SDRAM)は,CPUが2つ以上のメモリバンクに読み書きの処理を振り分け,それぞれのメモリバンクがクロックの立ち上がりと立ち下がりの2つのタイミングでデータを送受信することで,SDR SDRAM(Single Data Rate SDRAM,これのデータ送信はクロックの立ち上がりのみで行われる)に対し,クロック当たり2倍の帯域を実現しています.また,DDR SDRAMは,以前の命令の処理の完了を待たずに次の命令を発行することができます(すべてのメモリバンクがデータの読み取りを完了する前にpreコマンド(後述)を発行できる,等).さらにDRAMの動作では,読み書きの対象となるセルの指定に当たり,まず行を指定し次に列を指定しますが,一度特定の列が指定されれば自動的に次の列が次の読み書きの対象となるバーストモードという機能を備えており,2回目以降の列指定の命令を省くことで動作時間の短縮に貢献します.


To understand some DRAM timings, you need to know some of the basic commands in DRAM operation.

いくつかのメモリタイミングを理解するために,DRAMの動作における基本的なコマンドのいくつかを知る必要があります.

  • CS (chip select): It determines which memory chip is being accessed.
  • act (activate): It determines a bank address and a row address.
  • read/write: It determines a column address, and read/write data. It also include auto precharge individual columns.
  • pre (precharge): It closes the row (thus the row has remained open til fetch a precharge command), terminates all operation, and returns the memory chip to the standby state.
  • ref (refresh): The capacitors used for DRAM are volatile (they leaks electric charge unless written), so data will be lost if left untouched. To prevent this, it is necessary to periodically rewrite (refresh) the precharged memory chip.
  • CS(chip select):どのメモリチップにアクセスするかを決定します.
  • act(activate):バンクアドレスと列アドレスを決定します.
  • read/write:列アドレスを決定し,データを読み書きします.また,個々の列を自動プリチャージします.
  • pre(precharge):行を閉じて(つまり,preコマンドが受け取られるまで行が開いたままになります)すべての操作を終了し,メモリチップをスタンバイ状態に戻します.
  • ref(refresh):メモリに用いられるコンデンサは揮発性のため(書き込みをしない限り電荷がリークされる)そのままではデータが損失します.これを防ぐため,プリチャージされたメモリチップに定期的に再書き込みを行う(リフレッシュを行う)必要があります.
The diagram about very simplified operation of DDR SDRAM
The diagram about very simplified state transitions of SDRAM

Meaning of the Primary Timings

The primary timings are the most basic and important one of DRAM timings. Since there are few kinds of primary timings, the basic tuning method is to reduce the value one by one while balancing with the DRAM voltage based on the XMP of the DRAM.

プライマリタイミングは,DRAMタイミングのうち最も基本的かつ重要なものです.プライマリタイミングは数も少ないため,DRAMのXMPを基準に,DRAM電圧とのバランスをとりながら値を1ずつ削減していくことが基本的な調整方法になります.

  • tCL or tCAS (Column Address Strobe Latency): This means the number of clocks from when a column is selected by read/write command to when start read/written data. There are three types of read/write transaction of DRAM corresponding to status of the bank (page): Page-Hit Access (when the bank targeted to read/written is already open, and an act command isn’t required); Page-Empty Access (when the bank targeted to read/written is closed, so an act command is required); Page-Miss Access (when the wrong row is being opened so it is necessary to close the row opened currently and open a different row, thus it is necessary not only act command but also pre command before the act command). And tCL is the latency intervene in all of them, thus, tCL greatly affects the performance of DRAM. Therefore, it is important to reduce tCL preferentially.
  • tRAS (Raw Address Strobe Latency): This means the minimum number of clocks required from when selecting a row by an act command to when issuing a pre command. The target row remains opened during column selection and data reading/writing, so the range of tRAS is till a precharge command.
  • tRCD (Row Address to Column Address Delay): This means the minimum number of clocks required from when selecting a row by an act command to when issue a read/write command. There are two kinds of tRCDs: tRCDWR is tRCD which is required when a write command is issued; tRCDRD is required when a read command is issued.
  • tRP (Row Precharge Time): This means the minimum number of clocks required to complete a precharging.
  • CR (Command Rate): This means the number of consecutive clocks required when a memory controller sends commands to a memory bank. The CR is indicated as 1T or 2T (often 1N or 2N), each means one clock and two clocks. If the CR is 1T, each of the commands are sent only once to the memory bank which takes one clock (therefore, one clock delay occurs), and if 2T, each of the commands are sent twice which takes one clock (therefore, two clocks delay occurs). Since the CR is delay about each of the commands, it significantly influence the performance of DRAM. So you should set 1T (1N) preferentially.
  • tCLまたはtCAS(Column Address Strobe Latency):これは,read/writeコマンドにより列が選択されてからデータの読み書きが開始されるまでのクロック数を意味します.DRAMの読み書きには,バンク(ページ)の状況に応じて,ページヒットアクセス(バンクが既に開いている状態での読み書きで,actコマンドは不要),ページエンプティアクセス(バンクが閉じている状態での読み書きで,actコマンドが必要),ページミスアクセス(誤った行を開いているため,現在開いている行を閉じて異なる行を開く必要がある状態での読み書きで,actコマンドに加えて,その前にpreコマンドが必要)の3種類が存在します.tCLはそのすべてに介在する遅延であり,DRAMの性能に多大な影響を及ぼします.したがって,他のタイミングに優先してtCLを減らすことが重要になります.
  • tRAS(Raw Address Strobe Latency):これは,actコマンドによる行の選択からpreコマンドの発行までに必要な最小クロック数を意味します.列の選択やデータの読み書きの間,対象となっている行は開いたままなので,tRASの範囲はプリチャージまでということになります.
  • tRCD(Row Address to Column Address Delay):これは,actコマンドによる行の選択からread/writeコマンドの発行までに必要な最小クロック数を意味します.tRCDには,writeコマンドが発行された時に要求されるtRCDWR,readコマンドが発行された時に要求されるtRCDRD,の2種類があります.
  • tRP(Row Precharge Time):これは,プリチャージが完了するまでに必要な最小クロック数を意味します.
  • CR(Command Rate):これは,メモリコントローラがメモリバンクにコマンドを送る際に必要な連続したクロック数を意味します.CRは,1Tや2T(しばしば,1Nや2N)と表記されますが,これはそれぞれ1クロックと2クロックを意味します.CRが1Tの場合,各コマンドは1クロック分かけてメモリバンクに1度だけ送られ(したがって,1クロックの遅延が生じます),2Tの場合,各コマンドは1クロック分かけて2度送られます(したがって,2クロックの遅延が生じます).CRは各コマンドにかかる遅延であるため,メモリの性能に大きな影響を及ぼします.したがって,優先的に1T(1N)で設定します.

About the True Latency

The latency related to the commands in SDRAM (DRAM timings) is indicated in clock units, via the character of operation of SDRAM that synchronize with clock signals. For example, tCL 2 means that the latency between opening a column and reading/writing data is 2 clocks. The tCL can also be expressed in actual time, which is called true latency and is calculated as follows.

SDRAMにおけるコマンドにかかわる遅延(メモリタイミング)は,クロック信号に同期して動作する特徴から,クロック単位で示されます.例えば,tCL 2は,列の開放からデータの読み書きまでの遅延が2クロック分であることを意味します.tCLは実際の時間で表記することもでき,それは実レイテンシと呼ばれ以下のように計算します.

True Latency = tCL / memory frequency

When comparing multiple DRAMs, if the memory frequencies are different, the required time at Column Address Strobe indicated by the number of clocks will be different. If you want to compare the performance of DRAMs with different memory frequencies and DRAM timings, for this reason, it is necessary to refer to True Latency. The higher value of the memory frequency and the smaller value of DRAM timing means the better DRAM respect of performance, and therefore, the DRAM which have the smaller True Latency is the better one.

複数のDRAMを比較する際,そのメモリクロックが異なるとクロック数で表記されているColumn Address Strobeで要求される時間が異なってきます.それぞれ異なるメモリクロックとメモリタイミングをもつDRAMの性能を比較する際には,こうした理由から,実レイテンシ参照する必要が出てきます.メモリクロックの数値は大きくメモリタイミングの数値は小さい方が高性能のDRAMということになり,したがって小さい実レイテンシを持つDRAMは良いということになります.

For Zen2, it has been recommended that you set memory frequency 3733 MHz or 3800 MHz, and it is ok to overclock a DRAM which works 3200 MHz or to downclock a DRAM which works 4000 MHz. This True Latency can be helpful when choosing a DRAM to use with a Zen 2 processor. For example, in the case of (I) F4-3200C14-8gGFX (3200 MHz, CL14), (II) F4-3600C15-8gGTZ (3600 MHz, CL15) and (III) F4-4000C17-8GTZR (4000 MHz, CL17), the each actual latency is (I) 8.75 ns, (II) 8.33 ns, and (III) 8.5 ns, so the performance when operating at XMP is (II) > (III) > (I).

Zen2では3733 MHzまたは3800 MHzのメモリクロックが推奨されていますが,3200 MHzのメモリをオーバークロックしたり,4000 MHzのメモリをダウンクロックして使っても問題はありません.Zen 2プロセッサで使うメモリの選択の際に,この実レイテンシは参考になります.例えば,(I) F4-3200C14-8gGFX(3200 MHz, CL 14)と (II) F4-3600C15-8gGTZ(3600 MHz, CL 15)と (III) F4-4000C17-8GTZR(4000 MHz, CL 17)の場合,実レイテンシは(I) 8.75 ns,(II) 8.33 ns,(III) 8.5 nsとなり,XMPで動作した場合の性能は(II) > (III) > (I)です.


Meaning of the Secondary Timings and Standards for Setting Them

  • tRC (Row Cycle Time): This means the minimum number of clocks from when opening a row to when completing precharging (row cycle). tRC = tRP + tRAS.
  • tRRD (RAS to RAS Delay): This is the number of clocks required between two issuance of the RAS signal (which is enabled between the act command and the pre command). There are two kinds of tRRDs: tRRDS means tRRD among different memory bank groups; tRRDL means among the same memory bank groups. The values I often use are: tRRDS -> 4; tRRDL -> 6
  • tFAW (Four Activate Window): DRAM can be activated up to four memory banks (and rows) per memory rank, and tFAW means the time between when four memory banks are opened to when the next memory bank can be opened. tFAW = 4 * tRRDS.
  • tWTR (Write to Read Delay): This means the number of clocks required after a write command was completed successfully before a read command can be issued. There are two kinds of tWTRs: tWTRS means tWTR among different memory bank groups; tWTRL means among the same memory bank groups. The values I often use are: tWTRS -> 6; tWTRL -> 8.
  • tWR (Write Recovery Time): This means the number of clocks required after a write command was completed successfully before a pre command is issued. The value I often use is: tWR -> 12.
  • tRFC (Refresh Cycle Time): This means the number of clocks required from when a ref command is issued to when the next act command can be issued. tRFC = n * tRC, n = 6 or 7. One of the strengths of the Samsung B-Die chip is that it can significantly reduce tRFC, so it is best to target less than 300 when tuning the DRAM in which it is used. (And tRFC has two other variations, but in Ryzen, they aren’t used: tRFC2 = tRFC / 1.346 (at double frequency mode); tRFC4 = tRFC2 / 1.625 (at quad frequency mode).)
  • tCWL (CAS Write Latency): It is the number of clocks required from when an activation of the column of DRAM to when the execution of the write command, and it is de facto tCL. tCWL = tCL.
  • tRTP (Read to Precharge Delay): This means the number of clocks required from when issuance of the read command to when issurance the pre command in the same memory rank. tRTP = tWR / 2.
  • tCKE (Clock Enable Time): This means the number of clocks required to issue a CKE signal. All commands of DRAM operations are fetched only when the CKE signal is high (that is, commands are not read when the CKE signal is low). Therefore, when PowerDownMode (function to make the CKE signal low) is off, the value of tCKE has no effect on the DRAM operation because the CKE signal doesn’t become low.
  • tRDRD (Read to Read Delay): This means the number of clocks required from when a read command is issued to when the next read command can be issued. There are four kinds of tRDRDs: tRDRDSc means tRDRD among different memory bank groups; tRDRDScL means among the same memory bank groups; tRDRDSd means among different memory ranks; tRDRDDd means among different DRAMs. The values I often use are: tRDRDSc -> 1; tRDRDScL -> 4; tRDRDSd -> 4; tRDRDDd -> 4.
  • tWRWR (Write to Write Delay): This means the number of clocks required from when a write command is issued to when the next write command can be issued. There are four kinds of tWRWRs: tWRWRSc means tWRWR among different memory bank groups; tWRWRScL means among the same memory bank groups; tWRWRSd means among different memory ranks; tWRWRDd means among different DRAMs. The values I often use are: tWRWRSc -> 1; tWRWRScL -> 4; tWRWRSd -> 6; tWRWRDd -> 6.
  • tRDWR (Read Write Command Spacing): This means the number of clocks required from when a read command is issued to when the next write command can be issued in the same memory rank. The value I often use is: tRDWR -> 8.
  • tWRRD (Write Read Command Spacing): This means the number of clocks required from when a read command is issued to when the next write command can be issued in the same memory rank. The value I often use is: tWRRD -> 2.
  • tRC(Row Cycle Time):これは,actコマンドによって行が開いてからprechargeが完了するまで(行サイクル)の最小クロック数を意味します.tRC = tRP + tRAS
  • tRRD(RAS to RAS Delay):これは,2つの(actコマンドからpreコマンドの間有効になっている)RAS信号の発行に必要な間隔をクロック数で表したものです.tRRDには,異なるメモリバンクグループにおけるtRRDを意味するtRRDSと,同じメモリバンクグループにおけるtRRDLの2種類があります.著者がよく使う値は,tRRDS -> 4; tRRDL -> 6
  • tFAW(Four Activate Window):DRAMでは1つのメモリランクにつき最大4つのメモリバンク(と行)をアクティベートできますが,tFAWは4つのメモリバンクが開かれた後,次のメモリバンクを開くことができるようになるまでの時間を意味します.tFAW = 4 * tRRDS
  • tWTR(Write to Read Delay):これは,writeコマンドが正常に完了してからreadコマンドを発行できるようになるまでに必要なクロック数を意味します.tWTRには,異なるメモリバンクグループにおけるtWTRを意味するtWTRSと,同じメモリバンクグループにおけるtWTRLの2種類があります.著者がよく使う値は,tWTRS -> 6; tWTRL -> 8
  • tWR(Write Recovery Time):これは,writeコマンドが正常に完了してからpreコマンドが発行されるまでに必要なクロック数を意味します.著者がよく使う値は,tWR -> 12
  • tRFC(Refresh Cycle Time):これは,refコマンドが発行されてから次のactコマンドが発行できるようになるまでに必要なクロック数を意味します.tRFC = n * tRC, n = 6 or 7.Samsung B-DieチップはtRFCを大きく削減できることが長所の1つなので,それが使用されているDRAMをチューニングする場合,300以下にすることを目標にするといいでしょう.(また,tRFCには他に2種類のバリエーションが存在しますが,Ryzenにおいては使用されません.tRFC2 = tRFC / 1.346(double frequency mode); tRFC4 = tRFC2 / 1.625 (quad frequency mode))
  • tCWL(CAS Write Latency):DRAMの列をアクティベートしてからwriteコマンドを実行するまでに必要となるクロック数で,事実上のtCLです.tCWL = tCL
  • tRTP(Read to Precharge Delay): これは,同じメモリランクにおける,readコマンドの発行からpreコマンドの発行までに必要なクロック数を意味します.tRTP = tWR / 2
  • tCKE(Clock Enable Time):これは,CKE信号の発行に必要なクロック数のことを意味します.DRAMの動作にかかわるすべてのコマンドは,CKE信号がハイの場合にのみフェッチされます(つまり,CKE信号がローの状態はコマンドが読み取られません).したがって,PowerDownMode(CKE信号をローにする機能)をoffにしている場合,CKE信号がローにならないため,tCKEの値はDRAMの動作に影響力を持ちません.
  • tRDRD(Read to Read Delay):これは,readコマンドが発行されてから次のreadコマンドが発行できるようになるまでに必要なクロック数を意味します.tRDRDには,異なるメモリバンクグループにおけるtRDRDを意味するtRDRDSc,同じメモリバンクグループにおけるtRDRDScL,異なるメモリランクにおけるtRDRDSd,異なるDRAMにおけるtRDRDDd,の4種類があります.著者がよく使う値は,tRDRDSc -> 1; tRDRDScL -> 4; tRDRDSd -> 4; tRDRDDd -> 4
  • tWRWR(Write to Write Delay):これは,writeコマンドが発行されてから次のwriteコマンドが発行できるようになるまでに必要なクロック数を意味します.tWRWRには,異なるメモリバンクグループにおけるtWRWRを意味するtWRWRSc,同じメモリバンクグループにおけるtWRWRScL,異なるメモリランクにおけるtWRWRSd,異なるDRAMにおけるtWRWRDd,の4種類があります.著者がよく使う値は,tWRWRSc -> 1; tWRWRScL -> 4; tWRWRSd -> 6; tWRWRDd -> 6
  • tRDWR(Read Write Command Spacing):これは,同じメモリランクにおいて,readコマンドが発行されてから次のwriteコマンドが発行できるようになるまでに必要なクロック数を意味します.著者がよく使う値は,tRDWR -> 8
  • tWRRD(Write Read Command Spacing):これは,同じメモリランクにおいて,writeコマンドが発行されてから次のreadコマンドが発行できるようになるまでに必要なクロック数を意味します.著者がよく使う値は,tWRRD -> 2

How to do Stable DDR4 Tuning on Ryzen: Finding the Appropriate Values of the Termination Resistance (Rev. 2)

If you want to overclock DRAMs or reduce DRAM timings from XMP further, it is known that you can use Ryzen DRAM Calculator released by 1usmus. This calculates some values very easily, including detailed items. However, it is largely depends on your individual environment (system configuration) that those values are appropriate or not. Therefore, you just only enter values calculated by the calculator, you often get failure to start your system or instability on your daily operation. Thus, the calculator only provides a draft, and based on that, you should specify the optimal values of each item according to your own environment. It can be said that that is appropriate usage of Ryzen DRAM Calculator.

XMPからさらにDRAMをオーバークロックしたりDRAMタイミングを減少させる場合,1usmus氏によってリリースされているRyzen DRAM Calculatorを利用できることが知られています.これは細かな項目を含めて非常に簡単にいくつかの値を算出してくれますが,これらの項目の値が適切であるか否かは,個別の環境(システム構成)に大きく依存しています.したがって,ただ計算機から算出された値を入力しただけでは,システムの起動に失敗したり日常動作が不安定になることがしばしばあります.つまり,計算機はあくまでたたき台を提示するものであって,それを元に自分の個別の環境に合わせて各項目の適切な値を特定していく必要があります.それが,Ryzen DRAM Calculatorの適切な使用法だと言えます.

On this article, I will instruction a method for stable DRAM tuning, especially finding the optimal values of termination resistances, on Ryzen. Termination resistances are used for impedance matching that are ratio of current to voltage. If there are no termination resistances or inadequate termination resistances, impedances among the side of signal output, the side of signal input, and of the transmission passes (called “characteristic impedance”) become inconsistent. In this case, the transmitted signal is reflected at the end of the circuit, and the power which transmits the signal is attenuated (similar to a water wave bouncing off a wall). That is recognized that noises which degrade the signal waveform, and this can be fatal in the exchange of high-frequency signals, causing read/write errors. Because of that, tuning termination resistances to reduce noise is important when you overclock DRAMs.

今回は,Ryzenにおける安定したメモリの調整方法,特に,適切な終端抵抗の値を調べる方法を説明します.終端抵抗は,インピーダンス(電流と電圧の比)を整合させるためのものです.終端抵抗がない,あるいは不適切な終端抵抗になっている場合,信号の発信側と受信側,そして伝送路のインピーダンス(これを特性インピーダンスといいます)が不整合になります.この場合,送信された信号は回路の末端で反射し,信号を送信する電力が減衰します(壁で跳ね返る水の波のようなものです).それは信号波形を劣化させるノイズとして認識され,これは高周波信号のやりとりにおいては致命的となって読み書きのエラーを生じさせます.このため,ノイズを抑えるための終端抵抗の調整は,DRAMのオーバークロックにおいて重要になります.


Things to Prepare

memtest86 (bootable from an USB stick)

https://www.memtest86.com/

DRAM Calculator for Ryzen v1.7.0 by 1usmus (latest version as of February 5th, 2020)

https://www.techpowerup.com/download/ryzen-dram-calculator/

*Thank you, 1usmus!


Equipment Used for the Tests for This Article

  • Ryzen 9 3950X (core clock 4100 MHz)
  • F4-3600C14Q-32GTZN (use only 2 DRAMs)
  • X570 ROG Crosshair VIII HERO Wi-Fi (AGESA 1.0.0.4)

STEP1. Set Some Basic Items

Set target values, memory frequency, DRAM timings, DRAM voltage, CPU SoC voltage, VTT DDR voltage, and BGS (BankGroupSwap), for daily-use from UEFI.

UEFIから,DRAMクロック,DRAMタイミング,DRAM電圧,CPU SoC電圧,VTT DDR電圧,BGS(BankGroupSwap)を,常用の目標値に設定します.

memory frequency… For Zen2, the optimal memory frequency is 3733 MHz or 3800 MHz (https://ocod.home.blog/2019/12/08/why-tuning-ddr4-is-important-for-ryzen/).

メモリクロック… Zen2の場合,最適なメモリクロックは3733 MHzまたは3800 MHzです https://ocod.home.blog/2019/12/08/why-tuning-ddr4-is-important-for-ryzen/

If fClk does not synchronize automatically with mClk, you should set manually fClk to 1867 MHz or 1900 MHz from UEFI.

fClkが自動でmClkと自動的に同期しない場合,UEFIから手動で1867 MHzまたは1900 MHzに設定します.

DRAM timings… ( https://ocod.home.blog/2020/02/29/what-are-dram-timings-some-knowledge-about-operation-of-sdram-and-a-brief-memorandum-about-dram-timings/ )

DRAMタイミング… ( https://ocod.home.blog/2020/02/29/what-are-dram-timings-some-knowledge-about-operation-of-sdram-and-a-brief-memorandum-about-dram-timings/

If Gear Down Mode is enabled, you cannot set an odd value of tCL, so turn it off. And Power Down Mode is the function that puts the DRAM in sleep mode when your system is inactive. If you want to use the full performance of the DRAM, turn it off.

Gear Down Modeが有効になっていると奇数の値のtCLを設定することができないので,これをオフにします.また,Power Down Modeは非アクティブ時にDRAMを休止状態にする機能ですが,DRAMの性能をフルで使いたい場合,これをオフにします.

DRAM voltage… If you use Samsung B-Die memories, up to 1.5 V or slightly higher for daily-use.

DRAM電圧… Samsung B-dieを使用する場合,常用では1.5 Vかそれよりわずかに高い値を上限とします.

VTT DDR voltage… It means termination voltage. If impedances among the side of signal output, the side of signal input, and a characteristic impedance are matched, termination voltage will be half of DRAM voltage ( = voltage applied a side of signal output). That is because a termination voltage is affected by two resistances, one is the resistance applied to the side of signal output and the other is the termination resistance. When impedances are matched, resistance applied to the side of signal output and termination resistance will have same value generally, so the optimal termination voltage become half of DRAM voltage. As I’ll do below, our purpose in this article is find optimal termination resistance. When you want to find optimal value of a variable, you should fix values of another variables which effect that variable. So you should set VTT DDR voltage half of DRAM Voltage.

VTT DDR電圧… これは終端電圧を意味します.信号出力側,信号入力側,特性インピーダンスのインピーダンスが一致している場合,終端電圧はDRAM電圧(=信号出力側の電圧)の半分になります.これは終端電圧が2つの抵抗の影響を受けるためです.1つは信号出力側の抵抗で,もう1つは終端抵抗です.インピーダンスが一致すると,信号出力側に適用される抵抗と終端抵抗は,一般的に同じ値になるため,最適な終端電圧はDRAM電圧の半分になります.以下で行うように,ここでの目的は最適な終端抵抗を見つけることです.ある変数の最適値を見つけたいときには,その変数に影響を与える他の変数の値を固定する必要があります.したがって,DRAM電圧の半分のVTT DDRを設定します.

CPU SoC voltage… It is applied to memory controller on the CPU. Up to 1.1 V or slightly higher for daily-use.

CPU SoC電圧… これはCPUのメモリコントローラーに適用されます.常用では1.1 Vかそれよりわずかに高い値を上限とします.

BGS… BGS is a function to assign applications to physical areas of memory modules. When this is turned on, it brings benefit at running synthetic test apps and disadvantage at running game apps (https://community.amd.com/community/gaming/blog/2017/07/14/memory-oc-showdown-frequency-vs-memory-timings). If you value practicality, I think it is better to turn BankGroupSwap and BankGroupSwapAlt off.

BGS… BGSは,メモリモジュールの物理領域にアプリケーションを割り当てる機能です.これをオンにすると,総合テストアプリの実行における利益をもたらす一方で,ゲームアプリの実行におけるデメリットがもたらされます(https://community.amd.com/community/gaming/blog/2017/07/14/memory-oc-showdown-frequency-vs-memory-timings).実用性を重視する場合,BankGroupSwapとBankGroupSwapAltをオフにする方が良いと考えます.


STEP2. Set Values of CAD_Bus Drive Strength

The appropriate values for impedance matching depends on the combination of a motherboard, a memory, a SoC (in a CPU), and a value of memory clock, so you have to test each values one by one.

インピーダンスマッチングの適切な値は,マザーボード,メモリ,(CPU内の)SoC,メモリクロックの組み合わせに依存するため,しらみつぶしにテストしていくしかありません.

CAD_Bus (Command/Address/Data_Bus) Drive Strength… It means resistances which is applied to pins on a DRAM. Enter provisionally the values calculated by the DRAM Calculator. The optimal values of CAD_Bus Drive Strength depend on the circumstance composed by your PC parts, so you should adjust that later.

CAD_Bus(Command/Address/Data_Bus)Drive Strength… これはDRAM上のピンにかかる抵抗を意味します.DRAM Calculatorで計算された値を暫定的に入力します.適切なCAD_Bus Drive Strengthの値はPCパーツによって構成される状況に依存しているため,後で調整する必要があります.

  • ClkDrvStren (Clock Drive Strength)… It means a resistance of MEMCLK (Memory Clock) pin.
  • AddrCmdDrvStren (Address/Command Drive Strength)… It means resistances of each pins; Address, RAS# (Row Address Strobe), CAS# (Column Address Strobe), WE# (Write Enable), Bank, and Parity.
  • CsOdtDrvStren… (Chip Select/On-Die Termination Drive Strength)… It means resistances of each pins of CS# (Chip Select), and ODT (On-Die Termination).
  • CkeDrvStren (Clock Enable Drive Strength)… It means a resistance of CKE (Clock Enable) pin.
  • ClkDrvStren (Clock Drive Strength)… MEMCLK(Memory Clock)ピンの抵抗を意味します.
  • AddrCmdDrvStren (Address/Command Drive Strength)…Address,RAS#(Row Address Strobe),CAS#(Column Address Strobe),WE#(Write Enable),Bank,Parityの各ピンの抵抗を意味します.
  • CsOdtDrvStren… (Chip Select/On-Die Termination Drive Strength)… CS#(Chip Select)及びODT(On-Die Termination)ピンの抵抗を意味します.
  • CkeDrvStren (Clock Enable Drive Strength)… CKE(Clock Enable)ピンの抵抗を意味します.

STEP3. Set Values of Termination Resistance (1): Set Values of Rtt

Rtt… It means termination resistance which is applied each dies of DRAM individually, and it depends on the number of ranks of DRAM. Enter the values calculated by the DRAM Calculator.

Rtt… これはDRAMの各ダイに個別に適用される終端抵抗を意味し,DRAMのランクの数に依存します.DRAM Calculatorで計算された値を入力します.

  • Rtt_NOM (Nominal On-Die Termination Impedance) & Rtt_PARK (Park On-Die Termination Impedance)…They contribute to prevent signal degradation about dies which is not executing write commands.
  • Rtt_WR (Write On-Die Termination Impedance)… It contribute to prevent signal degradation about dies which is executing writing commands.
  • Rtt_NOM (Nominal On-Die Termination Impedance) & Rtt_PARK (Park On-Die Termination Impedance)… これらは書き込みコマンドを実行していないダイについての信号の乱れの防止に貢献します.
  • Rtt_WR (Write On-Die Termination Impedance)… これは書き込みコマンドを実行しているダイについての信号の乱れの防止に貢献します.

STEP4. Set Values of Termination Resistance (2): Find the Optimal ProcODT

ProcODT (Processor On-Die Termination)… It means termination resistance. We will test each values one by one, and safe line for daily-use is under 60 Ohm.

ProcODT (Processor On-Die Termination)… これは終端抵抗を意味します.ProcODTの値を1つずつ検証します.常用では60 Ω以下が安全です.

Boot memtest86 and execute only test8, ‘Random Number Sequence,’ for 4 times.

memtest86を起動し,test8「Random Number Sequence」のみを4回実行します.

Run the test for 1 and half minute and record the number of errors for each ProcODT. The one with the fewest number of errors is the optimal ProcODT (it is recommended to list some ProcODTs with fewer number of errors, because memtest86 don’t provide rigid results). If the number of errors is large (such as over 100), the values set in STEP 1 is inappropriate. In that case, you should adjust some values by increasing values of the DRAM timings or the DRAM voltage.

テストを1分30秒実行し,それぞれのProcODTごとのエラー数を記録します.もっともエラー数の少ないものが最適なProcODTになります(テスト結果に誤差が生じる場合があるため,少ないエラー数のProcODTをいくつかリストアップしておくことをおすすめします).エラー数が多い場合(100を超える等),STEP 1で設定した数値は不適切です.DRAMタイミングを緩めたりDRAM電圧を上げる等してください.

If you have no errors, decrease DRAM voltage temporarily to occurring errors to find the adequate value. In that case, restore the DRAM voltage as soon as the optimal values is found.

エラーが生じない場合,DRAM電圧を一時的に下げてエラーを発生させ,最適値を見つけます.最適値が見つかり次第,DRAM電圧を元に戻してください.


STEP5. Find the Optimal Values of CAD_Bus Drive Strength

Run test8 of memtest86 again and note the error results (“Expected” and “Actual”) as much as possible. Then, compare the values of “Expected” and “Actual” and records the numbers of results where “Actual” is higher(/lower) than “Expected”. Current CAD_BUS Drive Strength is lower than optimal one when the numbers of result of “‘Expected’ < ‘Actual'” (overshoot errors) was more occur than opposite ones. And current CAD_BUS Drive Strength is higher than optimal one when the numbers of case of “‘Expected’ > ‘Actual'” (undershoot errors) was more occur than opposite ones.

再度memtest86のtest8を実行し,生じたエラーの結果(「Expected」,「 Actual」)を可能な限りメモします.そして,「Expected」と「Actual」の数値を比較し,「Actual」が「Expected」より高い結果の数と低い結果の数を記録します.「Actual」が「Expected」より高い結果が多い(オーバーシュートエラーが多い)場合は今のCAD_Bus Drive Strengthが理想値より低く,「Actual」が「Expected」より低い結果が多い(アンダーシュートエラーが多い)場合は今のCAD_Bus Drive Strengthが理想値より高いことを示しています.

When changing the value of CAD_Bus Drive Strength, increase/decrease the value of all items of CAD_Bus Drive Strength at the same time. If the number of overshoot and undershoot errors is close to the same number, that is the appropriate values of CAD Bus Drive Strength.

CAD_Bus Drive Strengthの値を変更する場合,全てのCAD_Bus Drive Strengthの項目の値を同時に増減させてください.オーバーシュートエラーとアンダーシュートエラーが同数近くなったら,それが適切なCAD_Bus Drive Strengthの値です.

If you have no errors, decrease DRAM voltage temporarily to occurring errors to find the adequate value. In that case, restore the DRAM voltage as soon as the optimal values is found.

エラーが生じない場合,DRAM電圧を一時的に下げてエラーを発生させ,最適値を見つけます.最適値が見つかり次第,DRAM電圧を元に戻してください.


STEP6. Durability Test, and Revising Values of Some Items

If you find the optimal values of ProcODT and CAD Bus Drive Strength, run HCI Mem Test on DRAM Calculator (set default RAM size, task scope 400%, and single task mode). And adjust DRAM timings, DRAM voltage, and CPU SoC voltage until no errors are occurred.

ProcODTとCAD_Bus Drive Strengthの値が決まったら,DRAM CalculatorのHCI Mem Test(RAMサイズはデフォルト,task scopeは400%,single taskモードに設定)を実行します.そして,エラーが0になるまでDRAMタイミングとDRAM電圧,CPU SoC電圧を調整します.


Appendix. Tweaking VDDP Voltage

When some errors occur though you set optimal values of above items, increase the value of VDDP voltage may be effective. VDDP voltage means a voltage which is applied to interface (on SoC) with signals from DDR4. Try to increase the value of VDDP voltage in units of 10 mV or 15 mV from 855 mV up to 950 mV.

上記の各項目について最適値を設定しているにもかかわらずエラーが生じる場合,VDDP電圧を上げると効果があるかもしれません.VDDP電圧はDDR4からの信号との(SoC上の)インターフェースにかかる電圧を意味します.VDDP電圧を855 mV から950 mVにかけて,10 mVか15 mV単位で上げてみてください.


Result in the Test for This Article

DRAM frequency… 3800 MHz

1st timings: CL 14, tRCD_R 15, tRCD_W 15, tRP 15, tRAS 32

Command Rate: 1T

2nd timings: tRRD, 47; tRRD_S, 4; tRRD_L, 6; tFAW, 16; tWTR_S, 6; tWTR_L, 8; tWR, 12; tRFC, 282; tCWL, 14; tRTP, 6; tCKE, 1

3rd timings: TrdrdScL, 5; TwrwrScL, 5; TwrwrScl, 5; Trdwr, 8; Twrrd, 2; TwrwrSc, 1; TwrwrSd, 6; TwrwrDd, 6; TrdrdSc, 1; TrdrdSd, 4; TrdrdDd, 4

DRAM voltage: 1.48000 V

VTT DDR: 0.74375 V

CPU SoC voltage: 1.08125 V

Rtt: RTT_NOM, Disable; RTT_WR, off; RTT_PARK, RZQ/5

ProcODT: 28.2 Ohm

CAD_Bus Drive Strength: CAD_Bus ClkDrv, 60.0 Ohm; CAD_Bus AddCmdDrv, 24.0 Ohm; CAD_Bus CsOdtDrv, 24.0 Ohm; CAD_Bus CkeDrv, 30.0 Ohm

VDDP Voltage: 0.94500 V