How can we add port interfaces to the arguments in our C description? A hardware design exchanges data and 1
control commands with the rest of the system using ports with properly associated interfaces. Adding 2
interfaces to ports in an HLS description is the main concept introduced in this video. 3
Hardware designs use ports to communicate with other modules on a system. Ports have their own hardware 4
structure and can be a simple wire or a complex circuits implementing an interface, realising its sophisticated 5
protocol. 6
Ports can be output, input or inout. 7
Each input, output or inout signal in the hardware can have its own dedicated port. Also, a group of signals 8
can collaborate in implementing a port. 9
The hardware ports can be as simple as one-bit binary wire to 8-bit parallel data bus to complex 10
serial buses such as USB, DDR memory access port, I2C access port, just to name a few. 11
This code is the simple LED controller description explained in the previous lecture. The function 12
body is a simple assignment that returns a fixed value to drive eight LEDs. 13
We expect that a group of wires implements this assignment in the final hardware. As function arguments 14
are synthesised into input/output signals in the corresponding hardware design, there should be a port 15
associated with each of them implementing a specific interface. 16
In this example, the 8-bit width port implements eight simple wires without any specific protocol. 17
How can we define a port interface associated with a function argument in a C/C++ code? 18
Compiler directives can help us to do this definition. 19
For this purpose, we use the pragma directive following by HLS then INTERFACE. 20
Then we should specify the interface. As we don’t have any specific interface 21
in this example, the AP_NONE is used for this purpose. 22
Finally, we should indicate the function argument name. 23
Notice that, AP_NONE interface models a simple wire port in the final hardware design. 24
In addition to the function argument interfaces, there is an interface assigned to the whole function 25
that should be defined using a compiler directive via pragma. 26
This line of code describes the interface assigned to the whole function. 27
More details of this function level interface are explained along the course. 28
After understanding the concept behind the HLS description of the simple LED controller, “How can we use 29
Vivado-HLS to implement our controller?” In the following video, 30
I will cope with this question. 31
These are the takeaway messages from this lecture. 32
Compiler directives can be used to assign a hardware interface with a proper protocol to a function 33
description , The compiler directives can be applied to Function arguments, Or the function itself 34
Now, the quiz question. 35
How to describe a 16-LED controller in HLS that turns on the lower 8 LEDs and keeps the rest 36
OFF? 37
You can use the quiz question in the previous lecture, and add proper HLS pragmas to the code.