1 /* TRAX file header definition. 2 3 Copyright (c) 2007-2012 Tensilica Inc. 4 5 Permission is hereby granted, free of charge, to any person obtaining 6 a copy of this software and associated documentation files (the 7 "Software"), to deal in the Software without restriction, including 8 without limitation the rights to use, copy, modify, merge, publish, 9 distribute, sublicense, and/or sell copies of the Software, and to 10 permit persons to whom the Software is furnished to do so, subject to 11 the following conditions: 12 13 The above copyright notice and this permission notice shall be included 14 in all copies or substantial portions of the Software. 15 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 23 24 25 #define TRAX_FHEAD_MAGIC "TRAXdmp" 26 #define TRAX_FHEAD_VERSION 1 27 28 /* Header flags: */ 29 #define TRAX_FHEADF_OCD_ENABLED 0x00000001 /* set if OCD was enabled while capturing trace */ 30 #define TRAX_FHEADF_TESTDUMP 0x00000002 /* set if is a test file 31 (from 'memsave' instead of 'save') */ 32 #define TRAX_FHEADF_OCD_ENABLED_WHILE_EXIT 0x00000004 /* set if OCD was enabled while capturing trace and 33 we were exiting the OCD mode */ 34 35 /* Header at the start of a TRAX dump file. */ 36 typedef struct { 37 char magic[8]; /* 00: "TRAXdmp\0" (TRAX_FHEAD_MAGIC) */ 38 char endianness; /* 08: 0=little-endian, 1=big-endian */ 39 char version; /* 09: TRAX_FHEAD_VERSION */ 40 char reserved0[2]; /* 0A: ... */ 41 unsigned filesize; /* 0C: size of the trace file, including this header */ 42 unsigned trace_ofs; /* 10: start of trace output, byte offset from start of header */ 43 unsigned trace_size; /* 14: size of trace output in bytes */ 44 unsigned dumptime; /* 18: date/time of capture save (secs since 1970-01-01), 0 if unknown */ 45 unsigned flags; /* 1C: misc flags (TRAX_FHEAD_F_xxx) */ 46 char username[16]; /* 20: user doing the capture/save (up to 15 chars) */ 47 char toolver[24]; /* 30: tool + version used for capture/save (up to 23 chars) */ 48 char reserved2[40]; /* 48: (reserved - could be hostname used for dump (up to 39 chars)) */ 49 unsigned configid[2]; /* 70: processor ConfigID values, 0 if unknown */ 50 unsigned ts_freq; /* 78: timestamp frequency, 0 if not specified */ 51 unsigned reserved3; /* 7C: (reserved) */ 52 unsigned id; /* 80: TRAX registers at time of save (0 if not read) */ 53 unsigned control; 54 unsigned status; 55 unsigned reserved4; /* Data register (should not be read) */ 56 unsigned address; 57 unsigned trigger; 58 unsigned match; 59 unsigned delay; 60 unsigned trax_regs[24]; /*100: (total size) -- dummy allocation (FIXME) */ 61 } trax_file_header; 62 63