WEBVTT

1
00:00:00.250 --> 00:00:03.210
The collector needs four accepted samples.

2
00:00:04.150 --> 00:00:07.950
Some clock cycles contain work and others
are idle.

3
00:00:08.890 --> 00:00:12.630
At each rising edge, check the sample
event.

4
00:00:13.570 --> 00:00:17.770
An accepted sample increases the
completion count by one.

5
00:00:18.510 --> 00:00:21.230
An idle cycle leaves the count where it
was.

6
00:00:22.250 --> 00:00:24.090
Reset clears the count.

7
00:00:25.010 --> 00:00:28.610
The first edge accepts a sample and
increments to one.

8
00:00:29.250 --> 00:00:30.690
The second edge is idle.

9
00:00:31.430 --> 00:00:33.890
The third contributes the second sample.

10
00:00:34.650 --> 00:00:36.390
The fourth edge is idle again.

11
00:00:37.390 --> 00:00:42.630
The final two edges accept one each, so
the sixth edge completes the job.

12
00:00:43.625 --> 00:00:47.585
Replay the same clock and events in both
counters.

13
00:00:48.685 --> 00:00:53.425
The cycle counter adds one even when the
second edge is idle.

14
00:00:54.405 --> 00:00:57.505
At the fourth edge it already displays
four,

15
00:00:57.945 --> 00:01:00.885
while the work log shows only two samples.

16
00:01:01.925 --> 00:01:04.965
The trace exposes the premature
completion.

17
00:01:06.042 --> 00:01:09.762
The four sample indices are zero through
three,

18
00:01:10.382 --> 00:01:12.842
so two bits are enough for an index.

19
00:01:14.082 --> 00:01:19.002
The completion count ranges from zero
through four and needs three bits.

20
00:01:20.022 --> 00:01:22.402
With a target of one it needs one bit.

21
00:01:22.902 --> 00:01:25.242
With a target of three it needs two.

22
00:01:26.333 --> 00:01:32.373
At the sixth edge, the old count is three
and a fresh sample is accepted.

23
00:01:33.413 --> 00:01:35.213
That edge completes the job.

24
00:01:36.113 --> 00:01:40.213
The count becomes four after the
nonblocking update.

25
00:01:41.133 --> 00:01:44.113
A test that waits to read four from the
old

26
00:01:44.113 --> 00:01:47.273
count would report completion too late.

27
00:01:48.375 --> 00:01:54.615
Once the count reaches four, another
sample event leaves the count at four.

28
00:01:55.535 --> 00:01:58.835
The receiver can keep reading the
completed count.

29
00:01:59.715 --> 00:02:03.915
A different interface could wrap or block
input at its limit.

30
00:02:04.795 --> 00:02:07.735
Each choice needs its own expected
results.

31
00:02:08.917 --> 00:02:12.577
Timeout measures elapsed edges separately.

32
00:02:13.457 --> 00:02:19.337
Arm it at the starting edge and count the
following rising edge as tick one.

33
00:02:20.197 --> 00:02:22.037
Set its limit to six ticks.

34
00:02:23.157 --> 00:02:27.177
In this example, completion and expiration
coincide.

35
00:02:28.037 --> 00:02:31.397
Give completion priority and signal
timeout

36
00:02:31.397 --> 00:02:33.717
only if the work is still incomplete.

37
00:02:34.833 --> 00:02:40.013
Replay the same event sequence and mark
the accepted samples.

38
00:02:40.853 --> 00:02:43.273
The count should increase at those marks,

39
00:02:43.753 --> 00:02:47.313
and the completion flag should identify
the final one.

40
00:02:48.153 --> 00:02:51.053
The next lesson uses that precise event

41
00:02:51.053 --> 00:02:54.573
to move the collector into its reporting
stage.

