cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
5,573 Views
Registered: ‎09-28-2012

How to send data to PLB bus More than one time

Jump to solution

Hi,

I have the below c++ code and  want to send data to data bus more than one time. I have a test peripheral and I send the data to this peripherals BASE ADDRESS. In this code I sent 14, 2  and 14/2 to PLB data bus, but in simulation I can see just 14 on data bus.

Indeed I can see just the first data on data bus and seems the others didn't work.  I am not sure the way I'm sending data is correct.

Thanks in advance 

 

#include <XPARAMETERS.H>
#include <xio.h>

int main()
{

    double a , b , d  ;
    a = 14 ;
    b = 2 ;
    d = a / b ;
    XIo_Out32(XPAR_TEST_P_1_BASEADDR ,a);
    XIo_Out32(XPAR_TEST_P_1_BASEADDR+1 ,b);
    d = a / b ;
    XIo_Out32(XPAR_TEST_P_1_BASEADDR+2 ,d);
    return 0;
}

 data_bus_problem.jpg

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Teacher
Teacher
7,142 Views
Registered: ‎11-14-2011

From your screenshot, your logic asserts a RdAck - read acknowledge - to a write operation. Therefore, the bus is not being acknowledged for the write and is hanging. There may be a timeout for the PLB but I don't know what it is; from your example, it looks infinite.

 

Anyway, you need to change your USER LOGIC to acknowledge the write (and subsequent read, if any) correctly.

 

Regards,

 

Howard

 

P.S. I actually pointed this out to you in message 2 of this thread, as these two threads seem very closely related.

----------
"That which we must learn to do, we learn by doing." - Aristotle

View solution in original post

5 Replies
Highlighted
Visitor
Visitor
5,571 Views
Registered: ‎09-28-2012
I changed double to int but no result.
0 Kudos
Highlighted
Observer
Observer
5,568 Views
Registered: ‎01-04-2013

I think you adressing is incorrect. If you increase the address by 4 you will see another bus-access.

0 Kudos
Highlighted
Visitor
Visitor
5,555 Views
Registered: ‎09-28-2012

Thanks for your reply. I tested your suggestion but did'nt solve the problem.

I added nanosleepfunction in this way:

XIo_Out32(XPAR_TEST_P_1_BASEADDR ,a);
    nanosleep(50);
    XIo_Out32(XPAR_TEST_P_1_BASEADDR+4 ,b);
    d = a / b ;
    XIo_Out32(XPAR_TEST_P_1_BASEADDR+8 ,d);

 then I can see both 14 and 7 on the bus but WRCE signal is change only one time, not for both:

data_bus_problem2.jpg

0 Kudos
Highlighted
Teacher
Teacher
7,143 Views
Registered: ‎11-14-2011

From your screenshot, your logic asserts a RdAck - read acknowledge - to a write operation. Therefore, the bus is not being acknowledged for the write and is hanging. There may be a timeout for the PLB but I don't know what it is; from your example, it looks infinite.

 

Anyway, you need to change your USER LOGIC to acknowledge the write (and subsequent read, if any) correctly.

 

Regards,

 

Howard

 

P.S. I actually pointed this out to you in message 2 of this thread, as these two threads seem very closely related.

----------
"That which we must learn to do, we learn by doing." - Aristotle

View solution in original post

Highlighted
Visitor
Visitor
5,531 Views
Registered: ‎09-28-2012

Yes, You'r Right, thank you! on that thread ,because you mentioned that it's not related to the issue, i actually forgot to correct it. so thank you again.

0 Kudos