中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁 > EDA/PCB > 設(shè)計(jì)應(yīng)用 > 用Vivado-HLS實(shí)現(xiàn)低latency 除法器

        用Vivado-HLS實(shí)現(xiàn)低latency 除法器

        作者: 時(shí)間:2017-06-13 來源:網(wǎng)絡(luò) 收藏

        本文引用地址:http://www.antipu.com.cn/article/201706/358171.htm

        1 Vivado HLS簡介

        2創(chuàng)建一個(gè)Vivado-HLS工程

        2.1打開Vivado HLS GUI



        2.2創(chuàng)建新工程

        在 Welcome Page, 選擇Create New Project


        2.3添加源文件

        指定頂層需要綜合的源文件名,并添加文件.

        2.4添加測試文件

        添加測試文件.



        2.5創(chuàng)建solution

        3 C Validation

        4 C Synthesis. 13

        5 Explore不同新的Solution. 15

        1 Vivado HLS簡介

        Xilinx Vivado High-Level Synthesis (HLS)工具將C, C++,或者SystemC設(shè)計(jì)規(guī)范,算法轉(zhuǎn)成Register Transfer Level(RTL)實(shí)現(xiàn),可綜合到Xilinx FPGA.

        將DSP算法快速轉(zhuǎn)到RTL FPGA實(shí)現(xiàn)將C至RTL時(shí)間縮短4倍基于C語言的驗(yàn)證時(shí)間縮短100倍RTL仿真時(shí)間縮短3倍

        2創(chuàng)建一個(gè)Vivado-HLS工程2.1打開Vivado HLS GUI雙擊桌面上Vivado HLS GUI圖標(biāo),或從Start > All Programs >

        Vivado > Vivado HLS GUI

        打開GUI之后,Vivado-HLS welcome界面如下所示:

        2.2創(chuàng)建新工程在Welcome Page,選擇Create New Project

        2.3添加源文件指定頂層需要綜合的源文件名,并添加文件。

        本除法器設(shè)計(jì)采用移位算法

        #include radix2div.h

        quotient_t radix2div (

        dividend_t dividend, // (numerator)

        divisor_t divisor, // (denominator)

        remainder_t *remainder //

        ) {

        #pragma AP latency max=3

        #pragma AP pipeline

        quotient_i_t quo, y; // +1 bits unsigned

        subtract_t sub_out, rem_r; // +1 bits signed

        boolean_t last_bit, next_bit;

        loop_cnt_t i;

        ///////////////////////////////////////////////

        last_bit = 0;

        rem_r = 0;

        if (LOOP_MAX > 32)

        quo = 0ULL;

        else

        quo = 0;

        //////////////////////////////////////////////////

        div_booth_label0: for (i = 0; i

        #include

        #include radix2div.h

        //////////////////////////////////////////////////////////////////////////////

        quotient_t radix2div (

        dividend_t dividend, // (numerator)

        divisor_t divisor, // (denominator)

        remainder_t *remainder //

        );

        //////////////////////////////////////////////////////////////////////////////

        int test_divider (dividend_t dividend,

        divisor_t divisor



        {

        quotient_t quotient;

        remainder_t remainder;

        quotient = radix2div(dividend,divisor,

        fprintf(stdout, >>>>>>>>> dividend = %u, divisor = %u quotient = %u remainder = %u n,

        dividend, divisor, quotient, remainder);

        fprintf(stdout, >>>>>>>>>—— n);

        if ((quotient == dividend/divisor) (remainder == dividend-(divisor*quotient)) ) {

        printf (PASS n);

        }

        else {

        printf (FAIL n);

        return 1;

        }

        }

        //////////////////////////////////////////////////////////////////////////////

        int main () {

        int i, j;

        dividend_t max_num;

        max_num = 0;

        j = LOOP_MAX-1;

        for(i = 0; i j; i = i+1) {

        max_num = max_num +pow(2,i);

        }

        //////////////////////////////////////////////////////////////////////////////

        test_divider (max_num,1);

        test_divider (2,pow(2,9)-1);

        test_divider (max_num,pow(2,9)-1);

        test_divider (8,1);

        test_divider (99,10);

        //////////////////////////////////////////////////////////////////////////////

        test_divider (max_num,1);


        test_divider (2,pow(2,9)-1);


        test_divider (max_num,pow(2,9)-1);


        test_divider (8,1);


        test_divider (99,10);


        }

        2.5 創(chuàng)建solution
        創(chuàng)建solution, 時(shí)鐘約束, 并選器件.

        打開包括工程信息Vivado HLS GUI.

        3 C Validation

        在將c/c++/system c 轉(zhuǎn)換成RTL之前,必須先驗(yàn)證C 設(shè)計(jì),確保其功能是正確的

        點(diǎn)擊 “Run C Simulation” 圖標(biāo),


        4 C Synthesis
        現(xiàn)在可以對設(shè)計(jì)做C 綜合,生成RTL代碼. 當(dāng)綜合完成,, GUI 更新綜合結(jié)果. 包括資源使用,latency等。

        為了達(dá)到了預(yù)先要求為3 個(gè)時(shí)鐘周期, 將latency 的directive設(shè)置為3。

        5 Explore 不同新的Solution

        project -> new solution。

        在同一個(gè)工程里面,可以使用同一套源代碼,進(jìn)行不同solutions的嘗試。



        關(guān)鍵詞: VivadoHLS VivadoHLSGUI

        評論


        技術(shù)專區(qū)

        關(guān)閉