Editing SPE to SPE DMA transfer

From Cellbe

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Current revision Your text
Line 1: Line 1:
 +
acelacrob
This article shows a simple DMA transfer between two SPEs. The synchronization is done via mailbox with the aid of the PPE. The process ''"PGET"'' holds the target memory area; it writes 200 in the target area, then waits for the transfer, and prints the value stored in target area. The process ''"PPUT"'' writes a value in the target memory area. The order of operations is as follows:
This article shows a simple DMA transfer between two SPEs. The synchronization is done via mailbox with the aid of the PPE. The process ''"PGET"'' holds the target memory area; it writes 200 in the target area, then waits for the transfer, and prints the value stored in target area. The process ''"PPUT"'' writes a value in the target memory area. The order of operations is as follows:
Line 4: Line 5:
#PGET communicates to the PPE the target address via mailbox, then synchronizes with the PPE with a mailbox read
#PGET communicates to the PPE the target address via mailbox, then synchronizes with the PPE with a mailbox read
#The PPE calculates the effective address of the target, and sends it to PPUT via mailbox, and synchronizes with PPUT with a mailbox read
#The PPE calculates the effective address of the target, and sends it to PPUT via mailbox, and synchronizes with PPUT with a mailbox read
-
#PPUT reads the target's effective address from mailbox, starts the dma transfer, waits for it to finish and wakes up the PPE with a mailbox write
+
#PPUT reads the target's effective address from mailbox, starts the dma trasfer, waits for it to finish and wakes up the PPE with a mailbox write
#The PPE wakes up, and writes a mailbox to PGET to wake it up.
#The PPE wakes up, and writes a mailbox to PGET to wake it up.
#PGET wakes up, and  prints the content of the target memory area.
#PGET wakes up, and  prints the content of the target memory area.
Line 13: Line 14:
==Code snippet: Pointer passing structure==
==Code snippet: Pointer passing structure==
This structure is used to ensure compatibility when compiling with 32 or 64 bits word size.
This structure is used to ensure compatibility when compiling with 32 or 64 bits word size.
-
 
-
[http://www.professays.com/research-papers/ professional custom essays, buy essays]
 
<pre>
<pre>
/* =============================================================================
/* =============================================================================
Line 33: Line 32:
         unsigned int reserved;
         unsigned int reserved;
#endif   
#endif   
-
         volatile void *p;
+
         void *p;
     };   
     };   
};   
};   
Line 107: Line 106:
ls_base_addr.e = 0;    /* assigning 0 to make sure garbage is removed */
ls_base_addr.e = 0;    /* assigning 0 to make sure garbage is removed */
ls_base_addr.p = spe_ls_area_get(ctx1);
ls_base_addr.p = spe_ls_area_get(ctx1);
-
shared_ea.e = shared_lsaddr.e + ls_base_addr.e;
+
shared_ea.e = shared_lsaddr + ls_base_addr.e;
/* 3. Sending the calculated address to the "put" process.            */
/* 3. Sending the calculated address to the "put" process.            */
Line 132: Line 131:
</pre>
</pre>
-
 
==Code snippet: process ''PGET'', SPE side==
==Code snippet: process ''PGET'', SPE side==
<pre>
<pre>

Please note that all contributions to Cellbe may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Project:Copyrights for details). DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!


Cancel | Editing help (opens in new window)
Personal tools