diff --git a/quil-rs/src/program/scheduling/graph.rs b/quil-rs/src/program/scheduling/graph.rs index 46ee5dca..b74582f6 100644 --- a/quil-rs/src/program/scheduling/graph.rs +++ b/quil-rs/src/program/scheduling/graph.rs @@ -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) "# } } diff --git a/quil-rs/src/program/scheduling/snapshots/quil_rs__program__scheduling__graph__graphviz_dot_tests__memory_dependency_not_in_block_terminator.snap b/quil-rs/src/program/scheduling/snapshots/quil_rs__program__scheduling__graph__graphviz_dot_tests__memory_dependency_not_in_block_terminator.snap new file mode 100644 index 00000000..25dacf43 --- /dev/null +++ b/quil-rs/src/program/scheduling/snapshots/quil_rs__program__scheduling__graph__graphviz_dot_tests__memory_dependency_not_in_block_terminator.snap @@ -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"]; + } +}