From b44112b5db9176f77ffc932143dadd8eb2a6b8ef Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Thu, 30 Jul 2020 18:53:23 +0200 Subject: [PATCH] Add calibration documentation --- doc/calibration.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/calibration.md diff --git a/doc/calibration.md b/doc/calibration.md new file mode 100644 index 0000000..f6eaad3 --- /dev/null +++ b/doc/calibration.md @@ -0,0 +1,14 @@ +# Calibrating gram + +In order to accomodate various PCB layouts and RAM chips, gram offers a few calibration settings. Those settings are accessible through CSR registers. + +## Read delay & burst detection + +The DQSBUFM primitive of the ECP5 provides a read delay adjustement. This sets the delay between the moment DQS change its state and DQ datas are sampled. Each DQS group has its own adjustment: + + * `rdly_p0` (PHY): read delay for DQS group 0 + * `rdly_p1` (PHY): read delay for DQS group 1 + +A burst detection mecanism is required to determine the proper values of the read delay. This feature is available in the DQSBUFM primitive, and exposed through the `burstdet` CSR. Each bit of the burstdet CSR corresponds to a DQS group burst detection. The signals in this CSR are latched (ie. when a burst is detected, the corresponding bit stays at 1). You can reset this CSR by writing any value. + +Read delay values can be automatically computed by the `gram_auto_calibration()` function in [libgram](../libgram/). They are stored in the `gramProfile` structure. -- 2.30.2