0
1
00:00:00,800 --> 00:00:07,820
How can we add port interfaces to the arguments in our C description? A hardware design exchanges data and 
1

2
00:00:07,820 --> 00:00:14,390
control commands with the rest of the system using ports with properly associated interfaces. Adding 
2

3
00:00:14,390 --> 00:00:19,940
interfaces to ports in an HLS description is the main concept introduced in this video.
3

4
00:00:21,780 --> 00:00:29,370
Hardware designs use ports to communicate with other modules on a system. Ports have their own hardware 
4

5
00:00:29,370 --> 00:00:36,150
structure and can be a simple wire or a complex circuits implementing an interface, realising its sophisticated
5

6
00:00:36,150 --> 00:00:36,750
protocol.
6

7
00:00:37,440 --> 00:00:40,440
Ports can be output, input or inout. 
7

8
00:00:43,180 --> 00:00:50,410
Each input, output or inout signal in the hardware can have its own dedicated port. Also, a group of signals 
8

9
00:00:50,410 --> 00:00:52,570
can collaborate in implementing a port. 
9

10
00:00:53,020 --> 00:00:59,770
The hardware ports can be as simple as one-bit binary wire to 8-bit parallel data bus to complex 
10

11
00:00:59,770 --> 00:01:05,590
serial buses such as USB, DDR memory access port, I2C access port, just to name a few.
11

12
00:01:07,620 --> 00:01:13,380
This code is the simple LED controller description explained in the previous lecture. The function 
12

13
00:01:13,380 --> 00:01:18,540
body is a simple assignment that returns a fixed value to drive eight LEDs. 
13

14
00:01:19,110 --> 00:01:25,320
We expect that a group of wires implements this assignment in the final hardware.  As function arguments 
14

15
00:01:25,320 --> 00:01:31,620
are synthesised into input/output signals in the corresponding hardware design, there should be a port 
15

16
00:01:31,620 --> 00:01:35,100
associated with each of them implementing a specific interface.
16

17
00:01:35,970 --> 00:01:42,660
In this example, the 8-bit width port implements eight simple wires without any specific protocol. 
17

18
00:01:44,270 --> 00:01:50,720
How can we define a port interface associated with a function argument in a C/C++ code?
18

19
00:01:50,720 --> 00:01:53,270
Compiler directives can help us to do this definition. 
19

20
00:01:53,840 --> 00:01:59,090
For this purpose, we use the pragma directive following by HLS then INTERFACE. 
20

21
00:01:59,960 --> 00:02:05,270
Then we should specify the interface. As we don’t have any specific interface
21

22
00:02:05,270 --> 00:02:10,100
in this example, the AP_NONE is used for this purpose. 
22

23
00:02:10,340 --> 00:02:12,610
Finally, we should indicate the function argument name. 
23

24
00:02:12,630 --> 00:02:20,330
Notice that, AP_NONE interface models a simple wire port in the final hardware design.
24

25
00:02:20,870 --> 00:02:26,660
In addition to the function argument interfaces, there is an interface assigned to the whole function 
25

26
00:02:26,930 --> 00:02:31,170
that should be defined using a compiler directive via pragma.
26

27
00:02:31,490 --> 00:02:35,000
This line of code describes the interface assigned to the whole function. 
27

28
00:02:35,420 --> 00:02:39,440
More details of this function level interface are explained along the course.
28

29
00:02:41,070 --> 00:02:47,410
After understanding the concept behind the HLS description of the simple LED controller,  “How can we use 
29

30
00:02:47,410 --> 00:02:51,320
Vivado-HLS to implement our controller?” In the following video, 
30

31
00:02:51,480 --> 00:02:52,860
I will cope with this question.
31

32
00:02:54,550 --> 00:02:56,200
These are the takeaway messages from this lecture.
32

33
00:02:57,730 --> 00:03:02,710
Compiler directives can be used to assign a hardware interface with a proper protocol to a function 
33

34
00:03:02,710 --> 00:03:09,380
description , The compiler directives can be applied to Function arguments, Or the function itself
34

35
00:03:11,750 --> 00:03:12,770
Now, the quiz question.
35

36
00:03:13,940 --> 00:03:20,300
How to describe a 16-LED controller in HLS that turns on the lower 8 LEDs and keeps the rest 
36

37
00:03:20,300 --> 00:03:20,540
OFF? 
37

38
00:03:21,740 --> 00:03:26,360
You can use the quiz question in the previous lecture, and add proper HLS pragmas to the code.
