qubic.rfsoc.hwconfig
ElementConfig implementation for current QubiC gateware running on the RFSoC (ZCU216) platform. Responsible for converting phase/frequencies/amplitudes from natural units into words/buffers that can be loaded into FPGA memory. Instantiated during assembly based on provided channel config.
RFSoCElementCfg
Bases: ElementConfig
ElementConfig implementation for QubiC 2.0 on ZCU216.
Source code in qubic/rfsoc/hwconfig.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
|
get_amp_word(amplitude)
Converts amplitude (normalized to 1) into command word for FPGA
Parameters:
Name | Type | Description | Default |
---|---|---|---|
amplitude |
float
|
|
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
amplitude word |
Source code in qubic/rfsoc/hwconfig.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
|
get_cw_env_word(env_ind)
Returns the envelope word for a CW pulse. env_ind
is required
since the CW pulse requires a single clock cycle of envelope
data to be stored.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env_ind |
int
|
starting index of the envelope in the envelope buffer |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
env_word |
Source code in qubic/rfsoc/hwconfig.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
get_env_buffer(env)
Converts env to a list of samples to write to the env buffer memory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env |
np.ndarray, list, or dict
|
if np.ndarray or list this is interpreted as a list of samples. Samples should be normalized to 1. if dict, a function in the qubitconfig.envelope_pulse library is used to calculate the envelope samples. env['env_func'] should be the name of the function, and env['paradict'] is a dictionary of attributes to pass to env_func. The set of attributes varies according to the function but should include the pulse duration twidth |
required |
Returns:
Type | Description |
---|---|
np.ndarray:
|
buffer of envelope data |
Source code in qubic/rfsoc/hwconfig.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
get_env_word(env_ind, length_nsamples)
Returns the envelope word stored in the pulse command, which encodes the starting address and length of the pulse envelope.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
env_ind |
int
|
starting index of the envelope in the envelope buffer |
required |
length_nsamples |
int
|
length of the envelope in samples (could be the same as the pulse length in samples, or lower if interpolating) |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
env_word |
Source code in qubic/rfsoc/hwconfig.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
get_freq_buffer(freqs)
Converts a list of frequencies (in Hz) to a buffer, where each frequency has 16 elements:
[0]
is a 32-bit freq word, encoding phase increment per clock cycle[1:15]
are 16 bit I MSB + 16 bit Q LSB, encoding 15 phase offsets for each sample (except 0) within a clock cycle 16-element arrays for each frequency are concatenated into a single 1D numpy array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
freqs |
list | ndarray
|
List of frequencies, in Hz |
required |
Returns:
Type | Description |
---|---|
np.ndarray:
|
Frequency buffer: array of concatenated 16-element frequency lists; shape
is |
Source code in qubic/rfsoc/hwconfig.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
get_phase_word(phase)
Converts phase to 17 bit unsigned int, normalized to 2*pi (i.e. 2*pi -> 2**17)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
phase |
float
|
input phase (in radians) |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
17-bit phase word |
Source code in qubic/rfsoc/hwconfig.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
length_nclks(tlength)
Converts pulse length in seconds to integer number of clock cycles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tlength |
float
|
time in seconds |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
time in clocks |
Source code in qubic/rfsoc/hwconfig.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|