0
1
00:00:01,640 --> 00:00:08,350
How to use the Xilinx Vivado to generate the FPGA bitstream? The generated RTL IP by the Vivado-HLS 
1

2
00:00:08,360 --> 00:00:12,920
toolset requires the logic synthesis process to be converted to an FPGA bitstream. 
2

3
00:00:13,400 --> 00:00:14,250
The Xilinx Vivado Suite 
3

4
00:00:14,250 --> 00:00:16,220
can do this process.
4

5
00:00:16,370 --> 00:00:21,290
In this video, I am going to use this tool to create the FPGA bitstream file.
5

6
00:00:24,260 --> 00:00:29,600
Now run the Vivado IDE which can be done by double-clicking on the related icon on your desktop 
6

7
00:00:29,750 --> 00:00:36,140
or clicking on the program link in the "Start Menu" in Windows OS. If you are using a Linux based system, 
7

8
00:00:36,140 --> 00:00:38,480
you can run vivado command for this purpose.
8

9
00:00:40,390 --> 00:00:45,220
After running the Vivado, the first page appears where you can start managing your project.
9

10
00:00:47,160 --> 00:00:51,600
On the Quick Start section, you can create a new project or open an existing project. 
10

11
00:00:52,200 --> 00:00:57,810
There is also a list of the recent projects on the right-hand side that you can choose from and continue 
11

12
00:00:57,810 --> 00:00:59,640
working on your previous projects.
12

13
00:01:00,030 --> 00:01:05,460
Let's create a new project by clicking on the "Create Project" link. Then the "create new project" wizard 
13

14
00:01:05,460 --> 00:01:06,810
starts.  Press Next.
14

15
00:01:06,900 --> 00:01:11,130
Select a name for your project and set a destination path for that. 
15

16
00:01:11,680 --> 00:01:15,750
It is a good practice to select the "Create project subdirectory" option. 
16

17
00:01:16,350 --> 00:01:18,140
Click next to get to the next step.
17

18
00:01:19,400 --> 00:01:26,180
Choose RTL project, as we don't have any source file in this course select "Do not specify source 
18

19
00:01:26,180 --> 00:01:33,470
at this time" option. And click Next. Choose the target FPGA or Board. Click on the board, choose digilentinc.com 
19

20
00:01:33,650 --> 00:01:37,370
from the vendor list and then select the Basys3 Board and press 
20

21
00:01:37,370 --> 00:01:43,130
Next, After reviewing the project summary, press on the Finish button to create the project. As we are 
21

22
00:01:43,130 --> 00:01:49,190
going to use the IP generated by Vivado-HLS and probably some of the IPs from the Xilinx library 
22

23
00:01:49,490 --> 00:01:55,310
and we don't have any RTL source file, so we follow the Xilinx IP integrator design flow.
23

24
00:01:56,290 --> 00:02:01,870
This design flow starts with creating a block design. For this purpose, click on the "Create Block Design" 
24

25
00:02:01,870 --> 00:02:03,550
link on the left hand-side pane.
25

26
00:02:04,000 --> 00:02:07,140
You can choose a new name for the design or keep the default.  
26

27
00:02:07,570 --> 00:02:10,360
Let's keep the default. The Diagram 
27

28
00:02:10,360 --> 00:02:12,320
window appears to draw our design.
28

29
00:02:12,580 --> 00:02:16,540
First, we make our generated IP by Vivado-HLS accessible for the 
29

30
00:02:16,540 --> 00:02:19,810
Vivado IP integrator.
For this purpose,
30

31
00:02:20,020 --> 00:02:20,470
right-click 
31

32
00:02:20,470 --> 00:02:25,090
anywhere on the Diagram area and choose "IP settings…" from the drop-down menu.
32

33
00:02:25,660 --> 00:02:30,720
The setting window appears. Select IP->Repository from the left-hand side 
33

34
00:02:30,720 --> 00:02:35,140
list of options. In the IP Repository section on the right-hand side,
34

35
00:02:35,290 --> 00:02:36,280
click on the plus icon.
35

36
00:02:36,310 --> 00:02:42,580
Find the Vivado-HLS directory that you have already created for the basic_output project. 
36

37
00:02:43,480 --> 00:02:49,210
If you have multiple solution folders under the Vivado-HLS project directory, choose the desired 
37

38
00:02:49,210 --> 00:02:57,190
one and press Select. Viviado searches the solution folder for any possible IP available and adds the folder 
38

39
00:02:57,190 --> 00:03:04,520
to its repository. Click OK in the Add Repository dialog box.
Then press OK to get back to the Vivado IDE.
39

40
00:03:04,660 --> 00:03:10,960
Now press the plus singe in the middle of the Diagram area or right-click anywhere on the area and select 
40

41
00:03:10,960 --> 00:03:14,830
Add IP from the drop-down menu. In the search field, 
41

