Cov txheej txheem:

Vivado HLS Video IP Block Synthesis: 12 Cov Kauj Ruam
Vivado HLS Video IP Block Synthesis: 12 Cov Kauj Ruam

Video: Vivado HLS Video IP Block Synthesis: 12 Cov Kauj Ruam

Video: Vivado HLS Video IP Block Synthesis: 12 Cov Kauj Ruam
Video: Introduction to Vitis High-Level Synthesis (HLS) 2024, Kaum ib hlis
Anonim
Vivado HLS Video IP Block Synthesis
Vivado HLS Video IP Block Synthesis

Koj puas tau xav kom ua tiav lub sijhawm tiag tiag ntawm cov vis dis aus yam tsis ntxiv sijhawm ntau ntxiv lossis hauv kab ke? FPGAs (Field Programmable Gate Arrays) qee zaum siv los ua qhov no; Txawm li cas los xij, sau cov vis dis aus ua cov txheej txheem hauv cov cuab yeej tshwj xeeb cov lus zoo li VHDL lossis Verilog yog kev ntxhov siab ntawm qhov zoo tshaj plaws. Nkag mus rau Vivado HLS, Xilinx cov cuab yeej uas tso cai rau koj ua haujlwm hauv C ++ ib puag ncig thiab tsim cov cuab yeej tshwj xeeb cov lus lus los ntawm nws.

Yuav tsum tau softwares:

  • Vivado HLS
  • Vivado
  • (Yog tias koj siv AXI cov npe) Vivado SDK

(Tsis teb los tau) Rub tawm Xilinx ua piv txwv ntawm no:

Xilinx HLS video piv txwv

Kauj Ruam 1: Vivado HLS yog dab tsi?

Vivado HLS yog lub cuab yeej siv los tig c ++ zoo li cov lej rau hauv cov txheej txheem kho vajtse uas tuaj yeem siv rau ntawm FPGA. Nws suav nrog IDE rau kev ua qhov kev txhim kho no. Thaum koj tau ua tiav koj txoj kev txhim kho ntawm cov cai rau HLS koj tuaj yeem xa koj tus IP tsim tawm hauv hom ntawv rau siv nrog Vivado.

Rub tawm cov ntawv txuas thiab muab tso rau ze qhov uas koj yuav tsim koj txoj haujlwm. (hloov lawv rov qab mus rau "top.cpp" thiab "top.h" yog tias lawv muaj lub npe tsis raug)

Kauj Ruam 2: HLS Video Library

HLS Video Library
HLS Video Library
HLS Video Library
HLS Video Library

HLS Video Library muaj cov ntaub ntawv nrog cov qauv siv hauv daim ntawv no: XAPP1167 Lwm qhov peev txheej zoo yog Xilinx Wiki nplooj ntawv txog nws.

Pib Vivado HLS.

Tsim txoj haujlwm tshiab.

Nqa cov ntaub ntawv uas koj rub tawm hauv cov kauj ruam dhau los thiab ntxiv lawv ua cov ntaub ntawv. (Nco tseg: cov ntaub ntawv tsis tau theej rau hauv txoj haujlwm, tab sis hloov chaw nyob qhov twg lawv nyob)

Tom qab ntawd siv Browse khawm los xaiv txoj haujlwm saum toj kawg nkaus.

Ntawm nplooj ntawv tom ntej, xaiv Xilinx ib feem uas koj siv.

Kauj ruam 3: Synthesizing

Synthesizing
Synthesizing

Kev daws => Khiav C Synthesis => Cov Tshuaj Zoo

Tom qab ~ 227.218 vib nas this, nws yuav tsum ua tiav. (Faj seeb: koj lub sij hawm ua kom muaj tseeb yuav sib txawv raws ntau yam)

Kauj Ruam 4: Hloov Kho thiab Lwm Cov Ntaub Ntawv rau Export

Versioning thiab Lwm Cov Ntaub Ntawv rau Export
Versioning thiab Lwm Cov Ntaub Ntawv rau Export

Cov lej tus lej cuam tshuam nrog Vivado kom ua rau koj muaj peev xwm hloov kho tus IP hauv kev tsim qauv. Yog tias nws yog qhov hloov pauv me me nws tuaj yeem ua tiav thaum qhov hloov pauv loj xav tau koj tus kheej ntxiv rau hauv qhov thaiv tshiab thiab tshem qhov qub. Yog tias koj cuam tshuam tsis tau hloov pauv thiab hloov kho tshiab yog qhov me me qhov hloov tshiab tuaj yeem yog ua tiav tag nrho los ntawm nias lub hloov tshiab IP khawm Koj tuaj yeem khiav "report_ip_status" hauv Vivado tcl console kom pom cov xwm txheej ntawm koj tus IP.

