Go to the source code of this file.
|
| | 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) |
| |
◆ cester_assert_int_eq() [1/2]
◆ cester_assert_int_eq() [2/2]
◆ 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()
◆ spu_busy_wait()
◆ spu_read_sync()
| spu_read_sync |
( |
0x1000 |
, |
|
|
s_readback |
, |
|
|
0x80 |
|
|
) |
| |
◆ spu_reset_quiet()
◆ spu_write_sync()
| spu_write_sync |
( |
0x1000 |
, |
|
|
s_upload |
, |
|
|
128 |
|
|
) |
| |
◆ matches_after
◆ matches_reserved
◆ spu_tests