Nugget
Bare-metal libraries and examples for the original PlayStation
Loading...
Searching...
No Matches
Functions | Variables
spu-transfer.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 CESTER_TEST (transfer_via_dma, spu_tests, int fail_count=0;const uint32_t addrs[3]={ 0x01040, 0x40000, 0x7fec0 };const uint8_t seeds[3]={ 0x11, 0x22, 0x33 };for(int t=0;t< 3;t++) { spu_reset_quiet();for(int i=0;i< 256;i++) s_readback[i]=(uint8_t)(seeds[t] ^(i *7));for(int i=256;i< 320;i++) s_readback[i]=0xaa;spu_write_sync(addrs[t], s_readback, 320);for(int i=0;i< 256;i++) s_readback[i]=0xCC;spu_read_sync(addrs[t], s_readback, 256);int local_fail=0;for(int i=0;i< 256;i++) { uint8_t expected=(uint8_t)(seeds[t] ^(i *7));if(s_readback[i] !=expected) local_fail++;} fail_count+=local_fail;} cester_assert_int_eq(fail_count, 0);) CESTER_TEST(transfer_to_reserved_sdk_region
 
 spu_reset_quiet ()
 
 for (int i=0;i< 128;i++) s_upload[i]
 
 spu_write_sync (0x1000, s_upload, 128)
 
 spu_busy_wait (500000)
 
 spu_read_sync (0x1000, s_readback, 0x80)
 
 cester_assert_int_eq (matches_reserved, 16)
 
 cester_assert_int_eq (matches_after, 48)
 

Variables

 spu_tests
 
int matches_reserved = 0
 
int matches_after = 0
 

Function Documentation

◆ cester_assert_int_eq() [1/2]

cester_assert_int_eq ( matches_after  ,
48   
)

◆ cester_assert_int_eq() [2/2]

cester_assert_int_eq ( matches_reserved  ,
16   
)

◆ CESTER_TEST()

CESTER_TEST ( transfer_via_dma  ,
spu_tests  ,
int  fail_count = 0; const uint32_t addrs[3] = { 0x01040, 0x40000, 0x7fec0 }; const uint8_t seeds[3] = { 0x11, 0x22, 0x33 }; for (int t = 0; t < 3; t++) { spu_reset_quiet(); for (int i = 0; i < 256; i++) s_readback[i] = (uint8_t)(seeds[t] ^ (i * 7)); for (int i = 256; i < 320; i++) s_readback[i] = 0xaa; spu_write_sync(addrs[t], s_readback, 320); for (int i = 0; i < 256; i++) s_readback[i] = 0xCC; spu_read_sync(addrs[t], s_readback, 256); int local_fail = 0; for (int i = 0; i < 256; i++) { uint8_t expected = (uint8_t)(seeds[t] ^ (i * 7)); if (s_readback[i] != expected) local_fail++; } fail_count += local_fail; } cester_assert_int_eq(fail_count, 0); 
)

◆ for()

for ( )

◆ spu_busy_wait()

spu_busy_wait ( 500000  )

◆ spu_read_sync()

spu_read_sync ( 0x1000  ,
s_readback  ,
0x80   
)

◆ spu_reset_quiet()

spu_reset_quiet ( )

◆ spu_write_sync()

spu_write_sync ( 0x1000  ,
s_upload  ,
128   
)

Variable Documentation

◆ matches_after

int matches_after = 0

◆ matches_reserved

int matches_reserved = 0

◆ spu_tests

spu_tests