Skip to content

Commit

Permalink
test: improve test cases for #429
Browse files Browse the repository at this point in the history
  • Loading branch information
antalsz committed Jan 10, 2025
1 parent 825d2ea commit 9c9e4c8
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
18 changes: 16 additions & 2 deletions quil-rs/src/program/scheduling/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,15 +819,29 @@ LOAD bits4[0] bits integers[0] # read
"#
}

build_dot_format_snapshot_test_case! {
memory_dependency_not_in_block_terminator,
r#"
DECLARE ro BIT
DECLARE depends_on_ro BIT
NONBLOCKING CAPTURE 0 "ro_rx" flat(duration: 2.0000000000000003e-06, iq: 1.0, scale: 1.0, phase: 0.8745492960861506, detuning: 0.0) ro
MOVE depends_on_ro ro
JUMP @eq
LABEL @eq
PULSE 0 "ro_tx" gaussian(duration: 1, fwhm: 2, t0: 3)
"#
}

build_dot_format_snapshot_test_case! {
memory_dependency_in_block_terminator,
r#"
DECLARE ro BIT
NONBLOCKING CAPTURE 0 "readout_rx" flat(duration: 2.0000000000000003e-06, iq: 1.0, scale: 1.0, phase: 0.8745492960861506, detuning: 0.0) ro
NONBLOCKING CAPTURE 0 "ro_rx" flat(duration: 2.0000000000000003e-06, iq: 1.0, scale: 1.0, phase: 0.8745492960861506, detuning: 0.0) ro
JUMP-WHEN @eq ro
LABEL @eq
PULSE 0 "tx" gaussian(duration: 1, fwhm: 2, t0: 3)
PULSE 0 "ro_tx" gaussian(duration: 1, fwhm: 2, t0: 3)
"#
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
source: quil-rs/src/program/scheduling/graph.rs
expression: dot_format
---
digraph {
entry -> "block_0_start";
entry [label="Entry Point"];
subgraph cluster_0 {
label="block_0";
node [style="filled"];
"block_0_start" [shape=circle, label="start"];
"block_0_start" -> "block_0_0" [label="ordering
timing"];
"block_0_0" [shape=rectangle, label="[0] NONBLOCKING CAPTURE 0 \"ro_rx\" flat(detuning: 0, duration: 2.0000000000000003e-6, iq: 1, phase: 0.8745492960861506, scale: 1) ro[0]"];
"block_0_0" -> "block_0_1" [label="await capture"];
"block_0_0" -> "block_0_end" [label="ordering
timing"];
"block_0_1" [shape=rectangle, label="[1] MOVE depends_on_ro[0] ro[0]"];
"block_0_1" -> "block_0_end" [label="ordering"];
"block_0_end" [shape=circle, label="end"];
}
"block_0_end" -> "@eq_start" [label="always"];
subgraph cluster_1 {
label="@eq";
node [style="filled"];
"@eq_start" [shape=circle, label="start"];
"@eq_start" -> "@eq_0" [label="ordering
timing"];
"@eq_start" -> "@eq_end" [label="ordering
timing"];
"@eq_0" [shape=rectangle, label="[0] PULSE 0 \"ro_tx\" gaussian(duration: 1, fwhm: 2, t0: 3)"];
"@eq_0" -> "@eq_end" [label="ordering
timing"];
"@eq_end" [shape=circle, label="end"];
}
}

0 comments on commit 9c9e4c8

Please sign in to comment.