//@C Copyright Notice //@C ================ //@C This file is part of CPSW. It is subject to the license terms in the LICENSE.txt //@C file found in the top-level directory of this distribution and at //@C https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. //@C //@C No part of CPSW, including this file, may be copied, modified, propagated, or //@C distributed except according to the terms contained in the LICENSE.txt file. #include #include #include #include static int memis(uint8_t *d, uint8_t cmp, int len) { while ( len-- > 0 ) { if ( *d++ != cmp ) return 1; } return 0; } int main() { uint64_t data[] = { 0xa2fb283c4d0e9aec, 0xbaca2029771d8292, 0xf42414ba15995030, 0xdc8d0666a492389c, 0x7bf0b7c792cddf9a, 0x390808595be41adc, 0x1447c072d37eefdd }; uint8_t dbuf[sizeof(data)]; uint64_t tbuf[sizeof(data)]; unsigned i, j, o, l, k; unsigned succ = 0; uint8_t m1,mn; for ( i=0; i<=sizeof(data[0]); i++ ) { for ( j=0; j <= 32; j++ ) { memset(dbuf, 0, sizeof(dbuf)); cpsw_read_aligned( dbuf, ((uint8_t*)&data) + i, j ); if ( memcmp(dbuf, ((uint8_t*)&data) + i, j) || memis(dbuf + j, 0x00, sizeof(dbuf) - j) ) { unsigned kk; printf("MISMATCH: i %d, j %d\n", i, j); for ( kk=0; kk((uint8_t*)tbuf + o, (uint8_t*)&data[3] + o, l, m1, mn); uint64_t m = (((1ULL<