Teeb tus lej tus lej thiab lwm cov ntaub ntawv hauv Kev daws => Kev daws teeb meem…

Xwb, cov chaw no tuaj yeem teeb tsa thaum xa tawm.

Kauj ruam 5: Xa mus rau Vivado IP Library

Kev xa tawm mus rau Vivado IP Library
Kev xa tawm mus rau Vivado IP Library
Kev xa tawm mus rau Vivado IP Library
Kev xa tawm mus rau Vivado IP Library

Tshuaj => Export RTL

Yog tias koj tsis tau teeb tsa lub tsev qiv ntawv IP cov ntsiab lus hauv qib dhau los, koj tuaj yeem ua tam sim no.

Kauj Ruam 6: Kev Tshawb Fawb thiab Kev Tshawb Fawb Export

Synthesis thiab Export Analysis
Synthesis thiab Export Analysis
Synthesis thiab Export Analysis
Synthesis thiab Export Analysis
Synthesis thiab Export Analysis
Synthesis thiab Export Analysis

Ntawm lub vijtsam no peb tuaj yeem pom cov txheeb cais txog peb cov qauv xa tawm, qhia tias nws ua tau raws li peb lub sijhawm ntawm 10ns (100MHz) thiab ntau npaum li cas ntawm txhua qhov peev txheej nws siv.

Nrog kev sib koom ua ke ntawm qhov no, peb Cov Ntawv Tshaj Qhia Kev Tshawb Fawb, thiab peb cov ntaub ntawv tshuaj xyuas, peb tuaj yeem pom tias nws siv sijhawm 317338 moos mus * 10ns moos sijhawm * 14 ntu ntu = 0.04442732 vib nas this. Lub ntsiab lus tias tag nrho cov latency ntxiv los ntawm peb cov duab ua haujlwm tsawg dua li kaum ob ntawm ib pliag (thaum teev ntawm lub hom phiaj 100MHz).

Kauj Ruam 7: Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado

Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado
Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado
Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado
Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado
Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado
Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado
Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado
Ntxiv IP Lub Tsev Qiv Ntawv hauv Vivado

Txhawm rau siv koj tus IP sib txuas ua ke koj yuav xav tau ntxiv rau Vivado.

Hauv Vivado ntxiv IP chaw cia khoom rau koj txoj haujlwm los ntawm kev mus rau IP phau ntawv teev npe thiab nyem-xaiv "Ntxiv Chaw Cia Khoom …"

Nkag mus rau koj li Vivado HLS cov npe ua haujlwm thiab xaiv koj cov npe tshuaj.

Nws yuav tsum tshaj tawm tus IP uas nws pom.

Kauj Ruam 8: Ua Kev Txhim Kho

Ua Kev Txhim Kho
Ua Kev Txhim Kho
Ua Kev Txhim Kho
Ua Kev Txhim Kho
Ua Kev Txhim Kho
Ua Kev Txhim Kho

Qee zaum koj yuav tsum hloov pauv koj li HLS thaiv tom qab suav nrog nws hauv Vivado tsim.

Txhawm rau ua qhov no, koj tuaj yeem hloov pauv thiab rov ua dua tshiab thiab xa tawm IP nrog tus lej version siab dua (saib cov ntsiab lus hauv qib ua ntej txog qhov hloov pauv loj/tsawg tus lej).

Tom qab hloov pauv cov ntawv tshiab, rov ua dua koj li IP chaw cia khoom hauv Vivado. Qhov no tuaj yeem ua tiav thaum Vivado ceeb toom IP tau hloov pauv hauv qhov chaw cia khoom, lossis qhib siv tus kheej. (Nco tseg, yog tias koj rov kho koj li IP chaw cia khoom tom qab pib, tab sis ua ntej xa tawm ua tiav hauv HLS, tus IP yuav tsis nyob ib ntus, tos kom nws ua tiav thiab rov ua dua tshiab.)

Txij ntawm no mus lub qhov rai yuav tsum tshwm nrog cov ntaub ntawv uas IP tau hloov pauv ntawm lub disk thiab muab txoj hauv kev rau koj los hloov kho nws nrog "Hloov Kho Xaiv" khawm. tom qab ntawv nyem lub pob ntawd yuav hloov tus IP qub nrog tus tshiab, txwv tsis pub ua haujlwm ntau ntxiv.

Kauj Ruam 9: Cov Lus Qhia Ntxiv thiab Cov Lus Qhia

