User Tools

Site Tools


ds:projects:cryring:bpm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ds:projects:cryring:bpm [2020/09/24 16:09]
rgeissler
ds:projects:cryring:bpm [2023/02/09 12:01] (current)
rgeissler
Line 1: Line 1:
 ====== Cryring BPM Gateware Documentation ====== ====== Cryring BPM Gateware Documentation ======
  
-This documentation was automatically generated from Latex. +This documentation was automatically generated from the Markdown file ''%%README.md%%'' in the Git repository https://git.gsi.de/BEA_HDL/Cryring_BPM_Gateware\\ 
-Any changes should be applied to the Latex sources in the Git repository https://git.gsi.de/BEA_HDL/Cryring_BPM_Gateware\\ +Any changes should be applied to the Markdown file, which can be converted to DokuWiki format using the script ''%%FPGA_Common/doc/scripts/create_dokuwiki.py%%''.
-The Latex sources can be converted to the DokuWiki format using the script ''%%doc/scripts/create_dokuwiki.py%%'' (see [[#1053_dokuwiki|chapter 10.5.3]]).+
  
-The documentation is also available as a PDF: {{:ds:projects:cryring:bpm:gateware:documentation:Cryring_BPM_Gateware_Documentation.pdf|Cryring_BPM_Gateware_Documentation.pdf}}+The documentation is also available as a PDF: {{:ds:projects:cryring:bpm:gateware:Cryring_BPM_Gateware_Documentation.pdf|Cryring_BPM_Gateware_Documentation.pdf}} 
 + 
 +An up to date PDF version can be downloaded from the CI/CD section: https://git.gsi.de/BEA_HDL/Cryring_BPM_Gateware/-/pipelines. 
 + 
 +Documentation that is common to multiple FPGA based projects can be found here: [[:ds:projects:fpga:common|FPGA Common Documentation]]. 
 +It is also available as a PDF: {{:ds:projects:fpga:common:FPGA_Common_Documentation.pdf|FPGA_Common_Documentation.pdf}}
  
 ===== Resources ===== ===== Resources =====
  
-All of the code of this project, the helper scripts and also the source of this documentation are under version control in a Git repository whose upstream is: https://git.gsi.de/BEA_HDL/Cryring_BPM_Gateware. The relevant branch is //master//.+The code of this project and also the source of this documentation are under version control in a Git repository whose upstream is:\\ 
 +https://git.gsi.de/BEA_HDL/Cryring_BPM_Gateware\\ 
 +The relevant branch is //master//. 
 + 
 +Additional datasheets and papers are included as a Git submodule of the main Git repository. The upstream of the submodule is:\\ 
 +https://git.gsi.de/BEA_HDL/datasheets\\ 
 +The relevant branch is //master//.
  
-Additional datasheets and papers are included as a Git submodule of the main Git repository. The upstream of the submodule is: https://git.gsi.de/BEA_HDL/datasheets and the relevant branch is //master//.+Common code is included as a Git submodule of the main Git repository. The upstream of the submodule is:\\ 
 +https://git.gsi.de/BEA_HDL/FPGA_Common\\ 
 +The relevant branch is //master//.
  
-Installation scripts to set up a Gitlab runner for continuous integration including all necessary software to build the gateware can be found in a Git repository whose upstream is: https://git.gsi.de/BEA_HDL/Gitlab_Runner_Setup_Centos_7The relevant branch is //master//.+Installation scripts to set up a Gitlab runner for continuous integration including all necessary software to build the gateware can be found in a Git repository whose upstream is:\\ 
 +https://git.gsi.de/BEA_HDL/Gitlab_Runner_Setup_Centos_7\\ 
 +The relevant branch is //master//.
  
-====== 1 Introduction ======+===== 1 Introduction =====
  
 This document describes the gateware (= FPGA firmware) implementation of the Beam Position Monitor (BPM) for the Cryring accelerator at GSI. The term Trajectory Measurement System (TMS) is also common for this system and is used as a synonym for BPM. The BPM measures the horizontal and vertical beam positions at nine places of the accelerator ring, resulting in 18 location results. This document describes the gateware (= FPGA firmware) implementation of the Beam Position Monitor (BPM) for the Cryring accelerator at GSI. The term Trajectory Measurement System (TMS) is also common for this system and is used as a synonym for BPM. The BPM measures the horizontal and vertical beam positions at nine places of the accelerator ring, resulting in 18 location results.
  
-There had been a previous implementation by Piotr Miedzik, but since no documentation could be found besides a conference paper [[#15_references|[2]]], it was decided to reimplement the gateware.+There had been a previous implementation by Piotr Miedzik, but since no documentation could be found besides a conference paper [[#10_references|[2]]], it was decided to reimplement the gateware.
  
-===== 1.1 Measurement principle =====+==== 1.1 Measurement principle ====
  
 At each of the 18 measurement spots two capacitor plates are used to detect the electrostatic induction of the passing by charged particle bunches. At each of the 18 measurement spots two capacitor plates are used to detect the electrostatic induction of the passing by charged particle bunches.
  
-{{:ds:projects:cryring:bpm:gateware:documentation:BPM_mechanical_drawing.jpg| Mechanical drawing of a single BPM. The two segments of the slotted tube are the capacitor plates. The box on the top is the amplifier. Image origin: [[#15_references|[3]]]}}+{{:ds:projects:cryring:bpm:gateware:BPM_mechanical_drawing.jpg}}
  
-**Figure 1.1:** Mechanical drawing of a single BPM. The two segments of the slotted tube are the capacitor plates. The box on the top is the amplifier. Image origin: [[#15_references|[3]]]+**Figure 1.1:** Mechanical drawing of a single BPM. The two segments of the slotted tube are the capacitor plates. The box on the top is the amplifier. Image origin: [[#10_references|[3]]]
  
 The 36 voltages of the capacitor plates are amplified and led via coaxial cables to a single evaluation point where the analog to digital conversion and the digital processing takes place. The 36 voltages of the capacitor plates are amplified and led via coaxial cables to a single evaluation point where the analog to digital conversion and the digital processing takes place.
  
-{{:ds:projects:cryring:bpm:gateware:documentation:Cryring_BPM_System_overview.png| Cryring BPM system overview. This document only describes the implementation of the block labeled //125 MSa/s ADC DAQ System (36 ch.)//, excluding the software part. Image origin: [[#15_references|[3]]]}}+{{:ds:projects:cryring:bpm:gateware:Cryring_BPM_System_overview.png}}
  
-**Figure 1.2:** Cryring BPM system overview. This document only describes the implementation of the block labeled //125 MSa/s ADC DAQ System (36 ch.)//, excluding the software part. Image origin: [[#15_references|[3]]]+**Figure 1.2:** Cryring BPM system overview. This document only describes the implementation of the block labeled //125 MSa/s ADC DAQ System (36 ch.)//, excluding the software part. Image origin: [[#10_references|[3]]]
  
-The positions of the particle beam are calculated respectively from the voltage difference of two related capacitor plates using the algorithm described in [[#2_bpm_algorithm|chapter 2]].+The positions of the particle beam are calculated respectively from the voltage difference of two related capacitor plates using the algorithm described in chapter [[#2_bpm_algorithm|2]].
  
-===== 1.2 Processing hardware =====+{{:ds:projects:cryring:bpm:gateware:filter_schematic.png}}
  
-Each of the 36 voltages coming from the amplifiers at the capacitor plates is sampled by a Renesas ISLA216P ADC at a sampling rate of 125 MHz with a resolution of 16 bitsRespectively four of the ADCs are placed on a single FMC board. Respectively two (ore only one for the last one) of the FMC boards are mounted on an AFC carrier board which is equipped with a Xilinx Artix XC7A200T FPGA for data processing [[#15_references|[4]]].+**Figure 1.3:** Schematic of the digital input filtersImage origin: Andreas Reiter
  
-{{:ds:projects:cryring:bpm:gateware:documentation:AFC_board.jpg| An AFC carrier board with two mounted ADC FMC boards. The FPGA is located under the blue heat spreader.}}+The moving average filter is intended to reduce the noise when higher frequencies are not of interest.
  
-**Figure 1.3:** An AFC carrier board with two mounted ADC FMC boards. The FPGA is located under the blue heat spreader.+The Chebyshev filter is intended to suppress a 70 kHz noise on certain BPMs, which couples in from the supply voltage of the ion getter pumps.
  
-The FPGA is a mid-range device providing the following resources [[#15_references|[5]]]:+{{:ds:projects:cryring:bpm:gateware:chebyshev_frequency_response.png}} 
 + 
 +**Figure 1.4:** Frequency response of the Chebyshev filter 
 + 
 +==== 1.2 Processing hardware ==== 
 + 
 +Each of the 36 voltages coming from the amplifiers at the capacitor plates is sampled by a Renesas ISLA216P ADC at a sampling rate of 125 MHz with a resolution of 16 bits. Respectively four of the ADCs are placed on a single FMC board. Respectively two (ore only one for the last one) of the FMC boards are mounted on an AFC carrier board which is equipped with a Xilinx Artix XC7A200T FPGA for data processing [[#10_references|[4]]]. 
 + 
 +{{:ds:projects:cryring:bpm:gateware:AFC_board.jpg}} 
 + 
 +**Figure 1.5:** An AFC carrier board with two mounted ADC FMC boards. The FPGA is located under the blue heat spreader. 
 + 
 +The FPGA is a mid-range device providing the following resources [[#10_references|[5]]]:
  
   * Logic cells: 215,360   * Logic cells: 215,360
Line 51: Line 77:
   * Multipliers/Adders: 740   * Multipliers/Adders: 740
  
-The whole system uses five AFC carrier boards which are mounted in a MicroTCA crate together with a timing receiver and a CPU unit for post processing. Each of the five FPGAs is responsible for the processing of up to eight ADC data streams. The communication between the CPU unit and the FPGAs takes place via PCI Express over the so called backplane of the MicroTCA crate.+The whole system uses five AFC carrier boards which are mounted in a MicroTCA crate together with a timing receiver and a FEC for post processing. Each of the five FPGAs is responsible for the processing of up to eight ADC data streams. The communication between the FEC and the FPGAs takes place via PCI Express over the so called backplane of the MicroTCA crate.
  
-{{:ds:projects:cryring:bpm:gateware:documentation:MicroTCA_crate.jpg| MicroTCA crate with from left to right: power supply, MCH, CPU unit, timing receiver, 5 AFC boards with 9 mounted FMC ADC boards, second MCH}}+{{:ds:projects:cryring:bpm:gateware:MicroTCA_crate.jpg}}
  
-**Figure 1.4:** MicroTCA crate with from left to right: power supply, MCH, CPU unit, timing receiver, 5 AFC boards with 9 mounted FMC ADC boards, second MCH+**Figure 1.6:** MicroTCA crate with from left to right: power supply, MCH, FEC, timing receiver, 5 AFC boards with 9 mounted FMC ADC boards, second MCH
  
 This document describes the gatewares of the FPGAs on the five AFC carrier boards. The gatewares are identical independent of the number of mounted FMC boards. This document describes the gatewares of the FPGAs on the five AFC carrier boards. The gatewares are identical independent of the number of mounted FMC boards.
  
-====== 2 BPM algorithm ======+===== 2 BPM algorithm =====
  
 The beam position is calculated from the measurement of the voltages of two corresponding plates: The beam position is calculated from the measurement of the voltages of two corresponding plates:
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_6aa1d98f.png?nolink&0x25}}+{{:ds:projects:cryring:bpm:gateware:/equation_6aa1d98f.png?nolink&0x25}}
  
 with with
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_bda96d72.png?nolink&0x21}}+{{:ds:projects:cryring:bpm:gateware:/equation_bda96d72.png?nolink&0x21}}
  
 and and
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_590b21ff.png?nolink&0x21}}+{{:ds:projects:cryring:bpm:gateware:/equation_590b21ff.png?nolink&0x21}}
  
-where {{:ds:projects:cryring:bpm:gateware:documentation:/math_397916aa.png?nolink&0x13}} is a proportionality factor influenced by the dimension of the measurement system, {{:ds:projects:cryring:bpm:gateware:documentation:/math_86f7e437.png?nolink&0x13}} some possible voltage offset and {{:ds:projects:cryring:bpm:gateware:documentation:/math_11f6ad8e.png?nolink&0x13}} the beam position.+where {{:ds:projects:cryring:bpm:gateware:/math_397916aa.png?nolink&0x13}} is a proportionality factor influenced by the dimension of the measurement system, {{:ds:projects:cryring:bpm:gateware:/math_86f7e437.png?nolink&0x13}} some possible voltage offset and {{:ds:projects:cryring:bpm:gateware:/math_11f6ad8e.png?nolink&0x13}} the beam position.
  
-===== 2.1 Capacitance correction =====+==== 2.1 Capacitance correction ====
  
 The capacitance of the two corresponding capacitor plates can differ from their nominal value so that one of the voltages has to be corrected by multiplying a correction factor: The capacitance of the two corresponding capacitor plates can differ from their nominal value so that one of the voltages has to be corrected by multiplying a correction factor:
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_936443a7.png?nolink&0x24}}+{{:ds:projects:cryring:bpm:gateware:/equation_936443a7.png?nolink&0x24}}
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_96c08d2e.png?nolink&0x24}}+{{:ds:projects:cryring:bpm:gateware:/equation_96c08d2e.png?nolink&0x24}}
  
-The default value of {{:ds:projects:cryring:bpm:gateware:documentation:/math_771c3ab8.png?nolink&0x16}} in the gateware is 1. It is configurable by the software via register accesses.+The default value of {{:ds:projects:cryring:bpm:gateware:/math_771c3ab8.png?nolink&0x16}} in the gateware is 1. It is configurable by the software via register accesses.
  
-===== 2.2 Least squares algorithm =====+==== 2.2 Least squares algorithm ====
  
-A linear least squares approach is used to reduce measurement errors. The choice of the algorithm is described in [[#15_references|[1]]]. The optimal approach would be an orthogonal least squares algorithm. Since the relative error of the difference signal {{:ds:projects:cryring:bpm:gateware:documentation:/math_3a6a1655.png?nolink&0x18}} dominates that of the sum signal {{:ds:projects:cryring:bpm:gateware:documentation:/math_69c15416.png?nolink&0x13}}, it can be simplified to a vertical least squares algorithm:+A linear least squares approach is used to reduce measurement errors. The choice of the algorithm is described in [[#10_references|[1]]]. The optimal approach would be an orthogonal least squares algorithm. Since the relative error of the difference signal {{:ds:projects:cryring:bpm:gateware:/math_3a6a1655.png?nolink&0x18}} dominates that of the sum signal {{:ds:projects:cryring:bpm:gateware:/math_69c15416.png?nolink&0x13}}, it can be simplified to a vertical least squares algorithm:
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_124da6e9.png?nolink&0x28}}+{{:ds:projects:cryring:bpm:gateware:/equation_124da6e9.png?nolink&0x28}}
  
 Minimizing Minimizing
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_c37704a1.png?nolink&0x25}}+{{:ds:projects:cryring:bpm:gateware:/equation_c37704a1.png?nolink&0x25}}
  
 via partial differentiation via partial differentiation
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_ef6bcead.png?nolink&0x29}}+{{:ds:projects:cryring:bpm:gateware:/equation_ef6bcead.png?nolink&0x29}}
  
 and and
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_21c099c8.png?nolink&0x29}}+{{:ds:projects:cryring:bpm:gateware:/equation_21c099c8.png?nolink&0x29}}
  
 leads to leads to
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_3e26db20.png?nolink&0x50}}+{{:ds:projects:cryring:bpm:gateware:/equation_3e26db20.png?nolink&0x50}}
  
-**Equation 2.1:** BPM algorithm 
  
-===== 2.3 Averaging =====+**Equation 2.10:** BPM algorithm
  
-For further reducing the data rate and reducing the measurement noise, the result of the least squares algorithm is averaged over an adjustable number of samples {{:ds:projects:cryring:bpm:gateware:documentation:/math_b51a6073.png?nolink&0x18}}This is implemented via a simple block averaging:+=== 2.2.1 Variance ===
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_45acdf6b.png?nolink&0x31}}+The variance of the least squares algorithm result is calculated as follows:
  
-===== 2.4 Control signals =====+{{:ds:projects:cryring:bpm:gateware:/equation_9a14a8ab.png?nolink&0x50}}
  
-==== 2.4.1 Gate ====+=== 2.2.2 Intensity ===
  
-There is an input signal coming from a timing receiver that gates the calculation of the least squares algorithm. A calculation will start with the low to high transition of the gate signal and will be repeated continuously until a high to low transition is detected, after which the current calculation will still be completed.+The beam intensity is calculated as follows:
  
-==== 2.4.2 RF pulse ====+{{:ds:projects:cryring:bpm:gateware:/equation_f9bb7b82.png?nolink&0x39}} 
 + 
 +==== 2.3 Averaging ==== 
 + 
 +For further reducing the data rate and reducing the measurement noise, the result of the least squares algorithm is averaged over an adjustable number of samples {{:ds:projects:cryring:bpm:gateware:/math_b51a6073.png?nolink&0x18}}. This is implemented via a simple block averaging: 
 + 
 +{{:ds:projects:cryring:bpm:gateware:/equation_45acdf6b.png?nolink&0x31}} 
 + 
 +=== 2.3.1 Variance === 
 + 
 +The variance of the averaging result is calculated by averaging the variances and dividing by the averaging length: 
 + 
 +{{:ds:projects:cryring:bpm:gateware:/equation_111a6ae5.png?nolink&0x31}} 
 + 
 +=== 2.3.2 Intensity === 
 + 
 +The average intensity is calculated as follows: 
 + 
 +{{:ds:projects:cryring:bpm:gateware:/equation_bc5bf938.png?nolink&0x31}} 
 + 
 +==== 2.4 Control signals ==== 
 + 
 +=== 2.4.1 Gate === 
 + 
 +There is an input signal coming from a timing receiver that gates the calculation of the least squares algorithm. By default, the gateware is configured to use the first MLVDS line as an input for the gate signal. A calculation will start with the low to high transition of the gate signal and will be repeated continuously until a high to low transition is detected, after which the current calculation will still be completed. 
 + 
 +=== 2.4.2 RF pulse ===
  
 The RF pulse signal is intended to synchronize the calculation of the least squares algorithm with the frequency of the particle bunches. A possible previous calculation of the least squares algorithm will be finished and a new calculation will be started whenever a RF pulse is detected. The RF pulse signal is intended to synchronize the calculation of the least squares algorithm with the frequency of the particle bunches. A possible previous calculation of the least squares algorithm will be finished and a new calculation will be started whenever a RF pulse is detected.
  
-===== 2.5 Parameters =====+==== 2.5 Parameters ====
  
-==== 2.5.1 Least squares algorithm calculation length ====+=== 2.5.1 Least squares algorithm calculation length ===
  
 This parameter defines the number of ADC samples that will be taken into account by the least squares algorithm if no RF pulses are present. The detection of a RF pulse will override this parameter. The overriding will only work as expected if the calculation length is set to a value that is longer than the period of the RF pulses. This parameter defines the number of ADC samples that will be taken into account by the least squares algorithm if no RF pulses are present. The detection of a RF pulse will override this parameter. The overriding will only work as expected if the calculation length is set to a value that is longer than the period of the RF pulses.
Line 133: Line 184:
 The available range of values for the calculation length is 3 to 65536. The available range of values for the calculation length is 3 to 65536.
  
-==== 2.5.2 Averaging length ====+=== 2.5.2 Averaging length ===
  
-This parameter defines the number of Least squares algorithm results that will be taken into account by the averaging algorithm.+This parameter defines the number of least squares algorithm results that will be taken into account by the averaging algorithm.
  
 The available range of values for the averaging length is 1 to 1048576. The available range of values for the averaging length is 1 to 1048576.
  
-====== 3 Peripheral devices ======+===== 3 Common FPGA based projects documentation ===== 
 + 
 +This project incorporates the code from the //FPGA_Common// Git repository which is used in multiple projects. The documentation of the common features can be found here: 
 + 
 +==== 3.1 Common monitoring and control features ==== 
 + 
 +Documentation about the register bank, the architecture information storage and the observer can be found here:\\ 
 +https://git.gsi.de/BEA_HDL/FPGA_Common#2-common-monitoring-and-control-features 
 + 
 +==== 3.2 FPGA Observer ==== 
 + 
 +There is a expert GUI that can be used together with multiple projects:\\ 
 +https://git.gsi.de/BEA_HDL/FPGA_Common#3-fpga-observer 
 + 
 +==== 3.3 Build flow and simulation ==== 
 + 
 +You can find instructions on how to build and simulate the gateware here:\\ 
 +https://git.gsi.de/BEA_HDL/FPGA_Common#4-build-flow-and-simulation 
 + 
 +==== 3.4 Helper scripts ==== 
 + 
 +You can find usefull scripts here:\\ 
 +https://git.gsi.de/BEA_HDL/FPGA_Common#5-helper-scripts 
 + 
 +==== 3.5 Continuous integration environment ==== 
 + 
 +Information about the continuous integration setup can be found here:\\ 
 +https://git.gsi.de/BEA_HDL/FPGA_Common#6-continuous-integration-environment 
 + 
 +==== 3.6 Programming and hardware configuration ==== 
 + 
 +You can find instructions on how to program the FPGA and configure other hardware here: 
 + 
 +https://git.gsi.de/BEA_HDL/FPGA_Common#7-programming-and-hardware-configuration 
 + 
 +===== 4 Peripheral devices =====
  
 There are three different peripheral devices on each of the FMC ADC boards that have to be configured by the gateware. Since they have no persistent storage they have to configured after every power cycle: There are three different peripheral devices on each of the FMC ADC boards that have to be configured by the gateware. Since they have no persistent storage they have to configured after every power cycle:
Line 147: Line 233:
   * ISLA216P ADC   * ISLA216P ADC
  
-===== 3.1 Si571 programmable VCXO =====+==== 4.1 Si571 programmable VCXO ====
  
 The Si571 programmable VCXO is connected via I2C using 0x49 as device address. Additionally, there is an OE (output enable) pin, which has to be driven high or left unconnected since it provides an internal pullup. The device supports a maximum I2C bus speed of 400 kbit/s. The Si571 programmable VCXO is connected via I2C using 0x49 as device address. Additionally, there is an OE (output enable) pin, which has to be driven high or left unconnected since it provides an internal pullup. The device supports a maximum I2C bus speed of 400 kbit/s.
Line 157: Line 243:
 D09JW702+// D09JW702+//
  
-The part properties can be decoded by providing the part number 571AJC000337 on a SiLabs web page [[#15_references|[6]]]:+The part properties can be decoded by providing the part number 571AJC000337 on a SiLabs web page [[#10_references|[6]]]:
  
 Product: Si571\\ Product: Si571\\
Line 172: Line 258:
 Operating Temp Range (C): -40 to +85 Operating Temp Range (C): -40 to +85
  
-A datasheet can be found on the SiLabs website [[#15_references|[7]]].+A datasheet can be found on the SiLabs website [[#10_references|[7]]].
  
-==== 3.1.1 Programming the frequency ====+=== 4.1.1 Programming the frequency ===
  
 There are three adjustable parameters that define the output frequency: There are three adjustable parameters that define the output frequency:
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_27f33813.png?nolink&0x30}}+{{:ds:projects:cryring:bpm:gateware:/equation_27f33813.png?nolink&0x30}}
  
 where where
  
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_0f4907ea.png?nolink&0x22}} is the fixed internal quartz frequency of 114.285 MHz +/- 2000 ppm. +  * {{:ds:projects:cryring:bpm:gateware:/math_0f4907ea.png?nolink&0x22}} is the fixed internal quartz frequency of 114.285 MHz +/- 2000 ppm. 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_b81f82c3.png?nolink&0x22}} has to be in the range {{:ds:projects:cryring:bpm:gateware:documentation:/math_5163883c.png?nolink&0x25}}. +  * {{:ds:projects:cryring:bpm:gateware:/math_b81f82c3.png?nolink&0x22}} has to be in the range {{:ds:projects:cryring:bpm:gateware:/math_5163883c.png?nolink&0x25}}. 
-  * allowed values for {{:ds:projects:cryring:bpm:gateware:documentation:/math_31997e82.png?nolink&0x18}} are 4, 5, 6, 7, 9, 11 +  * allowed values for {{:ds:projects:cryring:bpm:gateware:/math_31997e82.png?nolink&0x18}} are 4, 5, 6, 7, 9, 11 
-  * allowed values for {{:ds:projects:cryring:bpm:gateware:documentation:/math_0604b491.png?nolink&0x18}} are 1 and all even numbers in {{:ds:projects:cryring:bpm:gateware:documentation:/math_35727f6a.png?nolink&0x25}}+  * allowed values for {{:ds:projects:cryring:bpm:gateware:/math_0604b491.png?nolink&0x18}} are 1 and all even numbers in {{:ds:projects:cryring:bpm:gateware:/math_35727f6a.png?nolink&0x25}}
  
-The three parameters should be chosen in a way that {{:ds:projects:cryring:bpm:gateware:documentation:/math_ac2f27fe.png?nolink&0x22}} is minimal to reduce power consumption. If there should still be multiple possibilities for the choice of {{:ds:projects:cryring:bpm:gateware:documentation:/math_f246e0f3.png?nolink&0x18}}, one should choose {{:ds:projects:cryring:bpm:gateware:documentation:/math_31997e82.png?nolink&0x18}} as maximal.+The three parameters should be chosen in a way that {{:ds:projects:cryring:bpm:gateware:/math_ac2f27fe.png?nolink&0x22}} is minimal to reduce power consumption. If there should still be multiple possibilities for the choice of {{:ds:projects:cryring:bpm:gateware:/math_f246e0f3.png?nolink&0x18}}, one should choose {{:ds:projects:cryring:bpm:gateware:/math_31997e82.png?nolink&0x18}} as maximal.
  
 For a desired output frequency of 125 MHz the optimum values are: For a desired output frequency of 125 MHz the optimum values are:
  
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_31997e82.png?nolink&0x18}} = 5 +  * {{:ds:projects:cryring:bpm:gateware:/math_31997e82.png?nolink&0x18}} = 5 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_0604b491.png?nolink&0x18}} = 8 +  * {{:ds:projects:cryring:bpm:gateware:/math_0604b491.png?nolink&0x18}} = 8 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_ac2f27fe.png?nolink&0x22}} = 43.750273439+  * {{:ds:projects:cryring:bpm:gateware:/math_ac2f27fe.png?nolink&0x22}} = 43.750273439
  
-Since the uncorrected {{:ds:projects:cryring:bpm:gateware:documentation:/math_0f4907ea.png?nolink&0x22}} frequency has an inaccuracy of 2000 ppm, one should read the initial {{:ds:projects:cryring:bpm:gateware:documentation:/math_ac2f27fe.png?nolink&0x22}} value first and calculate+Since the uncorrected {{:ds:projects:cryring:bpm:gateware:/math_0f4907ea.png?nolink&0x22}} frequency has an inaccuracy of 2000 ppm, one should read the initial {{:ds:projects:cryring:bpm:gateware:/math_ac2f27fe.png?nolink&0x22}} value first and calculate
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_94132f14.png?nolink&0x34}}+{{:ds:projects:cryring:bpm:gateware:/equation_94132f14.png?nolink&0x34}}
  
-in order to get a more accurate result. {{:ds:projects:cryring:bpm:gateware:documentation:/math_4fb27849.png?nolink&0x22}} is factory calibrated to compensate the actual frequency offset of {{:ds:projects:cryring:bpm:gateware:documentation:/math_0f4907ea.png?nolink&0x22}}.+in order to get a more accurate result. {{:ds:projects:cryring:bpm:gateware:/math_4fb27849.png?nolink&0x22}} is factory calibrated to compensate the actual frequency offset of {{:ds:projects:cryring:bpm:gateware:/math_0f4907ea.png?nolink&0x22}}.
  
 The VCXO has a built-in configuration timeout of 10 ms. All I2C write operations from freezing to unfreezing the digitally controlled oscillator have to complete during this period to become active. The VCXO has a built-in configuration timeout of 10 ms. All I2C write operations from freezing to unfreezing the digitally controlled oscillator have to complete during this period to become active.
  
-==== 3.1.2 Configuration ====+=== 4.1.2 Configuration ===
  
 The following registers are read by the gateware for calculating the frequency correction: The following registers are read by the gateware for calculating the frequency correction:
  
-  **address**^**description**                                  ^+      address^description                                      ^
 |  ''%%0x07%%''|HSDIV - 4 (bits 7 - 5), N1 - 1 MSB (bits 4 - 0)  | |  ''%%0x07%%''|HSDIV - 4 (bits 7 - 5), N1 - 1 MSB (bits 4 - 0)  |
 |  ''%%0x08%%''|RFREQ MSB (bits 5 - 0)                           | |  ''%%0x08%%''|RFREQ MSB (bits 5 - 0)                           |
Line 215: Line 301:
 |  ''%%0x0C%%''|RFREQ LSB                                        | |  ''%%0x0C%%''|RFREQ LSB                                        |
  
-**Table 3.1:** Si571 registers read by the gateware+ 
 +**Table 4.1:** Si571 registers read by the gateware
  
 The value of register 0x07 is only used to determine if the frequency has been programmed before, e.g. after a reloading of the bitstream of the FPGA without a power cycle of the FMC ADC board. The initial value of HSDIV is 4 and it is programmed to 5. Applying the frequency correction again would lead to a wrong result, since the RFREQ registers do not contain the factory defaults any more. The value of register 0x07 is only used to determine if the frequency has been programmed before, e.g. after a reloading of the bitstream of the FPGA without a power cycle of the FMC ADC board. The initial value of HSDIV is 4 and it is programmed to 5. Applying the frequency correction again would lead to a wrong result, since the RFREQ registers do not contain the factory defaults any more.
Line 221: Line 308:
 The following registers are programmed by the gateware after the calculation of the frequency correction: The following registers are programmed by the gateware after the calculation of the frequency correction:
  
-  **address**                          **value**^**description**                                   ^+      address^                               value^description                                       ^
 |  ''%%0x89%%''                       ''%%0x10%%''|freeze digitally controlled oscillator (bit 4)    | |  ''%%0x89%%''                       ''%%0x10%%''|freeze digitally controlled oscillator (bit 4)    |
 |  ''%%0x07%%''                       ''%%0x21%%''|HSDIV - 4 (bits 7 - 5), N1 - 1 MSB (bits 4 - 0)   | |  ''%%0x07%%''                       ''%%0x21%%''|HSDIV - 4 (bits 7 - 5), N1 - 1 MSB (bits 4 - 0)   |
Line 232: Line 319:
 |  ''%%0x87%%''                       ''%%0x40%%''|new frequency applied (bit 6)                     | |  ''%%0x87%%''                       ''%%0x40%%''|new frequency applied (bit 6)                     |
  
-**Table 3.2:** Si571 registers programmed by the gateware 
  
-==== 3.1.3 List of devices ====+**Table 4.2:** Si571 registers programmed by the gateware 
 + 
 +== Example configuration of some devices ==
  
