0
1
00:00:02,510 --> 00:00:08,390
After understanding the combinational logic and its associated propagation delay, the next question 
1

2
00:00:08,390 --> 00:00:11,480
is: How can we describe a combinational circuit in HLS?
2

3
00:00:14,130 --> 00:00:20,460
Let’s take a simple combinational circuit and describe that in HLS. Consider this logic circuit 
3

4
00:00:20,610 --> 00:00:22,320
comprised of three gates. 
4

5
00:00:22,920 --> 00:00:28,530
The functionality can be described by this logical expression. In order to describe this expression in 
5

6
00:00:28,530 --> 00:00:30,900
C/C++, we have two options.
6

7
00:00:31,470 --> 00:00:40,440
We can either use C/C++ logical operators or C/C++ bitwise operators. Whereas logical operators are applied
7

8
00:00:40,440 --> 00:00:48,510
to one-bit logic that can be 1/0 representing true/false, the bitwise operators are applied
8

9
00:00:48,510 --> 00:00:49,720
to a multiple-bit value. 
9

10
00:00:50,250 --> 00:00:53,820
I will explain how to use bitwise operators later in this course.
10

11
00:00:54,870 --> 00:01:00,750
Therefore, we can use either of these expressions in HLS to describe our circuit example.
11

12
00:01:02,880 --> 00:01:05,790
We need a function to describe our combinational circuit.
12

13
00:01:07,030 --> 00:01:13,300
The function should have three input and one output arguments. We define a pointer variable for the 
13

14
00:01:13,300 --> 00:01:18,760
output argument. Then we should write the logical expression describing the circuit functionality.
14

15
00:01:19,700 --> 00:01:26,060
After that, we have to define the argument interfaces as well as the function block interface.  As
15

16
00:01:26,060 --> 00:01:33,590
we are using wires to carry logic values, we use ap_none or ap_ctrl_none as the interface 
16

17
00:01:33,590 --> 00:01:34,070
modes.
17

18
00:01:35,440 --> 00:01:37,720
Now we are ready to synthesis the code.
18

19
00:01:39,410 --> 00:01:45,890
After doing the synthesis successfully, the tool gives us a thorough report in which three parts are important 
19

20
00:01:45,890 --> 00:01:53,690
for us now: Timing, Utilisation, and Interface parts. The timing part is more suitable for sequential 
20

21
00:01:53,690 --> 00:01:54,200
circuits.
21

22
00:01:54,470 --> 00:02:00,350
However, at the moment we are interested in the third column denoted as “Estimated”.
22

23
00:02:00,980 --> 00:02:04,490
This number is an estimation of the design propagation delay.
23

24
00:02:04,940 --> 00:02:10,520
More details about this estimation approach will be described in the “Digital System Design with High-
24

25
00:02:10,520 --> 00:02:13,700
Level Synthesis in FPGA: Sequential Circuit” course. 
25

26
00:02:14,210 --> 00:02:19,890
So, the propagation delay of our design is about 0.978 ns.
26

27
00:02:21,610 --> 00:02:27,550
The second part reports the resource utilisation. This part reports an estimation of the number of 
27

28
00:02:27,550 --> 00:02:30,830
resources that will be used for implementing the design.
28

29
00:02:31,600 --> 00:02:33,340
The report has five columns.
29

30
00:02:34,060 --> 00:02:41,680
Three of them include memory resources (which are BRAM_18k, FF, and URAM). 
30

31
00:02:42,630 --> 00:02:48,090
As we are designing combinational circuits, these resources shouldn’t be used, and their utilisation
31

32
00:02:48,090 --> 00:02:48,780
should be zero.
32

33
00:02:49,380 --> 00:02:58,230
The other two columns that are DSP48E and LUT can be used to implement a combinational 
33

34
00:02:58,230 --> 00:03:04,740
circuit. The DSP48E is used for mathematical operators, especially for floating-point data 
34

35
00:03:04,740 --> 00:03:05,160
types.
35

36
00:03:05,550 --> 00:03:10,080
The LUTs are used for implementing logical expressions and gates. 
36

37
00:03:10,590 --> 00:03:14,540
Notice that our design has only used 6 LUTs.
37

38
00:03:15,060 --> 00:03:19,770
The last part is about argument interfaces which its table has six columns.
38

39
00:03:20,520 --> 00:03:23,520
The first one is the name of the hardware RTL port. 
39

40
00:03:24,150 --> 00:03:28,020
The second column denotes the direction of the hardware signals. 
40

41
00:03:28,590 --> 00:03:33,050
The number of bits associated with each port is defined in the third column.
41

42
00:03:35,310 --> 00:03:38,460
The next column determines the corresponding interface mode. 
42

43
00:03:39,650 --> 00:03:43,550
The fifth column denotes the name of the arguments in the top-function.
43

44
00:03:43,850 --> 00:03:49,910
Finally, the last column shows the type of argument in c, whether it is a scalar or a pointer.
44

45
00:03:51,340 --> 00:03:57,280
In the next lecture, I will practically show how to use the Xilinx Vivado-HLS to synthesis 
45

46
00:03:57,280 --> 00:03:59,150
our simple combinational circuit.
46

47
00:04:00,790 --> 00:04:07,240
These are our takeaway messages. The HLS report of a combinational circuit synthesised by vivado-HLS  
47

48
00:04:07,240 --> 00:04:10,210
Should not utilise any memory elements.
48

49
00:04:10,530 --> 00:04:14,410
Also, it should not have any clock port in the interface part.
49

50
00:04:17,060 --> 00:04:23,010
Now the quiz question. Complete this code by defining the port interfaces using HLS pragmas. 
