element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
ZedBoard Hardware Design Make connections to existing IP
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 6 replies
  • Subscribers 353 subscribers
  • Views 817 views
  • Users 0 members are here
Related

Make connections to existing IP

Former Member
Former Member over 11 years ago

Hello all,

I would like to know the procedure for making connections after adding the existing IP adder /subtraction module.

How do I make connections to the existing IP, especially the adder/subtractor and multiplier modules and how do I communicate with them,  meaning how do I transfer the input store the data, process and get the output and where do I store it. .

Also provide me some additional documentation if any on how do I make those connections.

Thanks and Regards,
Dinesh.

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 11 years ago

    Hi,

    Thank you for your response.

    I have been trying to implement a floating point adder which sends A and B and gets back C.

    We have sent A, B successfully and C is calculated properly which is observed in the logic analyzer.

    I have been using two DMA's for sending A and B and I am getting back C on one of them i.e dma_0.

    For some reason I am not able to get back the calculated value back into C.

    I have also tried the tlast and tlast is getting asserted and the results are shown on the logic analyzer but its not getting back into the C variable and is not printing in the terminal of SDK.

    Could you please help me out with this issue.

    I am using the following
    vivado and sdk- 2013.4 and windows OS.

    Attached is the code.


    #include <stdio.h>
    #include "platform.h"
    #include "ps7_init.h"
    #include <xil_io.h>
    #include "xscugic.h"
    #include "xparameters.h"
    #include "xaxidma.h"

    // AXI DMA Instance
    XAxiDma AxiDma;
    XAxiDma AxiDma1;
    ///////////////////////////////////////initializing DMA 0 //////////////////////////////////////////////////////////////////////////////
    int init_dma(){
    XAxiDma_Config *CfgPtr;
    int status;
    CfgPtr = XAxiDma_LookupConfig(XPAR_AXI_DMA_0_DEVICE_ID);
    if(!CfgPtr){
    print("Error looking for AXI DMA config
    r");
    return XST_FAILURE;
    }
    status = XAxiDma_CfgInitialize(&AxiDma,CfgPtr);
    if(status != XST_SUCCESS){
    print("Error initializing DMA
    r");
    return XST_FAILURE;
    }
    //check for scatter gather mode
    if(XAxiDma_HasSg(&AxiDma)){
    print("Error DMA configured in SG mode
    r");
    return XST_FAILURE;
    }
    /* Disable interrupts, we use polling mode */
    XAxiDma_IntrDisable(&AxiDma,
    XAXIDMA_IRQ_ALL_MASK,XAXIDMA_DEVICE_TO_DMA);
    XAxiDma_IntrDisable(&AxiDma,
    XAXIDMA_IRQ_ALL_MASK,XAXIDMA_DMA_TO_DEVICE);
    return XST_SUCCESS;
    }

    int init_dma1(){
    XAxiDma_Config *CfgPtr;
    int status;
    CfgPtr = XAxiDma_LookupConfig(XPAR_AXI_DMA_1_DEVICE_ID);
    if(!CfgPtr){
    print("Error looking for AXI DMA config
    r");
    return XST_FAILURE;
    }
    status = XAxiDma_CfgInitialize(&AxiDma1,CfgPtr);
    if(status != XST_SUCCESS){
    print("Error initializing DMA
    r");
    return XST_FAILURE;
    }
    //check for scatter gather mode
    if(XAxiDma_HasSg(&AxiDma1)){
    print("Error DMA configured in SG mode
    r");
    return XST_FAILURE;
    }
    /* Disable interrupts, we use polling mode */
    XAxiDma_IntrDisable(&AxiDma1,
    XAXIDMA_IRQ_ALL_MASK,XAXIDMA_DEVICE_TO_DMA);
    XAxiDma_IntrDisable(&AxiDma1,
    XAXIDMA_IRQ_ALL_MASK,XAXIDMA_DMA_TO_DEVICE);
    return XST_SUCCESS;
    }


    int main()
    {
        init_platform();
        ps7_post_config();
        xil_printf("Hello World
    r");
        int status;
        // Init DMA
        status = init_dma();
        if(status != XST_SUCCESS){
        print("rError: DMA init failed
    ");
        return XST_FAILURE;
        }
        print("rDMA0 Init done
    r");

        status = init_dma1();
                if(status != XST_SUCCESS){
                print("rError: DMA init failed
    ");
                return XST_FAILURE;
                }
                print("rDMA1 Init done
    r");


        float A=8.3,B=-3.3,C;
        int whole,thousandths;


        xil_printf("
    raddress of A, B, C is %x,%x",&A,&B);
       //unsigned dma_size=4;
        unsigned int dma_size = sizeof(float);
        //flush the cache

        Xil_DCacheFlushRange((u32) &C,dma_size);

        print("rCache cleared
    r");

        status = XAxiDma_SimpleTransfer(&AxiDma, (u32) &C, dma_size, XAXIDMA_DEVICE_TO_DMA);
        xil_printf("
    rXAxiDMA_SimpleTransfer C status = %d
    ",status);
        if (status != XST_SUCCESS) {
             print("Error RX: DMA transfer from Vivado HLS block failed
    ");
             return XST_FAILURE;
        }

        Xil_DCacheFlushRange((u32) &A,dma_size);
        status = XAxiDma_SimpleTransfer(&AxiDma, (u32) &A, dma_size, XAXIDMA_DMA_TO_DEVICE);
        xil_printf("XAxiDMA_SimpleTransfer A status = %d
    ",status);
        if (status != XST_SUCCESS) {
        print("Error TX: DMA transfer to Vivado HLS block failed
    r");
        return XST_FAILURE;
        }
        print("rTransfer done");
        /* Wait for transfer to be done */
        while (XAxiDma_Busy(&AxiDma, XAXIDMA_DMA_TO_DEVICE)) ;
        print("
    rDMA Finished");


        Xil_DCacheFlushRange((u32) &B,dma_size);
        status = XAxiDma_SimpleTransfer(&AxiDma1, (u32) &B, dma_size, XAXIDMA_DMA_TO_DEVICE);
        xil_printf("XAxiDMA_SimpleTransfer B status = %d
    ",status);
        if (status != XST_SUCCESS) {
        print("Error TX: DMA transfer from Vivado HLS block failed
    ");
        return XST_FAILURE;
        }
        /* Wait for transfer to be done */
        while (XAxiDma_Busy(&AxiDma1, XAXIDMA_DMA_TO_DEVICE)) ;
        print("
    rDMA1 Finished");
    ;
        //poll the DMA engine to verify transfers are complete
        /* Waiting for data processing */

        /* Wait for transfer to be done */
        while ((XAxiDma_Busy(&AxiDma, XAXIDMA_DEVICE_TO_DMA)) ||
        (XAxiDma_Busy(&AxiDma, XAXIDMA_DMA_TO_DEVICE))) ;

        whole=A;
        thousandths=(A - whole) * 100000000;
        xil_printf("
    r This is the value of A in float = %d.%d",whole,thousandths);

        whole=B;
        thousandths=(B - whole) * 100000000;
        xil_printf("
    r This is the value of B in float = %d.%d",whole,thousandths);

        whole=C;
        thousandths=(C - whole) * 100000000;
        xil_printf("
    r This is the value of C in float = %d.%d",whole,thousandths);

        print("
    rEnd of code");
        return 0;
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 11 years ago

    Hi,

    Thank you for your response.

    I have been trying to implement a floating point adder which sends A and B and gets back C.

    We have sent A, B successfully and C is calculated properly which is observed in the logic analyzer.

    I have been using two DMA's for sending A and B and I am getting back C on one of them i.e dma_0.

    For some reason I am not able to get back the calculated value back into C.

    I have also tried the tlast and tlast is getting asserted and the results are shown on the logic analyzer but its not getting back into the C variable and is not printing in the terminal of SDK.

    Could you please help me out with this issue.

    I am using the following
    vivado and sdk- 2013.4 and windows OS.

    Attached is the code.


    #include <stdio.h>
    #include "platform.h"
    #include "ps7_init.h"
    #include <xil_io.h>
    #include "xscugic.h"
    #include "xparameters.h"
    #include "xaxidma.h"

    // AXI DMA Instance
    XAxiDma AxiDma;
    XAxiDma AxiDma1;
    ///////////////////////////////////////initializing DMA 0 //////////////////////////////////////////////////////////////////////////////
    int init_dma(){
    XAxiDma_Config *CfgPtr;
    int status;
    CfgPtr = XAxiDma_LookupConfig(XPAR_AXI_DMA_0_DEVICE_ID);
    if(!CfgPtr){
    print("Error looking for AXI DMA config
    r");
    return XST_FAILURE;
    }
    status = XAxiDma_CfgInitialize(&AxiDma,CfgPtr);
    if(status != XST_SUCCESS){
    print("Error initializing DMA
    r");
    return XST_FAILURE;
    }
    //check for scatter gather mode
    if(XAxiDma_HasSg(&AxiDma)){
    print("Error DMA configured in SG mode
    r");
    return XST_FAILURE;
    }
    /* Disable interrupts, we use polling mode */
    XAxiDma_IntrDisable(&AxiDma,
    XAXIDMA_IRQ_ALL_MASK,XAXIDMA_DEVICE_TO_DMA);
    XAxiDma_IntrDisable(&AxiDma,
    XAXIDMA_IRQ_ALL_MASK,XAXIDMA_DMA_TO_DEVICE);
    return XST_SUCCESS;
    }

    int init_dma1(){
    XAxiDma_Config *CfgPtr;
    int status;
    CfgPtr = XAxiDma_LookupConfig(XPAR_AXI_DMA_1_DEVICE_ID);
    if(!CfgPtr){
    print("Error looking for AXI DMA config
    r");
    return XST_FAILURE;
    }
    status = XAxiDma_CfgInitialize(&AxiDma1,CfgPtr);
    if(status != XST_SUCCESS){
    print("Error initializing DMA
    r");
    return XST_FAILURE;
    }
    //check for scatter gather mode
    if(XAxiDma_HasSg(&AxiDma1)){
    print("Error DMA configured in SG mode
    r");
    return XST_FAILURE;
    }
    /* Disable interrupts, we use polling mode */
    XAxiDma_IntrDisable(&AxiDma1,
    XAXIDMA_IRQ_ALL_MASK,XAXIDMA_DEVICE_TO_DMA);
    XAxiDma_IntrDisable(&AxiDma1,
    XAXIDMA_IRQ_ALL_MASK,XAXIDMA_DMA_TO_DEVICE);
    return XST_SUCCESS;
    }


    int main()
    {
        init_platform();
        ps7_post_config();
        xil_printf("Hello World
    r");
        int status;
        // Init DMA
        status = init_dma();
        if(status != XST_SUCCESS){
        print("rError: DMA init failed
    ");
        return XST_FAILURE;
        }
        print("rDMA0 Init done
    r");

        status = init_dma1();
                if(status != XST_SUCCESS){
                print("rError: DMA init failed
    ");
                return XST_FAILURE;
                }
                print("rDMA1 Init done
    r");


        float A=8.3,B=-3.3,C;
        int whole,thousandths;


        xil_printf("
    raddress of A, B, C is %x,%x",&A,&B);
       //unsigned dma_size=4;
        unsigned int dma_size = sizeof(float);
        //flush the cache

        Xil_DCacheFlushRange((u32) &C,dma_size);

        print("rCache cleared
    r");

        status = XAxiDma_SimpleTransfer(&AxiDma, (u32) &C, dma_size, XAXIDMA_DEVICE_TO_DMA);
        xil_printf("
    rXAxiDMA_SimpleTransfer C status = %d
    ",status);
        if (status != XST_SUCCESS) {
             print("Error RX: DMA transfer from Vivado HLS block failed
    ");
             return XST_FAILURE;
        }

        Xil_DCacheFlushRange((u32) &A,dma_size);
        status = XAxiDma_SimpleTransfer(&AxiDma, (u32) &A, dma_size, XAXIDMA_DMA_TO_DEVICE);
        xil_printf("XAxiDMA_SimpleTransfer A status = %d
    ",status);
        if (status != XST_SUCCESS) {
        print("Error TX: DMA transfer to Vivado HLS block failed
    r");
        return XST_FAILURE;
        }
        print("rTransfer done");
        /* Wait for transfer to be done */
        while (XAxiDma_Busy(&AxiDma, XAXIDMA_DMA_TO_DEVICE)) ;
        print("
    rDMA Finished");


        Xil_DCacheFlushRange((u32) &B,dma_size);
        status = XAxiDma_SimpleTransfer(&AxiDma1, (u32) &B, dma_size, XAXIDMA_DMA_TO_DEVICE);
        xil_printf("XAxiDMA_SimpleTransfer B status = %d
    ",status);
        if (status != XST_SUCCESS) {
        print("Error TX: DMA transfer from Vivado HLS block failed
    ");
        return XST_FAILURE;
        }
        /* Wait for transfer to be done */
        while (XAxiDma_Busy(&AxiDma1, XAXIDMA_DMA_TO_DEVICE)) ;
        print("
    rDMA1 Finished");
    ;
        //poll the DMA engine to verify transfers are complete
        /* Waiting for data processing */

        /* Wait for transfer to be done */
        while ((XAxiDma_Busy(&AxiDma, XAXIDMA_DEVICE_TO_DMA)) ||
        (XAxiDma_Busy(&AxiDma, XAXIDMA_DMA_TO_DEVICE))) ;

        whole=A;
        thousandths=(A - whole) * 100000000;
        xil_printf("
    r This is the value of A in float = %d.%d",whole,thousandths);

        whole=B;
        thousandths=(B - whole) * 100000000;
        xil_printf("
    r This is the value of B in float = %d.%d",whole,thousandths);

        whole=C;
        thousandths=(C - whole) * 100000000;
        xil_printf("
    r This is the value of C in float = %d.%d",whole,thousandths);

        print("
    rEnd of code");
        return 0;
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube