Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16603 Discussions

Blinking of LED's in OpenCL

Altera_Forum
Honored Contributor II
1,246 Views

Hi, 

 

As I am new to OpenCL, I am trying to implement LED Blinking program in OpenCL on Altera platform. I have seen codes those are written in verilog and dint find any proper documentation regarding OpenCL. I don't have an idea how pin configuration will happen in OpenCL (Does pin specification happen automatically or need to allocate manually?). Could you please suggest me the program flow for how to write led blinking code in OpenCL? 

 

Thanks.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
494 Views

I would highly advice against beginners using OpenCL on FPGAs to try to create designs that involve manual pin configuration. 

 

By standard, the manufacturer provides a Board Support Package (BSP) with all the IP Cores that access FPGA pins already implemented and configured. OpenCL does NOT provide a direct way to get access to the FPGA pins, except through the BSP. To access the FPGA pins that do not have an existing interface in the BSP, you have to create one yourself and recreate the BSP. Doing so requires modifying the BSP and adding your interface based on the standard interface that OpenCL requires, and creating an I/O channel that can be accessed in an OpenCL kernel. Then you can use that I/O channel from the kernel to drive the pins to, for example, turn on some LEDs. This requires extensive knowledge of hardware programming, Quartus/QSYS, the OpenCL interface used by Altera, and timing closure. You can find the official document that details creating a custom BSP, here (https://www.altera.com/en_us/pdfs/literature/hb/opencl-sdk/ug_aocl_custom_platform_toolkit.pdf). 

 

Please note that at the end of the day, achieving this particular goal using Verilog/VHDL will be far much faster and easier compared to OpenCL.
0 Kudos
Reply