-^  **FMC version**  ^  **serial number**    **initial HSDIV**    ^  **programmed HSDIV**  ^  **measured frequency in Hz**  ^  **mounted on AFC**  ^  **FMC slot**  ^ +^  FMC version  ^  FMC SN      initial RFREQ      ^    programmed RFREQ    ^  meas. freq. (Hz ^ 
-      v2.3              155107        |  ''%%0x02B8EF1D6D%%''  |  ''%%0x02BC3497C2%%''           125024480                   240030        |              +    v2.3       155107  |  ''%%0x02B8EF1D6D%%''  |  ''%%0x02BC3497C2%%''     125024480      
-      v2.3              301236        |  ''%%0x02B8F28CD4%%''  |  ''%%0x02BC380B4A%%''           125024401                   240030        |              +    v2.3       301236  |  ''%%0x02B8F28CD4%%''  |  ''%%0x02BC380B4A%%''     125024401      
-      v1.2                 ?          |  ''%%0x02B8BC2738%%''  |  ''%%0x02BC016450%%''           124974845                   111154        |              +    v1.2             |  ''%%0x02B8BC2738%%''  |  ''%%0x02BC016450%%''     124974845      
-      v1.0                 ?          |  ''%%0x02B94432E0%%''  |  ''%%0x02BC8A1373%%''           124975700                   111154        |              |+    v1.0             |  ''%%0x02B94432E0%%''  |  ''%%0x02BC8A1373%%''     124975700      |
  
-The frequency is measured relatively to the processing clock of the AFC board. The values were measured with the PLL enabled. TODO: measure with disabled PLL.+The frequency was measured relatively to the processing clock of the AFC board.
  
-===== 3.2 AD9510 PLL and clock distribution =====+==== 4.2 AD9510 PLL and clock distribution ====
  
 The Analog Devices AD9510 is connected via SPI. Writing to registers must be completed with a write to the register address 0x5A with the LSBit set in the write value (e.g. 0x01) to take effect. Multiple writes can precede the writing of register 0x5A, so that this needs to be done only once at the end of a write sequence. The maximum SPI clock frequency is 25 MHz. The Analog Devices AD9510 is connected via SPI. Writing to registers must be completed with a write to the register address 0x5A with the LSBit set in the write value (e.g. 0x01) to take effect. Multiple writes can precede the writing of register 0x5A, so that this needs to be done only once at the end of a write sequence. The maximum SPI clock frequency is 25 MHz.
Line 250: Line 338:
 The phase frequency detector of the PLL, which compares the VCXO frequency to the reference frequency, has a maximum input frequency of 100 MHz. Higher frequencies have to be divided by the prescalers R (reference input) and N (VCXO input). A lock signal can be connected to a status pin, that is connected to a FPGA GPIO. The phase frequency detector of the PLL, which compares the VCXO frequency to the reference frequency, has a maximum input frequency of 100 MHz. Higher frequencies have to be divided by the prescalers R (reference input) and N (VCXO input). A lock signal can be connected to a status pin, that is connected to a FPGA GPIO.
  
-A datasheet can be found on the Analog Devices website [[#15_references|[8]]].+A datasheet can be found on the Analog Devices website [[#10_references|[8]]].
  
-==== 3.2.1 Configuration ====+=== 4.2.1 Configuration ===
  
 The gateware configures the AD9510 device to lock the VCXO frequency to a reference clock coming from the FPGA.\\ The gateware configures the AD9510 device to lock the VCXO frequency to a reference clock coming from the FPGA.\\
 The following registers are programmed by the gateware: The following registers are programmed by the gateware:
  
-  **address**    **value**^**description**                                                                        ^+      address^         value^description                                                                            ^
 |  ''%%0x08%%'' ''%%0x33%%''|normal charge pump mode (bits 1 - 0), analog lock detect on STATUS pin (bit 5 - 2)     | |  ''%%0x08%%'' ''%%0x33%%''|normal charge pump mode (bits 1 - 0), analog lock detect on STATUS pin (bit 5 - 2)     |
 |  ''%%0x09%%'' ''%%0x70%%''|charge pump current: 4.8 mA (bits 6 - 4)                                               | |  ''%%0x09%%'' ''%%0x70%%''|charge pump current: 4.8 mA (bits 6 - 4)                                               |
 |  ''%%0x0A%%'' ''%%0x44%%''|PLL power up (bits 1 - 0), VCXO prescaler: 2 (bits 4 - 2), B counter bypass (bit 6)    | |  ''%%0x0A%%'' ''%%0x44%%''|PLL power up (bits 1 - 0), VCXO prescaler: 2 (bits 4 - 2), B counter bypass (bit 6)    |
 |  ''%%0x0B%%'' ''%%0x00%%''|R divider MSB                                                                          | |  ''%%0x0B%%'' ''%%0x00%%''|R divider MSB                                                                          |
-|  ''%%0x0C%%'' ''%%0x01%%''|R divider LSB: divide reference clock input by 2 (value is divider - 1)                +|  ''%%0x0C%%'' ''%%0x02%%''|R divider LSB: divide reference clock input by 2                                       
-|  ''%%0x0D%%'' ''%%0x01%%''|anti backlash pulse width: 2.ns (bit 1 - 0)                                          |+|  ''%%0x0D%%'' ''%%0x02%%''|anti backlash pulse width: 6.ns (bit 1 - 0)                                          |
 |  ''%%0x3C%%'' ''%%0x08%%''|output 0 voltage: 810 mV (bits 3 - 2), output 0 enable (to ADC 0, bits 1 - 0)          | |  ''%%0x3C%%'' ''%%0x08%%''|output 0 voltage: 810 mV (bits 3 - 2), output 0 enable (to ADC 0, bits 1 - 0)          |
 |  ''%%0x3D%%'' ''%%0x08%%''|output 1 voltage: 810 mV (bits 3 - 2), output 1 enable (to ADC 1, bits 1 - 0)          | |  ''%%0x3D%%'' ''%%0x08%%''|output 1 voltage: 810 mV (bits 3 - 2), output 1 enable (to ADC 1, bits 1 - 0)          |
Line 280: Line 368:
 |  ''%%0x5A%%'' ''%%0x01%%''|load the register bank overlay to the actual register bank (bit 0)                     | |  ''%%0x5A%%'' ''%%0x01%%''|load the register bank overlay to the actual register bank (bit 0)                     |
  
-**Table 3.3:** AD9510 registers programmed by the gateware 
  
-===== 3.3 ISLA216P ADC =====+**Table 4.3:** AD9510 registers programmed by the gateware 
 + 
 +==== 4.3 ISLA216P ADC ====
  
 The four ISLA216P ADCs are connected via SPI. The communication to each chip is enabled via an individual chip select line. The MOSI, MISO and CLK lines are shared between the four chips. Parallel configuration by driving all chip selects high at the same time works for the writing registers, but not for reading, since there would be multiple drivers on the MISO line. The maximum SPI clock frequency is given by the ADC sampling frequency divided by 16. At a sample frequency of 125 MHz this corresponds to a SPI clock frequency of 7.8125 MHz. The four ISLA216P ADCs are connected via SPI. The communication to each chip is enabled via an individual chip select line. The MOSI, MISO and CLK lines are shared between the four chips. Parallel configuration by driving all chip selects high at the same time works for the writing registers, but not for reading, since there would be multiple drivers on the MISO line. The maximum SPI clock frequency is given by the ADC sampling frequency divided by 16. At a sample frequency of 125 MHz this corresponds to a SPI clock frequency of 7.8125 MHz.
  
-A datasheet can be found on the Renesas website [[#15_references|[9]]].+A datasheet can be found on the Renesas website [[#10_references|[9]]].
  
 The ADCs provide a configurable gain correction of +/- 4.2% and a configurable offset correction of +/- 138 LSBs. Since the gain correction and the offset correction are implemented digitally in the gateware, most of the configuration registers can be left at their default values. The ADCs provide a configurable gain correction of +/- 4.2% and a configurable offset correction of +/- 138 LSBs. Since the gain correction and the offset correction are implemented digitally in the gateware, most of the configuration registers can be left at their default values.
Line 292: Line 381:
 The SPI interface in the gateware is implemented as a four wire interface, whereas the default setting of the ISLA216P SPI interface is a three wire mode. For being able to configure the ISLA216Ps interactively, the gateware configures the corresponding register to four wire mode at start up. The SPI interface in the gateware is implemented as a four wire interface, whereas the default setting of the ISLA216P SPI interface is a three wire mode. For being able to configure the ISLA216Ps interactively, the gateware configures the corresponding register to four wire mode at start up.
  
-==== 3.3.1 Configuration ====+=== 4.3.1 Configuration ===
  
 The following registers are programmed by the gateware: The following registers are programmed by the gateware:
  
-  **address**    **value**^**description**                                                        ^+      address^         value^description                                                            ^
 |  ''%%0x00%%'' ''%%0x80%%''|enable four wire mode (enable the usage of a dedicated SPI MISO line)  | |  ''%%0x00%%'' ''%%0x80%%''|enable four wire mode (enable the usage of a dedicated SPI MISO line)  |
  
-**Table 3.4:** ISLA216P registers programmed by the gateware 
  
-====== Gateware implementation ======+**Table 4.4:** ISLA216P registers programmed by the gateware
  
-===== 4.1 Clocking =====+===== 5 Gateware implementation ===== 
 + 
 +==== 5.1 Clocking ====
  
 The gateware uses three primary clocks: The gateware uses three primary clocks:
Line 311: Line 401:
   * FMC 1 ADC clock, 125 MHz   * FMC 1 ADC clock, 125 MHz
  
-==== 4.1.1 PCIe reference clock ====+=== 5.1.1 PCIe reference clock ===
  
-The PCIe reference clock comes from an output of an ADN4604 clock switch an the AFC board [[#15_references|[11]]]. The clock switch is controlled via I2C by the MMC firmware to output a 100 MHz clock, which enters the FPGA as a differential input signal on pins H20 and G20. The PCIe reference clock feeds the reference clock input of the PCIe IP core by Xilinx, which contains a PLL producing a 125 MHz output clock for the AXI interface named //clk_125_pcie_axi//.+The PCIe reference clock comes from an output of an ADN4604 clock switch on the AFC board [[#10_references|[11]]]. The clock switch is controlled via I2C by the MMC firmware to output a 100 MHz clock, which enters the FPGA as a differential input signal on pins H20 and G20. The PCIe reference clock feeds the reference clock input of the PCIe IP core by Xilinx, which contains a PLL producing a 125 MHz output clock for the AXI interface named //clk_125_pcie_axi//.
  
 //clk_125_pcie_axi// drives a MMCM to generate: //clk_125_pcie_axi// drives a MMCM to generate:
Line 323: Line 413:
 The SDRAM interface IP core contains a MMCM which generates a 100 MHz clock named //clk_100_sdram// for the AXI interface. The SDRAM interface IP core contains a MMCM which generates a 100 MHz clock named //clk_100_sdram// for the AXI interface.
  
-==== 4.1.2 FMC ADC clocks ====+=== 5.1.2 FMC ADC clocks ===
  
-On each of the two FMC boards there is a Si571 programmable VCXO (see [[#31_si571_programmable_vcxo|chapter 3.1]]) which feeds the four ADCs. The frequency of the VCXO can be coupled to a reference clock coming from the FPGA (see [[#32_ad9510_pll_and_clock_distribution|chapter 3.2]]). The VCXO is programmed to a nominal output frequency of 125 MHz and coupled by the PLL with //clk_125// coming from the FPGA. Bringing the PLL to lock is quite demanding, so that with the current settings a stable lock can not be guaranteed.+On each of the two FMC boards there is a Si571 programmable VCXO (see chapter [[#41_si571_programmable_vcxo|4.1]]) which feeds the four ADCs. The frequency of the VCXO can be coupled to a reference clock coming from the FPGA (see chapter [[#42_ad9510_pll_and_clock_distribution|4.2]]). The VCXO is programmed to a nominal output frequency of 125 MHz and coupled by the PLL with //clk_125// coming from the FPGA. Bringing the PLL to lock is quite demanding, so that with the current settings a stable lock can not be guaranteed.
  
 From each of the four ADCs of an FMC board an individual clock signal is led to the FPGA which is used for the deserialization in the IDDR primitives. For the further processing, only the clock signal from the first ADC of a FMC board is used since the clock frequencies of the four ADCs are identical. From each of the four ADCs of an FMC board an individual clock signal is led to the FPGA which is used for the deserialization in the IDDR primitives. For the further processing, only the clock signal from the first ADC of a FMC board is used since the clock frequencies of the four ADCs are identical.
Line 331: Line 421:
 There are two clock domain crossing FIFOs in the gateware to synchronize the data from the ADCs to the main processing clock //clk_125//. There are two clock domain crossing FIFOs in the gateware to synchronize the data from the ADCs to the main processing clock //clk_125//.
  
-===== 4.2 Resets =====+==== 5.2 Resets ====
  
-==== 4.2.1 PLL not in lock ====+=== 5.2.1 PLL not in lock ===
  
 As long as the PLL in the MMCM producing the main processing clock //clk_125// is not yet in lock, the design is held in reset. After this the lock should be stable until the next power cycle. As long as the PLL in the MMCM producing the main processing clock //clk_125// is not yet in lock, the design is held in reset. After this the lock should be stable until the next power cycle.
  
-==== 4.2.2 Reset button ====+=== 5.2.2 PCIe reset ===
  
-There is a push button labeled //RST// at the center of the AFC front panel which is connected to the microcontroller for the MMC firmware. The firmware should forward a button press to the FPGA pin AG26 as an active low signal to initiate a reset of the gatewareWith the actual OpenMMC firmware this forwarding does not work, so that pressing the //RST// button does not have any effect.+The design will be reset whenever the PCIe connection is re-initializedThis happens e.g. when the FEC is rebooted.
  
-===== 4.3 Data flow diagram =====+=== 5.2.3 Reset button ===
  
-{{:ds:projects:cryring:bpm:gateware:documentation:gateware_block_diagram.png| Simplified data flow diagram}}+There is a push button labeled //RST// at the center of the AFC front panel which is connected to the microcontroller for the MMC firmware. The OpenMMC firmware forwards a button press with a duration of at least two seconds to the FPGA pin AG26 as an active low signal to initiate a reset of the gateware.
  
-**Figure 4.1:** Simplified data flow diagram+Resetting the FPGA leads to the loss of the PCIe connection. To re-enable the connection, the FEC has to be rebooted.
  
-Figure 4.1 shows a simplified data flow diagram. For simplicity, some features are not included in the diagram:+==== 5.3 Data flow diagram ==== 
 + 
 +{{:ds:projects:cryring:bpm:gateware:gateware_block_diagram.png}} 
 + 
 +**Figure 5.1:** Simplified data flow diagram 
 + 
 +Figure [[#figure:Simplified_data_flow_diagram|5.1]] shows a simplified data flow diagram. For simplicity, some features are not included in the diagram:
  
   * processing clocks and clock domain crossings   * processing clocks and clock domain crossings
Line 359: Line 455:
   * data width conversions of AXI and AXI Stream connections   * data width conversions of AXI and AXI Stream connections
  
-===== 4.4 Input delays =====+==== 5.4 Input delays ====
  
-The data inputs from the ADCs require a latency correction to compensate clock and routing delays. This is implemented via individually configurable input delay primites for both the clock and for the data input pins. By increasing the input delay of either a clock or of the associated data inputs, the alignment can be corrected in both directions.+The data inputs from the ADCs require a latency correction to compensate clock and routing delays. This is implemented via individually configurable input delay primitives for both the clock and for the data input pins. By increasing the input delay of either a clock or of the associated data inputs, the alignment can be corrected in both directions.
  
-The input delays provide a 32 tap delay line with a configurable delay between 0 to 31 taps [[#15_references|[10]]]. Each tap corresponds to a delay of:+The input delays provide a 32 tap delay line with a configurable delay between 0 to 31 taps [[#10_references|[10]]]. Each tap corresponds to a delay of:
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/math_2b1453a9.png?nolink&0x33}}+{{:ds:projects:cryring:bpm:gateware:/math_2b1453a9.png?nolink&0x33}}
  
-with {{:ds:projects:cryring:bpm:gateware:documentation:/math_3940aa48.png?nolink&0x24}} being the frequency of the clock connected to the IDELAYCTRL primitive. With the 200 MHz clock connected in this design this corresonds to a tap delay value of 78 s.+with {{:ds:projects:cryring:bpm:gateware:/math_3940aa48.png?nolink&0x24}} being the frequency of the clock connected to the IDELAYCTRL primitive. With the 200 MHz clock connected in this design this corresponds to a tap delay value of 78 s.
  
-==== 4.4.1 Calculation of optimal delay values ====+=== 5.4.1 Calculation of optimal delay values ===
  
 The ADCs offers programmable user patterns that can be sent in place of the ADC samples to check the correct timing of the digital interface. For finding the optimum delay values, the following procedure is applied: The ADCs offers programmable user patterns that can be sent in place of the ADC samples to check the correct timing of the digital interface. For finding the optimum delay values, the following procedure is applied:
Line 377: Line 473:
   * The optimum value is assumed to be the midpoint between these values.   * The optimum value is assumed to be the midpoint between these values.
  
-There is a configuration file ''%%src/software/fpga_observer/config/enable_adc_test_patterns.csv%%'' which programs the ADCs to output reference patterns, which can be used together with the FPGA Observer software (see [[#816_peripherals_configuration_tab|chapter 8.1.6]]). +=== 5.4.2 Chosen delay values ===
- +
-==== 4.4.2 Chosen delay values ====+
  
 For an ADC clock frequency of 125 MHz the optimal delay values are: For an ADC clock frequency of 125 MHz the optimal delay values are:
Line 390: Line 484:
     * ADC data delay value: 0x00     * ADC data delay value: 0x00
  
-These values are programmed to the IDELAY primitives at start up. They can be changed via individual configuration registers (see [[#711_additional_configuration_registers|chapter 7.1.1]]).+These values are programmed to the IDELAY primitives at start up. They can be changed via individual configuration registers (see chapter [[#712_additional_configuration_registers|7.1.2]]).
  
-===== 4.5 Clock domain crossings =====+==== 5.5 Clock domain crossings ====
  
 Even though the FMC clocks are coupled to the main processing clock by the FMC’s PLLs, they can jitter against the main processing clock or even run at a slightly different frequency if the PLLs unlock for any reason. Even though the FMC clocks are coupled to the main processing clock by the FMC’s PLLs, they can jitter against the main processing clock or even run at a slightly different frequency if the PLLs unlock for any reason.
Line 398: Line 492:
 To prevent data corruption, two clock domain crossing FIFOs are used for the incoming ADC data, one for each FMC board. In the case of frequency deviations, there are two cases to differentiate: To prevent data corruption, two clock domain crossing FIFOs are used for the incoming ADC data, one for each FMC board. In the case of frequency deviations, there are two cases to differentiate:
  
-  the FMC clock is running slightly faster than the processing clock:+  the FMC clock is running slightly faster than the processing clock:
     * one sample at a time will be discarded     * one sample at a time will be discarded
     * this happens synchronous for all four ADCs of a FMC board     * this happens synchronous for all four ADCs of a FMC board
-  the FMC clock is running slightly slower than the processing clock:+  the FMC clock is running slightly slower than the processing clock:
     * one sample at a time will be repeated     * one sample at a time will be repeated
     * this happens synchronous for all four ADCs of a FMC board     * this happens synchronous for all four ADCs of a FMC board
  
-Due to the synchronous handling of the four ADCs on a FMC board, the discarding or repetition of samples should not have any measureable effect on the BPM results, since the two inputs to each BPM come from the same FMC board.+Due to the synchronous handling of the four ADCs on a FMC board, the discarding or repetition of samples should not have any measurable effect on the BPM results, since the two inputs to each BPM come from the same FMC board. 
 + 
 +==== 5.6 Gate signal ==== 
 + 
 +The gate signal is fed to the FPGA via one of the eight MLVDS lines on the AMC connector. The selection is made via a configuration register (see chapter [[#622_configuration_registers|6.2.2]]). The register’s default is to route MLVDS line 0 to the gate input of the BPM algorithm. 
 + 
 +==== 5.7 RF signal ==== 
 + 
 +The pulses of the RF signal define the length of the linear regression in the BPM algorithm. The selection is made via a configuration register (see chapter [[#622_configuration_registers|6.2.2]]). As a default, the RF signal is fed to the FPGA via the MMCX connector labeled //TRIG// on the front panel of FMC 1. In this case this signal is valid for both FMCs and the //TRIG// input of FMC 2 is not used. 
 + 
 +==== 5.8 BPM algorithm ====
  
-===== 4.6 BPM algorithm =====+The proportionality factor {{:ds:projects:cryring:bpm:gateware:/math_397916aa.png?nolink&0x13}} in equation 2.10 is set implicitly to 1 so that the result has to interpreted as a relative position in the range {{:ds:projects:cryring:bpm:gateware:/math_b61210c8.png?nolink&0x25}}:
  
-The proportionality factor {{:ds:projects:cryring:bpm:gateware:documentation:/math_397916aa.png?nolink&0x13}} in equation 2.1 is set implicitly to 1 so that the result has to interpreted as a relative position in the range {{:ds:projects:cryring:bpm:gateware:documentation:/math_b61210c8.png?nolink&0x25}}:+{{:ds:projects:cryring:bpm:gateware:/equation_b35b39a0.png?nolink&0x50}}
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_b35b39a0.png?nolink&0x50}} 
  
-**Equation 4.1:** Normalized BPM algorithm+**Equation 5.1:** Normalized BPM algorithm
  
-The capacitance correction (see [[#21_capacitance_correction|chapter 2.1]]) and the linear regression (equation 4.1) are implemented as a pipelined algorithm. The processing clock is equal to the sampling frequency of the ADCs.+The capacitance correction (see chapter [[#21_capacitance_correction|2.1]]) and the linear regression (equation 4.1) are implemented as a pipelined algorithm. The processing clock is equal to the sampling frequency of the ADCs.
  
-==== 4.6.1 Pipeline steps performed every clock cycle ====+=== 5.8.1 Pipeline steps performed every clock cycle ===
  
-The gain correction, the differences and sums of the incoming ADC data pairs {{:ds:projects:cryring:bpm:gateware:documentation:/math_69c15416.png?nolink&0x13}} and {{:ds:projects:cryring:bpm:gateware:documentation:/math_3a6a1655.png?nolink&0x18}} and the four different sums of equation 4.1 are calculated every clock cycle.+The gain correction, the differences and sums of the incoming ADC data pairs {{:ds:projects:cryring:bpm:gateware:/math_69c15416.png?nolink&0x13}} and {{:ds:projects:cryring:bpm:gateware:/math_3a6a1655.png?nolink&0x18}} and the four different sums of equation 4.1 are calculated every clock cycle.
  
-=== Step 0: Capacitance correction ===+== Step 0: Capacitance correction ==
  
   * offset and gain corrected ADC 0 data sample is strobed unchanged. Input: 17 bits signed, output 17 bits signed   * offset and gain corrected ADC 0 data sample is strobed unchanged. Input: 17 bits signed, output 17 bits signed
-  * offset and gain corrected ADC 1 data sample is multiplied with a correction factor coming from a configuration register. Input: 17s bit signed for data, 16 bits unsigned for correction factor, output 17 bits signed+  * offset and gain corrected ADC 1 data sample is multiplied with a correction factor coming from a configuration register. Input: 17 bits signed for data, 16 bits unsigned for correction factor, output 17 bits signed
  
-=== Step 1: Calculation of sum and difference signals ===+== Step 1: Calculation of sum and difference signals ==
  
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_69c15416.png?nolink&0x13}}: sum of data 0 and data 1, inputs: 17 bits signed, output: 18 bits signed +  * {{:ds:projects:cryring:bpm:gateware:/math_69c15416.png?nolink&0x13}}: sum of data 0 and data 1, inputs: 17 bits signed, output: 18 bits signed 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_3a6a1655.png?nolink&0x18}}: difference of data 0 and data 1, inputs: 17 bits signed, output: 18 bits signed+  * {{:ds:projects:cryring:bpm:gateware:/math_3a6a1655.png?nolink&0x18}}: difference of data 0 and data 1, inputs: 17 bits signed, output: 18 bits signed
  
-=== Step 2: Calculation of products, sign extension, summation ===+== Step 2: Calculation of products, sign extension, summation ==
  
-The maximum word length of the adders in the DSP48 blocks of the FPGA is 48 bits. When using these adders, the maximum summation length is limited by the word length of longest term {{:ds:projects:cryring:bpm:gateware:documentation:/math_92d6846a.png?nolink&0x18}} (36) to a value of 12.+The maximum word length of the adders in the DSP48 blocks of the FPGA is 48 bits. When using these adders, the maximum summation length is limited by the word length of longest term {{:ds:projects:cryring:bpm:gateware:/math_92d6846a.png?nolink&0x18}} (36) to a value of 12.
  
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_160e4edd.png?nolink&0x26}}: inputs: 18 bits signed, output: 48 bits signed +  * {{:ds:projects:cryring:bpm:gateware:/math_160e4edd.png?nolink&0x26}}: inputs: 18 bits signed, output: 48 bits signed 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_62936438.png?nolink&0x27}}: input: 18 bits signed, output: 48 bits signed +  * {{:ds:projects:cryring:bpm:gateware:/math_62936438.png?nolink&0x27}}: input: 18 bits signed, output: 48 bits signed 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_b051ae52.png?nolink&0x26}}: input: 18 bits signed, output: 30 bits signed +  * {{:ds:projects:cryring:bpm:gateware:/math_b051ae52.png?nolink&0x26}}: input: 18 bits signed, output: 30 bits signed 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_19017b62.png?nolink&0x26}}: input: 18 bits signed, output: 30 bits signed +  * {{:ds:projects:cryring:bpm:gateware:/math_19017b62.png?nolink&0x26}}: input: 18 bits signed, output: 30 bits signed 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_b51a6073.png?nolink&0x18}}: counter, output: 12 bits unsigned+  * {{:ds:projects:cryring:bpm:gateware:/math_b51a6073.png?nolink&0x18}}: counter, output: 12 bits unsigned
  
-==== 4.6.2 Pipeline steps performed with a reduced data rate ====+=== 5.8.2 Pipeline steps performed with a reduced data rate ===
  
-The following pipeline steps are only performed once for every linear regression period. The length of the linear regression period is defined by the BPM linear regression length register (see [[#621_configuration_registers|chapter 6.2.1]]).+The following pipeline steps are only performed once for every linear regression period. The length of the linear regression period is defined by the BPM linear regression length register (see chapter [[#622_configuration_registers|6.2.2]]).
  
 If a RF signal is present, the length is additionally controlled by the distances of the pulses of this signal. A new linear regression calculation will be started with every rising edge of the RF signal, while the post processing steps for the previous period will be started. If a RF signal is present, the length is additionally controlled by the distances of the pulses of this signal. A new linear regression calculation will be started with every rising edge of the RF signal, while the post processing steps for the previous period will be started.
  
-=== Step 3: Conversion to floating point ===+== Step 3: Conversion to floating point ==
  
 The DSP48 blocks in the FPGA can only handle multiplications up to 18 bits times 25 bits. For this reason, a conversion to a floating point format is performed. The DSP48 blocks in the FPGA can only handle multiplications up to 18 bits times 25 bits. For this reason, a conversion to a floating point format is performed.
Line 453: Line 556:
 The floating point format is: The floating point format is:
  
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_eb46f906.png?nolink&0x17}}: 18 bits signed (integer, not fractional as usual for floating point formats) +  * {{:ds:projects:cryring:bpm:gateware:/math_eb46f906.png?nolink&0x17}}: 18 bits signed (integer, not fractional as usual for floating point formats) 
-  * {{:ds:projects:cryring:bpm:gateware:documentation:/math_69cc8412.png?nolink&0x21}}: 6 bits unsigned+  * {{:ds:projects:cryring:bpm:gateware:/math_69cc8412.png?nolink&0x21}}: 6 bits unsigned
  
-which decodes to: {{:ds:projects:cryring:bpm:gateware:documentation:/math_a963fbfa.png?nolink&0x20}}+which decodes to: {{:ds:projects:cryring:bpm:gateware:/math_a963fbfa.png?nolink&0x20}}
  
-The sums {{:ds:projects:cryring:bpm:gateware:documentation:/math_160e4edd.png?nolink&0x26}}, {{:ds:projects:cryring:bpm:gateware:documentation:/math_62936438.png?nolink&0x27}}, {{:ds:projects:cryring:bpm:gateware:documentation:/math_b051ae52.png?nolink&0x26}} and {{:ds:projects:cryring:bpm:gateware:documentation:/math_19017b62.png?nolink&0x26}} are converted to float.+The sums {{:ds:projects:cryring:bpm:gateware:/math_160e4edd.png?nolink&0x26}}, {{:ds:projects:cryring:bpm:gateware:/math_62936438.png?nolink&0x27}}, {{:ds:projects:cryring:bpm:gateware:/math_b051ae52.png?nolink&0x26}} and {{:ds:projects:cryring:bpm:gateware:/math_19017b62.png?nolink&0x26}} are converted to float.
  
-A conversion is not necessary for {{:ds:projects:cryring:bpm:gateware:documentation:/math_b51a6073.png?nolink&0x18}} since it is only 12 bits wide.+A conversion is not necessary for {{:ds:projects:cryring:bpm:gateware:/math_b51a6073.png?nolink&0x18}} since it is only 12 bits wide.
  
-=== Step 4: Calculation of the products of sums ===+== Step 4: Calculation of the products of sums ==
  
-The products {{:ds:projects:cryring:bpm:gateware:documentation:/math_c07e31f0.png?nolink&0x26}}, {{:ds:projects:cryring:bpm:gateware:documentation:/math_9b22aba4.png?nolink&0x26}}, {{:ds:projects:cryring:bpm:gateware:documentation:/math_f6f5662e.png?nolink&0x27}} and {{:ds:projects:cryring:bpm:gateware:documentation:/math_30e95614.png?nolink&0x27}} are calculated by multiplying the mantissas and by adding the exponents of the floating point representations.+The products {{:ds:projects:cryring:bpm:gateware:/math_c07e31f0.png?nolink&0x26}}, {{:ds:projects:cryring:bpm:gateware:/math_9b22aba4.png?nolink&0x26}}, {{:ds:projects:cryring:bpm:gateware:/math_f6f5662e.png?nolink&0x27}} and {{:ds:projects:cryring:bpm:gateware:/math_30e95614.png?nolink&0x27}} are calculated by multiplying the mantissas and by adding the exponents of the floating point representations.
  
-=== Step 5: Shifting to align for subtraction and sign extensions ===+== Step 5: Shifting to align for subtraction and sign extensions ==
  
 In general the results of step 4 will have different exponents, so that the mantissas have to be shifted to a common exponent before a subtraction can take place. In general the results of step 4 will have different exponents, so that the mantissas have to be shifted to a common exponent before a subtraction can take place.
Line 472: Line 575:
 The mantissa of the float number with the smaller exponent is shifted by the difference of exponents digits to the right and the exponent is set to the larger exponent. Sign extensions by 1 bit take place to prevent over- and underflows by the subtraction. The mantissa of the float number with the smaller exponent is shifted by the difference of exponents digits to the right and the exponent is set to the larger exponent. Sign extensions by 1 bit take place to prevent over- and underflows by the subtraction.
  
-=== Step 6: Calculation of the subtractions in the numerator and the denominator ===+== Step 6: Calculation of the subtractions in the numerator and the denominator ==
  
 Now that the operands have the same exponent, the subtractions can take place by subtracting the mantissas. Now that the operands have the same exponent, the subtractions can take place by subtracting the mantissas.
Line 478: Line 581:
 The exponents of the results stay the same as that of the operands. The exponents of the results stay the same as that of the operands.
  
-The results are: {{:ds:projects:cryring:bpm:gateware:documentation:/math_8eb292c6.png?nolink&0x26}} and {{:ds:projects:cryring:bpm:gateware:documentation:/math_99162b0c.png?nolink&0x27}}+The results are: {{:ds:projects:cryring:bpm:gateware:/math_8eb292c6.png?nolink&0x26}} and {{:ds:projects:cryring:bpm:gateware:/math_99162b0c.png?nolink&0x27}}
  
-=== Step 7: Conversion of the mantissas to floating point ===+== Step 7: Conversion of the mantissas to floating point ==
  
 Due to the multiplication in step 4 and the sign extension in step 5 the mantissas have now a length of 37 bits, which is again too long for the final division. The mantissa is converted to the same floating point format as described in step 4. Due to the multiplication in step 4 and the sign extension in step 5 the mantissas have now a length of 37 bits, which is again too long for the final division. The mantissa is converted to the same floating point format as described in step 4.
Line 486: Line 589:
 The results respectively have a mantissa of 18 bits and two exponents of 6 bits each which have to be united in the next step. The results respectively have a mantissa of 18 bits and two exponents of 6 bits each which have to be united in the next step.
  
-=== Step 8: Start of division and unification of exponents ===+== Step 8: Unification of exponents and start of division ==
  
 Division is a costly operation in FPGAs. In this implementation it is performed by an IP core by Xilinx which is parametrized to 18 bits for both the divisor and the dividend. The result is 33 bits wide, of which 15 bits are fractional. Division is a costly operation in FPGAs. In this implementation it is performed by an IP core by Xilinx which is parametrized to 18 bits for both the divisor and the dividend. The result is 33 bits wide, of which 15 bits are fractional.
Line 494: Line 597:
 The exponents generated in step 7 are united to the existing ones from step 6 by addition. The exponents generated in step 7 are united to the existing ones from step 6 by addition.
  
-=== Step 9: Subtraction of the exponents of dividend and divisor ===+== Step 9 - 32Waiting for the division to complete ==
  
-The divider IP core only handles the mantissas. The exponents of the dividend and the divisor are subtracted.+The results of step 8 are pipelined until the completion of the division.
  
-=== Step 10 - 32Waiting for the division to complete ===+== Step 33Shifting and slicing the division result ==
  
-The results of step are pipelined until the completion of the division.+The division result is shifted to the right by minus the exponent from step 8. After that, the lower 16 bits are sliced to form the result of the linear regression algorithm.
  
-=== Step 33: Shifting and slicing the division result ===+The result has to be interpreted as a relative position in the range {{:ds:projects:cryring:bpm:gateware:/math_7f666a97.png?nolink&0x25}}, multiplied by {{:ds:projects:cryring:bpm:gateware:/math_ffca8a11.png?nolink&0x21}}.
  
-The division result is shifted to the right by minus the exponent from step 9. After that, the lower 16 bits are sliced to form the result of the linear regression algorithm. +Two signals are created for debugging purposes and are connected to the observer (see https://git.gsi.de/BEA_HDL/FPGA_Common#23-observer):
- +
-The result has to be interpreted as a relative position in the range {{:ds:projects:cryring:bpm:gateware:documentation:/math_7f666a97.png?nolink&0x25}}, multiplied by {{:ds:projects:cryring:bpm:gateware:documentation:/math_ffca8a11.png?nolink&0x21}}. +
- +
-Two signals are created for debugging purposes and are connected to the signal observer (see [[#4102_observer|chapter 4.10.2]]):+
  
   * //result out of range// (1 bit): High if the absolute value of the numerator is greater than that of the denominator. This can happen if the phases of the two input signals are not aligned. In this case the result is set to the maximum or minimum value.   * //result out of range// (1 bit): High if the absolute value of the numerator is greater than that of the denominator. This can happen if the phases of the two input signals are not aligned. In this case the result is set to the maximum or minimum value.
   * //division by zero// (1 bit): Comes from the divider IP core and is high if the divisor is zero. This is very unlikely to happen. In this case the result is set to 0.   * //division by zero// (1 bit): Comes from the divider IP core and is high if the divisor is zero. This is very unlikely to happen. In this case the result is set to 0.
  
-=== Limitations ===+== Limitations ==
  
 Allowed values for the linear regression length are: 3, 4, 5, … , 4096 Allowed values for the linear regression length are: 3, 4, 5, … , 4096
Line 521: Line 620:
 The upper limit is caused by the maximum operand length of the adder in the DSP48 primitives in the FPGA. A higher limit would be implementable at the cost of an increased resource usage and two additional clock cycles of processing latency. The upper limit is caused by the maximum operand length of the adder in the DSP48 primitives in the FPGA. A higher limit would be implementable at the cost of an increased resource usage and two additional clock cycles of processing latency.
  
-===== 4.BPM averaging =====+==== 5.BPM averaging ====
  
-The result from the BPM algorithm is sign extended and added up until the desired number of samples is reached. Only powers of two are allowed for the averaging length. Allowing any desired number would require a general division operation at the end of the averaging process, whereas a division by a power of two can be implemented by a simple shift operation. This is why the configuration register ’log2 of BPM averaging length’ contains the dual logarithm of the averaging length (see [[#621_configuration_registers|chapter 6.2.1]]).+The result from the BPM algorithm is sign extended and added up until the desired number of samples is reached. Only powers of two are allowed for the averaging length. Allowing any desired number would require a general division operation at the end of the averaging process, whereas a division by a power of two can be implemented by a simple shift operation. This is why the configuration register ’log2 of BPM averaging length’ contains the dual logarithm of the averaging length (see chapter [[#622_configuration_registers|6.2.2]]).
  
-The result is sliced to the same number of bits as the result from the BPM algorithm. It also has to be interpreted as a relative position in the range {{:ds:projects:cryring:bpm:gateware:documentation:/math_7f666a97.png?nolink&0x25}}, multiplied by {{:ds:projects:cryring:bpm:gateware:documentation:/math_ffca8a11.png?nolink&0x21}}.+The result is sliced to the same number of bits as the result from the BPM algorithm. It also has to be interpreted as a relative position in the range {{:ds:projects:cryring:bpm:gateware:/math_7f666a97.png?nolink&0x25}}, multiplied by {{:ds:projects:cryring:bpm:gateware:/math_ffca8a11.png?nolink&0x21}}.
  
 Available values for the averaging length are 1, 2, 4, … , 1,048,576. Available values for the averaging length are 1, 2, 4, … , 1,048,576.
Line 531: Line 630:
 The upper limit is not caused by any implementation limitation, but was simply chosen because longer averaging lengths were not assumed to be useful. The upper limit is not caused by any implementation limitation, but was simply chosen because longer averaging lengths were not assumed to be useful.
  
-===== 4.AXI infrastructure =====+==== 5.10 AXI infrastructure ====
  
 The memory mapped data transfers inside the FPGA are handled via the AXI protocol using a star topology with a central interconnect. The common data width is 256 bits and the common clock is the main processing clock of 125 MHz. The memory mapped data transfers inside the FPGA are handled via the AXI protocol using a star topology with a central interconnect. The common data width is 256 bits and the common clock is the main processing clock of 125 MHz.
Line 538: Line 637:
  
   * PCIe interface   * PCIe interface
-  * scope 0 / observer+  * scope 0
   * scope 1   * scope 1
   * scope 2   * scope 2
Line 555: Line 654:
 Even though there is no need for the PCIe interface to write to the SDRAM, this access is enabled because otherwise the PCIe driver will crash in case of an erroneous write access to the SDRAM. Even though there is no need for the PCIe interface to write to the SDRAM, this access is enabled because otherwise the PCIe driver will crash in case of an erroneous write access to the SDRAM.
  
-===== 4.AXI Stream infrastructure =====+==== 5.11 AXI Stream infrastructure ====
  
-The scopes / the observer internally use an AXI Stream bus to process the incoming data. The final data stream is converted to the AXI protocol.+The scopes internally use an AXI Stream bus to process the incoming data. The final data stream is converted to the AXI protocol.
  
-===== 4.10 Scopes and observers =====+=== 5.11.1 Scopes ===
  
-==== 4.10.1 Scopes ====+There are three so called scopes for interactively storing calculation resultsFor the storage format of the scope data see chapter [[#61_scope_memory|6.1]].
  
-There are three so called scopes for interactively storing calculation results.+== Scope 0: corrected ADC data ==
  
-=== Scope 0: corrected ADC data ===+Since the frequency of the incoming ADC data samples is identical to the AXI clock, the data samples are parallized twice to allow flow controlled data processing. This also converts the 128 bits wide ADC data stream (8 * 16 bits) to the common AXI data width of 256 bits.
  
-=== Scope 1: BPM results ===+An IP core called //AXI data mover// manages the write access to the SDRAM. The block size of the AXI bus accesses is set to 4 MiBytes to allow a low protocol overhead. A block size of 256 bits (width of a single data word) would slow down the transmission in a way that the necessary data rate to store all incoming ADC data samples would not be reached.
  
-=== Scope 1: BPM averaging results ===+== Scope 1: BPM results ==
  
-==== 4.10.2 Observer ====+The data rate of the BPM results is slow enough so that they do not have to be parallized before the transmission.
  
-The observer uses the same infrastructure as scope 0so that they cannot used at the same time. It additionately implements more complex observing features and configurable two-state trigger.+For the same reason, the block size of the AXI bus accesses can be set to the width of single data word which simplifies the transmission handling.
  
-===== 4.11 Configuration of peripheral devices =====+== Scope 2: BPM averaging results ==
  
-The peripheral devices documented in [[#3_peripheral_devices|chapter 3]] are initially programmed by the gateware. During operationthey can be configured using the corresponding gateware registers (see [[#711_additional_configuration_registers|chapter 7.1.1]]).+The data rate of the BPM averaging results is even slower than that of the BPM resultsso that the same mechanism can be used.
  
-==== 4.11.1 SPI Interface ====+==== 5.12 Configuration of peripheral devices ====
  
-==== 4.11.2 I2C Interface ====+The peripheral devices documented in chapter [[#4_peripheral_devices|4]] are initially programmed by the gatewareDuring operation, they can be configured using the corresponding gateware registers (see chapter [[#712_additional_configuration_registers|7.1.2]]).
  
-===== 4.12 PCIe Interface =====+=== 5.12.1 SPI Interface ===
  
-This gateware uses the Xilinx IP core //DMA/Bridge Subsystem for PCI Express// with the following configration:+There is an individual SPI interface for each of the two FMC boards. It is implemented as a four wire interface and connects to the four ADCs and to the PLL on the FMC ADC boards. The choice of the communication partner is implemented via indivial chip select lines.
  
-  * PCIe speed: GTransfers/s+=== 5.12.2 I2C Interface ===
  
-===== 4.13 SDRAM interface =====+There is an individual I2C interface for each of the two FMC boards. It only connects to the VCXO. The VCXO’s transaction timeout has to be kept in mind when programming it interactively (see chapter [[#41_si571_programmable_vcxo|4.1]].
  
-For the communication with the SDRAM, an IP core by Xilinx is used.+==== 5.13 PCIe Interface ====
  
-====== 5 Build flow and simulation ======+This gateware uses the Xilinx IP core //DMA/Bridge Subsystem for PCI Express// with the following configuration:
  
-The build flow is designed and tested to be run on a Linux operation system. The bitstream generation should also work on a Windows installation, but the depending Bash and Python scripts would have to be adapted for Windows. For example, there is one generated VHDL file ''%%src/vhdl/generated_constant_package.vhd%%'' which is generated by the script ''%%src/scripts/generate_monitoring_and_control.py%%'' using the content of the configuration files in ''%%src/config%%''.+  * PCIe speed: 5 GTransfers/
 +  * AXI clock frequency: 125 MHz 
 +  * reference clock frequency: 100 MHz
  
-===== 5.1 Prerequisites =====+The PCIe reference clock is routed to the FPGA via the MMC firmware and is configured to be driven by the 100 MHz //FCLKA// clock coming from the AMC connector.
  
-An installation of Xilinx Vivado is required. Currently the IP cores are built for version 2019.2 so that this version should be installed.+==== 5.14 SDRAM interface ====
  
-You can set your preferred Vivado version in the script ''%%src/config/project_config.sh%%''.+For the communication with the SDRAM, an IP core by Xilinx is usedThe clock frequency of the SDRAM interface’s AXI bus is 100 MHz, so that an AXI clock converter is used to connect it to the rest of the AXI infrastructure which is clocked at 125 MHz.
  
-===== 5.2 Build flow =====+==== 5.15 Observer ====
  
-==== 5.2.1 Scripted build flow ====+This project incorporates the observer interface from the //FPGA_Common// Git submodule (see https://git.gsi.de/BEA_HDL/FPGA_Common#13-observer).
  
-For a completely automatic script based build flow without using the Vivado GUI proceed as follows:+The following signals are connected to the observer inputs:
  
-  * navigate to the root folder of the repository in a terminal +^      value^input vector(64 bits)                                    ^valid signal 
-  * type ''%%run/run_build_flow.sh%%''+|  ''%%0%%''|corrected ADC data of ADCs 0 - 3                         |1             | 
 +|  ''%%1%%''|corrected ADC data of ADCs 4 - 7                         |1             | 
 +|  ''%%2%%''|BPM 0 and 1 result, additional information               |1             | 
 +|  ''%%3%%''|BPM 2 and 3 result, additional information               |1             | 
 +|  ''%%4%%''|BPM 0 and 1 averaging result, additional information     |1             | 
 +|  ''%%5%%''|BPM 2 and 3 averaging result, additional information     |1             | 
 +|  ''%%6%%''|SPI and I2C signals, MLVDS signals, FMC trigger signals  |1             | 
 + ''%%7%%''|test counter                                             |1             |
  
-A project will be generated in the folder ''%%output/<Vivado version>/build_flow%%''The bitstream (if successful) will be generated in the subfolder ''%%aft_top.runs/impl_1%%''.+The rest of the multiplexer inputs are connected to zero.
  
-==== 5.2.2 Vivado GUI based build flow ====+===== 6 Gateware software interface =====
  
-=== Via Bash script ===+The communication between the gateware and the software takes place via PCIe driver by Xilinx called XDMA. There is only one PCIe Bar in use in the gateware which maps the memory space to different physical memories on the AMC board.
  
-  * navigate to the root folder of the repository in a terminal +The following mapping is applied:
-  * type ''%%run/create_project.sh%%''+
  
-This will open the Vivado GUI and set up a projectwhich can take some minutes. The project will be generated in the folder ''%%output/<Vivado version>/project%%''.+^             address^            size^memory type  ^description                                ^ 
 +|  ''%%0x00000000%%''  ''%%2 kiB%%''|Flip Flops   |inside FPGAfor registers                 | 
 +|  ''%%0x00004000%%''|  ''%%16 kiB%%''|Block RAM    |inside FPGA, for architecture information 
 +|  ''%%0x00010000%%'' ''%%64 kiB%%''|Block RAM    |inside FPGA, for observer                  | 
 +|  ''%%0x80000000%%''  ''%%2 GiB%%''|SDRAM        |external, for scope data                   |
  
-=== Via the Vivado GUI === 
  
-If you intend to use the Vivado GUI itself to set up the project proceed as follows:+**Table 6.1:** Memory mapping
  
-  * open Vivado +The //architecture information// and the //observer// are documented here:\\ 
-  * use the TCL console in the bottom of the GUI to navigate to ''%%src/scripts%%'' using the commands ''%%pwd%%'' and ''%%cd%%'' +https://git.gsi.de/BEA_HDL/FPGA_Common#2-common-monitoring-and-control-features
-  * type ''%%source create_project.tcl%%'' in the TCL console. This will set up the Vivado project.+
  
-===== 5.3 Simulation =====+==== 6.1 PCIe Driver ====
  
-==== 5.3.1 Vivado GUI based simulation ====+Read and write accesses are mapped to virtual file accesses:
  
-Prerequisite: an existing Vivado project see [[#522_vivado_gui_based_build_flow|chapter 5.2.2]].+  * ''%%/dev/xdma0_c2h_0%%'' for read accesses 
 +  * ''%%/dev/xdma0_h2c_0%%'' for write accesses
  
-Click on //Run Simulation// in the Vivado GUI.+=== 6.1.1 Reading from a register ===
  
-==== 5.3.2 Scripted simulation ====+Example in C:
  
-The scripted simulation checks that the simulation results match a predefined reference pattern.+<code> 
 +uint32_t address = 0x00000000; 
 +int fd = open("/dev/xdma0_c2h_0", O_RDWR); 
 +lseek(fd, address, SEEK_SET); 
 +uint64_t value; 
 +read(fd, &value, sizeof(uint64_t)); 
 +</code> 
 +=== 6.1.2 Writing to a register ===
  
-  * navigate to the root folder of the repository in a terminal +It is important to write the whole register width of 64 bits. If a register has less than 64 bits, the unused MSBs have to be written to any value32 bit write accesses will not have any effect.
-  * type ''%%run/run_simulation.sh <name of module (or none for the toplevel simulation)>%%'' +
-  * you will find the output files of the simulation in the folder ''%%output/<Vivado version>/simulation%%''.+
  
-==== 5.3.3 Peripherals simulation models ====+Example in C:
  
-The toplevel simulation includes a Verilog simulation model from Micronthe manufacturer of the AFC’s SDRAMwhich allows the simulation of the behaviour of the external SDRAM.+<code> 
 +uint64_t value = 42; 
 +uint32_t address = 0x00000400; 
 +int fd = open("/dev/xdma0_h2c_0"O_RDWR); 
 +lseek(fdaddress, SEEK_SET); 
 +write(fd, &value, sizeof(uint64_t)); 
 +</code> 
 +=== 6.1.3 Reading of scope data ===
  
-The SDRAM interface IP needs an initial calibration process which finishes after about 120 us. If the communication to the SDRAM is of interest the simulation time should be chosen to be longer than that.+Example in C:
  
-====== 6 Gateware software interface ======+<code> 
 +uint32_t address 0x80000000; 
 +int fd open("/dev/xdma0_c2h_0", O_RDWR); 
 +lseek(fd, address, SEEK_SET); 
 +char data[1024]; 
 +read(fd, data, 1024); 
 +</code> 
 +This example reads 1024 bytes of data from scope 0 to an array. For bigger data blocks, instead of using an array, you will probably prefer a dynamically allocated memory region.
  
-The communication between the gateware inside the FPGA and the software running on the CPU unit takes place via a PCIe driver by Xilinx called XDMAThere is only one PCIe Bar in use in the gateware which maps a coherent memory space of 0x80010000 bytes (2,147,549,184 in decimal) to different physical memories on the AFC board.+==== 6.2 Scope memory ====
  
-The following mapping is applied:+There are three scope memory regions of which the one for the corrected ADC data is the largest since it has the highest data rate.
  
- **address**       **size**^**memory type**  ^**description**                                          +      start address^             size^description           
-  0x00000000  ''%%GiB%%''|SDRAM            |on AFC board, for scope data                             + ''%%0x80000000%%''   ''%%GiB%%''|corrected ADC data    
-|   0x80000000|  ''%%32 kiB%%''|Block RAM        |inside FPGA, for device information and write registers  | +|  ''%%0xC0000000%%''|  ''%%512 MiB%%''|BPM result            
-  0x80008000|  ''%%32 kiB%%''|Flip Flops       |inside FPGA, for read registers                          | + ''%%0xE0000000%%''|  ''%%512 MiB%%''|BPM averaging result  |
- +
-**Table 6.1:** Memory mapping +
- +
-===== 6.1 Scope memory ===== +
- +
-There are three scope memory regions of which the one for the corrected ADC data is the largest since it has the highest data rate.+
  
-^   **start address**^         **size**^**description**       ^ 
-|  ''%%0x00000000%%''   ''%%1 GiB%%''|corrected ADC data    | 
-|  ''%%0x40000000%%'' ''%%512 MiB%%''|BPM result            | 
-|  ''%%0x60000000%%'' ''%%512 MiB%%''|BPM averaging result  | 
  
 **Table 6.2:** Scopes memory map **Table 6.2:** Scopes memory map
  
-==== 6.1.1 Scope 0: corrected ADC data ====+=== 6.2.1 Scope 0: corrected ADC data ===
  
 The corrected ADC data is stored in the following format: The corrected ADC data is stored in the following format:
  
-        **address**   **bits**^**radix**  ^**description**        +            address^        bits^radix   ^description            
-|  ''%%0x00000000%%'' ''%%16%%''|signed     |ADC 0 data (time = 0)  | +|  ''%%0x80000000%%'' ''%%16%%''|signed  |ADC 0 data (time = 0)  | 
-|  ''%%0x00000002%%'' ''%%16%%''|signed     |ADC 1 data (time = 0)  | +|  ''%%0x80000002%%'' ''%%16%%''|signed  |ADC 1 data (time = 0)  | 
-|  ''%%0x00000004%%'' ''%%16%%''|signed     |ADC 2 data (time = 0)  | +|  ''%%0x80000004%%'' ''%%16%%''|signed  |ADC 2 data (time = 0)  | 
-|  ''%%0x00000006%%'' ''%%16%%''|signed     |ADC 3 data (time = 0)  | +|  ''%%0x80000006%%'' ''%%16%%''|signed  |ADC 3 data (time = 0)  | 
-|  ''%%0x00000008%%'' ''%%16%%''|signed     |ADC 4 data (time = 0)  | +|  ''%%0x80000008%%'' ''%%16%%''|signed  |ADC 4 data (time = 0)  | 
-|  ''%%0x0000000A%%'' ''%%16%%''|signed     |ADC 5 data (time = 0)  | +|  ''%%0x8000000A%%'' ''%%16%%''|signed  |ADC 5 data (time = 0)  | 
-|  ''%%0x0000000C%%'' ''%%16%%''|signed     |ADC 6 data (time = 0)  | +|  ''%%0x8000000C%%'' ''%%16%%''|signed  |ADC 6 data (time = 0)  | 
-|  ''%%0x0000000E%%'' ''%%16%%''|signed     |ADC 7 data (time = 0)  | +|  ''%%0x8000000E%%'' ''%%16%%''|signed  |ADC 7 data (time = 0)  | 
-|  ''%%0x00000010%%'' ''%%16%%''|signed     |ADC 0 data (time = 1)  | +|  ''%%0x80000010%%'' ''%%16%%''|signed  |ADC 0 data (time = 1)  | 
-|                   …|           …|…          |…                      |+|                   …|           …|…       |…                      | 
  
 **Table 6.3:** Corrected ADC data storage format **Table 6.3:** Corrected ADC data storage format
  
-The corrected data is the result of two sequential operations on the raw ADC data:+The corrected data is the result of four sequential operations on the raw ADC data:
  
-  offset correction by adding a correction summand +  offset correction by adding a correction summand 
-  gain correction by multiplying a correction factor+  gain correction by multiplying a correction factor 
 +  * configurable moving average filtering 
 +  * optional high pass filtering
  
-The correction summand and the correction factor can be set by individual configuration registers (see [[#621_configuration_registers|chapter 6.2.1]]).+The correction summandthe correction factor and the filter settings can be set by individual configuration registers (see chapter [[#622_configuration_registers|6.2.2]]).
  
-The corrected ADC data scope memory can hold up to {{:ds:projects:cryring:bpm:gateware:documentation:/math_b49a383e.png?nolink&0x21}} samples. At a sampling frequency of 125 MHz this corresponds to a maximum capture duration of 0.537 seconds.+The corrected ADC data scope memory can hold up to {{:ds:projects:cryring:bpm:gateware:/math_b49a383e.png?nolink&0x21}} samples. At a sampling frequency of 125 MHz this corresponds to a maximum capture duration of 0.537 seconds.
  
-==== 6.1.2 Scope 1: BPM result ====+=== 6.2.2 Scope 1: BPM result ===
  
 The BPM result is stored in the following format: The BPM result is stored in the following format:
  
-        **address**   **bits**^**radix**  ^**description**                                  +            address^        bits^radix     ^description                                                         
-|  ''%%0x40000000%%'' ''%%16%%''|signed     |BPM 0 result (time = 0)                          +|  ''%%0xC0000000%%'' ''%%48%%''|unsigned  |time stamp, starting from gate high transition, 125 MHz (time = 0)  | 
-|  ''%%0x40000002%%'' ''%%16%%''|unsigned   |reserved for BPM 0 result confidence (time = 0)  | +|  ''%%0xC0000006%%'' ''%%16%%''|unsigned  |effective linear regression length                                  | 
-|  ''%%0x40000004%%'' ''%%16%%''|signed     |BPM 1 result (time = 0)                          +|  ''%%0xC0000008%%'' ''%%16%%''|signed    |BPM 0 result (time = 0)                                             
-|  ''%%0x40000006%%'' ''%%16%%''|unsigned   |reserved for BPM 1 result confidence (time = 0)  | +|  ''%%0xC000000A%%'' ''%%16%%''|unsigned  |BPM 0 variance * N (time = 0)                                       | 
-|  ''%%0x40000008%%'' ''%%16%%''|signed     |BPM 2 result (time = 0)                          + ''%%0xC000000C%%'' ''%%16%%''|unsigned  |BPM 0 intensity (time = 0)                                          
-|  ''%%0x4000000A%%'' ''%%16%%''|unsigned   |reserved for BPM 2 result confidence (time = 0)  | +|  ''%%0xC000000E%%'' ''%%16%%''|signed    |BPM 1 result (time = 0)                                             
-|  ''%%0x4000000C%%'' ''%%16%%''|signed     |BPM 3 result (time = 0)                          +|  ''%%0xC0000010%%'' ''%%16%%''|unsigned  |BPM 1 variance * N (time = 0)                                       | 
-|  ''%%0x4000000E%%'' ''%%16%%''|unsigned   |reserved for BPM 3 result confidence (time = 0)  + ''%%0xC0000012%%'' ''%%16%%''|unsigned  |BPM 1 intensity (time = 0)                                          
-|  ''%%0x40000010%%'' ''%%16%%''|signed     |BPM 0 result (time = 1)                          +|  ''%%0xC0000014%%'' ''%%16%%''|signed    |BPM 2 result (time = 0)                                             
-|                   …|           …|…          |…                                                |+|  ''%%0xC0000016%%'' ''%%16%%''|unsigned  |BPM 2 variance * N (time = 0)                                       | 
 + ''%%0xC0000018%%'' ''%%16%%''|unsigned  |BPM 2 intensity (time = 0)                                          
 +|  ''%%0xC000001A%%'' ''%%16%%''|signed    |BPM 3 result (time = 0)                                             
 +|  ''%%0xC000001C%%'' ''%%16%%''|unsigned  |BPM 3 variance * N (time = 0)                                       
 +|  ''%%0xC000001E%%'' ''%%16%%''|unsigned  |BPM 3 intensity (time = 0)                                          | 
 +|  ''%%0xC0000020%%'' ''%%48%%''|unsigned  |time stamp, starting from gate high transition, 125 MHz (time = 1)  
 +|                   …|           …|…         |…                                                                   | 
  
 **Table 6.4:** BPM result storage format **Table 6.4:** BPM result storage format
  
-The BPM result scope memory can hold up to {{:ds:projects:cryring:bpm:gateware:documentation:/math_b33da5a8.png?nolink&0x21}} samples. At a sampling frequency of 125 MHz and with a linear regression length of e.g. 1024 this corresponds to a maximum capture duration of 4:35 minutes.+The BPM result scope memory can hold up to {{:ds:projects:cryring:bpm:gateware:/math_6b2062f3.png?nolink&0x21}} samples. At a sampling frequency of 125 MHz and with a linear regression length of e.g. 1024 this corresponds to a maximum capture duration of 2:17 minutes.
  
-==== 6.1.3 Scope 2: BPM averaging result ====+== BPM {0 - 3} result ==
  
-The BPM averaging result is stored in the following format:+This value divided by {{:ds:projects:cryring:bpm:gateware:/math_ffca8a11.png?nolink&0x21}} represents the relative beam position in the range {{:ds:projects:cryring:bpm:gateware:/math_6818d66b.png?nolink&0x25}}.
  
-^         **address**^    **bits**^**radix**  ^**description**                                            ^ +== BPM {3} variance * N ==
-|  ''%%0x60000000%%'' ''%%16%%''|signed     |BPM 0 averaging result (time 0)                          | +
-|  ''%%0x60000002%%'' ''%%16%%''|unsigned   |reserved for BPM 0 averaging result confidence (time 0)  | +
-|  ''%%0x60000004%%'' ''%%16%%''|signed     |BPM 1 averaging result (time = 0)                          | +
-|  ''%%0x60000006%%'' ''%%16%%''|unsigned   |reserved for BPM 1 averaging result confidence (time = 0)  | +
-|  ''%%0x60000008%%'' ''%%16%%''|signed     |BPM 2 averaging result (time = 0)                          | +
-|  ''%%0x6000000A%%'' ''%%16%%''|unsigned   |reserved for BPM 2 averaging result confidence (time = 0)  | +
-|  ''%%0x6000000C%%'' ''%%16%%''|signed     |BPM averaging result (time 0)                          | +
-|  ''%%0x6000000E%%'' ''%%16%%''|unsigned   |reserved for BPM 3 averaging result confidence (time = 0)  | +
-|  ''%%0x60000010%%'' ''%%16%%''|signed     |BPM 0 averaging result (time 1)                          | +
-|                   …|           …|…          |…                                                          |+
  
-**Table 6.5:** BPM averaging result storage format+This value divided by {{:ds:projects:cryring:bpm:gateware:/math_4f4440e7.png?nolink&0x21}} represents the variance of the corresponding BPM result multiplied with the linear regression length.
  
-The BPM averaging result scope memory can hold up to {{:ds:projects:cryring:bpm:gateware:documentation:/math_b33da5a8.png?nolink&0x21}} samples. At a sampling frequency of 125 MHz, with linear regression length of e.g. 1024 and with an averaging length of e.g. 1024 this corresponds to a maximum capture duration of 78.2 hours.+The scaling with the linear regression length guarantees enough LSBs to evaluateThe variance itself quantized with 16 bits would otherwise often result in zero.
  
-===== 6.2 Register map =====+== BPM {0 - 3} intensity ==
  
-==== 6.2.1 Configuration registers ====+The intensity of the beamA value of {{:ds:projects:cryring:bpm:gateware:/math_90f0d1f4.png?nolink&0x22}} corresponds to the maximum achievable intensity at an alternating pattern of maximum and minimum ADC samples on both inputs.
  
-The following registers can be written by software:+=== 6.2.3 Scope 2BPM averaging result ===
  
-^   **index**^         **address**^    **bits**^**radix**  ^**description**                      ^  **default value**^ +The BPM averaging result is stored in the following format:
-|   ''%%0%%'' ''%%0x80007000%%'' ''%%16%%''|signed     |ADC 0 offset correction summand      |     ''%%0x0000%%''+
-|   ''%%1%%'' ''%%0x80007020%%'' ''%%16%%''|signed     |ADC 1 offset correction summand      |     ''%%0x0000%%''+
-|   ''%%2%%'' ''%%0x80007040%%'' ''%%16%%''|signed     |ADC 2 offset correction summand      |     ''%%0x0000%%''+
-|   ''%%3%%'' ''%%0x80007060%%'' ''%%16%%''|signed     |ADC 3 offset correction summand      |     ''%%0x0000%%''+
-|   ''%%4%%'' ''%%0x80007080%%'' ''%%16%%''|signed     |ADC 4 offset correction summand      |     ''%%0x0000%%''+
-|   ''%%5%%'' ''%%0x800070A0%%'' ''%%16%%''|signed     |ADC 5 offset correction summand      |     ''%%0x0000%%''+
-|   ''%%6%%'' ''%%0x800070C0%%'' ''%%16%%''|signed     |ADC 6 offset correction summand      |     ''%%0x0000%%''+
-|   ''%%7%%'' ''%%0x800070E0%%'' ''%%16%%''|signed     |ADC 7 offset correction summand      |     ''%%0x0000%%''+
-|   ''%%8%%'' ''%%0x80007100%%'' ''%%16%%''|unsigned   |ADC 0 gain correction factor             ''%%0x8000%%''+
-|   ''%%9%%'' ''%%0x80007120%%'' ''%%16%%''|unsigned   |ADC 1 gain correction factor             ''%%0x8000%%''+
-|  ''%%10%%'' ''%%0x80007140%%'' ''%%16%%''|unsigned   |ADC 2 gain correction factor             ''%%0x8000%%''+
-|  ''%%11%%'' ''%%0x80007160%%'' ''%%16%%''|unsigned   |ADC 3 gain correction factor             ''%%0x8000%%''+
-|  ''%%12%%'' ''%%0x80007180%%'' ''%%16%%''|unsigned   |ADC 4 gain correction factor             ''%%0x8000%%''+
-|  ''%%13%%'' ''%%0x800071A0%%'' ''%%16%%''|unsigned   |ADC 5 gain correction factor             ''%%0x8000%%''+
-|  ''%%14%%'' ''%%0x800071C0%%'' ''%%16%%''|unsigned   |ADC 6 gain correction factor             ''%%0x8000%%''+
-|  ''%%15%%'' ''%%0x800071E0%%'' ''%%16%%''|unsigned   |ADC 7 gain correction factor             ''%%0x8000%%''+
-|  ''%%16%%'' ''%%0x80007200%%'' ''%%16%%''|unsigned   |BPM 0 capacitance correction factor  |     ''%%0x8000%%''+
-|  ''%%17%%'' ''%%0x80007220%%'' ''%%16%%''|unsigned   |BPM 1 capacitance correction factor  |     ''%%0x8000%%''+
-|  ''%%18%%'' ''%%0x80007240%%'' ''%%16%%''|unsigned   |BPM 2 capacitance correction factor  |     ''%%0x8000%%''+
-|  ''%%19%%'' ''%%0x80007260%%'' ''%%16%%''|unsigned   |BPM 3 capacitance correction factor  |     ''%%0x8000%%''+
-|  ''%%20%%'' ''%%0x80007280%%'' ''%%12%%''|unsigned   |BPM linear regression length - 1          ''%%0x3FF%%''+
-|  ''%%21%%'' ''%%0x800072A0%%''  ''%%5%%''|unsigned   |log2 of BPM averaging length               ''%%0x0A%%''+
-|  ''%%22%%'' ''%%0x800072C0%%''  ''%%4%%''|unsigned   |gate signal input select                    ''%%0x0%%''+
-|  ''%%23%%'' ''%%0x800072E0%%''  ''%%4%%''|unsigned   |RF signal input select                      ''%%0x8%%''+
-|  ''%%32%%'' ''%%0x80007400%%'' ''%%26%%''|unsigned   |scope 0 capture length - 1            ''%%0x0000FFF%%''+
-|  ''%%33%%'' ''%%0x80007420%%''  ''%%2%%''|unsigned   |scope 0 trigger mode                        ''%%0x2%%''+
-|  ''%%34%%'' ''%%0x80007440%%''  ''%%1%%''|binary     |scope 0 arm trigger                  |          ''%%0%%''+
-|  ''%%40%%'' ''%%0x80007500%%'' ''%%25%%''|unsigned   |scope 1 capture length - 1            ''%%0x0000FFF%%''+
-|  ''%%41%%'' ''%%0x80007520%%''  ''%%2%%''|unsigned   |scope 1 trigger mode                        ''%%0x1%%''+
-|  ''%%42%%'' ''%%0x80007540%%''  ''%%1%%''|binary     |scope 1 arm trigger                  |          ''%%0%%''+
-|  ''%%43%%'' ''%%0x80007560%%''  ''%%1%%''|binary     |scope 1 capture mode                          ''%%0%%''+
-|  ''%%48%%'' ''%%0x80007600%%'' ''%%25%%''|unsigned   |scope 2 capture length - 1            ''%%0x0000FFF%%''+
-|  ''%%49%%'' ''%%0x80007620%%''  ''%%2%%''|unsigned   |scope 2 trigger mode                        ''%%0x1%%''+
-|  ''%%50%%'' ''%%0x80007640%%''  ''%%1%%''|binary     |scope 2 arm trigger                  |          ''%%0%%''+
-|  ''%%51%%'' ''%%0x80007660%%''  ''%%1%%''|binary     |scope 2 capture mode                          ''%%0%%''|+
  
-**Table 6.6:** List of configuration registers+^             address^        bits^radix     ^description                                                         ^ 
 +|  ''%%0xE0000000%%'' ''%%48%%''|unsigned  |time stamp, starting from gate high transition, 125 MHz (time = 0)  | 
 +|  ''%%0xE0000006%%'' ''%%16%%''|unsigned  |average linear regression length                                    | 
 +|  ''%%0xE0000008%%'' ''%%16%%''|signed    |BPM 0 averaging result (time = 0)                                   | 
 +|  ''%%0xE000000A%%'' ''%%16%%''|unsigned  |BPM 0 averaging variance N_avg (time = 0)                     | 
 +|  ''%%0xE000000C%%'' ''%%16%%''|unsigned  |BPM 0 averaging intensity (time = 0)                                | 
 +|  ''%%0xE000000E%%'' ''%%16%%''|signed    |BPM 1 averaging result (time = 0)                                   | 
 +|  ''%%0xE0000010%%'' ''%%16%%''|unsigned  |BPM 1 averaging variance N_avg (time = 0)                     | 
 +|  ''%%0xE0000012%%'' ''%%16%%''|unsigned  |BPM 1 averaging intensity (time = 0)                                | 
 +|  ''%%0xE0000014%%'' ''%%16%%''|signed    |BPM 2 averaging result (time = 0)                                   | 
 +|  ''%%0xE0000016%%'' ''%%16%%''|unsigned  |BPM 2 averaging variance * N * N_avg (time = 0)                     | 
 +|  ''%%0xE0000018%%'' ''%%16%%''|unsigned  |BPM 2 averaging intensity (time = 0)                                | 
 +|  ''%%0xE000001A%%'' ''%%16%%''|signed    |BPM 3 averaging result (time = 0)                                   | 
 +|  ''%%0xE000001C%%'' ''%%16%%''|unsigned  |BPM 3 averaging variance * N * N_avg (time = 0)                     | 
 +|  ''%%0xE000001E%%'' ''%%16%%''|unsigned  |BPM 3 averaging intensity (time = 0)                                | 
 +|  ''%%0xE0000020%%'' ''%%48%%''|unsigned  |time stamp, starting from gate high transition, 125 MHz (time = 1)  | 
 +|                   …|           …|…         |…                                                                   |
  
-=== 0 - 7: ADC {0 - 7} offset correction summand === 
  
-Correction summand for a possible offset deviation of the ADC. The offset correction precedes the gain correction.+**Table 6.5:** BPM averaging result storage format
  
-=== 8 - 15: ADC {0 - 7gain correction factor ===+The BPM averaging result scope memory can hold up to {{:ds:projects:cryring:bpm:gateware:/math_6b2062f3.png?nolink&0x21}samples. At a sampling frequency of 125 MHz, with a linear regression length of e.g. 1024 and with an averaging length of e.g. 1024 this corresponds to a maximum capture duration of 39.1 hours.
  
-Correction factor for a possible gain deviation of the ADC. The default value 0x8000 corresponds to a multiplication by 1. The possible correction range is {{:ds:projects:cryring:bpm:gateware:documentation:/math_69644564.png?nolink&0x25}}.+== BPM {0 - 3averaging result ==
  
-=== 16 - 19BPM {0 - 3capacitance correction factor ===+This value divided by {{:ds:projects:cryring:bpm:gateware:/math_ffca8a11.png?nolink&0x21}} represents the relative beam position in the range {{:ds:projects:cryring:bpm:gateware:/math_6818d66b.png?nolink&0x25}}.
  
-The capacitances of the two corresponding capacitor plates of a single BPM can differ. Data is fed unchanged into the BPM algorithm, while data 1 is multiplied by a correction factor. The default value 0x8000 corresponds to a multiplication by 1. The possible correction range is {{:ds:projects:cryring:bpm:gateware:documentation:/math_69644564.png?nolink&0x25}}.+== BPM {- 3averaging variance * N * N_avg ==
  
-=== 20: BPM linear regression length - 1 ===+This value divided by {{:ds:projects:cryring:bpm:gateware:/math_4f4440e7.png?nolink&0x21}} represents the variance of the corresponding BPM averaging result multiplied with the average linear regression length and the averaging length.
  
-Number of samples over which the linear regression is calculated if no external RF pulse signal is presentThis value is valid for all four BPMs. If an external RF pulse signal is present, the result of the linear regression will be output and a new calculation will be started on every rising edge of the RF pulse signal. For this to work, this register has to be set to a value that is longer than the interval between the RF pulses.+The scaling with the average linear regression length times the averaging length guarantees enough LSBs to evaluateThe variance itself quantized with 16 bits would otherwise nearly always result in zero.
  
-Allowed values: 0x002 0xFFF+== BPM {0 3} averaging intensity ==
  
-The lower limit is determined by the throughput of the divider IP core of 1 in 3 clock cycles that is used for the final division of the BPM algorithm.+The average intensity of the beam. A value of {{:ds:projects:cryring:bpm:gateware:/math_90f0d1f4.png?nolink&0x22}} corresponds to the maximum achievable intensity at an alternating pattern of maximum and minimum ADC samples on both inputs.
  
-=== 21: Log2 of BPM averaging length ===+==== 6.3 Register map ====
  
-Dual logarithm of the number of linear regression results over which the averaging is calculatedThis value is valid for all four BPMs.+=== 6.3.1 Status registers ===
  
-Allowed range: 0 .. 20. Higher values will be set to the maximum allowed value. This corresponds to an averaging length of 1, 2, 4, … , 1,048,576.+The following status registers can be read by software:
  
-=== 22: Gate signal input select ===+^        index^             address^        bits^radix     ^description                                  ^ 
 +|    ''%%0%%'' ''%%0x00000000%%'' ''%%16%%''|signed    |latest BPM 0 result                          | 
 +|    ''%%1%%'' ''%%0x00000008%%'' ''%%16%%''|signed    |latest BPM 1 result                          | 
 +|    ''%%2%%'' ''%%0x00000010%%'' ''%%16%%''|signed    |latest BPM 2 result                          | 
 +|    ''%%3%%'' ''%%0x00000018%%'' ''%%16%%''|signed    |latest BPM 3 result                          | 
 +|    ''%%4%%'' ''%%0x00000020%%'' ''%%16%%''|unsigned  |latest BPM 0 variance * N                    | 
 +|    ''%%5%%'' ''%%0x00000028%%'' ''%%16%%''|unsigned  |latest BPM 1 variance * N                    | 
 +|    ''%%6%%'' ''%%0x00000030%%'' ''%%16%%''|unsigned  |latest BPM 2 variance * N                    | 
 +|    ''%%7%%'' ''%%0x00000038%%'' ''%%16%%''|unsigned  |latest BPM 3 variance * N                    | 
 +|    ''%%8%%'' ''%%0x00000040%%'' ''%%16%%''|unsigned  |latest BPM 0 intensity                       | 
 +|    ''%%9%%'' ''%%0x00000048%%'' ''%%16%%''|unsigned  |latest BPM 1 intensity                       | 
 +|   ''%%10%%'' ''%%0x00000050%%'' ''%%16%%''|unsigned  |latest BPM 2 intensity                       | 
 +|   ''%%11%%'' ''%%0x00000058%%'' ''%%16%%''|unsigned  |latest BPM 3 intensity                       | 
 +|   ''%%12%%'' ''%%0x00000060%%'' ''%%12%%''|unsigned  |effective linear regression length           | 
 +|   ''%%13%%'' ''%%0x00000068%%'' ''%%48%%''|unsigned  |time from gate high transition               | 
 +|   ''%%16%%'' ''%%0x00000080%%'' ''%%16%%''|signed    |latest BPM 0 averaging result                | 
 +|   ''%%17%%'' ''%%0x00000088%%'' ''%%16%%''|signed    |latest BPM 1 averaging result                | 
 +|   ''%%18%%'' ''%%0x00000090%%'' ''%%16%%''|signed    |latest BPM 2 averaging result                | 
 +|   ''%%19%%'' ''%%0x00000098%%'' ''%%16%%''|signed    |latest BPM 3 averaging result                | 
 +|   ''%%20%%'' ''%%0x000000A0%%'' ''%%16%%''|unsigned  |latest BPM 0 averaging variance * N * N_avg  | 
 +|   ''%%21%%'' ''%%0x000000A8%%'' ''%%16%%''|unsigned  |latest BPM 1 averaging variance * N * N_avg  | 
 +|   ''%%22%%'' ''%%0x000000B0%%'' ''%%16%%''|unsigned  |latest BPM 2 averaging variance * N * N_avg  | 
 +|   ''%%23%%'' ''%%0x000000B8%%'' ''%%16%%''|unsigned  |latest BPM 3 averaging variance * N * N_avg  | 
 +|   ''%%24%%'' ''%%0x000000C0%%'' ''%%16%%''|unsigned  |latest BPM 0 averaging intensity             | 
 +|   ''%%25%%'' ''%%0x000000C8%%'' ''%%16%%''|unsigned  |latest BPM 1 averaging intensity             | 
 +|   ''%%26%%'' ''%%0x000000D0%%'' ''%%16%%''|unsigned  |latest BPM 2 averaging intensity             | 
 +|   ''%%27%%'' ''%%0x000000D8%%'' ''%%16%%''|unsigned  |latest BPM 3 averaging intensity             | 
 +|   ''%%28%%'' ''%%0x000000E0%%'' ''%%12%%''|unsigned  |average effective linear regression length   | 
 +|   ''%%32%%'' ''%%0x00000100%%''  ''%%2%%''|unsigned  |scope 0 capture status                       | 
 +|   ''%%33%%'' ''%%0x00000108%%'' ''%%32%%''|unsigned  |scope 0 next write address                   | 
 +|   ''%%40%%'' ''%%0x00000140%%''  ''%%2%%''|unsigned  |scope 1 capture status                       | 
 +|   ''%%41%%'' ''%%0x00000148%%'' ''%%32%%''|unsigned  |scope 1 next write address                   | 
 +|   ''%%48%%'' ''%%0x00000180%%''  ''%%2%%''|unsigned  |scope 2 capture status                       | 
 +|   ''%%49%%'' ''%%0x00000188%%'' ''%%32%%''|unsigned  |scope 2 next write address                   | 
 +|  ''%%124%%'' ''%%0x000003E0%%'' ''%%32%%''|unsigned  |build timestamp                              | 
 +|  ''%%125%%'' ''%%0x000003E8%%'' ''%%57%%''|unsigned  |FPGA serial number                           | 
 +|  ''%%126%%'' ''%%0x000003F0%%'' ''%%64%%''|unsigned  |module ID                                    | 
 +|  ''%%127%%'' ''%%0x000003F8%%'' ''%%64%%''|unsigned  |magic number                                 |
  
-^  value^input                              ^ 
-|  0 - 7|MLVDS line 0 - 7 on the backplane  | 
-|      8|FMC 0 //TRIG// input               | 
-|      9|FMC 1 //TRIG// input               | 
  
-The gate signal input can be switched between one of the eight MLVDS lines on the backplane and the two MMCX connectors labeled //TRIG// on the FMC front panels.+**Table 6.6:** List of status registers
  
-=== 23RF signal input select ===+== 0 - 3latest BPM {0 - 3} result ==
  
-^  value^input                              ^ +This value divided by {{:ds:projects:cryring:bpm:gateware:/math_ffca8a11.png?nolink&0x21}} represents the relative beam position in the range {{:ds:projects:cryring:bpm:gateware:/math_6818d66b.png?nolink&0x25}}.
-|  0 - 7|MLVDS line 0 - 7 on the backplane +
-|      8|FMC 0 //TRIG// input               | +
-|      9|FMC 1 //TRIG/input               |+
  
-The RF signal input can be switched between one of the eight MLVDS lines on the backplane and the two MMCX connectors labeled //TRIG// on the FMC front panels.+== 4 - 7: latest BPM {0 - 3} variance * N ==
  
-=== 32, 40, 48: Scope {0, 1, 2capture length - 1 ===+This value divided by {{:ds:projects:cryring:bpm:gateware:/math_4f4440e7.png?nolink&0x21}represents the variance of the corresponding BPM result multiplied with the linear regression length.
  
-The number of samples minus one that are stored after a scope has been triggeredEach sample consists of 16 bytes.+The scaling with the linear regression length guarantees enough LSBs to evaluateThe variance itself quantized with 16 bits would otherwise often result in zero.
  
-Scope can only handle even numbers of samples. Uneven numbers will be automatically handled as the next higher even number. For scopes 1 and 2, also uneven numbers are allowed.+== 8 - 11: latest BPM {- 3} intensity ==
  
-=== 33, 41, 49: Scope {0, 1, 2trigger mode ===+The intensity of the beam. A value of {{:ds:projects:cryring:bpm:gateware:/math_90f0d1f4.png?nolink&0x22}corresponds to the maximum achievable intensity at an alternating pattern of maximum and minimum ADC samples on both inputs.
  
-^  value^trigger mode                                                                               ^ +== 12: effective linear regression length ==
-|      0|trigger on rising edge of gate signal                                                      | +
-|      1|trigger on high state of gate signal                                                       | +
-|   2, 3|trigger instantly after the trigger is armed, independent of the state of the gate signal  |+
  
-=== 3442, 50: Scope {0, 1, 2} arm trigger ===+The effective linear regression length is determined by the nominal value of the linear regression length configuration register and the frequency of the RF pulses. If no RF pulses are presentthis register should hold the value of the linear regression length configuration register.
  
-Writing a 1 to this register will arm the trigger once. The register does not have to be reset to 0 before the next arm trigger, just write another 1 to it. If the corresponding register ’continuous trigger’ is set to 1, writing to this register does not have any effect.+== 13: time from gate high transition ==
  
-When in ’waiting for trigger’ state (see status register ’capture status’ in [[#622_status_registers|chapter 6.2.2]])writing a 0 to this register will cancel the arming of the trigger and the capture status will change to ’done’.+Counter valuedriven by the 125 MHz main processing clock, starting from the high transition of the gate input signal.
  
-=== 43, 51Scope {1, 2capture mode ===+== 16 - 19latest BPM {0 - 3averaging result ==
  
-^  value^capture mode                                                                 ^ +This value divided by {{:ds:projects:cryring:bpm:gateware:/math_ffca8a11.png?nolink&0x21}} represents the relative beam position in the range {{:ds:projects:cryring:bpm:gateware:/math_6818d66b.png?nolink&0x25}}. Due to the averaging there should be less noise on this value than on the BPM result.
-|      0|capture until the number of samples defined by register {40, 48are stored +
-|      1|the same, but cancel capturing when the gate signal goes low                 |+
  
-A capture mode register is only available for scopes 1 and 2. Scope (for corrected ADC data) always operates in capture mode 0.+== 20 - 23: latest BPM {- 3} averaging variance * N * N_avg ==
  
-==== 6.2.2 Status registers ====+This value divided by {{:ds:projects:cryring:bpm:gateware:/math_4f4440e7.png?nolink&0x21}} represents the variance of the corresponding BPM averaging result multiplied with the average linear regression length and the averaging length.
  
-The following status registers can be read by software:+The scaling with the average linear regression length times the averaging length guarantees enough LSBs to evaluate. The variance itself quantized with 16 bits would otherwise nearly always result in zero.
  
-^    **index**^         **address**^    **bits**^**radix**  ^**description**                ^ +== 24 - 27: latest BPM {3averaging intensity ==
-|    ''%%0%%'' ''%%0x80008000%%'' ''%%16%%''|signed     |latest BPM 0 result            | +
-|    ''%%1%%'' ''%%0x80008020%%'' ''%%16%%''|signed     |latest BPM 1 result            | +
-|    ''%%2%%'' ''%%0x80008040%%'' ''%%16%%''|signed     |latest BPM 2 result            | +
-|    ''%%3%%'' ''%%0x80008060%%'' ''%%16%%''|signed     |latest BPM 3 result            | +
-|    ''%%4%%'' ''%%0x80008080%%'' ''%%16%%''|signed     |latest BPM 0 averaging result +
-|    ''%%5%%'' ''%%0x800080A0%%'' ''%%16%%''|signed     |latest BPM 1 averaging result +
-|    ''%%6%%'' ''%%0x800080C0%%'' ''%%16%%''|signed     |latest BPM 2 averaging result +
-|    ''%%7%%'' ''%%0x800080E0%%'' ''%%16%%''|signed     |latest BPM 3 averaging result +
-|   ''%%32%%'' ''%%0x80008400%%''  ''%%2%%''|unsigned   |scope 0 capture status         | +
-|   ''%%33%%'' ''%%0x80008420%%'' ''%%32%%''|unsigned   |scope 0 next write address     | +
-|   ''%%40%%'' ''%%0x80008500%%''  ''%%2%%''|unsigned   |scope 1 capture status         | +
-|   ''%%41%%'' ''%%0x80008520%%'' ''%%32%%''|unsigned   |scope 1 next write address     | +
-|   ''%%48%%'' ''%%0x80008600%%''  ''%%2%%''|unsigned   |scope 2 capture status         | +
-|   ''%%49%%'' ''%%0x80008620%%'' ''%%32%%''|unsigned   |scope 2 next write address     | +
-|  ''%%127%%'' ''%%0x80008FE0%%'' ''%%57%%''|unsigned   |FPGA serial number             |+
  
-**Table 6.7:** List of status registers+The intensity of the beamA value of {{:ds:projects:cryring:bpm:gateware:/math_90f0d1f4.png?nolink&0x22}} corresponds to the maximum achievable intensity at an alternating pattern of maximum and minimum ADC samples on both inputs.
  
-=== 0 - 3latest BPM {0 - 3} result ===+== 28average effective linear regression length ==
  
-This value divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_ffca8a11.png?nolink&0x21}} represents the relative beam position in the range {{:ds:projects:cryring:bpm:gateware:documentation:/math_6818d66b.png?nolink&0x25}}.+The average of the effective linear regression lengths of the BPM.
  
-=== 4 - 7latest BPM {0 - 3averaging result ===+== 32, 40, 48Scope {0, 1, 2capture status ==
  
-This value divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_ffca8a11.png?nolink&0x21}} represents the relative beam position in the range {{:ds:projects:cryring:bpm:gateware:documentation:/math_6818d66b.png?nolink&0x25}}. Due to the averaging there should be less noise on this value than on the BPM result. +     value^capture status       ^ 
- + ''%%0%%''|idle                 | 
-=== 32, 40, 48: Scope {0, 1, 2} capture status === + ''%%1%%''|waiting for trigger 
- + ''%%2%%''|capturing            | 
- value^capture status       ^ + ''%%3%%''|done                 |
-     0|idle                 | +
-     1|waiting for trigger +
-     2|capturing            | +
-     3|done                 |+
  
 The value 0 is only present before starting the trigger for the first time. After that, the effective idle state is 3. The value 0 is only present before starting the trigger for the first time. After that, the effective idle state is 3.
  
-=== 33, 41, 49: Scope {0, 1, 2} next write address ===+== 33, 41, 49: Scope {0, 1, 2} next write address ==
  
 Address where the next data sample will be stored during the scope’s capturing process. Address where the next data sample will be stored during the scope’s capturing process.
  
-=== 127FPGA serial number ===+== 124build timestamp ==
  
-The XDMA PCIe driver by Xilinx numbers the devices randomly and is not able to identify the slot number of an AFC board. This register holds the FPGA’s unique serial number and can be used to identify an AFC board.+Time when the bitstream was created. This information can be used to identify the gateware version (together with the Git commit information documented in https://git.gsi.de/BEA_HDL/FPGA_Common#122-gateware-information).
  
-===== 6.3 Capturing procedure =====+Format:
  
-==== 6.3.1 Known number of samples ====+^  bits 31 - 27  ^  bits 26 - 23  ^           bits 22 - 17            bits 16 - 12  ^  bits 11 -   bits 5 - 0  ^ 
 +|      day           month      |  year (last two decimal digits)  |     hours      |    minutes    |   seconds    |
  
-A typical procedure for capturing a predefineable number of samples starting from the rising edge of the gate signal is the following:+== 125FPGA serial number ==
  
-  * write the number of samples minus 1 to the configuration register ’capture length - 1’ +The XDMA PCIe driver by Xilinx numbers the devices randomly and is not able to identify the slot number of an AMC board. This register holds the FPGAs unique serial number and can be used to identify an AMC board.
-  * write a 0 to the configuration register named trigger mode’ +
-  * write a 0 (= default) to the configuration register named ’capture mode’ +
-  * write a 1 to the configuration register named ’arm trigger’ +
-  * you can check the status register named ’capture status’ for the progress: 1: rising edge of gate signal not yet detected, 2: capturing is ongoing, 3: capturing completed +
-  * you can check the current write address by polling the status register named ’next write address’+
  
-==== 6.3.2 Unknown number of samples ====+== 126: module ID ==
  
-BPM results are only calculated while the gate signal is highIf you want to capture a complete high period of e.g. BPM average samples, the total number of samples is unknownProceed as follows:+The module ID can be used to identify the type of the current bitstream.\\ 
 +The module ID of the Cryring BPM gateware is ''%%0x0102010300010001%%''.
  
-  * write the maximum value 0x1FFFFFF to the configuration register named ’capture length - 1’ +The fields are defined as follows:
-  * write a 0 to the configuration register named ’trigger mode’ +
-  * write a 1 to the configuration register named ’capture mode’ +
-  * write a 1 to the configuration register named ’arm trigger’ +
-  * you can check the status register ’capture status’ as above +
-  * the value of the status register named ’next write address’ will be static after completion and indicates how many samples have been captured+
  
-====== 7 Extended gateware software interface ======+^       bits 63 - 56             bits 55 - 48           bits 47 - 40      ^     bits 39 - 32      ^  bits 31 - 16  ^  bits 15 - 0  ^ 
 +|  minor gateware version  |  major gateware version  |  minor board version  |  major board version  |  developer ID  |  project ID   |
  
-Besides the interface documented in [[#6_gateware_software_interface|chapter 6]] which is meant for productive use, there is an extended interface for development and debugging purposes. The extended interface is also present in the bitstream by default.+Here is an incomplete list of project IDs:
  
-While the productive interface is intended to be kept as downward compatible as possible, the extended interface may be subject to major changes during the development process.+^      project ID^project name          ^ 
 +|  ''%%0x0001%%''|Cryring BPM           | 
 +|  ''%%0x0002%%''|UniMon                | 
 +|  ''%%0x0003%%''|Rate Divider          | 
 +|  ''%%0x0004%%''|BLoFELD               | 
 +|  ''%%0x0005%%''|Resonant Transformer 
 +|  ''%%0x8001%%''|Red Pitaya            |
  
-===== 7.1 Extended register map =====+== 127: magic number ==
  
-==== 7.1.1 Additional configuration registers ====+The magic number can be used to determine if the gateware uses the expected register format.\\ 
 +The value of this register is the same for all module IDs: ''%%0xBADEAFFEDEADC0DE%%''.
  
-The following additional registers can be written by software:+=== 6.3.2 Configuration registers ===
  
-^   **index**^         **address**^   **bits**^**radix**  ^**description**              **default value**^ +The following registers can be written by software:
-|  ''%%39%%'' ''%%0x800074E0%%'' ''%%1%%''|binary     |scope 0 continuous trigger  |          ''%%0%%''+
-|  ''%%47%%'' ''%%0x800075E0%%'' ''%%1%%''|binary     |scope 1 continuous trigger  |          ''%%0%%''+
-|  ''%%55%%'' ''%%0x800076E0%%'' ''%%1%%''|binary     |scope 2 continuous trigger  |          ''%%0%%''+
-|  ''%%64%%'' ''%%0x80007800%%'' ''%%2%%''|unsigned   |FMC 0 status LED select            ''%%0x0%%''+
-|  ''%%65%%'' ''%%0x80007820%%'' ''%%3%%''|unsigned   |FMC 0 status LED value      |        ''%%0x7%%''+
-|  ''%%66%%'' ''%%0x80007840%%'' ''%%5%%''|unsigned   |FMC 0 SPI chip select             ''%%0x0F%%''+
-|  ''%%67%%'' ''%%0x80007860%%'' ''%%1%%''|binary     |FMC 0 SPI read/write        |          ''%%0%%''+
-|  ''%%68%%'' ''%%0x80007880%%'' ''%%8%%''|unsigned   |FMC 0 SPI address                 ''%%0x00%%''+
-|  ''%%69%%'' ''%%0x800078A0%%'' ''%%8%%''|unsigned   |FMC 0 SPI write data        |       ''%%0x00%%''+
-|  ''%%70%%'' ''%%0x800078C0%%'' ''%%1%%''|binary     |FMC 0 SPI trigger                    ''%%0%%''+
-|  ''%%71%%'' ''%%0x800078E0%%'' ''%%1%%''|binary     |FMC 0 ADC resetn            |          ''%%1%%''+
-|  ''%%72%%'' ''%%0x80007900%%'' ''%%1%%''|binary     |FMC 0 I2C read/write        |          ''%%0%%''+
-|  ''%%73%%'' ''%%0x80007920%%'' ''%%7%%''|unsigned   |FMC 0 I2C device address    |       ''%%0x49%%''+
-|  ''%%74%%'' ''%%0x80007940%%'' ''%%8%%''|unsigned   |FMC 0 I2C register address  |       ''%%0x00%%''+
-|  ''%%75%%'' ''%%0x80007960%%'' ''%%8%%''|unsigned   |FMC 0 I2C write data        |       ''%%0x00%%''+
-|  ''%%76%%'' ''%%0x80007980%%'' ''%%1%%''|binary     |FMC 0 I2C trigger                    ''%%0%%''+
-|  ''%%77%%'' ''%%0x800079A0%%'' ''%%1%%''|binary     |FMC 0 PLL resetn            |          ''%%1%%''+
-|  ''%%78%%'' ''%%0x800079C0%%'' ''%%1%%''|binary     |FMC 0 clock switch select            ''%%1%%''+
-|  ''%%79%%'' ''%%0x800079E0%%'' ''%%1%%''|binary     |FMC 0 VCXO output enable    |          ''%%1%%''+
-|  ''%%80%%'' ''%%0x80007A00%%'' ''%%2%%''|unsigned   |FMC 1 status LED select            ''%%0x0%%''+
-|  ''%%81%%'' ''%%0x80007A20%%'' ''%%3%%''|unsigned   |FMC 1 status LED value      |        ''%%0x7%%''+
-|  ''%%82%%'' ''%%0x80007A40%%'' ''%%5%%''|unsigned   |FMC 1 SPI chip selec        |       ''%%0x0F%%''+
-|  ''%%83%%'' ''%%0x80007A60%%'' ''%%1%%''|binary     |FMC 1 SPI read/write        |          ''%%0%%''+
-|  ''%%84%%'' ''%%0x80007A80%%'' ''%%8%%''|unsigned   |FMC 1 SPI address                 ''%%0x00%%''+
-|  ''%%85%%'' ''%%0x80007AA0%%'' ''%%8%%''|unsigned   |FMC 1 SPI write data        |       ''%%0x00%%''+
-|  ''%%86%%'' ''%%0x80007AC0%%'' ''%%1%%''|binary     |FMC 1 SPI trigger                    ''%%0%%''+
-|  ''%%87%%'' ''%%0x80007AE0%%'' ''%%1%%''|binary     |FMC 1 ADC rstn              |          ''%%1%%''+
-|  ''%%88%%'' ''%%0x80007B00%%'' ''%%1%%''|binary     |FMC 1 I2C read/write        |          ''%%0%%''+
-|  ''%%89%%'' ''%%0x80007B20%%'' ''%%7%%''|unsigned   |FMC 1 I2C device address    |       ''%%0x49%%''+
-|  ''%%90%%'' ''%%0x80007B40%%'' ''%%8%%''|unsigned   |FMC 1 I2C register address  |       ''%%0x00%%''+
-|  ''%%91%%'' ''%%0x80007B60%%'' ''%%8%%''|unsigned   |FMC 1 I2C write data        |       ''%%0x00%%''+
-|  ''%%92%%'' ''%%0x80007B80%%'' ''%%1%%''|binary     |FMC 1 I2C trigger                    ''%%0%%''+
-|  ''%%93%%'' ''%%0x80007BA0%%'' ''%%1%%''|binary     |FMC 1 PLL rstn              |          ''%%1%%''+
-|  ''%%94%%'' ''%%0x80007BC0%%'' ''%%1%%''|binary     |FMC 1 clock switch select            ''%%1%%''+
-|  ''%%95%%'' ''%%0x80007BE0%%'' ''%%1%%''|binary     |FMC 1 VCXO output enable    |          ''%%1%%''|+
  
-**Table 7.1:** List of additional configuration registers part 1+^        index^             address^        bits^radix     ^description                          ^      default value^ 
 +|    ''%%0%%'' ''%%0x00000400%%'' ''%%16%%''|signed    |ADC 0 offset correction summand      |     ''%%0x0000%%''
 +|    ''%%1%%'' ''%%0x00000408%%'' ''%%16%%''|signed    |ADC 1 offset correction summand      |     ''%%0x0000%%''
 +|    ''%%2%%'' ''%%0x00000410%%'' ''%%16%%''|signed    |ADC 2 offset correction summand      |     ''%%0x0000%%''
 +|    ''%%3%%'' ''%%0x00000418%%'' ''%%16%%''|signed    |ADC 3 offset correction summand      |     ''%%0x0000%%''
 +|    ''%%4%%'' ''%%0x00000420%%'' ''%%16%%''|signed    |ADC 4 offset correction summand      |     ''%%0x0000%%''
 +|    ''%%5%%'' ''%%0x00000428%%'' ''%%16%%''|signed    |ADC 5 offset correction summand      |     ''%%0x0000%%''
 +|    ''%%6%%'' ''%%0x00000430%%'' ''%%16%%''|signed    |ADC 6 offset correction summand      |     ''%%0x0000%%''
 +|    ''%%7%%'' ''%%0x00000438%%'' ''%%16%%''|signed    |ADC 7 offset correction summand      |     ''%%0x0000%%''
 +|    ''%%8%%'' ''%%0x00000440%%'' ''%%16%%''|unsigned  |ADC 0 gain correction factor             ''%%0x8000%%''
 +|    ''%%9%%'' ''%%0x00000448%%'' ''%%16%%''|unsigned  |ADC gain correction factor             ''%%0x8000%%''
 +|   ''%%10%%'' ''%%0x00000450%%'' ''%%16%%''|unsigned  |ADC 2 gain correction factor             ''%%0x8000%%''
 +|   ''%%11%%'' ''%%0x00000458%%'' ''%%16%%''|unsigned  |ADC 3 gain correction factor             ''%%0x8000%%''
 +|   ''%%12%%'' ''%%0x00000460%%'' ''%%16%%''|unsigned  |ADC 4 gain correction factor             ''%%0x8000%%''
 +|   ''%%13%%'' ''%%0x00000468%%'' ''%%16%%''|unsigned  |ADC 5 gain correction factor             ''%%0x8000%%''
 +|   ''%%14%%'' ''%%0x00000470%%'' ''%%16%%''|unsigned  |ADC 6 gain correction factor             ''%%0x8000%%''
 +|   ''%%15%%'' ''%%0x00000478%%'' ''%%16%%''|unsigned  |ADC 7 gain correction factor             ''%%0x8000%%''
 +|   ''%%16%%'' ''%%0x00000480%%'' ''%%16%%''|unsigned  |BPM 0 capacitance correction factor  |     ''%%0x8000%%''
 +|   ''%%17%%'' ''%%0x00000488%%'' ''%%16%%''|unsigned  |BPM 1 capacitance correction factor  |     ''%%0x8000%%''
 +|   ''%%18%%'' ''%%0x00000490%%'' ''%%16%%''|unsigned  |BPM 2 capacitance correction factor  |     ''%%0x8000%%''
 +|   ''%%19%%'' ''%%0x00000498%%'' ''%%16%%''|unsigned  |BPM 3 capacitance correction factor  |     ''%%0x8000%%''
 +|   ''%%20%%'' ''%%0x000004A0%%'' ''%%12%%''|unsigned  |BPM linear regression length - 1          ''%%0x3FF%%''
 +|   ''%%21%%'' ''%%0x000004A8%%''  ''%%5%%''|unsigned  |log2 of BPM averaging length               ''%%0x0A%%''
 +|   ''%%22%%'' ''%%0x000004B0%%''  ''%%4%%''|unsigned  |gate signal input select                    ''%%0x0%%''
 +|   ''%%23%%'' ''%%0x000004B8%%''  ''%%4%%''|unsigned  |RF signal input select                      ''%%0x8%%''
 +|   ''%%24%%'' ''%%0x000004C0%%''  ''%%4%%''|unsigned  |intensity normalization exponent            ''%%0x0%%''
 +|   ''%%25%%'' ''%%0x000004C8%%'' ''%%10%%''|unsigned  |moving average filter length - 1     |      ''%%0x000%%''
 +|   ''%%26%%'' ''%%0x000004D0%%''  ''%%4%%''|unsigned  |IIR filter enable                    |        ''%%0x0%%''
 +|   ''%%32%%'' ''%%0x00000500%%'' ''%%26%%''|unsigned  |scope 0 capture length - 1            ''%%0x0000FFF%%''
 +|   ''%%33%%'' ''%%0x00000508%%''  ''%%2%%''|unsigned  |scope 0 trigger mode                        ''%%0x2%%''
 +|   ''%%34%%'' ''%%0x00000510%%''  ''%%1%%''|binary    |scope 0 arm trigger                  |          ''%%0%%''
 +|   ''%%40%%'' ''%%0x00000540%%'' ''%%24%%''|unsigned  |scope 1 capture length - 1             ''%%0x000FFF%%''
 +|   ''%%41%%'' ''%%0x00000548%%''  ''%%2%%''|unsigned  |scope 1 trigger mode                        ''%%0x1%%''
 +|   ''%%42%%'' ''%%0x00000550%%''  ''%%1%%''|binary    |scope 1 arm trigger                  |          ''%%0%%''
 +|   ''%%43%%'' ''%%0x00000558%%''  ''%%1%%''|binary    |scope 1 capture mode                          ''%%0%%''
 +|   ''%%48%%'' ''%%0x00000580%%'' ''%%24%%''|unsigned  |scope 2 capture length - 1             ''%%0x000FFF%%''
 +|   ''%%49%%'' ''%%0x00000588%%''  ''%%2%%''|unsigned  |scope 2 trigger mode                        ''%%0x1%%''
 +|   ''%%50%%'' ''%%0x00000590%%''  ''%%1%%''|binary    |scope 2 arm trigger                  |          ''%%0%%''
 +|   ''%%51%%'' ''%%0x00000598%%''  ''%%1%%''|binary    |scope 2 capture mode                          ''%%0%%''
 +|  ''%%127%%'' ''%%0x000007F8%%''  ''%%1%%''|binary    |reset                                |          ''%%0%%''|
  
-^    **index**^         **address**^    **bits**^**radix**  ^**description**                                     **default value**^ 
-|   ''%%96%%'' ''%%0x80007C00%%''  ''%%5%%''|unsigned   |FMC 0 ADC 0 clock delay                                  ''%%0x0D%%''| 
-|   ''%%97%%'' ''%%0x80007C20%%''  ''%%5%%''|unsigned   |FMC 0 ADC 1 clock delay                                  ''%%0x0D%%''| 
-|   ''%%98%%'' ''%%0x80007C40%%''  ''%%5%%''|unsigned   |FMC 0 ADC 2 clock delay                                  ''%%0x0D%%''| 
-|   ''%%99%%'' ''%%0x80007C60%%''  ''%%5%%''|unsigned   |FMC 0 ADC 3 clock delay                                  ''%%0x0D%%''| 
-|  ''%%100%%'' ''%%0x80007C80%%''  ''%%5%%''|unsigned   |FMC 0 ADC 0 data delay                    |                ''%%0x00%%''| 
-|  ''%%101%%'' ''%%0x80007CA0%%''  ''%%5%%''|unsigned   |FMC 0 ADC 1 data delay                    |                ''%%0x00%%''| 
-|  ''%%102%%'' ''%%0x80007CC0%%''  ''%%5%%''|unsigned   |FMC 0 ADC 2 data delay                    |                ''%%0x00%%''| 
-|  ''%%103%%'' ''%%0x80007CE0%%''  ''%%5%%''|unsigned   |FMC 0 ADC 3 data delay                    |                ''%%0x00%%''| 
-|  ''%%104%%'' ''%%0x80007D00%%''  ''%%5%%''|unsigned   |FMC 1 ADC 0 clock delay                                  ''%%0x0D%%''| 
-|  ''%%105%%'' ''%%0x80007D20%%''  ''%%5%%''|unsigned   |FMC 1 ADC 1 clock delay                                  ''%%0x0D%%''| 
-|  ''%%106%%'' ''%%0x80007D40%%''  ''%%5%%''|unsigned   |FMC 1 ADC 2 clock delay                                  ''%%0x0D%%''| 
-|  ''%%107%%'' ''%%0x80007D60%%''  ''%%5%%''|unsigned   |FMC 1 ADC 3 clock delay                                  ''%%0x0D%%''| 
-|  ''%%108%%'' ''%%0x80007D80%%''  ''%%5%%''|unsigned   |FMC 1 ADC 0 data delay                    |                ''%%0x00%%''| 
-|  ''%%109%%'' ''%%0x80007DA0%%''  ''%%5%%''|unsigned   |FMC 1 ADC 1 data delay                    |                ''%%0x00%%''| 
-|  ''%%110%%'' ''%%0x80007DC0%%''  ''%%5%%''|unsigned   |FMC 1 ADC 2 data delay                    |                ''%%0x00%%''| 
-|  ''%%111%%'' ''%%0x80007DE0%%''  ''%%5%%''|unsigned   |FMC 1 ADC 3 data delay                    |                ''%%0x00%%''| 
-|  ''%%112%%'' ''%%0x80007E20%%''  ''%%1%%''|binary     |AFC LED select                            |                   ''%%0%%''| 
-|  ''%%113%%'' ''%%0x80007E40%%''  ''%%3%%''|unsigned   |AFC LED value                                             ''%%0x7%%''| 
-|  ''%%114%%'' ''%%0x80007E60%%''  ''%%1%%''|binary     |gate override                                               ''%%0%%''| 
-|  ''%%115%%'' ''%%0x80007E80%%''  ''%%1%%''|binary     |gate override value                                         ''%%1%%''| 
-|  ''%%116%%'' ''%%0x80007EC0%%''  ''%%8%%''|unsigned   |MLVDS direction                                          ''%%0x00%%''| 
-|  ''%%117%%'' ''%%0x80007EE0%%''  ''%%8%%''|unsigned   |MLVDS output value                        |                ''%%0x00%%''| 
-|  ''%%118%%'' ''%%0x80007E00%%''  ''%%1%%''|binary     |observer scope mode                                         ''%%1%%''| 
-|  ''%%119%%'' ''%%0x80007EA0%%''  ''%%2%%''|unsigned   |observer valid signal select              |                 ''%%0x0%%''| 
-|  ''%%120%%'' ''%%0x80007F00%%''  ''%%3%%''|unsigned   |observer multiplexer 0 select                             ''%%0x0%%''| 
-|  ''%%121%%'' ''%%0x80007F20%%''  ''%%3%%''|unsigned   |observer multiplexer 1 select                             ''%%0x0%%''| 
-|  ''%%122%%'' ''%%0x80007F40%%'' ''%%27%%''|unsigned   |observer number of samples - 1            |          ''%%0x00000FFF%%''| 
-|  ''%%123%%'' ''%%0x80007F60%%''  ''%%3%%''|unsigned   |observer trigger select                                   ''%%0x0%%''| 
-|  ''%%124%%'' ''%%0x80007F80%%'' ''%%64%%''|unsigned   |observer trigger compare vector (t = -1)  |  ''%%0x0000000000000000%%''| 
-|  ''%%125%%'' ''%%0x80007FA0%%'' ''%%64%%''|unsigned   |observer trigger compare vector (t = 0)    ''%%0x0000000000000000%%''| 
-|  ''%%126%%'' ''%%0x80007FC0%%'' ''%%64%%''|unsigned   |observer trigger compare bit mask          ''%%0xFFFFFFFFFFFFFFFF%%''| 
-|  ''%%127%%'' ''%%0x80007FE0%%''  ''%%1%%''|binary     |observer arm trigger                      |                   ''%%0%%''| 
  
-**Table 7.2:** List of additional configuration registers - part 2+**Table 6.7:** List of configuration registers
  
-=== 39, 47, 55Scope {0, 1, 2continuous trigger ===+== 0 - 7ADC {0 - 7offset correction summand ==
  
-If set to 1, the trigger is armed and will be rearmed automatically after every capture completion.+Correction summand for a possible offset deviation of the ADC. The offset correction precedes the gain correction.
  
-=== 64, 80FMC {0, 1status LED select ===+== 8 - 15ADC {0 - 7gain correction factor ==
  
-There is one tricolor LED on the FMC front panel labeled //status// that can be controlled by the gateware.+Correction factor for a possible gain deviation of the ADC. The default value 0x8000 corresponds to a multiplication by 1. The possible correction range is {{:ds:projects:cryring:bpm:gateware:/math_69644564.png?nolink&0x25}}.
  
-^  value^input                                                                                            ^ +== 16 - 19BPM {0 - 3capacitance correction factor ==
-|      0|ADC clock, blink frequency divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_326299be.png?nolink&0x21}}, green if AD9510 PLL is in lock, otherwise red  | +
-|      1|AD9510 monitoring clock, blink frequency divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_326299be.png?nolink&0x21}}                                   | +
-|   2, 3|static value from register ’status LED value’                                                    |+
  
-=== 65, 81: FMC {0, 1} status LED value ===+The capacitances of the two corresponding capacitor plates of a single BPM can differ. Data is fed unchanged into the BPM algorithmwhile data is multiplied by a correction factor. The default value 0x8000 corresponds to a multiplication by 1. The possible correction range is {{:ds:projects:cryring:bpm:gateware:/math_69644564.png?nolink&0x25}}.
  
-The static lighting pattern defined by this register becomes active if the corresponding register ’status LED select’ is set to 2 or 3.+== 20: BPM linear regression length - 1 ==
  
-^  bit^color +Number of samples over which the linear regression is calculated if no external RF pulse signal is present. This value is valid for all four BPMs. If an external RF pulse signal is present, the result of the linear regression will be output and a new calculation will be started on every rising edge of the RF pulse signal. For this to work, this register has to be set to a value that is longer than the interval between the RF pulses.
-|    0|red    | +
-|    1|green +
-|    2|blue   |+
  
-=== 66, 82FMC {0, 1} SPI cs ===+Allowed values0x002 - 0xFFF
  
-Chip select signals (active high) of the SPI bus to the four ADCs and to the AD9510 PLL and clock distribution.+The lower limit is determined by the throughput of the divider IP core of 1 in 3 clock cycles that is used for the final division of the BPM algorithm.
  
-^  bit^device                      ^ +== 21: Log2 of BPM averaging length ==
-|    0|ADC 0                       | +
-|    1|ADC 1                       | +
-|    2|ADC 2                       | +
-|    3|ADC 3                       | +
-|    4|PLL and clock distribution  |+
  
-=== 67, 83: FMC {0, 1} SPI read/write ===+Dual logarithm of the number of linear regression results over which the averaging is calculated. This value is valid for all four BPMs.
  
-0write mode, 1: read mode+Allowed range0 .. 20. Higher values will be set to the maximum allowed value. This corresponds to an averaging length of 1, 2, 4, … , 1,048,576.
  
-=== 68, 84FMC {0, 1} SPI address ===+== 22Gate signal input select ==
  
-The address of the register that shall be accessed.+^                  value^input                              ^ 
 +|  ''%%0%%'' - ''%%7%%''|MLVDS line 0 - 7 on the backplane 
 +|              ''%%8%%''|FMC 0 //TRIG// input               | 
 +|              ''%%9%%''|FMC 1 //TRIG// input               |
  
-=== 69, 85: FMC {0, 1} SPI write data ===+The gate signal input can be switched between one of the eight MLVDS lines on the backplane and the two MMCX connectors labeled //TRIG// on the FMC front panels.
  
-The data that shall be written to a register.+== 23: RF signal input select ==
  
-=== 70, 86: FMC {01} SPI trigger ===+^                  value^input                              ^ 
 +|  ''%%0%%'' - ''%%7%%''|MLVDS line 0 - 7 on the backplane 
 +|              ''%%8%%''|FMC 0 //TRIG// input               | 
 +|              ''%%9%%''|FMC //TRIG// input               |
  
-Write a 1 to this register to start a read or write access on the SPI bus. The register does not have to be reset to 0 before the next SPI trigger, just write another 1 to it.+The RF signal input can be switched between one of the eight MLVDS lines on the backplane and the two MMCX connectors labeled //TRIG// on the FMC front panels.
  
-=== 71, 87FMC {0, 1} ADC resetn ===+== 24Intensity normalization exponent ==
  
-Low active reset signal to the four ADCs in parallelTie to 0 and back to to initiate a reset.+The intensity calculation in the BPM algorithm is normalized to ensure that no saturation can occurThis leads to small results during normal operation which are susceptible to quantization noise. By means of this register the normalization can be changed to allow larger results.
  
-=== 7288: FMC {0, 1} I2c read/write ===+With each increment of this exponent by onethe result will double. Keep in mind that the result can saturate when setting this value to larger than zero.
  
-0write mode, 1: read mode+== 25Moving average filter length - ==
  
-=== 73, 89: FMC {0, 1} I2C device address ===+The averaging length minus 1 of the moving average filter on the ADC data. All possible values from to 1023 are allowedresulting in an averaging length between and 1024.
  
-The address of the connected VCXO is 0x49.+== 25: IIR filter enable ==
  
-=== 74, 90: FMC {0, 1} I2C register address ===+Bitmask which enables the IIR filter per BPM. The filter is intended to suppress a 70 kHz interference on certain BPMs. Bit enables the filter on the data of ADC 0 and 1bit on the data of ADC 2 and 3 and so on.
  
-The address of the register that shall be accessed.+== 32, 40, 48: Scope {0, 1, 2} capture length - 1 ==
  
-=== 75, 91: FMC {0, 1} I2C write data ===+The number of samples minus one that are stored after a scope has been triggered. Each sample consists of 16 bytes.
  
-The data that shall be written to a register.+Scope 0 can only handle even numbers of samples. Uneven numbers will be automatically handled as the next higher even number. For scopes 1 and 2, also uneven numbers are allowed.
  
-=== 7692FMC {0, 1} I2C trigger ===+== 3341, 49Scope {0, 1, 2} trigger mode ==
  
-Write a to this register to start a read or write access on the I2C bus. The register does not have to be reset to 0 before the next I2C trigger, just write another 1 to it.+^                 value^trigger mode                                                                               ^ 
 +|             ''%%0%%''|trigger on rising edge of gate signal                                                      | 
 +|             ''%%1%%''|trigger on high state of gate signal                                                       | 
 +|  ''%%2%%'', ''%%3%%''|trigger instantly after the trigger is armedindependent of the state of the gate signal  |
  
-=== 7793FMC {0, 1} PLL resetn ===+== 3442, 50Scope {0, 1, 2arm trigger ==
  
-Low active reset signal to the PLL and clock distributionTie to 0 and back to 1 to initiate a reset.+Writing a 1 to this register will arm the trigger onceThe register does not have to be reset to 0 before the next arm trigger, just write another 1 to it. If the corresponding register //continuous trigger// is set to 1, writing to this register does not have any effect.
  
-=== 7894: FMC {0, 1} Clock switch select ===+When in ’waiting for trigger’ state (see status register ’capture status’ in chapter [[#621_status_registers|6.2.1]])writing a to this register will cancel the arming of the trigger and the capture status will change to ’done’.
  
-There is a separate clock switch in front of the AD9510 PLL reference clock input.+== 43, 51: Scope {1, 2} capture mode ==
  
- value^connect to                                                          +     value^capture mode                                                                 
-     0|MMCX connector labeled //REF// on the front panel of the FMC board  | + ''%%0%%''|capture until the number of samples defined by register {40, 48} are stored  | 
-     1|clock output from the FPGA via the FMC connector                    |+ ''%%1%%''|the same, but cancel capturing when the gate signal goes low                 |
  
-=== 79, 95: FMC {0, 1} VCXO output enable ===+A capture mode register is only available for scopes and 2. Scope 0 (for corrected ADC data) always operates in capture mode 0.
  
-Enables the frequency output of the VCXO.+== 127: Reset ==
  
-=== 96 - 99 and 104 - 107: FMC {01} ADC {- 3} clock delay ===+Writing a 1 to this register triggers a reset on the gatewarewhich also resets all configuration registers to their default values.\\ 
 +The reset will be automatically lifted so that the register does not have to be written to after initiating a reset.
  
-There is a configurable input delay for setting the correct digital interface timing for both the clock and the data signals. Increasing this value increases the delay of the clock, so that the data is sampled later.+==== 6.4 Capturing procedure ====
  
-=== 100 - 103 and 108 - 111: FMC {0, 1} ADC {0 - 3} data delay ===+=== 6.4.Known number of samples ===
  
-See above. Increasing this value increases the delay of the data, so that the data is sampled at an earlier position.+A typical procedure for capturing a predefinable number of samples starting from the rising edge of the gate signal is the following:
  
-=== 112AFC LED select ===+  * write the number of samples minus 1 to the configuration register //capture length - 1// 
 +  * write a 0 to the configuration register //trigger mode// 
 +  * write a 0 (default) to the configuration register //capture mode// 
 +  * write a 1 to the configuration register //arm trigger// 
 +  * you can check the status register ’capture status’ for the progress''%%1%%'': rising edge of gate signal not yet detected, ''%%2%%'': capturing is ongoing, ''%%3%%'': capturing completed 
 +  * you can check the current write address by polling the status register //next write address//
  
-There is one tricolor LED at the center of the AFC front panel labeled //L3// that can be controlled by the gateware.+=== 6.4.2 Unknown number of samples ===
  
-^  value^input                                                               ^ +BPM results are only calculated while the gate signal is high. If you want to capture a complete high period of e.g. BPM average samplesthe total number of samples is unknown. Proceed as follows:
-|      0|PCIe reference clockblink frequency divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_326299be.png?nolink&0x21}}, white  | +
-|      1|static value from register 113 ’AFC LED value’                      |+
  
-=== 113: AFC LED value ===+  * write the maximum value 0x1FFFFFF to the configuration register //capture length - 1// 
 +  * write a 0 to the configuration register //trigger mode// 
 +  * write a 1 to the configuration register //capture mode// 
 +  * write a 1 to the configuration register //arm trigger// 
 +  * you can check the status register //capture status// as above 
 +  * the value of the status register //next write address// will be static after completion and indicates how many samples have been captured
  
-Static lighting pattern if register 112 ’AFC LED select’ 1.+===== 7 Extended gateware software interface =====
  
-^  bit^color +Besides the interface documented in chapter [[#6_gateware_software_interface|6]] which is meant for productive use, there is an extended interface for development and debugging purposes. The extended interface is also present in the bitstream by default.
-|    0|red    | +
-|    1|green +
-|    2|blue   |+
  
-=== 114: Gate override ===+While the productive interface is intended to be kept as downward compatible as possible, the extended interface may be subject to major changes during the development process.
  
-For testing purposes without an external gate signal this register can be set to to simulate a gate signal via the register 115 ’gate override value’.+==== 7.Extended register map ====
  
-=== 115: Gate override value ===+=== 7.1.1 Additional status registers ===
  
-Can be used to simulate a gate signal when register 114 ’gate override’ is 1.+The following additional status registers can be read by software:
  
-=== 116: MLVDS direction === +^        index^             address^        bits^radix     ^description                         ^ 
- +|   ''%%64%%'' ''%%0x00000200%%''  ''%%1%%''|binary    |FMC SPI busy                      | 
-Determines the direction of the eight MLVDS lines on the AMC connector. A ’0’ corresponds to an input to the FPGA and a ’1’ to an output from the FPGA. +|   ''%%65%%'' ''%%0x00000208%%''  ''%%8%%''|unsigned  |FMC SPI read data                 | 
- +|   ''%%66%%'' ''%%0x00000210%%''  ''%%1%%''|binary    |FMC 0 I2C busy                      | 
-=== 117: MLVDS output value === +|   ''%%67%%'' ''%%0x00000218%%''  ''%%8%%''|unsigned  |FMC I2C read data                 | 
- +|   ''%%68%%'' ''%%0x00000220%%''  ''%%1%%''|binary    |FMC 0 PLL status                    
-Determines the logic levels of the eight MLVDS lines if they are configured as outputs (see previous register). +  ''%%69%%'' ''%%0x00000228%%'' ''%%38%%''|unsigned  |FMC 0 VCXO initial RFREQ            | 
- +  ''%%70%%''|  ''%%0x00000230%%'' ''%%38%%''|unsigned  |FMC 0 VCXO RFREQ                    
-=== 118: Observer scope mode === +|   ''%%71%%'' ''%%0x00000238%%'' ''%%32%%''|unsigned  |FMC 0 measured ADC clock frequency  | 
- +|   ''%%72%%'' ''%%0x00000240%%'' ''%%32%%''|unsigned  |FMC ADC FIFO underflow counter    | 
-When observer scope mode is 1, scope operates in an easy to use mode for storing ADC data. +|   ''%%73%%'' ''%%0x00000248%%'' ''%%32%%''|unsigned  |FMC 0 ADC FIFO overflow counter     | 
- +|   ''%%80%%'' ''%%0x00000280%%''  ''%%1%%''|binary    |FMC 1 SPI busy                      | 
-Setting this register to enables additional functionality like combining and choosing different signals to store and a more powerful and flexible two-stage trigger. +  ''%%81%%'' ''%%0x00000288%%''  ''%%8%%''|unsigned  |FMC 1 SPI read data                 
- +  ''%%82%%'' ''%%0x00000290%%''  ''%%1%%''|binary    |FMC 1 I2C busy                      
-Registers 119 to 127 are only relevant in non productive mode. +  ''%%83%%'' ''%%0x00000298%%''  ''%%8%%''|unsigned  |FMC I2C read data                 
- +  ''%%84%%'' ''%%0x000002A0%%''  ''%%1%%''|binary    |FMC 1 PLL status                    
-=== 119: Observer valid signal select === +  ''%%85%%'' ''%%0x000002A8%%'' ''%%38%%''|unsigned  |FMC VCXO initial RFREQ            
- +  ''%%86%%'' ''%%0x000002B0%%'' ''%%38%%''|unsigned  |FMC 1 VCXO RFREQ                    
-Determines the data valid input to the observer. Samples are only stored when the valid signal is high. +  ''%%87%%'' ''%%0x000002B8%%'' ''%%32%%''|unsigned  |FMC 1 measured ADC clock frequency  | 
- +  ''%%88%%'' ''%%0x000002C0%%'' ''%%32%%''|unsigned  |FMC 1 ADC FIFO underflow counter    
- value^input                       ^ +  ''%%89%%'' ''%%0x000002C8%%'' ''%%32%%''|unsigned  |FMC ADC FIFO overflow counter     | 
-|   0, 3|constant                  +|   ''%%96%%'' ''%%0x00000300%%'' ''%%16%%''|unsigned  |ADC 0 max peak to peak              | 
-     1|BPM result valid            | +|   ''%%97%%'' ''%%0x00000308%%'' ''%%16%%''|unsigned  |ADC max peak to peak              | 
-     2|BPM averaging result valid  | +|   ''%%98%%'' ''%%0x00000310%%'' ''%%16%%''|unsigned  |ADC 2 max peak to peak              | 
- +|   ''%%99%%'' ''%%0x00000318%%'' ''%%16%%''|unsigned  |ADC 3 max peak to peak              | 
-=== 120, 121: Observer multiplexer {0, 1} select === +|  ''%%100%%'' ''%%0x00000320%%'' ''%%16%%''|unsigned  |ADC 4 max peak to peak              | 
- +|  ''%%101%%'' ''%%0x00000328%%'' ''%%16%%''|unsigned  |ADC 5 max peak to peak              | 
-The observer stores samples that are 128 bits wide, which consist of two concatenated 64 bits wide multiplexer outputs. Each multiplexer can choose between eight different input vectors. Like this, each signal can be observed in parallel to any other signal. +|  ''%%102%%'' ''%%0x00000330%%'' ''%%16%%''|unsigned  |ADC 6 max peak to peak              | 
- +|  ''%%103%%'' ''%%0x00000338%%'' ''%%16%%''|unsigned  |ADC max peak to peak              | 
- value^input vector(64 bits)                                    ^ +|  ''%%111%%'' ''%%0x00000378%%''  ''%%1%%''|binary    |SDRAM initial calibration complete  |
-     0|corrected ADC data of ADCs 0 - 3                         +
-     1|corrected ADC data of ADCs 4 - 7                         +
-     2|BPM 0 and result, additional information               +
-     3|BPM 2 and 3 result, additional information               +
-     4|BPM 0 and averaging result, additional information     +
-     5|BPM 2 and 3 averaging result, additional information     +
-     6|SPI and I2C signals, MLVDS signals, FMC trigger signals  | +
-     7|test counter                                             +
- +
-For a detailed description of the input vectors see [[#4102_observer|chapter 4.10.2]]. +
- +
-=== 122: Observer number of samples - === +
- +
-The number of samples minus one that are stored after the observer has been triggered. Each sample consists of 16 bytes. +
- +
-=== 123: Observer trigger select === +
- +
-Analog to register 120 and 121. Determines on which observer input vector the trigger listens. +
- +
-=== 124: Observer trigger compare vector (t = -1) === +
- +
-64 bit wide compare vector that is compared with the observer input vector determined by register 123 ’observer trigger select’. If the two pattern match, the next sample will be compared to the compare vector determined by register 125: ’trigger compare vector (t = 0)’. +
- +
-=== 125: Observer trigger compare vector (t = -1) === +
- +
-See above. If the patterns do not match, the next sample will be compared to the compare vector determined by register 124: ’trigger compare vector (t = -1)’. If the patterns match the data acquisition is triggered. +
- +
-=== 126: Observer trigger compare bit mask === +
- +
-Determines which bits of the input vector shall be compared with that of the compare vectors. Valid for both trigger compare vectors (registers 124 and 125). For triggering, the patterns must match for all bits whose bit mask is 1. +
- +
-=== 126: Observer arm trigger === +
- +
-Starts the comparing process. Data is captured if the patterns defined by the previous three registers match. +
- +
-==== 7.1.2 Additional status registers ==== +
- +
-The following additional status registers can be read by software:+
  
-^    **index**^         **address**^    **bits**^**radix**  ^**description**                     ^ 
-|   ''%%64%%'' ''%%0x80008800%%''  ''%%1%%''|binary     |FMC 0 SPI busy                      | 
-|   ''%%65%%'' ''%%0x80008820%%''  ''%%8%%''|unsigned   |FMC 0 SPI read data                 | 
-|   ''%%66%%'' ''%%0x80008840%%''  ''%%1%%''|binary     |FMC 0 I2C busy                      | 
-|   ''%%67%%'' ''%%0x80008860%%''  ''%%8%%''|unsigned   |FMC 0 I2C read data                 | 
-|   ''%%68%%'' ''%%0x80008880%%''  ''%%1%%''|binary     |FMC 0 PLL status                    | 
-|   ''%%69%%'' ''%%0x800088A0%%'' ''%%38%%''|unsigned   |FMC 0 VCXO initial RFREQ            | 
-|   ''%%70%%'' ''%%0x800088C0%%'' ''%%38%%''|unsigned   |FMC 0 VCXO RFREQ                    | 
-|   ''%%71%%'' ''%%0x800088E0%%'' ''%%32%%''|unsigned   |FMC 0 measured ADC clock frequency  | 
-|   ''%%72%%'' ''%%0x80008900%%'' ''%%32%%''|unsigned   |FMC 0 ADC FIFO underflow counter    | 
-|   ''%%73%%'' ''%%0x80008920%%'' ''%%32%%''|unsigned   |FMC 0 ADC FIFO overflow counter     | 
-|   ''%%80%%'' ''%%0x80008A00%%''  ''%%1%%''|binary     |FMC 1 SPI busy                      | 
-|   ''%%81%%'' ''%%0x80008A20%%''  ''%%8%%''|unsigned   |FMC 1 SPI read data                 | 
-|   ''%%82%%'' ''%%0x80008A40%%''  ''%%1%%''|binary     |FMC 1 I2C busy                      | 
-|   ''%%83%%'' ''%%0x80008A60%%''  ''%%8%%''|unsigned   |FMC 1 I2C read data                 | 
-|   ''%%84%%'' ''%%0x80008A80%%''  ''%%1%%''|binary     |FMC 1 PLL status                    | 
-|   ''%%85%%'' ''%%0x80008AA0%%'' ''%%38%%''|unsigned   |FMC 1 VCXO initial RFREQ            | 
-|   ''%%86%%'' ''%%0x80008AC0%%'' ''%%38%%''|unsigned   |FMC 1 VCXO RFREQ                    | 
-|   ''%%87%%'' ''%%0x80008AE0%%'' ''%%32%%''|unsigned   |FMC 1 measured ADC clock frequency  | 
-|   ''%%88%%'' ''%%0x80008B00%%'' ''%%32%%''|unsigned   |FMC 1 ADC FIFO underflow counter    | 
-|   ''%%89%%'' ''%%0x80008B20%%'' ''%%32%%''|unsigned   |FMC 1 ADC FIFO overflow counter     | 
-|   ''%%96%%'' ''%%0x80008C00%%'' ''%%16%%''|unsigned   |ADC 0 max peak to peak              | 
-|   ''%%97%%'' ''%%0x80008C20%%'' ''%%16%%''|unsigned   |ADC 1 max peak to peak              | 
-|   ''%%98%%'' ''%%0x80008C40%%'' ''%%16%%''|unsigned   |ADC 2 max peak to peak              | 
-|   ''%%99%%'' ''%%0x80008C60%%'' ''%%16%%''|unsigned   |ADC 3 max peak to peak              | 
-|  ''%%100%%'' ''%%0x80008C80%%'' ''%%16%%''|unsigned   |ADC 4 max peak to peak              | 
-|  ''%%101%%'' ''%%0x80008CA0%%'' ''%%16%%''|unsigned   |ADC 5 max peak to peak              | 
-|  ''%%102%%'' ''%%0x80008CC0%%'' ''%%16%%''|unsigned   |ADC 6 max peak to peak              | 
-|  ''%%103%%'' ''%%0x80008CE0%%'' ''%%16%%''|unsigned   |ADC 7 max peak to peak              | 
-|  ''%%111%%'' ''%%0x80008DE0%%''  ''%%1%%''|binary     |SDRAM initial calibration complete  | 
-|  ''%%124%%'' ''%%0x80008F80%%''  ''%%1%%''|binary     |observer triggered                  | 
-|  ''%%125%%'' ''%%0x80008FA0%%''  ''%%1%%''|binary     |observer capture busy               | 
-|  ''%%126%%'' ''%%0x80008FC0%%'' ''%%32%%''|unsigned   |build timestamp                     | 
  
-**Table 7.3:** List of additional status registers+**Table 7.1:** List of additional status registers
  
-=== 64, 80: FMC {0, 1} SPI busy ===+== 64, 80: FMC {0, 1} SPI busy ==
  
 Indicates that a SPI read or write access is going on. The value of this register has to be checked to be 0 before triggering a SPI access. Indicates that a SPI read or write access is going on. The value of this register has to be checked to be 0 before triggering a SPI access.
  
-=== 65, 81: FMC {0, 1} SPI read data ===+== 65, 81: FMC {0, 1} SPI read data ==
  
 Contains the result of a read access to a SPI register. Contains the result of a read access to a SPI register.
  
-=== 66, 82: FMC {0, 1} I2C busy ===+== 66, 82: FMC {0, 1} I2C busy ==
  
 Indicates that an I2C read or write access is going on. The value of this register has to be checked to be 0 before triggering an I2C access. Indicates that an I2C read or write access is going on. The value of this register has to be checked to be 0 before triggering an I2C access.
  
-=== 67, 83: FMC {0, 1} I2C read data ===+== 67, 83: FMC {0, 1} I2C read data ==
  
 Contains the result of a read access to an I2C register. Contains the result of a read access to an I2C register.
  
-=== 68, 84: FMC {0, 1} PLL status ===+== 68, 84: FMC {0, 1} PLL status ==
  
 Value of the configurable output pin //status// of the AD9510 PLL and clock distribution IC. By default this pin indicates lock status of the PLL. Value of the configurable output pin //status// of the AD9510 PLL and clock distribution IC. By default this pin indicates lock status of the PLL.
  
-=== 69, 85: FMC {0, 1} VCXO initial RFREQ ===+== 69, 85: FMC {0, 1} VCXO initial RFREQ ==
  
-//RFREQ// is a factory calibrated multiplicator to the XTAL frequency of the Si571 programmable VCXO. Before the programming of a new output frequency this value has to be read (see [[#31_si571_programmable_vcxo|chapter 3.1]]).+//RFREQ// is a factory calibrated multiplicator to the XTAL frequency of the Si571 programmable VCXO. Before the programming of a new output frequency this value has to be read (see chapter [[#41_si571_programmable_vcxo|4.1]]).
  
-=== 69, 86: FMC {0, 1} VCXO RFREQ ===+== 69, 86: FMC {0, 1} VCXO RFREQ ==
  
-The VCXO output frequency is programmed to 125 MHz by the gateware. This register holds the value of //RFREQ// that has been programmed (see [[#31_si571_programmable_vcxo|chapter 3.1]]).+The VCXO output frequency is programmed to 125 MHz by the gateware. This register holds the value of //RFREQ// that has been programmed (see chapter [[#41_si571_programmable_vcxo|4.1]]).
  
-=== 71, 87: FMC {0, 1} measured ADC clock frequency ===+== 71, 87: FMC {0, 1} measured ADC clock frequency ==
  
 The ADC clock is measured against the main processing clock. This register holds the number of detected ADC clock cycles during 1 second of the main processing clock. The ADC clock is measured against the main processing clock. This register holds the number of detected ADC clock cycles during 1 second of the main processing clock.
  
-=== 72, 88: FMC {0, 1} ADC FIFO underflow counter ===+== 72, 88: FMC {0, 1} ADC FIFO underflow counter ==
  
 If the ADC clock is slower than the main processing clock, samples will be repeated by the clock domain crossing FIFO output logic. For each repetition the underflow counter will be incremented by 1. If the ADC clock is slower than the main processing clock, samples will be repeated by the clock domain crossing FIFO output logic. For each repetition the underflow counter will be incremented by 1.
  
-=== 73, 89: FMC {0, 1} ADC FIFO underflow counter ===+== 73, 89: FMC {0, 1} ADC FIFO underflow counter ==
  
 If the ADC clock is faster than the main processing clock, samples will discarded by the clock domain crossing FIFO input logic. For each discarded sample the overflow counter will be incremented by 1. If the ADC clock is faster than the main processing clock, samples will discarded by the clock domain crossing FIFO input logic. For each discarded sample the overflow counter will be incremented by 1.
  
-=== {96 - 103}: ADC {0 - 7} max peak to peak ===+== {96 - 103}: ADC {0 - 7} max peak to peak ==
  
 The maximum and the minimum value of the ADC data is determined over a free running period of 1 second. This register contains the difference of the maximum and the minimum value. The maximum and the minimum value of the ADC data is determined over a free running period of 1 second. This register contains the difference of the maximum and the minimum value.
  
-=== 111: SDRAM initial calibration complete ===+== 111: SDRAM initial calibration complete ==
  
 The communication to the SDRAM is controlled by an IP core by Xilinx which performs a timing calibration at start up. The value of this register will be 1 after completion of the initial calibration. The communication to the SDRAM is controlled by an IP core by Xilinx which performs a timing calibration at start up. The value of this register will be 1 after completion of the initial calibration.
  
-=== 124: observer triggered ===+=== 7.1.2 Additional configuration registers ===
  
-Indicates that the observer has been triggered.+The following additional registers can be written by software:
  
-=== 125: observer capture busy ===+^       index^             address^       bits^radix     ^description                  default value^ 
 +|  ''%%27%%'' ''%%0x000004D8%%'' ''%%1%%''|binary    |ADC test data enable        |      ''%%0%%''
 +|  ''%%39%%'' ''%%0x00000538%%'' ''%%1%%''|binary    |scope 0 continuous trigger  |      ''%%0%%''
 +|  ''%%47%%'' ''%%0x00000578%%'' ''%%1%%''|binary    |scope 1 continuous trigger  |      ''%%0%%''
 +|  ''%%55%%'' ''%%0x000005B8%%'' ''%%1%%''|binary    |scope 2 continuous trigger  |      ''%%0%%''
 +|  ''%%56%%'' ''%%0x000005C0%%'' ''%%1%%''|binary    |AFC LED select              |      ''%%0%%''
 +|  ''%%57%%'' ''%%0x000005C8%%'' ''%%3%%''|unsigned  |AFC LED value                  ''%%0x7%%''
 +|  ''%%58%%'' ''%%0x000005D0%%'' ''%%1%%''|binary    |gate override                    ''%%0%%''
 +|  ''%%59%%'' ''%%0x000005D8%%'' ''%%1%%''|binary    |gate override value              ''%%1%%''
 +|  ''%%60%%'' ''%%0x000005E0%%'' ''%%8%%''|unsigned  |MLVDS direction               ''%%0x00%%''
 +|  ''%%61%%'' ''%%0x000005E8%%'' ''%%8%%''|unsigned  |MLVDS output value          |   ''%%0x00%%''
 +|  ''%%64%%'' ''%%0x00000600%%'' ''%%2%%''|unsigned  |FMC 0 status LED select        ''%%0x0%%''
 +|  ''%%65%%'' ''%%0x00000608%%'' ''%%3%%''|unsigned  |FMC 0 status LED value      |    ''%%0x7%%''
 +|  ''%%66%%'' ''%%0x00000610%%'' ''%%5%%''|unsigned  |FMC 0 SPI chip select         ''%%0x0F%%''
 +|  ''%%67%%'' ''%%0x00000618%%'' ''%%1%%''|binary    |FMC 0 SPI read/write        |      ''%%0%%''
 +|  ''%%68%%'' ''%%0x00000620%%'' ''%%8%%''|unsigned  |FMC 0 SPI address             ''%%0x00%%''
 +|  ''%%69%%'' ''%%0x00000628%%'' ''%%8%%''|unsigned  |FMC 0 SPI write data        |   ''%%0x00%%''
 +|  ''%%70%%'' ''%%0x00000630%%'' ''%%1%%''|binary    |FMC 0 SPI trigger                ''%%0%%''
 +|  ''%%71%%'' ''%%0x00000638%%'' ''%%1%%''|binary    |FMC 0 ADC resetn            |      ''%%1%%''
 +|  ''%%72%%'' ''%%0x00000630%%'' ''%%1%%''|binary    |FMC 0 I2C read/write        |      ''%%0%%''
 +|  ''%%73%%'' ''%%0x00000638%%'' ''%%7%%''|unsigned  |FMC 0 I2C device address    |   ''%%0x49%%''
 +|  ''%%74%%'' ''%%0x00000650%%'' ''%%8%%''|unsigned  |FMC 0 I2C register address  |   ''%%0x00%%''
 +|  ''%%75%%'' ''%%0x00000658%%'' ''%%8%%''|unsigned  |FMC 0 I2C write data        |   ''%%0x00%%''
 +|  ''%%76%%'' ''%%0x00000660%%'' ''%%1%%''|binary    |FMC 0 I2C trigger                ''%%0%%''
 +|  ''%%77%%'' ''%%0x00000668%%'' ''%%1%%''|binary    |FMC 0 PLL resetn            |      ''%%1%%''
 +|  ''%%78%%'' ''%%0x00000670%%'' ''%%1%%''|binary    |FMC 0 clock switch select        ''%%1%%''
 +|  ''%%79%%'' ''%%0x00000678%%'' ''%%1%%''|binary    |FMC 0 VCXO output enable    |      ''%%1%%''
 +|  ''%%80%%'' ''%%0x00000680%%'' ''%%2%%''|unsigned  |FMC 1 status LED select        ''%%0x0%%''
 +|  ''%%81%%'' ''%%0x00000688%%'' ''%%3%%''|unsigned  |FMC 1 status LED value      |    ''%%0x7%%''
 +|  ''%%82%%'' ''%%0x00000690%%'' ''%%5%%''|unsigned  |FMC 1 SPI chip selec        |   ''%%0x0F%%''
 +|  ''%%83%%'' ''%%0x00000698%%'' ''%%1%%''|binary    |FMC 1 SPI read/write        |      ''%%0%%''
 +|  ''%%84%%'' ''%%0x000006A0%%'' ''%%8%%''|unsigned  |FMC 1 SPI address             ''%%0x00%%''
 +|  ''%%85%%'' ''%%0x000006A8%%'' ''%%8%%''|unsigned  |FMC 1 SPI write data        |   ''%%0x00%%''
 +|  ''%%86%%'' ''%%0x000006B0%%'' ''%%1%%''|binary    |FMC 1 SPI trigger                ''%%0%%''
 +|  ''%%87%%'' ''%%0x000006B8%%'' ''%%1%%''|binary    |FMC 1 ADC rstn              |      ''%%1%%''
 +|  ''%%88%%'' ''%%0x000006C0%%'' ''%%1%%''|binary    |FMC 1 I2C read/write        |      ''%%0%%''
 +|  ''%%89%%'' ''%%0x000006C8%%'' ''%%7%%''|unsigned  |FMC 1 I2C device address    |   ''%%0x49%%''
 +|  ''%%90%%'' ''%%0x000006D0%%'' ''%%8%%''|unsigned  |FMC 1 I2C register address  |   ''%%0x00%%''
 +|  ''%%91%%'' ''%%0x000006D8%%'' ''%%8%%''|unsigned  |FMC 1 I2C write data        |   ''%%0x00%%''
 +|  ''%%92%%'' ''%%0x000006E0%%'' ''%%1%%''|binary    |FMC 1 I2C trigger                ''%%0%%''
 +|  ''%%93%%'' ''%%0x000006E8%%'' ''%%1%%''|binary    |FMC 1 PLL rstn              |      ''%%1%%''
 +|  ''%%94%%'' ''%%0x000006F0%%'' ''%%1%%''|binary    |FMC 1 clock switch select        ''%%1%%''
 +|  ''%%95%%'' ''%%0x000006F8%%'' ''%%1%%''|binary    |FMC 1 VCXO output enable    |      ''%%1%%''|
  
-Indicates that a capturing process is ongoing. 
  
-=== 126build timestamp ===+**Table 7.2:** List of additional configuration registers - part 1
  
-Time when the bitstream was created. This information can be used to identify the gateware version (together with the Git commit information documented in [[#723_gateware_information|chapter 7.2.3]]).+^        index^             address^       bits^radix     ^description              ^  default value^ 
 +  ''%%96%%'' ''%%0x00000700%%'' ''%%5%%''|unsigned  |FMC 0 ADC 0 clock delay  |   ''%%0x0D%%''
 +|   ''%%97%%'' ''%%0x00000708%%'' ''%%5%%''|unsigned  |FMC 0 ADC 1 clock delay  |   ''%%0x0D%%''
 +|   ''%%98%%'' ''%%0x00000710%%'' ''%%5%%''|unsigned  |FMC 0 ADC clock delay  |   ''%%0x0D%%''
 +|   ''%%99%%'' ''%%0x00000718%%'' ''%%5%%''|unsigned  |FMC 0 ADC clock delay  |   ''%%0x0D%%''
 +|  ''%%100%%'' ''%%0x00000720%%'' ''%%5%%''|unsigned  |FMC 0 ADC 0 data delay     ''%%0x00%%''
 +|  ''%%101%%'' ''%%0x00000728%%'' ''%%5%%''|unsigned  |FMC 0 ADC 1 data delay     ''%%0x00%%''
 +|  ''%%102%%'' ''%%0x00000730%%'' ''%%5%%''|unsigned  |FMC 0 ADC 2 data delay     ''%%0x00%%''
 +|  ''%%103%%'' ''%%0x00000738%%'' ''%%5%%''|unsigned  |FMC 0 ADC 3 data delay     ''%%0x00%%''
 +|  ''%%104%%'' ''%%0x00000730%%'' ''%%5%%''|unsigned  |FMC 1 ADC 0 clock delay  |   ''%%0x0D%%''
 +|  ''%%105%%'' ''%%0x00000738%%'' ''%%5%%''|unsigned  |FMC 1 ADC 1 clock delay  |   ''%%0x0D%%''
 +|  ''%%106%%'' ''%%0x00000750%%'' ''%%5%%''|unsigned  |FMC 1 ADC 2 clock delay  |   ''%%0x0D%%''
 +|  ''%%107%%'' ''%%0x00000758%%'' ''%%5%%''|unsigned  |FMC 1 ADC 3 clock delay  |   ''%%0x0D%%''
 +|  ''%%108%%'' ''%%0x00000760%%'' ''%%5%%''|unsigned  |FMC 1 ADC 0 data delay     ''%%0x00%%''
 +|  ''%%109%%'' ''%%0x00000768%%'' ''%%5%%''|unsigned  |FMC 1 ADC 1 data delay     ''%%0x00%%''
 +|  ''%%110%%'' ''%%0x00000770%%'' ''%%5%%''|unsigned  |FMC 1 ADC 2 data delay     ''%%0x00%%''
 +|  ''%%111%%'' ''%%0x00000778%%'' ''%%5%%''|unsigned  |FMC 1 ADC 3 data delay     ''%%0x00%%''|
  
-Format: 
  
-^     bits^information                          ^ +**Table 7.3:** List of additional configuration registers part 2
-|    0 - 5|seconds                              | +
-|   6 - 11|minutes                              | +
-|  12 - 16|hours                                | +
-|  17 - 22|last two decimal digits of the year  | +
-|  23 - 26|month                                | +
-|  27 31|day                                  |+
  
-===== 7.2 Architecture information storage =====+== 17: ADC test data enable ==
  
-The first seven eights of the Block RAM (see memory mapping, table 6.1) are used to store information about the observer signalsthe registers and the gateware version.+If set to 1all eight ADC data inputs will be overridden by a counter value which is incremented by 1 every 125 MHz clock cycle.
  
-==== 7.2.Observer signal information ====+== 39, 47, 55: Scope {0, 1, 2} continuous trigger ==
  
-Information about the signals connected to the eight observer multiplexer inputs is stored in the first half of the Block RAMFollowing information is stored for every bit of each of the eight 64 bits wide multiplexer inputs:+If set to 1, the trigger is armed and will be rearmed automatically after every capture completion.
  
-  * name of signal (30 bytes) +== 56: AFC LED select ==
-  * display type of signal (1 byte) +
-  * bit index in signal (1 byte)+
  
-^         **address**^  **multiplexer input**  ^**bytes 0 - 29**  ^**byte 30**               ^**byte 31**            ^ +There is one tricolor LED at the center of the AFC front panel labeled //L3// that can be controlled by the gateware.
-|  ''%%0x80000000%%''           0            |name of signal A  |display type of signal A  |0                      | +
-|  ''%%0x80000020%%''           0            |name of signal A  |display type of signal A  |1                      | +
-|                   …|            …            |…                 |…                         |width - 1 of signal A  | +
-|  ''%%0x80000XXX%%''           0            |name of signal B  |display type of signal B  |0                      | +
-|  ''%%0x80000XXX%%''           0            |name of signal B  |display type of signal B  |1                      | +
-|                   …|            …            |…                 |…                         |width - 1 of signal B  | +
-|                   …|            …            |…                 |…                         |…                      | +
-|  ''%%0x80000800%%''           1            |name of signal C  |display type of signal C  |0                      | +
-|  ''%%0x80000820%%''           1            |name of signal C  |display type of signal C  |1                      | +
-|                   …|            …            |…                 |…                         |width - 1 of signal C  | +
-|  ''%%0x80000XXX%%''           1            |name of signal D  |display type of signal D  |0                      | +
-|  ''%%0x80000XXX%%''           1            |name of signal D  |display type of signal D  |1                      | +
-|                   …|            …            |…                 |…                         |width - 1 of signal D  | +
-|                   …|            …            |…                 |…                         |…                      | +
-|  ''%%0x80003FE0%%''           7            |name of signal X  |display type of signal X  |width - 1 of signal X  |+
  
-**Table 7.4:** Observer signal information storage format+^      value^input                                                               ^ 
 +|  ''%%0%%''|PCIe reference clock, blink frequency divided by {{:ds:projects:cryring:bpm:gateware:/math_326299be.png?nolink&0x21}}, white  | 
 +|  ''%%1%%''|static value from register 113 ’AFC LED value’                      |
  
-Table 7.4 shows the storage format of the 512 entries, each of which has a width of 32 bytes. The coding of the display type byte is the following:+== 57AFC LED value ==
  
-^  value^display type  ^ +Static lighting pattern if register 112 ’AFC LED select’ = 1.
-|      0|hexadecimal   | +
-|      1|signed        | +
-|      2|unsigned      | +
-|      3|binary        | +
-|      4|analog        |+
  
-The names are stored as ASCII strings. If a name is shorter than 30 bytes, the remaining bytes are filled with Null characters.+^  bit^color 
 +|    0|red    | 
 +|    1|green 
 +|    2|blue   |
  
-The observer signal information is used by the FPGA Observer software to display the observer signals in the Data Acquisition tab (see [[#813_data_acquisition_tab|chapter 8.1.3]]). The information is also used to format the measurement data to be displayed by GTKWave.+== 58: Gate override ==
  
-==== 7.2.2 Register information ====+For testing purposes without an external gate signal this register can be set to 1 to simulate a gate signal via the register 115 ’gate override value’.
  
-Information about the 128 configuration registers and the 128 status registers is stored in the third quarter of the Block RAM. Following information is stored for every register:+== 59Gate override value ==
  
-  * name of register (31 bytes) +Can be used to simulate a gate signal when register 114 ’gate override’ is 1.
-  * number of bits (byte)+
  
-^         **address**^**bytes 0 - 30**                    ^**byte 31**                          ^ +== 60: MLVDS direction ==
-|  ''%%0x80004000%%''|name of configuration register 0    |width of configuration register 0    | +
-|  ''%%0x80004020%%''|name of configuration register 1    |width of configuration register 1    | +
-|                   …|…                                   |…                                    | +
-|  ''%%0x80004FE0%%''|name of configuration register 127  |width of configuration register 127  | +
-|  ''%%0x80005000%%''|name of status register 0           |width of status register 0           | +
-|  ''%%0x80005020%%''|name of status register 1           |width of status register 1           | +
-|                   …|…                                   |…                                    | +
-|  ''%%0x80005FE0%%''|name of status register 127         |width of status register 127         |+
  
-**Table 7.5:** Register information storage format+Determines the direction of the eight MLVDS lines on the AMC connector. A ’0’ corresponds to an input to the FPGA and a ’1’ to an output from the FPGA.
  
-Table 7.5 shows the storage format of the 256 entries, each of which has a width of 32 bytes. The names are stored as ASCII strings. If a name is shorter than 31 bytes, the remaining bytes are filled with Null characters. If not all registers are in use, a width of 0 bits indicates that a register is not present.+== 61: MLVDS output value ==
  
-The register information is used by the FPGA Observer software to display the registers in the Register Access tab (see [[#812_register_access_tab|chapter 8.1.2]]).+Determines the logic levels of the eight MLVDS lines if they are configured as outputs (see previous register).
  
-==== 7.2.3 Gateware information ====+== 64, 80: FMC {0, 1} status LED select ==
  
-The address range from 0x80006000 to 0x80006FFF is used to store information about the gateware version. The information is stored as an ASCII string of variable length (maximum 4 kiB), which is assembled from information from the Git repository. It contains the URL of the remote server of the Git repository, the latest commit hash and the latest commit date.+There is one tricolor LED on the FMC front panel labeled //status// that can be controlled by the gateware.
  
-The gateware information is used by the FPGA Observer software to display the information in the Gateware Information tab (see [[#817_gateware_information_tab|chapter 8.1.7]])except from the bitstream generation date, which is read from status register 126 build timestamp.+^                 value^input                                                                                            ^ 
 +|             ''%%0%%''|ADC clock, blink frequency divided by {{:ds:projects:cryring:bpm:gateware:/math_326299be.png?nolink&0x21}}, green if AD9510 PLL is in lock, otherwise red  | 
 +|             ''%%1%%''|AD9510 monitoring clock, blink frequency divided by {{:ds:projects:cryring:bpm:gateware:/math_326299be.png?nolink&0x21}}                                   | 
 +|  ''%%2%%''''%%3%%''|static value from register ’status LED value’                                                    |
  
-====== 8 Test software ======+== 65, 81: FMC {0, 1} status LED value ==
  
-===== 8.1 FPGA Observer =====+The static lighting pattern defined by this register becomes active if the corresponding register ’status LED select’ is set to 2 or 3.
  
-There is a graphical test software intended to be run on the CPU unit. It is implemented in Python using the GTK 3 GUI toolkit.+^  bit^color 
 +|    0|red    | 
 +|    1|green 
 +|    2|blue   |
  
-==== 8.1.1 Installation and usage ====+== 66, 82: FMC {0, 1} SPI cs ==
  
-The sources and an installation script can be found under ''%%src/software/fpga_observer/%%'' in the //Cryring_BPM_Gateware// Git repository.+Chip select signals (active high) of the SPI bus to the four ADCs and to the AD9510 PLL and clock distribution.
  
-=== Installation ===+^  bit^device                      ^ 
 +|    0|ADC 0                       | 
 +|    1|ADC 1                       | 
 +|    2|ADC 2                       | 
 +|    3|ADC 3                       | 
 +|    4|PLL and clock distribution  |
  
-Connect to the CPU unit e.g. via ssh. Clone the //Cryring_BPM_Gateware// Git repository:+== 67, 83: FMC {0, 1} SPI read/write ==
  
-''%%git clone git@git.gsi.de:BEA_HDL/Cryring_BPM_Gateware.git%%''+0write mode, 1: read mode
  
-Install the PCIe driver:+== 68, 84FMC {0, 1} SPI address ==
  
-''%%cd src/software/pcie_driver%%''\\ +The address of the register that shall be accessed.
-''%%sudo ./install.sh%%''+
  
-Install the FPGA Observer software:+== 69, 85FMC {0, 1} SPI write data ==
  
-''%%cd ../fpga_observer%%''\\ +The data that shall be written to a register.
-''%%sudo ./install.sh%%''+
  
-{{:ds:projects:cryring:bpm:gateware:documentation:FPGA_Observer_Register_Access.png| FPGA Observer - Register Access tab}}+== 70, 86: FMC {0, 1SPI trigger ==
  
-**Figure 8.1:** FPGA Observer - Register Access tab+Write a 1 to this register to start a read or write access on the SPI busThe register does not have to be reset to 0 before the next SPI trigger, just write another to it.
  
-=== Usage ===+== 71, 87: FMC {0, 1} ADC resetn ==
  
-For the PCIe driver to work, the bitstreams of the FPGAs have to be loaded before powering the CPU unit. If that is not the case, power cycle the CPU unit by pulling out the Hot Swap Handle and pushing it in again. A software reboot does not work.+Low active reset signal to the four ADCs in parallel. Tie to and back to 1 to initiate a reset.
  
-Connect to the CPU unit e.g. via ''%%ssh -X%%'' in order to allow a graphical connection. Start the FPGA Observer software by:+== 72, 88FMC {0, 1} I2c read/write ==
  
-''%%sudo fpga_observer local%%''+0: write mode, 1: read mode
  
-A GUI should open and a choice of FPGA serial numbers should be displayed on the upper left corner. If the list is emptyeither the loading of the FPGAs finished after powering the CPU unit or the PCIe driver did not install correctly. The FPGA serial numbers can be used to identify the AFC board you like to access. Choose a serial number and click //connect//.+== 7389: FMC {0, 1} I2C device address ==
  
-==== 8.1.2 Register Access tab ====+The address of the connected VCXO is 0x49.
  
-The names and widths of the registers are read from an information memory region in the FPGA (see [[#722_register_information|chapter 7.2.2]]). The status registers are displayed on the left and the configuration registers on the right.+== 74, 90: FMC {0, 1} I2C register address ==
  
-The //read// button reads all the status registers either once or continuously if the //continuous// check button is checked. The //write// button writes all the configuration registers whose check buttons next to the write value are checked.+The address of the register that shall be accessed.
  
-==== 8.1.3 Data Acquisition tab ====+== 75, 91: FMC {0, 1} I2C write data ==
  
-The names and widths of the signals connected to the eight observer multiplexer inputs are read from an information memory region in the FPGA (see [[#721_observer_signal_information|chapter 7.2.1]]).+The data that shall be written to a register.
  
-The two combo boxes //Observer 0// and //Observer 1// determine which multiplexer inputs are selected for data acquisition. The combo box //Trigger// determines on which of the observer inputs the trigger will listen.+== 76, 92: FMC {01} I2C trigger ==
  
-{{:ds:projects:cryring:bpm:gateware:documentation:FPGA_Observer_Data_Acquisition.png| FPGA Observer - Data Acquisition tab}}+Write a 1 to this register to start a read or write access on the I2C bus. The register does not have to be reset to 0 before the next I2C trigger, just write another 1 to it.
  
-**Figure 8.2:** FPGA Observer - Data Acquisition tab+== 77, 93FMC {0, 1} PLL resetn ==
  
-The //Number Of Samples// entry determines how many samples will be stored after a trigger event when the //capture// button has been pressedIf the //continuous// check button is checked, the trigger will be rearmed automatically when the data acquisition completes.+Low active reset signal to the PLL and clock distributionTie to 0 and back to 1 to initiate a reset.
  
-The individual //Trigger Active (&)// check buttons define on which signals the trigger will listen. All of the enabled conditions have to become true for a trigger event.+== 78, 94: FMC {0, 1} Clock switch select ==
  
-The trigger conditions for t = -1 and t = 0 contain the compare vectors of the two stage trigger which have to match in consecutive clock cycles. The //Trigger Mask (&)// defines on which bits of a signal the trigger will listen.+There is a separate clock switch in front of the AD9510 PLL reference clock input.
  
-When the data acquisition completes, the open source waveform viewer GTKWave is called to display the captured data, which has been stored to a .vcd file before.+^      value^connect to                                                          ^ 
 +|  ''%%0%%''|MMCX connector labeled //REF// on the front panel of the FMC board  | 
 +|  ''%%1%%''|clock output from the FPGA via the FMC connector                    |
  
-{{:ds:projects:cryring:bpm:gateware:documentation:GTKWave.png| GTKWave}}+== 79, 95: FMC {0, 1VCXO output enable ==
  
-**Figure 8.3:** GTKWave+Enables the frequency output of the VCXO.
  
-==== 8.1.4 BPM Calculation tab ====+== 96 - 99 and 104 - 107: FMC {0, 1} ADC {0 - 3} clock delay ==
  
-The result of the BPM algorithm and of the averaging are displayed in this tab. If the //read// button is pressed, the values from status registers 0 - 3 and 4 - 7 (see [[#622_status_registers|chapter 6.2.2]]) are read once (or continuously if the check button //continuous// is checked). The displayed values are the register values divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_ffca8a11.png?nolink&0x21}}.+There is a configurable input delay for setting the correct digital interface timing for both the clock and the data signals. Increasing this value increases the delay of the clockso that the data is sampled later.
  
-{{:ds:projects:cryring:bpm:gateware:documentation:FPGA_Observer_BPM.png| FPGA Observer BPM Calculation tab}}+== 100 - 103 and 108 - 111: FMC {0, 1} ADC {3data delay ==
  
-**Figure 8.4:** FPGA Observer - BPM Calculation tab+See above. Increasing this value increases the delay of the data, so that the data is sampled at an earlier position.
  
-==== 8.1.5 Scope tabs ====+===== 8 Hardware properties =====
  
-{{:ds:projects:cryring:bpm:gateware:documentation:FPGA_Observer_Scope0.png| FPGA Observer - Scope 0 tab}} +==== 8.1 LEDs driven by the FPGA gateware ====
- +
-**Figure 8.5:** FPGA Observer - Scope 0 tab +
- +
-==== 8.1.6 Peripherals Configuration tab ==== +
- +
-=== Configuration === +
- +
-A configuration file can be loaded to program the three different peripheral devices documented in [[#3_peripheral_devices|chapter 3]]. An initial configuration is already performed by the gateware after startup.\\ +
-The configuration file is a comma separated values (.csv) file with the following syntax: +
- +
-//device number// (1 hexadecimal digit), //register number// (2 hexadecimal digits), //value// (2 hexadecimal digits) +
- +
-The device number is encoded as follows: +
- +
-^number  ^device                        ^ +
-|0 - 3   |ADCs 0 - 3 on FMC0            | +
-|4       |all ADCs on FMC0 in parallel +
-|5       |PLL on FMC0                   | +
-|6       |VCXO on FMC0                  | +
-|7 - A   |ADCs 0 - 3 on FMC0            | +
-|B       |all ADCs on FMC0 in parallel +
-|C       |PLL on FMC0                   | +
-|D       |VCXO on FMC0                  | +
- +
-A correct configuration of the VCXOs via software can not be guaranteed due to the I2C configuration timeout of 10 ms of the VCXOs (see [[#31_si571_programmable_vcxo|chapter 3.1]]). Any configuration to the VCXOs should be checked by subsequently reading back the register values. +
- +
-=== Reading the device registers === +
- +
-The complete register bank of the first ADC, the PLL and the VCXO on FMC 0 can be read and stored to three individual log files in the ''%%/tmp%%'' directory. +
- +
-{{:ds:projects:cryring:bpm:gateware:documentation:FPGA_Observer_Peripherals_Configuration.png| FPGA Observer - Peripherals Configuration tab}} +
- +
-**Figure 8.6:** FPGA Observer - Peripherals Configuration tab +
- +
-==== 8.1.7 Gateware Information tab ==== +
- +
-{{:ds:projects:cryring:bpm:gateware:documentation:FPGA_Observer_Gateware_Information.png| FPGA Observer - Gateware Information tab}} +
- +
-**Figure 8.7:** FPGA Observer - Gateware Information tab +
- +
-Information about the gateware version is displayed in this tab. The URL of the remote server of the Git repository, the latest commit hash and the latest commit date are read from an information memory region in the FPGA (see [[#723_gateware_information|chapter 7.2.3]]). The bitstream generation date is read from status register 126 ’build timestamp’. +
- +
-===== 8.2 Test scripts ===== +
- +
-==== 8.2.1 PCIe access test script ==== +
- +
-There is a PCIe access test script under ''%%src/software/pcie_driver/test_pcie_access.sh%%'' in the //Cryring_BPM_Gateware// Git repository. It uses the tools provided together with the XDMA PCIe driver to test some basic reading and writing to different memories via the PCIe driver. The reading results are displayed via hexdump. +
- +
-====== 9 Helper scripts ====== +
- +
-===== 9.1 VHDL beautification ===== +
- +
-There is a script ''%%src/scripts/beautify_vhdl.py%%'' for autoformatting VHDL files using the open source software //Emacs//+
- +
-The script expects one parameter: ''%%<file that shall be formatted>%%'', or ''%%all%%'' for formatting all VHDL files in the repository. The formatting is performed in place, overwriting the original source file. +
- +
-The script applies several corrections and changes to the //Emacs// formatting result: +
- +
-  * correction of the handling of the comparison operator ''%%<=%%'' +
-  * correction of the handling of initializations like ''%%(others => ’0’)%%'' +
-  * enforcing of spaces around the operators ''%%+%%'', ''%%-%%'', ''%%*%%'', ''%%/%%'', ''%%&%%'' +
-  * no indentation for closing brackets +
-  * aligning of full comment lines to the indentation level of the following VHDL command +
-  * indentation with tabs instead of spaces +
- +
-===== 9.2 Remote power cycling of the CPU unit ===== +
- +
-Whenever the bitstream of an FPGA is reloaded, the CPU unit has to be rebooted via its Hot Swap Handle in order to establish a PCIe connection. A software reboot does not work. +
- +
-An alternative possibility of remote power cycling the CPU unit is via the MCH. +
- +
-The script ''%%src/scripts/powercycle_cpu_unit.py%%'' instructs the MCH via SSH to power down and repower the CPU unit. The script expects one parameter: ''%%<name of MCH, e.g. sdmch023>%%''+
- +
-The script takes about 60 seconds to complete. +
- +
-===== 9.3 Plotting of measurement data ===== +
- +
-The script ''%%src/scripts/plot_frequency_response.py%%'' can be used to plot measurement data. It was used to create figure 12.6. +
- +
-===== 9.4 Generation of a VHDL file for monitoring and control ===== +
- +
-The monitoring and control configuration of the gateware is defined by the configuration files ''%%observer_signals.csv%%'', ''%%read_registers.csv%%'' and ''%%write_registers.csv%%'' in the folder ''%%src/config%%''+
- +
-The script ''%%src/scripts/generate_monitoring_and_control.py%%'' is used to convert the configuration to a VHDL file stored as ''%%src/vhdl/generated_constant_package.vhd%%''. It contains the register default values and a Block RAM initialization vector containing the observer and register configuration. +
- +
-The script is also executed by the gateware build flow documented in [[#5_build_flow_and_simulation|chapter 5]]. +
- +
-===== 9.5 Generation of documentation ===== +
- +
-==== 9.5.1 PDF ==== +
- +
-There is a script ''%%doc/scripts/create_pdf.sh%%'' for generating a PDF file from the Latex sources in ''%%doc/tex%%''. It calls the open source software //Pdflatex// twice on the top level documentation file ''%%Cryring_BPM_Gateware_Documentation.tex%%'' to enable the generation of references inside the PDF file. +
- +
-==== 9.5.2 Markdown ==== +
- +
-There is a script ''%%doc/scripts/create_markdown.py%%'' for generating the Markdown file ''%%README.md%%'', which is displayed on the repository’s start page in Gitlab. The script uses the open source software //Pandoc// for an initial conversion of the Latex sources in ''%%doc/tex%%''+
- +
-The result of //Pandoc// is postprocessed for multiple reasons: +
- +
-  * conversion of the math syntax to Gitlab’s .md format +
-  * corrections of the bibliography, HTML syntax and Latex labels +
-  * corrections of the references to figures, tables and equations +
-  * enumeration of chapters, sections and subsections +
-  * adding of captions for figures and equations +
-  * enumeration of figures, tables and equations +
-  * generation of a table of contents +
-  * implementation of citations +
- +
-Additional documentation which is not included in the Latex sources is appended from the file ''%%doc/markdown/epilog.md%%''+
- +
-==== 9.5.3 DokuWiki ==== +
- +
-There is a script ''%%doc/scripts/create_dokuwiki.py%%'' for generating a DokuWiki file which can be used to populate a Wiki page on e.g. https://www-bd.gsi.de/dokuwiki. +
- +
-The script converts the Latex documentation sources to the DokuWiki format in four steps: +
- +
-  - conversion of Latex sources to Markdown +
-  - preprocessing of Markdown before the conversion to DokuWiki +
-  - calling //Pandoc// to convert Markdown to DokuWiki +
-  - postprocessing for correction, extension of functionality and a different style +
- +
-The preprocessing actions are: +
- +
-  * removing table of contents since it is automatically generated by DokuWiki +
- +
-The postprocessing actions are: +
- +
-  * conversion or equations to images since DokuWiki can not render equations +
-  * replacement of HTML tags, Latex color tags, etc. since DokuWiki can not handle them +
-  * conversion of the reference format +
- +
-====== 10 Continuous integration environment ====== +
- +
-There is a continuous integration environment setup for the //Cryring_BPM_Gateware// Git repository. It is implemented as a so called Gitlab Runner that communicates with the remote of the Git repository, the Gitlab server //git.gsi.de//+
- +
-At the moment the Gitlab Runner is running on the Linux server //sdlx035// located in a server room in the basement. +
- +
-The benefits of continuous integration are: +
- +
-  * every change will be tested automatically +
-  * it is ensured that no files are missing in the repository +
-  * the master branch can be kept functional at any time +
-  * build results like e.g. bitstreams are automatically generated and can be archived +
- +
-{{:ds:projects:cryring:bpm:gateware:documentation:Gitlab_pipelines.png| Gitlab: continuous integration pipelines}} +
- +
-**Figure 10.1:** Gitlab: continuous integration pipelines +
- +
-===== 10.1 Installation ===== +
- +
-There is an installation script ''%%install.sh%%'' in the //Gitlab_Runner_Setup_Centos_7// Git repository. It installs the Gitlab Runner as well as the software needed for simulation, generation of documentation and building an FPGA. +
- +
-After the installation, the newly setup Gitlab Runner has to configured to connect to a remote repository on a Gitlab server. In the repository’s web front end on the Gitlab server, go to //Settings CI/CD Runners// and copy the registration token which you will need in the following step. +
- +
-On the newly installed Gitlab Runner server, open a terminal and type ''%%sudo gitlab-runner register%%''+
- +
-Enter the following information: +
- +
-  * gitlab-ci coordinator URL: e.g. ''%%https://git.gsi.de%%'' +
-  * gitlab-ci token: enter the registration token copied before +
-  * gitlab-ci description: name of the server, e.g. ''%%sdlx035%%'' +
-  * gitlab-ci tags: leave empty +
-  * executor: ''%%shell%%'' +
- +
-You can add multiple repositories with different tokens by running ''%%sudo gitlab-runner register%%'' multiple times. +
- +
-===== 10.2 Pipeline Stages ===== +
- +
-Each ''%%push%%'' to the Gitlab server will trigger a so called continuous integration / continuous delivery (CI/CD) pipeline. The pipeline setup is defined by the file ''%%gitlab-ci.yml%%'' in the root folder of the repository. +
- +
-The following pipeline stages are defined: +
- +
-  * documentation +
-  * simulation +
-  * FPGA build +
- +
-{{:ds:projects:cryring:bpm:gateware:documentation:Gitlab_pipeline_stages.png| Gitlab: Pipeline stages}} +
- +
-**Figure 10.2:** Gitlab: Pipeline stages +
- +
-==== 10.2.1 Documentation ==== +
- +
-The script ''%%create_documentation.sh%%'' in ''%%doc/tex%%'' is run to generate this documentation from the Latex source files. Pdflatex is run twice by the script to allow the generation of references inside the document. This pipeline stage succeeds if Pdflatex can generate the PDF without errors. +
- +
-The log file of Pdflatex and - if successful - the PDF of the documentation are archived. +
- +
-==== 10.2.2 Simulation ==== +
- +
-The script ''%%run/run_simulation.sh%%'' is run which uses the Vivado command line interface to simulate the top level of the gateware. Test signals from the ADCs are generated as inputs to the simulation. The BPM results are saved to a file which is compared to a reference pattern. This pipeline stage succeeds if there is no error in simulation and if the BPM result file matches the reference pattern. +
- +
-The log file of the simulation and - if successful - a file with the BPM results from the simulation are archived. +
- +
-==== 10.2.3 FPGA build ==== +
- +
-The script ''%%run/run_build_flow.sh%%'' is run which uses the Vivado command line interface to build the gateware. This pipeline stage succeeds if there is no error during the build process and if a bitstream file has been generated. +
- +
-Different log files from synthesis and implementation, different reports like utilization and timing reports and - if successful - the bitstream file are archived. +
- +
-{{:ds:projects:cryring:bpm:gateware:documentation:Gitlab_pipeline_console.png| Gitlab: Pipeline progress console}} +
- +
-**Figure 10.3:** Gitlab: Pipeline progress console +
- +
-===== 10.3 Build results ===== +
- +
-For each of the pipeline stages the archiving of build results can be configured for an adjustable time period, which is set to one week. If the period has passed and the build results have been deleted, they can be generated again by restarting the pipeline. +
- +
-The build results can be downloaded from the Gitlab web front end where they are called //job artifacts// (see figure 10.3). +
- +
-<color green>**The CI/CD pipelines can also be used to generate FPGA bitstreams without +
-having to set up a build environment.**</color> +
- +
-===== 10.4 Settings ===== +
- +
-You can define individual settings for the CI/CD section of each Git repository in the Gitlab web front end. The following settings should fit for most cases: +
- +
-  * Use git clone to get the recent application code, otherwise the pipelines might fail during git fetch:\\ +
-//Settings CI/CD General pipelines Git strategy for pipelines: git clone// +
-  * Increase the timeout to allow FPGA build to finish in any case:\\ +
-//Settings CI/CD General pipelines Timeout: 6h// +
- +
-====== 11 Programming and hardware configuration ====== +
- +
-===== 11.1 Programming the gateware ===== +
- +
-==== 11.1.1 Using a JTAG programmer ==== +
- +
-Before being able to access the FPGA you need to program the JTAG switch on the AFC board using a script from the //Cryring_BPM_Gateware// Git repository. Open the Vivado Hardware Manager software: +
- +
-//Tools Run Tcl Script//: ''%%src/scripts/program_scansta_jtag_switch.tcl%%'' +
- +
-You should now see a //xc7a200t_0// device. Right click on it and choose //Program Device//. +
- +
-Choose the correct bitstream (.bit file) and press //OK//. The programming takes about one minute. +
- +
-==== 11.1.2 Using a JTAG Switch Module ==== +
- +
-If there is a JTAG Switch Module (JSM) in the MicroTCA crate, the bitstream can also be programmed remotely via a so called Xilinx Virtual Cable: +
- +
-  * download ''%%svf_to_nsvf-linux-x86.bin%%'' from //MCH GUI JSM// +
-  * download ''%%afc_scansta.sfv%%'' from https://github.com/lnls-dig/fpga-programming +
-  * convert ''%%afc_scansta.sfv%%'' to ''%%afc_scansta.nsfv%%'' using the command ''%%./svf_to_nsvf-linux-x86.bin afc_scansta.sfv%%'' +
-  * upload ''%%afc_scansta.nsfv%%'' in //MCH GUI JSM// to the port of the JTAG switch to which the AFC board you want to program is connected +
-  * open Vivado Hardware Manager +
-  * //Open Target New Target Next Local Server Add Xilinx Virtual Cable (XVC)// +
-  * //Hostname//: ''%%sdmch<xxx>.acc.gsi.de%%'' +
-  * Port: find correct port number in //NAT-MCH GUI JSM// +
-  * //Finish// +
-  * //Open target// +
-  * you should see the FPGA now in Vivado Hardware Manager and can program it +
- +
-The first four steps are persistent and only have to be executed initially. +
- +
-==== 11.1.3 Storing a bitstream persistently in the SPI Flash ==== +
- +
-There is a 256 MB SPI Flash memory on the AFCv3.1 board for persistent bitstream storage. +
- +
-=== File format conversion === +
- +
-First you have to convert the bitstream (.bit) file to a .mcs file. There is a script in the //Cryring_BPM_Gateware// Git repository for this purpose: +
- +
-''%%src/scripts/convert_bit_to_mcs.sh <path to .bit file>%%'' +
- +
-The .mcs file will be generated in the same folder as the .bit file. +
- +
-=== Programming === +
- +
-Program the JTAG switch on the AFC board as described in [[#1111_using_a_jtag_programmer|chapter 11.1.1]]. You should now see a //xc7a200t_0// device.\\ +
-Right click on it and choose //Add Configuration Memory Device// and choose //mt25ql256-spi-x1_x2_x4// +
- +
-You should now see a //mt25ql256-spi-x1_x2_x4// device. +
- +
-Right click on it and choose //Program Configuration Memory Device//.\\ +
-Choose the .mcs file you created before and press //OK//. The programming is really slow and can take up to half an hour. +
- +
-===== 11.2 Configuration of the MCH ===== +
- +
-==== 11.2.1 Via the MCH’s web interface ==== +
- +
-=== Base configuration === +
- +
-//MCH global parameter SSH access: enabled//\\ +
-This will trigger SSH key generation which takes some minutes to complete. +
- +
-//PCIe parameter Upstream slot power up delay: 5 sec//\\ +
-Delay before the CPU unit will power up on start up. For making sure that the bitstreams are loaded to the AFC’s FPGAs from Flash memory before the CPU unit boots you might have to increase this value. +
- +
-//PCIe parameter PCIe hot plug delay for AMCs: 0 sec//\\ +
-Delay before the AFC boards will power up on start up. +
- +
-=== Switch PCIe x80 === +
- +
-Set the CPU-Unit as upstream AMC source in ’Virtual Switch 0’: +
- +
-//PCIe Virtual Switches Upstream AMC: AMC1/4..7//\\ +
-(for CPU unit in AMC slot 1) +
- +
-Make sure you enable //PCIe downstream ’4..7’// for the AMC slots which contain your AFC boards. +
- +
-==== 11.2.2 Via USB ==== +
- +
-The most comfortable way of configuring the MCH is via its web interface. If you have accidentally disabled the webserver, set an invalid IP or DHCP configuration or reset the MCH settings to default, you can access the MCH via an USB connection to the micro USB port on the left side of the front panel. +
- +
-On a Linux PC, connect a micro USB cable and check via ''%%dmesg%%'' that a //LUFA USB-RS232 Adapter// has been detected. The driver will be accessible at ''%%/dev/ttyACM<some number>%%'', use e.g. Putty to connect to this serial port using the parameter speed = 19200. +
- +
-Now typing ''%%mch%%'' will output information about the MCH. Typing ''%%?%%'' will display a list of available commands. Most of the settings of the web interface are also available on the command line interface. You can for example set the IP address or a DHCP name to be able to connect to the web interface. +
- +
-===== 11.3 Enabling network boot on the CPU unit ===== +
- +
-Shortly after powering the CPU unit, press F2 to enter the BIOS. +
- +
-In the //Main// tab, go to //Boot Features// and select the following (using F6 for enabling and F5 for disabling): +
- +
-  * ''%%PXE BOOT: <Enabled>%%'' +
-  * ''%%Front ETH0: <Enabled>%%'' or Front Panel ETH1: <Enabled>, depending on the version of the CPU unit and the BIOS +
-  * ''%%Auto Retry PXE Boot: Enabled%%''. The existence of this menu entry depends on the BIOS version. +
- +
-In the //Advanced// tab, go to //Network Stack Configuration// and enable //Ipv4 PXE Support//. The availability of this menu entry also depends on the BIOS version. +
- +
-In the //Boot// tab, go to //Legacy// and //Boot Type Order//. There should be an //Others// entry that has to be shifted to the top of the list using F6. In newer BIOS versions, there is a //Boot Option #1// entry in the //Boot// tab, which has to be chosen to //IBA GE Slot 1600 v1513//. +
- +
-Save the settings by pressing F4. +
- +
-The CPU unit should boot from network after the next reboot. For the loading of the correct network image, the MAC address of the desired Ethernet port of the CPU unit has to registered in the DHCP server responsible for distributing the locations from which to load the network images. +
- +
-===== 11.4 Programming the MMC firmware ===== +
- +
-For programming the MMC firmware into the LPC microcontroller you need to install a proprietary software from NXP called LPCxpresso. +
- +
-==== 11.4.1 Installation of LPCxpresso on Linux ==== +
- +
-Download LPCxpresso from the NXP website [[#15_references|[12]]]. You need to register for the download. Follow the instructions in ''%%INSTALL.txt%%''. After the installation, open the IDE via ''%%<installation directory>/lpcxpresso%%'' and register the installation via //Help Activate Create serial number and register (Free Edition)//. Create a serial number in the dialog, copy it to the form in the website and afterwards paste the activation key you got from the website to //Help Activate Activate (Free Edition)//+
- +
-==== 11.4.2 Programming ==== +
- +
-Disconnect the AFC board completely. The power for programming the microcontroller will come from the LPC-Link programmer. Connect and power the LPC-Link programmer via USB and connect the customized cable to the //CPU-JTAG// connector on the AFC board. Connect the plug so that the flat cable is pointing in the direction of the FMC connector. +
- +
-Program the device via: +
- +
-''%%lpcxpresso/bin/dfu-util -d 0x0471:0xdf55 -c 0 -t 2048 -R -D lpcxpresso/bin/LPCXpressoWIN.enc%%'' +
- +
-''%%sudo lpcxpresso/bin/crt_emu_cm3_nxp -pLPC1768 -g -wire=winusb -load-base=0 -flash-load-exec=<path to firmware binary>%%'' +
- +
-You can find the openMMC firmware binary under ''%%firmware/openMMC-full-afc-bpm-v1.4.0.bin%%'' in the //Cryring_BPM_Gateware// Git repository. +
- +
-==== 11.4.3 Differences in the MMC firmwares of Creotech and LNLS ==== +
- +
-LNLS’s OpenMMC firmware routes a 100 MHz clock to the PCIe reference clock input, whereas Creotech’s MMC firmware routes a 125 MHz clock to this pin. The frequency of //sys_clk// is 125 MHz for both. +
- +
-The OpenMMC firmware should forward the signal of the reset button on the AFC front panel to the FPGA pin AG26 after some seconds. However, no reaction can be observed on this pin. It is unclear if or how Creotechs MMC firmware handles reset button actions, since there is no observable reaction. +
- +
-The current gateware is functional with the OpenMMC firmware. For running it together with Creotech’s MMC firmware, the PCIe reference clock frequency in the IP //pcie_dma_ip// has to be changed to 125 MHz. +
- +
-===== 11.5 Configuration of the timing receiver ===== +
- +
-The timing receiver is connected to the AFC boards via eight differential MLVDS lines via the backplane of the MicroTCA crate. By default, the gateware is configured to use the first MLVDS line as an input for the gate signal. +
- +
-The GPIOs of the timing receiver can be controlled via command line commands available in the network boot image of the CPU unit: +
- +
-<HTML><ul></HTML> +
-<HTML><li></HTML><HTML><p></HTML>display all available GPIOs:<HTML></p></HTML> +
-<HTML><p></HTML>''%%saft-io-ctl tr0 -i%%''<HTML></p></HTML><HTML></li></HTML> +
-<HTML><li></HTML><HTML><p></HTML>enable the outputs to the backplane:<HTML></p></HTML> +
-<HTML><p></HTML>''%%saft-io-ctl tr0 -n V_MTCA4B_EN -q 1%%''<HTML></p></HTML><HTML></li></HTML> +
-<HTML><li></HTML><HTML><p></HTML>display the properties of a single GPIO: e.g. <HTML></p></HTML> +
-<HTML><p></HTML>''%%saft-io-ctl tr0 -n MTCA4_IO1%%''<HTML></p></HTML><HTML></li></HTML> +
-<HTML><li></HTML><HTML><p></HTML>enable the output of a single GPIO: e.g. <HTML></p></HTML> +
-<HTML><p></HTML>''%%saft-io-ctl tr0 -n MTCA4_IO1 -o 1%%''<HTML></p></HTML><HTML></li></HTML> +
-<HTML><li></HTML><HTML><p></HTML>drive the output of a single GPIO high: e.g. <HTML></p></HTML> +
-<HTML><p></HTML>''%%saft-io-ctl tr0 -n MTCA4_IO1 -d 1%%''<HTML></p></HTML><HTML></li></HTML><HTML></ul></HTML> +
- +
-====== 12 Hardware properties ====== +
- +
-===== 12.1 LEDs on the AFC and FMC front panels ===== +
- +
-==== 12.1.1 LEDs driven by the FPGA gateware ====+
  
 There are three tricolor LEDs connected to FPGA pins: There are three tricolor LEDs connected to FPGA pins:
  
-  * //L3// in the center of the AFC front panel:\\ +  * //L3// in the center of the AFC front panel: Currently displays the PCIe reference clock divided by {{:ds:projects:cryring:bpm:gateware:/math_326299be.png?nolink&0x21}} in white. 
-Currently displays the PCIe reference clock divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_326299be.png?nolink&0x21}} in white. +  * //LD1// (v1.0) or //STATUS// (v1.2 and v2.3) on the right of the two FMC board’s front panels: Currently display the ADC clock frequencies divided by {{:ds:projects:cryring:bpm:gateware:/math_326299be.png?nolink&0x21}} in green if the PLLs indicate a lock, otherwise red.
-  * //LD1// (v1.0) or //STATUS// (v1.2 and v2.3) on the right of the two FMC board’s front panels:\\ +
-Currently display the ADC clock frequencies divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_326299be.png?nolink&0x21}} in green if the PLLs indicate a lock, otherwise red.+
  
 Each tricolor LED consists of three independent LEDs (red, green and blue). Each tricolor LED consists of three independent LEDs (red, green and blue).
  
-==== 12.1.2 LEDs driven by the MMC ====+==== 8.2 Differences between FMC ADC 250 M 16B 4CH versions ====
  
-  * In Service (//L1//), green +The //LD1// (v1.0or //STATUS// (v1.2 and v2.3LED on the right of the FMC board front panel is connected differently between v1.0 and (v1.2 and v2.3). When using the location constraints for v1.2 and v2.3 together with a v1.0 boardthe LED lights as follows:
-  * Alarm (//L2//), red +
-  * Hot Swap (//HS//), blue+
  
-=== Lighting patterns of the Hot Swap LED ===+  * wanted red: off 
 +  * wanted green: lights green 
 +  * wanted blue: lights red
  
-Insertion of an AFC board:+Also, the MMCX input //TRIG// seems to be connected differently on v1.0. Feeding HF-Pulses into v1.0 boards does not work with the current bitstream.
  
-^**event**                                   ^**Hot Swap Handle**  ^**Hot Swap LED**  ^ +==== 8.3 Analog characteristics ====
-|AMC inserted into chassis with handle open  |Open                 |On                | +
-|AMC handle closed                           |Closed               |Blinks            | +
-|Activation granted and AMC powers up        |Closed               |Off               |+
  
-Source: [[#15_references|[13]]]+=== 8.3.1 ADC input filter ===
  
-Removal of an AFC board:+The FMC ADC boards were originally designed for very high input frequencies and are equipped with input filters that show a pronounced high pass characteristic. There are different versions of the boards which have a different ADC input filter circuitry.
  
-^**event**                                                          ^**Hot Swap Handle**  ^**Hot Swap LED**  ^ +{{:ds:projects:cryring:bpm:gateware:ADC_input_filter_v1_0_and_v1_2_schematics.png}}
-|AMC handle pulled open                                             |Open                 |Blinks            | +
-|Deactivation granted and AMC powers down (AMC can now be removed)  |Open                 |On                |+
  
-Source: [[#15_references|[13]]]+**Figure 8.1:** Schematics of the original ADC input filter of versions 1.0 and 1.2. Image taken from [[#10_references|[12]]]
  
-===== 12.2 MCH PCIe status LEDs =====+{{:ds:projects:cryring:bpm:gateware:ADC_input_filter_v2_3_schematics.png}}
  
-The lighting patterns of the PCIe status LEDs on the MCH show the link status and the link speed of the PCIe connections:+**Figure 8.2:** Schematics of the original ADC input filter of version 2.3. Image taken from [[#10_references|[13]]]
  
-^**LED state**  ^**meaning**   ^ +The part labeled //TR1(B) BD0205F5050A00// is a balun with an operating range of 70 - 1000 MHz [[#10_references|[14]]]. Lower frequencies are severely attenuated.
-|off            |no PCIe link  | +
-|1 blink/sec    |2.5 GBaud     | +
-|2 blinks/sec   |5 GBaud       | +
-|on             |8 GBaud       |+
  
-Source: [[#15_references|[14]]]+For being able to use the FMC ADC boards in the Cryring BPM system, the baluns have to be replaced by more suitable components.
  
-===== 12.3 Differences between hardware versions =====+Two approaches have been implemented on versions 1.0 and 1.2 (probably by Piotr Miedzik):
  
-==== 12.3.1 Differences between AFC version 2 and AFC version 3.1 ====+  * each balun is replaced by two wires 
 +  * each balun is replaced by two capacitors of probably 100 nF (hint in an old email)
  
-Both boards carry 2 GiBytes of DDR3-SDRAM, divided in four modules of 512 MiBytes each. The SDRAM model can be determined via the FBGA code printed on the modules using the Micron part decoder webpage [[#15_references|[15]]].+{{:ds:projects:cryring:bpm:gateware:ADC_input_filter_v1_2_balun_replaced_by_capacitors.jpg}}
  
-=== AFC version ===+**Figure 8.3:** v1.ADC input filter: balun //TR1B// replaced by two capacitors
  
-  * FBGA codeD9PBC, translates to Micron MT41J512M8RA-125:+{{:ds:projects:cryring:bpm:gateware:ADC_input_filter_v1_0_balun_replaced_by_wires.jpg}}
-  * operates at 1.5 V+
  
-=== AFC version 3.1 ===+**Figure 8.4:** v1.0 ADC input filter: balun //TR1B// replaced by two wires
  
-  * FBGA codeD9QBV, translates to Micron MT41K512M8RH-125 IT:+{{:ds:projects:cryring:bpm:gateware:ADC_input_filter_v2_3_original.jpg}}
-  * compatible to older MT41J family, operates at 1.5 V or 1.35 V+
  
-=== Differences between FMC ADC 250 M 16B 4CH versions ===+**Figure 8.5:** Original v2.3 ADC input filter
  
-The //LD1// (v1.0) or //STATUS// (v1.2 and v2.3) LED on the right of the FMC board front panel is connected differently between v1.0 and (v1.2 and v2.3). When using the location constraints for v1.2 and v2.3 together with a v1.0 board, the LED lights as follows:+The heatspreader under the bottom of the FMC ADC board has to be unscrewed to access the baluns.
  
-  * wanted red off +There is a significant difference in the ADC input filter circuitry between versions 1.0 and 1.2 and version 2.3. In version 2.3 the transmission line transformers //L11 {A, B, C, D}// have been removed and the RC filter has been modified.
-  * wanted green lights green +
-  * wanted blue lights red+
  
-Also, the MMCX input //TRIG// seems to be connected differently on v1.0. Feeding HF-Pulses into v1.0 boards does not work with the current bitstream.+Figure [[#851_adc_input_filter|8.6]] shows the magnitude frequency responses of the original v2.3 input filter and of the two modifications of the v1.0 and v1.2 input filters. The diagram data was created by using a sine signal from a signal generator with an amplitude of 2 {{:ds:projects:cryring:bpm:gateware:/math_1f363008.png?nolink&0x24}} and by measuring the maximum amplitude swing of the raw ADC data.
  
-===== 12.4 Maximum achievable data rate to and from SDRAM =====+{{:ds:projects:cryring:bpm:gateware:FMC_ADC_magnitude_frequency_response.png}}
  
-The gross data rate of the SDRAM interface is 800 MT/s with 32 bits/transfer, resulting in a theoretical gross data rate of 3.2 GiBytes/s. The maximum achievable data rate is limited by concurrent read and write accesses and by SDRAM refresh cycles.+**Figure 8.6:** Magnitude frequency responses of different ADC input filters
  
-The storage of the samples of all eight ADCs in parallel at a sampling rate of 125 MHz results in a write data rate of:+==== 8.4 Required changes for PLL lock ====
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/math_a53f595d.png?nolink&0x25}}+For being able to drive the reference clock of the PLLs on the FMC ADC boards from an FPGA output pin, a pullup resistor indicating the clock direction has to be desoldered. The resistor is labeled //R132// in the FMC ADC schematic [[#10_references|[13]]]. Figure [[#86_required_changes_for_pll_lock|8.7]] shows the location of the resistor.
  
-The SDRAM capacity of 2 GiBytes would be sufficient to store the stream data of all eight ADCs for 1.07 seconds.+Without this change slight clock frequency differences between the processing clock on the AFC board and the ADC clocks on the FMC boards occur. There are synchronization FIFOs which ensure correct clock domain crossings, but in this case a small fraction of ADC samples might have to be discarded or repeated once, depending on which frequency is higher. This will always affect all the samples of a FMC board in parallel, so that no differences between the two input data streams of a single BPM will occur and no measurable effect on the BPM results should be observed.
  
-===== 12.5 Analog characteristics =====+With this changes applied and with the correct settings of the PLL, the ADC samples of both FMC boards will arrive exactly in parallel and no samples will be lost or repeated.
  
-==== 12.5.1 ADC input filter ====+Update: Even though removing the resistor is advisable, the PLL also locks with it in placeNot all the boards in the productive setup have been changed.
  
-The FMC ADC boards were originally designed for very high input frequencies and are equipped with input filters that show a pronounced high pass characteristic. There are different versions of the boards which have a different ADC input filter circuitry.+{{:ds:projects:cryring:bpm:gateware:FMC_ADC_resistor_to_remove.jpg}}
  
-{{:ds:projects:cryring:bpm:gateware:documentation:ADC_input_filter_v1_0_and_v1_2_schematics.png| Schematics of the original ADC input filter of versions 1.0 and 1.2. Image taken from [[#15_references|[16]]]}}+**Figure 8.7:** Pullup resistor which needs to be removed for the PLL to lock
  
-**Figure 12.1:** Schematics of the original ADC input filter of versions 1.0 and 1.2. Image taken from [[#15_references|[16]]]+==== 8.5 List of ADC-FMC boards ====
  
-{{:ds:projects:cryring:bpm:gateware:documentation:ADC_input_filter_v2_3_schematics.pngSchematics of the original ADC input filter of version 2.3. Image taken from [[#15_references|[17]]]}}+^   Label^AFC number  ^FMC number  ^remarks                                                               ^ 
 +|   ADC 1|4           |2           |from old setup                                                        | 
 +|   ADC 2|-           |-           |from old setup, port 3 has lower amplitude (0.8) and a phase shift    | 
 +|   ADC 3|1           |2           |from old setup                                                        | 
 +|   ADC 4|-           |-           |from old setup, works fine                                            | 
 +|   ADC 5|4           |1           |from old setup                                                        | 
 +|   ADC 6|-           |-           |from old setup, port 3 has an offset of about -2000 LSBs              | 
 +|   ADC 7|-           |-           |from old setup, port has higher amplitude (1.15) and a phase shift  | 
 +|   ADC 8|-           |-           |from old setup, port does not work, port 2 equal to that of ADC 7   | 
 +|   ADC 9|-           |-           |from old setup, not tested                                            | 
 +|  ADC 10|1           |1           |old spare                                                             | 
 +|  ADC 11|5           |2           |old spare                                                             | 
 +|  ADC 12|2           |1           |new                                                                   | 
 +|  ADC 13|2           |2           |new                                                                   | 
 +|  ADC 14|3           |1           |new                                                                   | 
 +|  ADC 15|5           |1           |new                                                                   |
  
-**Figure 12.2:** Schematics of the original ADC input filter of version 2.3. Image taken from [[#15_references|[17]]]+==== 8.6 Productive setup ====
  
-The part labeled //TR1(B) BD0205F5050A00// is a balun with an operating range of 70 - 1000 MHz [[#15_references|[18]]]Lower frequencies are severely attenuated.+The following AFC version 3.1 boards are installed in the productive setup in the Cryring container:
  
-For being able to use the FMC ADC boards in the Cryring BPM system, the baluns have to be replaced by more suitable components.+^AFC number  ^FPGA serial number  ^   FMC 1^   FMC 2^  AMC slot^ 
 +|1           |0x048A82110D1B05C    ADC 10|   ADC 3|         3| 
 +|2           |0x008182110D1B05C    ADC 12|  ADC 13|         4| 
 +|3           |0x010A82110D1B05C    ADC 14|       -|         5| 
 +|4           |0x068B48160E47054     ADC 5|   ADC 1|         6| 
 +|5           |0x018D5C24235885C    ADC 15|  ADC 11|         7|
  
-Two approaches have been implemented on versions 1.and 1.2 (probably by Piotr Miedzik):+The FPGA serial number is not printed anywhere, but can only be read from the DNA_PORT primitive by the gatewareIn this gateware the FPGA serial number is read out and stored in a register (see chapter [[#621_status_registers|6.2.1]]).
  
-  - each balun is replaced by two wires +The signal cables are connected as follows:
-  - each balun is replaced by two capacitors of probably 100 nF (hint in an old email)+
  
-{{:ds:projects:cryring:bpm:gateware:documentation:ADC_input_filter_v1_2_balun_replaced_by_capacitors.jpgv1.ADC input filter: balun //TR1B// replaced by two capacitors}}+^signal      AFC number  ^  FMC number  ^  port number 
 +|YR2DX1HL        1            1                   | 
 +|YR2DX1HR        1            1                   | 
 +|YR2DX2VO        1            1                   | 
 +|YR2DX2VU        1            1                   | 
 +|YR10DX1HL  |      1            2                   | 
 +|YR10DX1HR  |      1            2                   | 
 +|YR10DX2VO  |      1            2                   | 
 +|YR10DX2VU  |      1            2                   | 
 +|YR3DX3VO        2            1                   | 
 +|YR3DX3VU        2            1                   | 
 +|YR3DX4HL        2            1                   | 
 +|YR3DX4HR        2            1                   | 
 +|YR12DX1HL  |      2            2                   | 
 +|YR12DX1HR  |      2            2                   | 
 +|YR12DX2VO  |      2            2                   | 
 +|YR12DX2VU  |      2            2                   | 
 +|YR7DX1HL        3            1                   | 
 +|YR7DX1HR        3            1                   | 
 +|YR7DX2VO        3            1                   | 
 +|YR7DX2VU        3            1                   | 
 +|YR3DX1HL        4            1                   | 
 +|YR3DX1HR        4            1                   | 
 +|YR3DX2VO        4            1                   | 
 +|YR3DX2VU        4            1                   | 
 +|YR8DX1HL        4            2                   | 
 +|YR8DX1HR        4            2                   | 
 +|YR8DX2VO        4            2                   | 
 +|YR8DX2VU        4            2                   | 
 +|YR6DX1HL        5            1                   | 
 +|YR6DX1HR        5            1                   | 
 +|YR6DX2VO        5            1                   | 
 +|YR6DX2VU        5            1                   | 
 +|YR11DX1HL  |      5            2                   | 
 +|YR11DX1HR  |      5            2                   | 
 +|YR11DX2VO  |      5            2                   | 
 +|YR11DX2VU  |      5            2                   |
  
-**Figure 12.3:** v1.2 ADC input filter: balun //TR1B// replaced by two capacitors+===== 9 Test coverage =====
  
-{{:ds:projects:cryring:bpm:gateware:documentation:ADC_input_filter_v1_0_balun_replaced_by_wires.jpg| v1.0 ADC input filter: balun //TR1B// replaced by two wires}}+==== 9.1 BPM algorithm ====
  
-**Figure 12.4:** v1.0 ADC input filter: balun //TR1B// replaced by two wires +=== 9.1.1 Simulation ===
- +
-{{:ds:projects:cryring:bpm:gateware:documentation:ADC_input_filter_v2_3_original.jpg| Original v2.3 ADC input filter}} +
- +
-**Figure 12.5:** Original v2.3 ADC input filter +
- +
-The heatspreader under the bottom of the FMC ADC board has to be unscrewed to access the baluns. +
- +
-There is a significant difference in the ADC input filter circuitry between versions 1.0 and 1.2 and version 2.3. In version 2.3 the transmission line transformers //L11 {A, B, C, D}// have been removed and the RC filter has been modified. +
- +
-Figure 12.6 shows the magnitude frequency responses of the original v2.3 input filter and of the two modifications of the v1.0 and v1.2 input filters. The diagram data was created by using a sine signal from a signal generator with an amplitude of 2 {{:ds:projects:cryring:bpm:gateware:documentation:/math_1f363008.png?nolink&0x24}} and by measuring the maximum amplitude swing of the raw ADC data. +
- +
-{{:ds:projects:cryring:bpm:gateware:documentation:FMC_ADC_magnitude_frequency_response.png| Magnitude frequency responses of different ADC input filters}} +
- +
-**Figure 12.6:** Magnitude frequency responses of different ADC input filters +
- +
-===== 12.6 List of AFC v3.1 boards ===== +
- +
-^**AFC serial number**  ^**FPGA serial number**  ^**MMC firmware**             ^**bitstream in Flash memory**  ^**FMC**                               ^**location**          ^ +
-|111154                 |0x004ACC24235885C       |openMMC-full-afc-bpm-v1.4.0  |Cryring BPM                    |2 x FMC ADC 250M 16b 4ch v1.0 & v1.2  |SB2 4.111a            | +
-|191087                 |0x004D5C242358854       |openMMC-full-afc-bpm-v1.4.0  |LNLS RT DAQ                    |2 x FMC ADC 100M 14b 4ch v5           |ask Tobias Hoffmann   | +
-|240030                 |0x078D5C24235885C       |openMMC-full-afc-bpm-v1.4.0  |Cryring BPM                    |2 x FMC ADC 250M 16b 4ch v2.3         |ask René Geißler      | +
-|260046                 |?                       |openMMC-full-afc-bpm-v1.4.0  |LNLS RT DAQ                    |none, power supply damaged            |ask Tobias Hoffmann   | +
-|261056                 |0x068D5C24235885C       |openMMC-full-afc-bpm-v1.4.0  |LNLS RT DAQ                    |2 x FMC ADC 100M 14b 4ch v5           |PowerBridge Computer +
-|290148                 |0x058D5C24235885C       |openMMC-full-afc-bpm-v1.4.0  |LNLS RT DAQ                    |2 x FMC ADC 100M 14b 4ch v5           |ask Harald Bräuning   | +
- +
-The FPGA serial number is not printed anywhere, but can only be read from the DNA_PORT primitive by the gateware. In this gateware the FPGA serial number is read out and stored in a register (see [[#622_status_registers|chapter 6.2.2]]). +
- +
-====== 13 Test coverage ====== +
- +
-===== 13.1 BPM algorithm ===== +
- +
-==== 13.1.1 Simulation ====+
  
 This test simulates the VHDL code of the gateware and is automatically run by the CI/CD pipelines of Gitlab. This test simulates the VHDL code of the gateware and is automatically run by the CI/CD pipelines of Gitlab.
Line 1994: Line 1672:
 All ADC data inputs are driven by the same repeated pattern of positive and negative values, but with different amplitudes. All ADC data inputs are driven by the same repeated pattern of positive and negative values, but with different amplitudes.
  
-For the same patterns on both inputs of a BPM with the amplitudes {{:ds:projects:cryring:bpm:gateware:documentation:/math_b09bb11b.png?nolink&0x21}} and {{:ds:projects:cryring:bpm:gateware:documentation:/math_86684571.png?nolink&0x21}},+For the same patterns on both inputs of a BPM with the amplitudes {{:ds:projects:cryring:bpm:gateware:/math_b09bb11b.png?nolink&0x21}} and {{:ds:projects:cryring:bpm:gateware:/math_86684571.png?nolink&0x21}},
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/math_61cf3adf.png?nolink&0x21}} can be expressed as {{:ds:projects:cryring:bpm:gateware:documentation:/math_25bf9959.png?nolink&0x16}} with {{:ds:projects:cryring:bpm:gateware:documentation:/math_a49fed8f.png?nolink&0x31}}+{{:ds:projects:cryring:bpm:gateware:/math_61cf3adf.png?nolink&0x21}} can be expressed as {{:ds:projects:cryring:bpm:gateware:/math_25bf9959.png?nolink&0x16}} with {{:ds:projects:cryring:bpm:gateware:/math_a49fed8f.png?nolink&0x31}}
  
 and equation 4.1 simplifies to: and equation 4.1 simplifies to:
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/equation_7d8f7e17.png?nolink&0x50}}+{{:ds:projects:cryring:bpm:gateware:/equation_7d8f7e17.png?nolink&0x50}}
  
-**Equation 13.1:** equally_shaped_signal_bpm_result+ 
 +**Equation 9.1:** equally_shaped_signal_bpm_result
  
 so that the expected BPM result can be calculated as: so that the expected BPM result can be calculated as:
  
-{{:ds:projects:cryring:bpm:gateware:documentation:/math_e816f738.png?nolink&0x31}}+{{:ds:projects:cryring:bpm:gateware:/math_e816f738.png?nolink&0x31}}
  
-^  **BPM**^  **ADC**^  **relative amplitudes {{:ds:projects:cryring:bpm:gateware:documentation:/math_b09bb11b.png?nolink&0x21}}, {{:ds:projects:cryring:bpm:gateware:documentation:/math_86684571.png?nolink&0x21}}**^  **expected BPM result**^  **simulated BPM result**+^  BPM^  ADC^  relative amplitudes {{:ds:projects:cryring:bpm:gateware:/math_b09bb11b.png?nolink&0x21}}, {{:ds:projects:cryring:bpm:gateware:/math_86684571.png?nolink&0x21}}^  expected BPM result^  simulated BPM result^ 
-       0|        0|                                         1|                 10922.67|                     10922| +   0|    0|                                     1|             10922.67|                 10922| 
-               1|                                       1/2|                                                  +       1|                                   1/2|                                          
-       1|        2|                                       1/2|                -10922.67|                    -10923| +   1|    2|                                   1/2|            -10922.67|                -10923| 
-               3|                                         1|                                                  +       3|                                     1|                                          
-       2|        4|                                         1|                        0|                         0| +   2|    4|                                     1|                    0|                     0| 
-               5|                                         1|                                                  +       5|                                     1|                                          
-       3|        6|                                         1|                 25486.22|                     25487| +   3|    6|                                     1|             25486.22|                 25487| 
-               7|                                       1/8|                                                  |+       7|                                   1/8|                                          |
  
-The simulation results are consistent with the expections considering possible numeric calculation deviations in the numerous calculation steps, which might influence the least significant bits.+The simulation results are consistent with the expectations considering possible numeric calculation deviations in the numerous calculation steps, which might influence the least significant bits.
  
-==== 13.1.2 Using a function generator as data source ====+=== 9.1.2 Using a function generator as data source ===
  
-=== Digital gain setting ===+== Digital gain setting ==
  
-The following measurement was made using a function generator which was configured to output two phase aligned sines with an amplitude of {{:ds:projects:cryring:bpm:gateware:documentation:/math_1b43d523.png?nolink&0x24}} which were connected to the two inputs of a BPM.+The following measurement was made using a function generator which was configured to output two phase aligned sines with an amplitude of {{:ds:projects:cryring:bpm:gateware:/math_1b43d523.png?nolink&0x24}} which were connected to the two inputs of a BPM.
  
 The linear regression length and the averaging length were both set to 1024. The linear regression length and the averaging length were both set to 1024.
  
-Before starting the measurement, the digital gain of one of the two ADC inputs was corrected so that the BPM averaging result equalled 0.+Before starting the measurement, the digital gain of one of the two ADC inputs was corrected so that the BPM averaging result equaled 0.
  
 After that, the digital gain correction of the other ADC input was used to set different amplitudes in order to avoid possible nonlinearities of the function generator gain. After that, the digital gain correction of the other ADC input was used to set different amplitudes in order to avoid possible nonlinearities of the function generator gain.
  
-The results were read from the FPGA Observer GUI which displays the BPM results divided by {{:ds:projects:cryring:bpm:gateware:documentation:/math_ffca8a11.png?nolink&0x21}}.+The results were read from the FPGA Observer GUI which displays the BPM results divided by {{:ds:projects:cryring:bpm:gateware:/math_ffca8a11.png?nolink&0x21}}.
  
-^  **relative amplitude**^  **expected BPM result**^  **measured BPM result**+^  relative amplitude^  expected BPM result^  measured BPM result^ 
-                    1/8|       0.{{:ds:projects:cryring:bpm:gateware:documentation:/math_316d3cea.png?nolink&0x21}}|                    0.778| +                1/8|   0.{{:ds:projects:cryring:bpm:gateware:/math_316d3cea.png?nolink&0x21}}|                0.778| 
-                    2/8|                      0.6|                    0.600| +                2/8|                  0.6|                0.600| 
-                    3/8|      0.{{:ds:projects:cryring:bpm:gateware:documentation:/math_50440082.png?nolink&0x21}}|                    0.454| +                3/8|  0.{{:ds:projects:cryring:bpm:gateware:/math_50440082.png?nolink&0x21}}|                0.454| 
-                    4/8|       0.{{:ds:projects:cryring:bpm:gateware:documentation:/math_ccce9f9d.png?nolink&0x21}}|                    0.333| +                4/8|   0.{{:ds:projects:cryring:bpm:gateware:/math_ccce9f9d.png?nolink&0x21}}|                0.333| 
-                    5/8|                   0.2308|                    0.230| +                5/8|               0.2308|                0.230| 
-                    6/8|                   0.1429|                    0.142| +                6/8|               0.1429|                0.142| 
-                    7/8|      0.0{{:ds:projects:cryring:bpm:gateware:documentation:/math_403698e3.png?nolink&0x21}}|                    0.066| +                7/8|  0.0{{:ds:projects:cryring:bpm:gateware:/math_403698e3.png?nolink&0x21}}|                0.066| 
-                    8/8|                        0|                    0.000|+                8/8|                    0|                0.000|
  
-The measurement results are consistent with the expections considering noise and possible numeric calculation deviations in the numerous calculation steps, which might influence the least significant bits.+The measurement results are consistent with the expectations considering noise and possible numeric calculation deviations in the numerous calculation steps, which might influence the least significant bits.
  
-===== 13.2 Reliability tests =====+==== 9.2 Reliability tests ====
  
-A test of the BPM scope and the BPM averaging scope was run overnight. The two inputs of a BPM were fed by two function generator ouputs with the following settings:+A test of the BPM scope and the BPM averaging scope was run overnight. The two inputs of a BPM were fed by two function generator outputs with the following settings:
  
   * sine signal   * sine signal
   * frequency: 1 MHz   * frequency: 1 MHz
-  * output to ADC0: 2.001 {{:ds:projects:cryring:bpm:gateware:documentation:/math_1f363008.png?nolink&0x24}} +  * output to ADC0: 2.001 {{:ds:projects:cryring:bpm:gateware:/math_1f363008.png?nolink&0x24}} 
-  * output to ADC1: 0.667 {{:ds:projects:cryring:bpm:gateware:documentation:/math_1f363008.png?nolink&0x24}}+  * output to ADC1: 0.667 {{:ds:projects:cryring:bpm:gateware:/math_1f363008.png?nolink&0x24}}
  
 According to equation 13.1, the expected BPM result for the chosen input amplitudes is 0.5. According to equation 13.1, the expected BPM result for the chosen input amplitudes is 0.5.
  
-The test was run for 12 hours, during which the scopes were read continously and histograms of the occurring results were created.+The test was run for 12 hours, during which the scopes were read continuously and histograms of the occurring results were created.
  
-{{:ds:projects:cryring:bpm:gateware:documentation:bpm_result_histogram.png| BPM result histogram}}+{{:ds:projects:cryring:bpm:gateware:bpm_result_histogram.png}}
  
-**Figure 13.1:** BPM result histogram+**Figure 9.1:** BPM result histogram
  
 The gateware was configured as follows: The gateware was configured as follows:
Line 2070: Line 1749:
   * number of samples per capture: 1024   * number of samples per capture: 1024
  
-{{:ds:projects:cryring:bpm:gateware:documentation:bpm_averaging_result_histogram.png| BPM averaging result histogram}}+{{:ds:projects:cryring:bpm:gateware:bpm_averaging_result_histogram.png}}
  
-**Figure 13.2:** BPM averaging result histogram+**Figure 9.2:** BPM averaging result histogram
  
 The resulting histograms do not show Gaussian distributions, but still seem to be reasonably confined. The deviations from Gaussian distributions might have been caused by temperature shifts during the night which might have affected the amplitudes. The resulting histograms do not show Gaussian distributions, but still seem to be reasonably confined. The deviations from Gaussian distributions might have been caused by temperature shifts during the night which might have affected the amplitudes.
  
-====== 14 System limitations ====== +===== 10 References =====
- +
-===== 14.1 CPU unit reboot ===== +
- +
-The FPGA bitstreams have to be loaded before CPU unit boots, otherwise the PCIe driver will not detect the FPGAs. This can be ensured by setting suitable power up delays in the MCH (see [[#1121_via_the_mchs_web_interface|chapter 11.2.1]]). +
- +
-Whenever a new bitstream is loaded to a FPGA, the CPU unit has to rebooted either via its Hot Swap Handle or remotely via the MCH (see [[#92_remote_power_cycling_of_the_cpu_unit|chapter 9.2]]). An operating system reboot does not work. +
- +
-===== 14.2 PLL not in lock on the FMC boards ===== +
- +
-With the current openMMC firmware, the PLLs on the FMC boards cannot lock, since there are no clocks connected to the reference clock inputs. This will result in slight clock frequency differences betweeen the processing clock on the AFC board and the ADC clocks on the FMC boards. +
- +
-There are synchronization FIFOs which ensure correct clock domain crossings, but a small fraction of ADC samples might have to be discarded or repeated once, depending on which frequency is higher. +
- +
-This will always affect all the samples of a FMC board in parallel, so that no differences between the two input data streams of a single BPM will occur and no measurable effect on the BPM results should be observed. +
- +
-TODO: Change the openMMC firmware to configure the clock switch on the AFC board to route PCIE_CLK1 to FIN1_CLK3 and FIN2_CLK3, which are connected to the reference clock inputs. Currently, it is configured to route TCLKA from the AMC connector to FIN1_CLK3 and FIN2_CLK3. With Creotech’s MMC firmware, the locking of the PLLs could be observed. +
- +
-====== 15 References ======+
  
 [1] A. Reiter, R. Singh: Comparison of beam position calculation methods for application in digital acquisition systems. //Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment//, February 2018, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/Paper_BPM_Algorithm.pdf [1] A. Reiter, R. Singh: Comparison of beam position calculation methods for application in digital acquisition systems. //Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment//, February 2018, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/Paper_BPM_Algorithm.pdf
Line 2106: Line 1767:
 [5] Xilinx: 7 Series FPGAs Data Sheet: Overview, https://www.xilinx.com/support/documentation/data_sheets/ds180_7Series_Overview.pdf [5] Xilinx: 7 Series FPGAs Data Sheet: Overview, https://www.xilinx.com/support/documentation/data_sheets/ds180_7Series_Overview.pdf
  
-[6] Silicon Labs: Timing part decoder web page, https://www.silabs.com/timing/lookup-customize+[6] Silicon Labs (now Skyworks): Timing part decoder web page, https://tools.skyworksinc.com/TimingUtility/timing-part-number-search-results.aspx
  
-[7] Silicon Labs: Si571 datasheet, https://www.silabs.com/documents/public/data-sheets/si570.pdf+[7] Silicon Labs: Si571 datasheet, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/si570.pdf
  
-[8] Analog Devices: AD9510 datasheet, https://www.analog.com/media/en/technical-documentation/data-sheets/AD9510.pdf+[8] Analog Devices: AD9510 datasheet, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/AD9510.pdf
  
-[9] Renesas: ISLA216P datasheet, https://www.renesas.com/us/en/www/doc/datasheet/isla216p.pdf+[9] Renesas: ISLA216P datasheet, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/isla216p.pdf
  
 [10] Xilinx: Artix 7 datasheet: DC and AC Switching Characteristics, https://www.xilinx.com/support/documentation/data_sheets/ds181_Artix_7_Data_Sheet.pdf [10] Xilinx: Artix 7 datasheet: DC and AC Switching Characteristics, https://www.xilinx.com/support/documentation/data_sheets/ds181_Artix_7_Data_Sheet.pdf
Line 2118: Line 1779:
 [11] AFC v3.1 schematics, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/Schematics_AFC_v3.1.pdf [11] AFC v3.1 schematics, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/Schematics_AFC_v3.1.pdf
  
-[12] NXP: LPCxpresso download web page, https://www.nxp.com/design/microcontrollers-developer-resources/lpc-microcontroller-utilities/lpcxpresso-ide-v8-2-2:LPCXPRESSO +[12] FMC ADC 250M 16B 4ch v1.2 schematics, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/Schematics_FMC_ADC_250M_16B_4ch_v1_2.pdf
- +
-[13] NXP: AMC documentation, https://www.nxp.com/docs/en/reference-manual/MSC8156AMCUM.pdf +
- +
-[14] NAT GmbH: MCH technical reference manual, https://www.nateurope.com/manuals/nat_mch_pciex48_v2x_man_hw.pdf +
- +
-[15] Micron: FBGA and Component Marking Decoder, https://www.micron.com/support/tools-and-utilities/fbga +
- +
-[16] FMC ADC 250M 16B 4ch v1.0 and v1.2 schematics, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/Schematics_FMC_ADC_250M_16B_4ch.pdf +
- +
-[17] FMC ADC 250M 16B 4ch v2.3 schematics, https://github.com/lnls-dig/fmc250-hw/blob/master/circuit_board/ADC.SchDoc +
- +
-[18] Anaren: Balun BD0205F5050A00 datasheet, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/Balun_BD0205F5050A00_datasheet.pdf+
  
 +[13] FMC ADC 250M 16B 4ch v2.3 schematics, https://github.com/lnls-dig/fmc250-hw/blob/master/circuit_board/ADC.SchDoc
  
 +[14] Anaren: Balun BD0205F5050A00 datasheet, https://git.gsi.de/BEA_HDL/datasheets/-/blob/master/Balun_BD0205F5050A00_datasheet.pdf
ds/projects/cryring/bpm.1600956582.txt.gz · Last modified: 2020/09/24 16:09 by rgeissler