Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MH:AZP (1 byte)
- byte pattern_count=0;
- unsigned int j;
- for (j = 0; i<MAX_PATTERNS_PER_MATRIX; i++){
- if (traced_matrices[i].access_patterns[i].length!=0){
- pattern_count++;
- }
- }
- VG_(write) (fd, &pattern_count, sizeof(byte));
- static void write_patterns(int fd, traced_matrix * matrix){
- /**
- * Access Pattern (ZP) 7 Byte + ZP:Len * 12 Byte
- */
- unsigned int i;
- for (i = 0; i<MAX_PATTERNS_PER_MATRIX; i++){
- if (matrix->access_patterns[i].length!=0){
- //ZP:ID
- byte id = (byte)(matrix->access_patterns[i] - matrix->access_patterns);
- VG_(write) (fd, &id, sizeof(byte));
- //ZP:ANZ
- VG_(write)(fd, &(matrix->access_patterns[i].occurences), sizeof(unsigned int));
- //ZP:LEN
- ushort len = (ushort)(matrix->access_patterns[i].length);
- VG_(write)(fd, &(len), sizeof(ushort));
- int k;
- for (k = 0; k < matrix->access_patterns[i].length; ++k)
- {
- matrix_access_method accm = matrix->access_patterns[i].steps[k];
- // ZA:OM
- VG_(write)(fd, &(accm.offset_m), sizeof(ushort));
- // ZA:ON
- VG_(write)(fd, &(accm.offset_n), sizeof(ushort));
- // ZA:AH
- VG_(write)(fd, &(accm.hits), sizeof(unsigned int));
- // ZA:AM
- VG_(write)(fd, &(accm.misses), sizeof(unsigned int));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment