﻿1
00:00:12,360 --> 00:00:16,200
Rehab a test bench for the universal shift register.

2
00:00:16,330 --> 00:00:20,790
And so I'm just going to kind of quickly run through and just show you different parts of the test bench

3
00:00:20,860 --> 00:00:25,180
and you can kind of see what's going on to give you an idea of what to expect when you're creating a

4
00:00:25,180 --> 00:00:26,100
test bench.

5
00:00:26,320 --> 00:00:32,950
So the first line we have a library instantiation where we call in show libraries which we're now I'm

6
00:00:32,950 --> 00:00:35,380
sure you're somewhat familiar with.

7
00:00:35,380 --> 00:00:42,940
And we also have the libraries that are only use in the test bench on line 6 and 7 9 9.

8
00:00:42,960 --> 00:00:49,210
We're calling it a custom package that when you get to the lab section and you have to start creating

9
00:00:49,210 --> 00:00:55,210
and test benches I give you the files you need and show you how to them how to structure your folder

10
00:00:55,210 --> 00:00:59,790
so that you can use the sim them in that package.

11
00:01:00,120 --> 00:01:08,080
And we have the entity declaration which is called test us are then our component USAR which is the

12
00:01:08,950 --> 00:01:09,820
beach of design.

13
00:01:09,820 --> 00:01:13,960
We want to test and we go ahead and define the signals and constants.

14
00:01:13,960 --> 00:01:20,290
We're going to use to actually test universal shift register and then right or anything begin we have

15
00:01:20,290 --> 00:01:26,860
our device running tests which is us our go ahead and use a generic map port map to go ahead and generate

16
00:01:26,860 --> 00:01:31,540
this universal shift register and then we have our stimulus process.

17
00:01:31,900 --> 00:01:36,530
And in our stimulus process we have several different variables in that line right.

18
00:01:36,850 --> 00:01:45,760
And what these do are they're going to read in values from a text file or from a text file we're using

19
00:01:46,290 --> 00:01:54,340
and that will go ahead and essentially we're going to take these ideas from that infamous text file

20
00:01:54,400 --> 00:01:56,820
and it's going to compare him to the baddies.

21
00:01:56,830 --> 00:02:03,040
We actually get from the actual universal shift register and make sure the inputs match the outputs.

22
00:02:03,230 --> 00:02:06,050
And so that's essentially exactly what's going on here.

23
00:02:06,160 --> 00:02:13,480
We are reading in these by an input line in char and we're converting them to ask you to hack's which

24
00:02:13,480 --> 00:02:17,810
is what the function is declared and send them.

25
00:02:17,920 --> 00:02:22,600
And it all package and then we're going to read the line output line.

26
00:02:22,600 --> 00:02:29,260
We have a clock that we're toggling in 0 and 1 and then we have this wait for 10 seconds which is allows

27
00:02:29,290 --> 00:02:37,440
us to wait and toggle our clock back and forth and then we do have at the very end we kind of have a

28
00:02:38,130 --> 00:02:45,460
this this error reporting where if it's successful or if there's no we don't count any errors then we

29
00:02:45,460 --> 00:02:49,660
know it's a success and we can say success us our task completed.

30
00:02:49,900 --> 00:02:55,540
However otherwise we know that our device is broken or you can write whatever whatever type of warning

31
00:02:55,540 --> 00:02:59,010
you would like to use.

32
00:02:59,240 --> 00:03:03,550
Now I was just kind of a quick overview of what the U.S. Our testbench is like.