Cov theem hauv qab no muab cov ntaub ntawv ntau ntxiv txog yuav ua li cas HLS kev sib xyaw ua haujlwm thiab koj tuaj yeem ua dab tsi nrog nws.

Rau qhov piv txwv ntawm txoj haujlwm siv HLS ua ke IP thaiv, saib cov lus qhia no.

Kauj Ruam 10: Tso Tawm thiab Tso Tawm

Tso zis thiab tawm tswv yim
Tso zis thiab tawm tswv yim
Tso zis thiab tawm tswv yim
Tso zis thiab tawm tswv yim

Cov txiaj ntsig thiab cov tswv yim mus rau qhov kawg IP thaiv tau txiav txim siab los ntawm kev tshuaj xyuas qhov sib xyaw ua ke ntawm cov ntaub ntawv ntws hauv thiab tawm ntawm qhov ua haujlwm saum toj kawg nkaus.

Zoo ib yam li hauv VHDL lossis verilog, HLS tso cai rau koj qhia meej txog kev sib txuas ntawm IP. Cov kab no yog piv txwv ntawm qhov no:

void image_filter (AXI_STREAM & video_in, AXI_STREAM & video_out, int & x, int & y) {

#pragma HLS INTERFACE axis port = video_in bundle = INPUT_STREAM #pragma HLS INTERFACE axis port = video_out bundle = OUTPUT_STREAM #pragma HLS INTERFACE s_axilite port = x bundle = CONTROL_BUS offset = 0x14 #pragma HLS INTERFACE = bundle

Koj tuaj yeem pom yuav ua li cas cov chaw nres nkoj nthuav tawm ntawm IP thaiv tau cuam tshuam los ntawm cov lus qhia no.

Kauj Ruam 11: AXI Sau Npe cuam tshuam

AXI Sau npe cuam tshuam
AXI Sau npe cuam tshuam

Txhawm rau kom tau txais cov tswv yim/tso tawm rau/los ntawm koj tus IP thaiv rau PS txoj hauv kev zoo los ua qhov no yog los ntawm AXI interface.

Koj tuaj yeem hais qhia qhov no hauv koj li HLS code, suav nrog cov offsets kom siv los nkag tau tus nqi tom qab zoo li no:

void image_filter (AXI_STREAM & video_in, AXI_STREAM & video_out, int & x, int & y) {

#pragma HLS INTERFACE s_axilite chaw nres nkoj = x nras = CONTROL_BUS offset = 0x14

#pragma HLS INTERFACE s_axilite chaw nres nkoj = y nras = CONTROL_BUS offset = 0x1C #pragma HLS dataflow

x = 42 hli

y = 0xDEADBEEF; }

Thaum txuas zoo hauv Vivado, koj tuaj yeem nkag mus rau qhov txiaj ntsig siv tus lej no hauv Vivado SDK:

#suav nrog "parameter.h"

#define xregoff 0x14 #define yregoff 0x1c x = Xil_In32 (XPAR_IMAGE_FILTER_0_S_AXI_CONTROL_BUS_BASEADDR+xregoff); y = Xil_In32 (XPAR_IMAGE_FILTER_0_S_AXI_CONTROL_BUS_BASEADDR+yregoff);

Qhov no yuav ua rau koj xaus nrog 42 hauv x thiab 0xdeadbeef hauv y

Kauj ruam 12: Dataflow Pragma

Cov ntaub ntawv Pragma
Cov ntaub ntawv Pragma
Cov ntaub ntawv Pragma
Cov ntaub ntawv Pragma
Cov ntaub ntawv Pragma
Cov ntaub ntawv Pragma

Sab hauv #pragma DATAFLOW txoj hauv kev uas txoj cai tau hloov pauv los ntawm ib txwm C ++. Cov cai tau xa mus rau txhua qhov ntawm cov lus qhia tau ua haujlwm txhua lub sijhawm hauv ntau qhov chaw ntawm cov ntaub ntawv (Xav txog nws zoo li kab sib dhos hauv lub hoobkas, txhua lub chaw nres tsheb tau ua haujlwm tas li ua ib qho haujlwm thiab xa nws mus rau tom chaw nres tsheb tom ntej)

los ntawm daim duab koj tuaj yeem pom tias txhua qhov kev coj ua

Txawm hais tias tau tshwm sim los ua qhov hloov pauv ib txwm, cov khoom img tau ua tiav raws li qhov me me ntawm cov lus txib. Siv cov duab los ua tswv yim rau lub luag haujlwm "siv" nws thiab ua rau nws siv tsis tau ntxiv lawm. (Yog li qhov xav tau cov lus txib theej tawm)

Pom zoo: