1
00:00:00,840 --> 00:00:07,290
How can we create a given wave form as a test vector for an input of a logic circuit inviting such a..

2
00:00:09,940 --> 00:00:17,140
Sometimes we need to create a specific waveform for a logic socket input to test its functionality and

3
00:00:17,140 --> 00:00:17,710
timing.

4
00:00:17,890 --> 00:00:24,640
For example, assuming we should generate a single cycle pulse every four hundred nanoseconds to test

5
00:00:24,640 --> 00:00:25,240
the design.

6
00:00:27,750 --> 00:00:33,540
To focus on generating away from signals in a test bench, let's consider a very simple logic design

7
00:00:33,780 --> 00:00:41,340
that connects its input argument to its output when they enable signal is one notice that if you simply

8
00:00:41,340 --> 00:00:47,160
connect the input to the output, the description is synthesized into a combination of circuit, a simple

9
00:00:47,160 --> 00:00:49,990
wire, which is not desirable in this election.

10
00:00:50,760 --> 00:00:57,300
I have used the register called State in the description so it will be synthesized into sequential circuit

11
00:00:57,450 --> 00:00:58,350
with the clock signal.

12
00:01:01,020 --> 00:01:04,440
Let's assume the design clock frequency is 100 megahertz.

13
00:01:05,830 --> 00:01:12,700
As the first example, we should generate a regular single cycle pulse with the period of 80 nanoseconds,

14
00:01:13,570 --> 00:01:17,020
the pulse rate is 10 nanosecond, which is one clock period.

15
00:01:18,000 --> 00:01:24,060
The input signal is in a state one four one clock cycle and seven cycles in the state.

16
00:01:26,410 --> 00:01:30,580
In summary, one period of the input signal takes eight clock cycles.

17
00:01:32,640 --> 00:01:37,230
Let's try the test punch code to generate such input for our design under test.

18
00:01:38,620 --> 00:01:45,850
After including the required header files and the function for site we define to macro's and an M which

19
00:01:45,850 --> 00:01:53,020
are 10 and eight respectively, each input signal period requires eight clock cycles and we will generate

20
00:01:53,170 --> 00:01:55,090
10 periods of the input signal.

21
00:01:55,980 --> 00:02:02,130
The main function returns the status variable, which is zero all the time in this example, then we

22
00:02:02,130 --> 00:02:06,390
should define a few variables corresponding to the design top function arguments.

23
00:02:08,300 --> 00:02:14,530
In the first function called Let's pass a zero value to the design, remember that each function call

24
00:02:14,540 --> 00:02:21,200
takes one clock cycle as the design is based on the single cycle design scheme to generate one period

25
00:02:21,200 --> 00:02:27,050
of the input signal, we should call the design eight times in which only during the first call the

26
00:02:27,050 --> 00:02:30,770
input is one if loop can implement this condition.

27
00:02:32,240 --> 00:02:38,600
To repeat the signal period 10 times, if all loop can be used and compassing the aforementioned as

28
00:02:38,600 --> 00:02:44,000
it's in, therefore this code fits the design under test with the required periodic signal.

29
00:02:47,510 --> 00:02:53,270
After synthesizing the code and performing the art, you'll see code simulation, this diagram shows

30
00:02:53,270 --> 00:02:56,710
that signal timing, which is exactly the one required.

31
00:02:59,670 --> 00:03:06,090
Now, as a second example, let's generate the following signal as a design in one period of the signal

32
00:03:06,090 --> 00:03:07,410
contains eight of.

33
00:03:08,740 --> 00:03:11,140
Each bit lasts for 20 hours.

34
00:03:12,140 --> 00:03:19,940
The data in one period is one zero zero one one one zero one again, the design clock frequency is one

35
00:03:19,940 --> 00:03:21,050
hundred megahertz.

36
00:03:23,470 --> 00:03:26,380
We have a test match code similar to the previous code.

37
00:03:35,000 --> 00:03:41,900
We can define an area to say the data pattern in one period of the signal, then we can call the design

38
00:03:41,900 --> 00:03:44,770
function and send input data using this area.

39
00:03:45,170 --> 00:03:50,950
We should notice that each data elements duration is 20 nanoseconds, which means to function calls

40
00:03:51,590 --> 00:03:55,670
as each function call takes one clock cycle, which is 10 nemecek.

41
00:03:59,720 --> 00:04:06,680
After synthesizing the code and performing the RTL simulation, this diagram shows the signal timing,

42
00:04:06,830 --> 00:04:08,690
which is exactly the one required.

43
00:04:12,300 --> 00:04:14,700
This video is the last lecture in this section.

44
00:04:15,030 --> 00:04:21,000
Therefore, the next lecture will give you a few exercises to practice what you have learned throughout

45
00:04:21,000 --> 00:04:21,480
this section.

46
00:04:24,050 --> 00:04:30,170
These are our takeaway messages that can generate given away from signals for the design designing,

47
00:04:31,130 --> 00:04:36,650
considering the single cycle design approach, the number of function calls directly determines the

48
00:04:36,650 --> 00:04:41,750
number of times that an input data are applied to the design during simulation.

49
00:04:42,200 --> 00:04:48,200
An area that saves the input away from data can be used in a statement to be applied to the design under

50
00:04:48,200 --> 00:04:48,620
test.

51
00:04:50,660 --> 00:04:55,760
Now, the quiz question right at this point to apply the following to my form, to the input of the

52
00:04:55,760 --> 00:04:58,160
simple design proposed in this lecture.
