WEBVTT

1
00:00:00.000 --> 00:00:03.180
Last time, a decision let data through.

2
00:00:03.180 --> 00:00:06.380
Now a decision chooses a path.

3
00:00:06.960 --> 00:00:09.120
Start with two eight-bit channels.

4
00:00:09.680 --> 00:00:12.080
Select zero routes the first byte.

5
00:00:12.080 --> 00:00:14.720
Select one routes the second.

6
00:00:14.720 --> 00:00:19.560
The control line chooses the path and the
data lines carry the byte.

7
00:00:20.090 --> 00:00:23.830
Add a third channel and use two select
bits.

8
00:00:25.250 --> 00:00:30.110
Zero zero picks A, zero one picks B, and
one zero picks C.

9
00:00:30.890 --> 00:00:36.770
One one has no channel, so this
specification sets data and valid to zero.

10
00:00:37.590 --> 00:00:39.990
A valid channel can also carry a zero
byte.

11
00:00:40.665 --> 00:00:44.985
An if and else can express a two-input
mux.

12
00:00:45.645 --> 00:00:50.045
For several exact selector values, a plain
case also works.

13
00:00:50.725 --> 00:00:54.005
Here each branch drives data and valid
together.

14
00:00:54.665 --> 00:00:58.885
Pick any row, including the default, and
you can find both output values.

15
00:00:59.420 --> 00:01:02.860
Separate request signals may both be high.

16
00:01:03.620 --> 00:01:05.600
Here A has priority.

17
00:01:06.440 --> 00:01:09.860
If A requests service, the first branch
wins.

18
00:01:10.600 --> 00:01:13.500
Only when A is low do we test B.

19
00:01:14.280 --> 00:01:17.660
Include the both-high row, since single

20
00:01:17.660 --> 00:01:20.880
requests pass even with the priority
reversed.

21
00:01:21.470 --> 00:01:25.590
Remove default and go from zero one to one
one.

22
00:01:26.030 --> 00:01:29.350
The complete design clears data and valid.

23
00:01:30.090 --> 00:01:34.510
The incomplete design keeps the B byte and
valid stays high.

24
00:01:35.410 --> 00:01:38.510
Try zero zero followed by one one.

25
00:01:38.950 --> 00:01:40.770
This time it keeps A.

26
00:01:41.330 --> 00:01:43.490
The output now depends on history.

27
00:01:43.960 --> 00:01:49.020
The tool sees that the uncovered branch
needs the old value.

28
00:01:50.180 --> 00:01:53.680
In this lab, synthesis diagnoses an
inferred

29
00:01:53.680 --> 00:01:56.960
latch in the incomplete combinational
block.

30
00:01:57.920 --> 00:02:02.340
Check the assignment paths with legacy
always star as well.

31
00:02:03.280 --> 00:02:05.540
Give each output a clear driver.

32
00:02:06.130 --> 00:02:08.830
Both versions assign both variables.

33
00:02:09.570 --> 00:02:13.710
On the left, stage the input before
copying it to the output.

34
00:02:14.610 --> 00:02:19.170
On the right, the first line sees the
previous staged value.

35
00:02:19.790 --> 00:02:23.550
The block does not rerun just because it
wrote that value itself.

36
00:02:24.455 --> 00:02:27.975
Drive zero, then one, then zero.

37
00:02:28.735 --> 00:02:30.915
The repaired output follows the input.

38
00:02:31.695 --> 00:02:37.075
The bad version reads X initially, then
reads the previous zero and previous one.

39
00:02:37.875 --> 00:02:39.815
These are the lab simulation samples.

40
00:02:40.555 --> 00:02:44.475
The example has no clock, so do not infer
a pipeline stage.

41
00:02:45.375 --> 00:02:50.355
When enabled, this mistaken circuit drives
an output from its own inverse.

42
00:02:51.175 --> 00:02:52.995
Follow the path around the loop.

43
00:02:53.555 --> 00:02:56.035
There is no storage element in that path.

44
00:02:56.855 --> 00:02:59.035
The lab runs a bounded structure check,

45
00:02:59.355 --> 00:03:02.075
since simulators can handle zero-delay
loops differently.

46
00:03:02.660 --> 00:03:06.780
Restore default and replay the same
stimulus.

47
00:03:07.700 --> 00:03:13.900
Reaching one one from either path now
gives zero data and valid low.

48
00:03:14.900 --> 00:03:19.100
Inspect the synthesized structure for
unintended latches.

49
00:03:19.760 --> 00:03:23.100
What happens if the downstream block
ignores

50
00:03:23.100 --> 00:03:25.440
valid and treats zero as a measurement?

