-
Notifications
You must be signed in to change notification settings - Fork 148
Pr 43 build a complete qick testbench to run simulations #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
meeg
merged 29 commits into
main
from
PR-43-build-a-complete-qick-testbench-to-run-simulations
Jun 15, 2026
Merged
Changes from 15 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
5f05823
[openquantumhardware/qick_internal#22] Added RB_tProc_v1_experiment n…
mmdiego c430151
[openquantumhardware/qick_internal#22] Updated test03_random_benchmar…
mmdiego cbde8bc
[openquantumhardware/qick_internal#22] Renamed test03_random_benchmar…
mmdiego ca61e2d
Merge remote-tracking branch 'origin/main' into 43-build-a-complete-q…
mmdiego 2641a12
Merge remote-tracking branch 'origin/main' into 43-build-a-complete-q…
mmdiego 062db18
[openquantumhardware/qick_internal#43] Moved testbench_notebooks to f…
mmdiego 13cfcc1
Merge remote-tracking branch 'origin/main' into 43-build-a-complete-q…
mmdiego c153651
[openquantumhardware/qick_internal#43] moved stimuli and tasks code f…
mmdiego a838f28
[openquantumhardware/qick_internal#43] created qick_dut and moved tpr…
mmdiego 90192c9
[openquantumhardware/qick_internal#43] moved sg and ro blocks into qi…
mmdiego 0cbd9e8
[openquantumhardware/qick_internal#43] moved model_DAC_ADC to its own…
mmdiego e2340e7
Merge remote-tracking branch 'origin/main' into 43-build-a-complete-q…
mmdiego 4bf966f
Merge branch '43-qick-testbench-ai-mods' into 43-build-a-complete-qic…
mmdiego 4bccba1
[openquantumhardware/qick_internal#43] Added option to dump_cfg() to …
mmdiego 8a3c136
Merge remote-tracking branch 'qick_internal/43-build-a-complete-qick-…
mmdiego 5d652c7
update version
qickbot 0d49d48
[openquantumhardware/qick_internal#43] Fixed some Copilot review comm…
mmdiego 431f15d
Merge remote-tracking branch 'qick_internal/43-build-a-complete-qick-…
mmdiego 74279ae
Merge branch 'PR-43-build-a-complete-qick-testbench-to-run-simulation…
mmdiego 55dd4e6
[openquantumhardware/qick_internal#43] Fixed some Copilot review comm…
mmdiego dbc08ea
Merge remote-tracking branch 'qick_internal/43-build-a-complete-qick-…
mmdiego d57c7f5
[openquantumhardware/qick_internal#43] Fixed some Copilot review comm…
mmdiego 49bf0b9
Merge remote-tracking branch 'qick_internal/43-build-a-complete-qick-…
mmdiego 580183e
Merge remote-tracking branch 'origin/main' into PR-43-build-a-complet…
mmdiego a05f5b6
update version
qickbot 0dd600a
Merge remote-tracking branch 'origin/main' into PR-43-build-a-complet…
mmdiego fc871d5
update version
qickbot 69eeac4
move print_sg_mem to where it belongs
meeg 18ab912
add caution in docstring
meeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -462,4 +462,4 @@ module fifo_dc_axi_xpm | |
|
|
||
| // End of xpm_fifo_async_inst instantiation | ||
|
|
||
| endmodule; | ||
| endmodule | ||
638 changes: 638 additions & 0 deletions
638
firmware/notebooks/qick_rb/RB_tProc_v1_experiment.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
1,724 changes: 1,724 additions & 0 deletions
1,724
firmware/notebooks/qick_rb/RB_tProc_v2_experiment.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| /////////////////////////////////////////////////////////////////////////////// | ||
| // Fermilab National Accelerator Laboratory | ||
| /////////////////////////////////////////////////////////////////////////////// | ||
| // Description: | ||
| // DAC-ADC RF frontend model | ||
| /////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| module model_DAC_ADC #( | ||
| parameter integer DAC_W = 16, | ||
| parameter integer ADC_W = 16, | ||
| parameter integer BUFFER_SIZE = 16 | ||
| )( | ||
| input wire clk_DAC, | ||
| input wire [DAC_W-1:0] dac_sample, | ||
|
|
||
| input wire clk_ADC, | ||
| output logic [ADC_W-1:0] adc_sample, | ||
|
|
||
| input int mode // 0 = ZOH, 1 = linear | ||
| ); | ||
|
|
||
| // Parameters | ||
| real pi = 3.14159265358979; | ||
|
|
||
| // DAC samples Buffer | ||
| real buffer_samples[BUFFER_SIZE]; | ||
| real buffer_times[BUFFER_SIZE]; | ||
| int wr_ptr = 0; | ||
|
|
||
| // Internal Signals | ||
| real signal_in; | ||
| real sampled_ADC; | ||
|
|
||
| initial begin | ||
| for (int i=0; i<BUFFER_SIZE; i++) begin | ||
| buffer_samples[i] = 0.0; | ||
| buffer_times[i] = 0.0; | ||
| end | ||
| end | ||
|
|
||
| // DAC processing | ||
| always @(posedge clk_DAC) begin | ||
| real t_now = $realtime * 1e-9; | ||
| signal_in = $signed(dac_sample) / 2.0**(DAC_W-1); | ||
|
|
||
| buffer_samples[wr_ptr] = signal_in; | ||
| buffer_times[wr_ptr] = t_now; | ||
| wr_ptr = (wr_ptr + 1) % BUFFER_SIZE; | ||
|
|
||
| // $display("[%0t ns] DAC sample: %f", $time, signal_in); | ||
| end | ||
|
|
||
| // ADC processing | ||
| always @(posedge clk_ADC) begin | ||
| real t_adc = $realtime * 1e-9; | ||
| real val; | ||
| case (mode) | ||
| 0: begin | ||
| // ZOH: last value | ||
| int idx_last = (wr_ptr + BUFFER_SIZE - 1) % BUFFER_SIZE; | ||
| val = buffer_samples[idx_last]; | ||
| end | ||
| 1: begin | ||
| // Linear: use last 2 samples to interpolate | ||
| int idx_curr = (wr_ptr + BUFFER_SIZE - 1) % BUFFER_SIZE; | ||
| int idx_prev = (wr_ptr + BUFFER_SIZE - 2) % BUFFER_SIZE; | ||
| real t1 = buffer_times[idx_prev]; | ||
| real t2 = buffer_times[idx_curr]; | ||
| real y1 = buffer_samples[idx_prev]; | ||
| real y2 = buffer_samples[idx_curr]; | ||
| if (t2 != t1) | ||
| val = y1 + (t_adc - t1) * (y2 - y1)/(t2 - t1); | ||
| else | ||
| val = y2; | ||
| end | ||
| default: val = 0.0; | ||
| endcase | ||
|
|
||
| if (val > 1.0) sampled_ADC = 1.0; | ||
| else if (val < -1.0) sampled_ADC = -1.0; | ||
| else sampled_ADC = val; | ||
| adc_sample = sampled_ADC * $signed(2**(ADC_W-1)-1); | ||
|
|
||
| // $display("[%0t ns] ADC sample (mode %0d): %f", $time, mode, sampled_ADC); | ||
| end | ||
|
|
||
| endmodule |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.