Fast DAC
We use fast DAC chip AD9152 from Analog Device, converts digital to analog signal. So FPGA will be Transmitter and AD9152 is Receiver. This IC includes 2 DACs:
- DAC0 : output IOUT
- DAC1 : output QOUT
Kiwi device has qu-bit rate 80MHz, we use time-bin encoded, so DAC0 in Alice generates double pulse at 80MHz, DAC1 also generates signal for PM at the same rate. We calculated the JESD204B parameters before designing the sytem, you can find the parameters in registers we set for the chip. We set:
- lane rate 10Gbits/s per lane
- 4 lanes
- jesd in mode 4
- subclass 1
- refclk 200MHz
- sysref clk 3.125MHz
Read JESD204 Survival Guide and AD9152 datasheet to understand protocol. Read chapter JESD204B Setup in AD9152 datasheet to calculate lane rate.
Receiver AD9152
- refclk and sysref comes from clock chip ltc9152
- registers setting in order by these functions in control software
Set_reg_powerup()
Set_reg_plls()
Set_reg_seq1()
Set_reg_seq2()
Transmitter FPGA
fastdac block is splited into 3 layers:
- jesd transport: module jesd_transport.v
- jesd: module jesd204b_tx_wrapper.v
- jesd phy: IP jesd204 phy
To synchronise the output with PPS, add an extra module to sync_tx_ready to PPS
Sync_tx_tready
This module will synchronize tx_tready to PPS to make sure the analog output of the Receiver will be synced
Port descriptions
| Signals name | Interface | Dir | Init status | Description |
|---|---|---|---|---|
| pps_i | - | I | - | PPS from WRS |
| tx_core_clk | Clock | I | 200MHz | clock for logic |
| tx_core_rst | Reset | I | - | reset for jesd tx core |
| tx_tready | I | - | signal from jesd, ready to send data | |
| tx_tready_o | O | - | tx_tready synced to PPS |
Jesd transport
Generate data to provide for Jesd. There are 2 DACs inside AD9152, so DAC0 in charge of signal for AM, DAC1 in charge of signal for PM.
- Maximum output power for each DAC is 600mV peak-to-peak into 50 Ohm load
- Sampling rate for each DAC: 800M sample/s, qubit rate = 80 MHz. So you have 10 samples for 1 double pulse period
Signal for AM
- qbit is encoded in 5 ns double pulse, pulse rate is 80MHz (12,5ns). Pulse Generator(PG) triggers the rising edge of the DAC0 signal to generate the pulses, so make sure distance between 2 rising edge is 5ns +- 200ps. You can play around with Pulse Generator threshold and DAC0 signal to find the best position for PG trigger
Signal for PM
- Amplitude of DAC1 signal defines the phase difference applied to 2 bins from 0 to 2\(\pi\). Depends on power of the PM amplifier, you can reach higher amplitude. Two peaks of PM signal for 1 qubit is symetrique.
- With BB84 protocol, the phase is random, there are 4 phase possibilities. Which means 1 double pulse requires 2 bits of rng, rng data rate = 80M* 2 = 160Mbits/s
- SwiftPro RNG USB output RNG data at roughly 200Mbits/s. So you have to read from fifo output 4bits at 40MHz -> 4bits rng selects the amplitude for DAC1 signal
- For the purpose of calibration, there is one option, rng can be put to dpram and read out 4bits at 40MHz. Knowing value of rng helps finding position of modulated qubit
- For visibility, apply sequence of 64 phases (from 0 to 2\(\pi\) or higher)
- Signal can be shifted 10 steps, 1,25ns each step
Port descriptions
| Signals name | Interface | Dir | Init status | Description |
|---|---|---|---|---|
| axil signals | s_axil | IO | - | standard axilite interface for r/w registers |
| s_axil_aclk | Clock | I | 15MHz | clock for axil interface |
| s_axil_aresetn | Reset | I | - | reset for axil interface, active LOW |
| s_axis_tdata[127:0] | s_axis | I | - | rng data from xdma0_h2c |
| s_axis_tvalid | s_axis | I | - | stream valid indicator |
| s_axis_tready | s_axis | O | - | raise high when ready to receive data |
| s_axis_clk | Clock | I | 250MHz | clock for axis interface |
| s_axis_tresetn | Reset | I | - | reset for axis interface, active LOW |
| tx_tdata[127:0] | tx | O | - | send data to jesd layer |
| tx_tready | tx | I | - | jesd indicator ready to receive data |
| tx_core_clk | Clock | I | 200MHz | clock domain for logic |
| tx_core_rst | Reset | I | - | reset for logic, active HIGH |
| tdata200_mod | - | I | - | data from tdc |
| gate_pos0/1/2/3 | - | I | - | gate_pos0/1/2/3 from tdc |
| q_gc_time_valid_mod16 | - | I | - | q_gc modulo 16 |
| rd_en_4 | - | O | - | enable signal at 40MHz |
| rd_en_16 | - | O | - | enable signal at 10MHz |
| rng_value[3:0] | - | O | - | rng data send to ddr to save |
| other ports | - | O | - | for debugging |
User parameters
| Parameter | Value | Description |
|---|---|---|
| C_S_Axil_Addr_Width | 16 | Address width of axil interface |
| C_S_Axil_Data_Width | 32 | Address width of axil interface |
Axil registers
From the Axil address distribution table, module target jesd_transport takes 64K from offset 0x0003_0000
| Offset | max address | Range | Target |
|---|---|---|---|
| 0x0003_0000 | 0x0003_1000 | 4096 | Regs for parameters |
| 0x0003_1000 | 0X0003_2000 | 4096 | Data for dpram_seqs |
| 0x0003_2000 | 0X0004_0000 | 57344 | Data for dpram_rng |
Tables of Registers for parameters, base is 0x0003_0000 Address of slv_reg(n) = 0x0003_0000 + 4 * n
slv_reg1 - R/W Access - Configuration
| Bits | Signal name | HW Wire | Action/Value | Description |
|---|---|---|---|---|
| 31:16 | fastdac_up_offset_o | fastdac_up_offset_o | - | up offset in feedback mode of Bob |
| 15:8 | - | - | - | Reserved 0 |
| 7:4 | fastdac_zero_pos_o | fastdac_zero_pos_i | max 15 | Define position to insert the zero on PM signal |
| 3:0 | fastdac_amp_dac1_shift_o | shift_i | max 10 | shift step for PM signal |
slv_reg2 - R/W Access - Configuration
| Bits | Signal name | HW Wire | Action/Value | Description |
|---|---|---|---|---|
| 31:16 | fastdac_amp_dac1_o | fastdac_amp_dac1_i | - | amplitude0 for PM signal |
| 15:0 | fastdac_amp_dac1_o | fastdac_amp_dac1_i | - | amplitude1 for PM signal |
slv_reg3 - R/W Access - Trigger Control
| Bits | Signal name | HW Wire | Action/Value | Description |
|---|---|---|---|---|
| 31:1 | - | - | - | Reserved 0 |
| 0 | dac1_reg_en_o | reg_en_o | Pull LOW to HIGH | Enable to update registers |
slv_reg4 - R/W Access - Configuration
| Bits | Signal name | HW Wire | Action/Value | Description |
|---|---|---|---|---|
| 31:16 | - | - | - | Reserved 0 |
| 15:8 | fastdac_dpram_max _addr_seq_dac1_o | fastdac_dpram_max _addr_seq_dac1_i | - | dpram_seq max read add |
| 7:0 | fastdac_dpram_max _addr_seq_dac0_o | fastdac_dpram_max _addr_seq_dac0_i | - | dpram_seq max read add |
slv_reg5 - R/W Access - Configuration
| Bits | Signal name | HW Wire | Action/Value | Description |
|---|---|---|---|---|
| 31:5 | - | - | - | Reserved 0 |
| 4 | fastdac_dac0_mode_o | fastdac_dac0_mode_i | 1:fpga hardcoded sequence 0:from dpram | Choose which sequence for AM signal |
| 3 | fastdac_zero_mode_o | fastdac_zero_mode_i | 1:enable 0:disable | Enable insert zeros to PM signal |
| 2 | fastdac_fb_mode_o | fastdac_fb_mode_i | 1:enable 0:disable | Enable feedback mode on Bob |
| 1 | fastdac_dac1_mode_o | fastdac_dac1_mode_i | 1:fpga hardcoded sequence 0:from dpram | Choose which sequence for PM signal |
| 0 | fastdac_rng_mode_o | fastdac_rng_mode_i | 1:tRNG 0:dpram_rng | Choose which source of RNG |
slv_reg6 - R/W Access - Configuration
| Bits | Signal name | HW Wire | Action/Value | Description |
|---|---|---|---|---|
| 31:16 | fastdac_amp_dac2_o | fastdac_amp_dac2_i | - | amplitude2 for PM signal |
| 15:0 | fastdac_amp_dac2_o | fastdac_amp_dac2_i | - | amplitude3 for PM signal |
slv_reg7 - R/W Access - Configuration
| Bits | Signal name | HW Wire | Action/Value | Description |
|---|---|---|---|---|
| 31:15 | - | - | - | Reserved 0 |
| 14:0 | fastdac_dpram_max _addr_rng_dac1_o | fastdac_dpram_max _addr_rng_dac1_i | - | dpram_rng max read address |
Programming note
dpram_seqs: address range is 4096, maximum you can write 1024 words to each dpram
dpram_rng: address range is 57344, maximum you can write 14336 words to dpram_rng. For calibration procedure over:
- 100km optical fiber (0.5ms), you need a sequence of 20000 dpram_rng [3:0], means 2500 axil words
- 10km optical fiber, you need 2000 dpram_rng[3:0], means 250 axil words
fifos_rng: SwiftRro RNG output data rate around 200Mb/s, we read fifo in fpga at 160Mb/s.
There are several MUXs, simply choosing different modes for calibration purpose. When running the protocol, turn on all modes to 1
You have these 3 functions in software control to send data and write registers in jesd transport layer
Jesd
Our developper replaces AMD JESD204 IP by jesd204b_tx_wrapper.v so you don't need to pay AMD for JESD204 IP.However, this module supports only jesd204b protocol in mode 4 and mode 10. This function in software control sets all registers for jesd204b_tx_wrapper.v
Read Jesd204b overview written by our developper
Jesd phy
Physical layer, where the stream of data from jesd is mapped to 4 physical GT lanes. This IP is provided by AMD.
Process to run scripts
python main.py party_name --sequence arg0
python main.py party_name --shift arg0 arg1 arg2 arg3 arg4 arg5
python main.py party_name --fda_init
--sequence includes:
- write samples for DACs to dpram0 and dpram1 from file, arg0: choose double pulse, single pulse or 0 to generate on DAC0, fix sequence 64 angles on DAC1
- write rng sequence to rng_dpram from file
- write the max_address value to read out from dpram0, dpram1, rng_dpram
--shift:
- arg0: mode
Remind you setting mode in slave_reg5
| Slave_reg | Reg name | Description |
|---|---|---|
| slv_reg5[0] | fastdac_rng_mode_o | rng_mode |
| slv_reg5[1] | fastdac_dac1_mode_o | dac1_mode |
| slv_reg5[2] | fastdac_fb_mode_o | fb_mode |
| slv_reg5[3] | fastdac_zero_mode_o | zero_mode |
Depends on which calibration procedure, change the mode as your requirements
| rng_mode | description | usecase |
|---|---|---|
| 0 | fix sequence for dac1 to dpram | phase is sequence of 64 angles in linear amplitude |
| 2 | random amplitude, fake rng | find shift delay |
| 6 | random amplitude, true rng data, feedback on | find optical delay |
| 15 | random amplitude, true rng data, feedback on, insert zero | running qkd |
- arg1 to arg4: amplitude of the phase signal [from -1 to 1]
- arg5: shift value from 0 to 10
--fda_init:
-
Write configuration for jesd module
-
Reset jesd module
-
Set all registers for receiver ad9152
-
Read back some registers of receiver for monitoring
0x084 & 0x281: dac pll and serdes pll locked status0x302: dyn_link_latency, should be 0. Otherwise, run again the fda_init
0x470 to 0x473: all should be 0x0f, indicates all layers of jesd204b protocol is established