当前位置:网站首页>Embedded hardware development tutorial -- Xilinx vivado HLS case (2)

Embedded hardware development tutorial -- Xilinx vivado HLS case (2)

2022-06-24 01:53:00 Tranlong123

front said

This paper mainly introduces HLS How to use the case , Applicable development environment :Windows 7/10 64bit、Xilinx Vivado 2017.4、Xilinx Vivado HLS 2017.4、Xilinx SDK 2017.4.

Xilinx Vivado HLS(High-Level Synthesis, High level synthesis ) Tool support will C、C++ And so on , At the same time, support based on OpenCL And so on Xilinx Programmable logic device development , It can accelerate the process of algorithm development , Shorten time to market .

This case uses the technology of chuanglong TLZ7x-EasyEVM-S Development board , It is based on Xilinx Zynq-7000 series XC7Z010/XC7Z020 Heterogeneous multi-core processor with high performance and low power consumption SoC Evaluation board , Processor Integration PS End binuclear ARM Cortex-A9 + PL End Artix-7 framework 28nm Programmable logic resources , The evaluation board is composed of core board and evaluation bottom board . The core board has been professionally PCB Layout And high and low temperature tests to verify .

TLZ7x-EasyEVM-S Evaluation board

TLZ7x-EasyEVM-S Evaluation board evaluation board interface resources are rich , Leading out Gigabit Ethernet port 、 dual CAMERA、USB、Micro SD、CAN、UART Such as the interface , Support LCD Display expansion and Qt GUI development .

led_flash Case study

Case function : Control the evaluation LED2 every other 0.5s Flip the state once .

HLS Project description

  1. The clock

HLS The engineering clock is 100MHz, The case uses the clock to calculate 0.5s At intervals LED2 On off state control , Generated IP The core also needs to be connected to the clock . To modify the clock frequency , Please open the HLS Click after the project , In the pop-up interface Synthesis The column is modified .

chart 26

  1. Top level function

The top-level function of the case is led_flash.cpp Medium led_flash().

chart 27

Click and , In the pop-up interface Synthesis Column view or set the top level function .

chart 28

This function controls the evaluation LED2 every other 0.5s Flip the state once . The clock set for the project is 100MHz( cycle 10ns), stay for The count in the loop is 100000000, The time is 10ns x 100000000 = 1s.

Compilation and simulation

Please refer to this document HLS Development process description section , Compile . After compilation , Enter the simulation interface and click to perform single step operation , Get into led_flash() function .

chart 29

Continue clicking to enter for loop , When i < 50000000 when ,*led_o be equal to 1(true).

chart 31

Click to run or modify at full speed i The value of is 50000000, When i ≥ 50000000 when ,*led_o be equal to 0(false).

chart 32

IP Nuclear testing

Please refer to this document HLS Development process description section , complete IP Preparations for nuclear testing .

HLS Project generated IP Nuclear is led_flash_0.

chart 33

load PL End .bit Format executable , You can see the evaluation of the floor LED2 Flashing .

key_led_demo Case study

Case function : By pressing the key KEY2 Control the evaluation of LED2 state .

HLS Project description

  1. The clock

HLS The engineering clock is 100MHz. Case by pressing the key KEY2 Control the evaluation of LED2 state , The clock is not actually used . To modify the clock frequency , Please open the HLS Click after the project

, In the pop-up interface Synthesis The column is modified .

chart 34

  1. Top level function

The top-level function of the case is key_led_demo.cpp Medium key_led_demo().

chart 35

After clicking , In the pop-up interface Synthesis Column view or set the top level function .

chart 36

Corresponding to the key IO Pull up by default 、 High level . When you press the key ,key_i by 0; When you release the key ,key_i by 1.

Ordinary scalar type parameters correspond to IP Core input interface , Such as key_i As input . Pointer type parameters can be used as input and output , Such as *led_o As the output .

chart 37

Compilation and simulation

Please refer to this document HLS Development process description section , Compile . After compilation , Enter the simulation interface and click to perform single step operation , You can see Console Window printing led_o Value . because key_i The default value is 0, therefore led_o The value of is 1.

chart 38

modify key_i The value of is 1, And continue to click for single step operation .

chart 39

At this point, you can see led_o The value of is 0.

chart 40

IP Nuclear testing

Please refer to this document HLS Development process description section , complete IP Preparations for nuclear testing .

HLS Project generated IP Nuclear is key_led_demo_0.

chart 41

load PL End .bit Format executable , Press down KEY2 be LED2 Lighten up , Release KEY2 be LED2 Extinguish .

原网站

版权声明
本文为[Tranlong123]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/11/20211111095959864e.html

随机推荐