42
00:03:14,950 --> 00:03:19,150
write the name of your IP, which is basic_output in this lab.
42

43
00:03:19,840 --> 00:03:23,080
Double click on the IP name to add that to our design.
43

44
00:03:23,470 --> 00:03:27,070
Our IP with one output port appears in the Diagram area.
44

45
00:03:27,280 --> 00:03:31,150
Select the port and then right-click and select “make external” option. 
45

46
00:03:31,810 --> 00:03:35,680
You can change the name of the port and give that a more convenient name. 
46

47
00:03:36,400 --> 00:03:43,780
As this port drives the LEDs, we change the name in the external port properties view to led. Notice that 
47

48
00:03:44,020 --> 00:03:46,300
this port is a vector of 8 signals. 
48

49
00:03:46,750 --> 00:03:53,680
Then the individual signals can be addressed by led[0] to led[7]. To connect the design external-
49

50
00:03:53,680 --> 00:03:57,490
port to the FPGA pins that are connected to the LEDs on the board, 
50

51
00:03:57,760 --> 00:04:02,230
we should create a constraint file to define a set of physical I/O pin constraints.
51

52
00:04:03,130 --> 00:04:08,590
For this purpose, click on the Source tab on the left-hand side of the diagram area. Then right-
52

53
00:04:08,590 --> 00:04:12,220
click on the Constraints folder and select "Add Sources …" option.
53

54
00:04:14,430 --> 00:04:20,880
In the add sources dialog, make sure that "Add or create constraints" is selected then press Next button.
54

55
00:04:21,450 --> 00:04:23,400
and then click on the "Create File" button.
55

56
00:04:23,400 --> 00:04:29,970
Here you can choose a file name in the dialog box. For example, basic_output then 
56

57
00:04:29,970 --> 00:04:31,790
click OK and Finish.
57

58
00:04:31,800 --> 00:04:37,810
The XDC file editor will be opened to add your constraints.
Instead of adding constraints from scratch, you can use 
58

59
00:04:37,810 --> 00:04:44,190
the related XDC file provided by the board vendor and uncomment and modify the required constraints.
59

60
00:04:46,510 --> 00:04:51,940
Connect to digilent gitub site at https://github.com/Digilent/Basys3 
60

61
00:04:57,940 --> 00:05:05,680
then go the Resources/XDC path, open the Basys3_Master.xdc file and copy all its 
61

62
00:05:05,680 --> 00:05:12,850
contents into the xdc file in your  vivado project. To connect our design output to 8 LEDs, 
62

63
00:05:13,090 --> 00:05:16,770
we uncomment the first 8 LEDs constraints in the LEDs section. 
63

64
00:05:17,470 --> 00:05:23,020
The signal name in the constraints is LED, which is exactly the same name as the external port in 
64

65
00:05:23,020 --> 00:05:23,670
our design.
65

66
00:05:23,830 --> 00:05:26,290
So, no other changes are required.
66

67
00:05:31,640 --> 00:05:37,190
Right-click on the design name in the Sources tab and click on the "generate output products…" option. 
67

68
00:05:37,670 --> 00:05:43,370
This process creates some internal files and structures required for the rest of the Vivado design flow.
68

69
00:05:43,700 --> 00:05:45,250
The Generate Output Products 
69

70
00:05:45,260 --> 00:05:49,280
dialog will be opened. Accept the default values and click on Generate button.
70

71
00:05:58,740 --> 00:06:05,310
Then right-click on the design name in the Sources tab again and select the "Create HDL Wrapper…"  option,
71

72
00:06:06,000 --> 00:06:10,290
which creates an HDL top file that encompasses our design .
72

73
00:06:10,650 --> 00:06:16,860
Now we are ready to generate the FPGA bitstream.
ON the left-hand side pane, click on Generate Bitstream 
73

74
00:06:16,860 --> 00:06:18,610
under the PROGRAM AND DEBUG section.
74

75
00:06:19,080 --> 00:06:22,030
It takes a couple of minutes to generate the FPGA bitstream.
75

76
00:06:37,900 --> 00:06:43,420
After generating the FPGA bitstream, we are ready to program our FPGA board. In the next lecture, 
76

77
00:06:43,570 --> 00:06:44,740
I will explain that.
77

78
00:06:46,300 --> 00:06:52,260
These are our takeaway messages.  To be able to use the IP generated by Viviado-HLS in the Vivado IDE, 
78

79
00:06:53,650 --> 00:06:55,660
we should add that to the IP repository.
79

80
00:06:56,750 --> 00:07:02,030
The list of constraints provided by the Basys3 board vendor can be used and modified to add 
80

81
00:07:02,030 --> 00:07:04,550
constraints to our design targeting this board.
81

82
00:07:06,880 --> 00:07:13,060
Now, the quiz question. Keep the default port name in the design, then modify the required constraints 
82

83
00:07:13,060 --> 00:07:14,200
and generate the FPGA bitstream.
