[clug] Looking for Linux on CBE programming expert help

Sanders King sandersking at hotmail.com
Sat Aug 29 01:50:46 MDT 2009


I have been stalking the CLUG mailing list for 18 months without ever posting or answering a post, however today I introduce myself :-) and pose a question.


PS3 Cell Broadband Engine - Linux Programming

I am trying to do a DMA transfer mfc_get from main memory to SPE memory.  I have done a successful transfer of the a parameters structure, however when I try to transfer some data I run into trouble.

In the SPE program I have declared and allocated local memory to take the data structure, like this:

    float *p1 __attribute__ ((aligned (128)));

    p1 = (float*) malloc(floatArrayByteCount + 128 + 128); // Note: floatArrayByteCount = 128.  // +128+128 is to allow for 128 byte boundary alignment (below)

I am using the following to make sure that my pointers start on a 128 byte boundary.  I know that there must be a better way but I don't know it:

    while ((unsigned int)p1 % 128 != 0) {p1 += 1;}

I am lining up the main memory source pointer (passed from the PPE program) to a 128 byte bondary in a similiar way.

Then I start the transfer with no problem, using:

    mfc_get(p1, ppe_p1_start_address, floatArrayByteCount, 31, 0, 0); // ppe_p1_start_address

However when I wait for the transfer to finish the program stalls (apparently forever) with no error:

    mfc_write_tag_mask(1<<31); 
    mfc_read_tag_status_all(); // Stalls here



Please forgive my obvious ignorance.  Any help is appreciated.

Cheers

Sanders
_________________________________________________________________
Use Windows Live Messenger from your Hotmail inbox Web IM has arrived!
http://windowslive.ninemsn.com.au/article.aspx?id=823454


More information about the linux mailing list