00001 /* 00002 * eio.h - external interfaces to external I/O files 00003 * 00004 * This file is a part of the SimpleScalar tool suite written by 00005 * Todd M. Austin as a part of the Multiscalar Research Project. 00006 * 00007 * The tool suite is currently maintained by Doug Burger and Todd M. Austin. 00008 * 00009 * Copyright (C) 1997, 1998 by Todd M. Austin 00010 * 00011 * This source file is distributed "as is" in the hope that it will be 00012 * useful. The tool set comes with no warranty, and no author or 00013 * distributor accepts any responsibility for the consequences of its 00014 * use. 00015 * 00016 * Everyone is granted permission to copy, modify and redistribute 00017 * this tool set under the following conditions: 00018 * 00019 * This source code is distributed for non-commercial use only. 00020 * Please contact the maintainer for restrictions applying to 00021 * commercial use. 00022 * 00023 * Permission is granted to anyone to make or distribute copies 00024 * of this source code, either as received or modified, in any 00025 * medium, provided that all copyright notices, permission and 00026 * nonwarranty notices are preserved, and that the distributor 00027 * grants the recipient permission for further redistribution as 00028 * permitted by this document. 00029 * 00030 * Permission is granted to distribute this file in compiled 00031 * or executable form under the same conditions that apply for 00032 * source code, provided that either: 00033 * 00034 * A. it is accompanied by the corresponding machine-readable 00035 * source code, 00036 * B. it is accompanied by a written offer, with no time limit, 00037 * to give anyone a machine-readable copy of the corresponding 00038 * source code in return for reimbursement of the cost of 00039 * distribution. This written offer must permit verbatim 00040 * duplication by anyone, or 00041 * C. it is distributed by someone who received only the 00042 * executable form, and is accompanied by a copy of the 00043 * written offer of source code that they received concurrently. 00044 * 00045 * In other words, you are welcome to use, share and improve this 00046 00047 * source file. You are forbidden to forbid anyone else to use, share 00048 * and improve what you give them. 00049 * 00050 * INTERNET: dburger@cs.wisc.edu 00051 * US Mail: 1210 W. Dayton Street, Madison, WI 53706 00052 * 00053 * $Id: eio.h,v 1.1.1.1 2003/09/18 00:57:54 panalyzer Exp $ 00054 * 00055 * $Log: eio.h,v $ 00056 * Revision 1.1.1.1 2003/09/18 00:57:54 panalyzer 00057 * 00058 * 00059 * Revision 1.1.1.1 2003/09/18 00:18:43 panalyzer 00060 * 00061 * 00062 * Revision 1.1.1.1 2003/09/16 18:48:14 gdm 00063 * 00064 * 00065 * Revision 1.1.1.1 2000/11/29 14:53:54 cu-cs 00066 * Grand unification of arm sources. 00067 * 00068 * 00069 * Revision 1.1.1.1 2000/05/26 15:21:52 taustin 00070 * SimpleScalar Tool Set 00071 * 00072 * 00073 * Revision 1.1 1998/08/27 08:21:37 taustin 00074 * Initial revision 00075 * 00076 * 00077 */ 00078 00079 #ifndef EIO_H 00080 #define EIO_H 00081 00082 #include <stdio.h> 00083 00084 /* EIO file formats */ 00085 #define EIO_PISA_FORMAT 1 00086 #define EIO_ALPHA_FORMAT 2 00087 00088 /* EIO file version */ 00089 #define EIO_FILE_VERSION 3 00090 00091 FILE *eio_create(char *fname); 00092 00093 FILE *eio_open(char *fname); 00094 00095 /* returns non-zero if file FNAME has a valid EIO header */ 00096 int eio_valid(char *fname); 00097 00098 void eio_close(FILE *fd); 00099 00100 /* check point current architected state to stream FD, returns 00101 EIO transaction count (an EIO file pointer) */ 00102 counter_t 00103 eio_write_chkpt(struct regs_t *regs, /* regs to dump */ 00104 struct mem_t *mem, /* memory to dump */ 00105 FILE *fd); /* stream to write to */ 00106 00107 /* read check point of architected state from stream FD, returns 00108 EIO transaction count (an EIO file pointer) */ 00109 counter_t 00110 eio_read_chkpt(struct regs_t *regs, /* regs to dump */ 00111 struct mem_t *mem, /* memory to dump */ 00112 FILE *fd); /* stream to read */ 00113 00114 /* syscall proxy handler, with EIO tracing support, architect registers 00115 and memory are assumed to be precise when this function is called, 00116 register and memory are updated with the results of the sustem call */ 00117 void 00118 eio_write_trace(FILE *eio_fd, /* EIO stream file desc */ 00119 counter_t icnt, /* instruction count */ 00120 struct regs_t *regs, /* registers to update */ 00121 mem_access_fn mem_fn, /* generic memory accessor */ 00122 struct mem_t *mem, /* memory to update */ 00123 md_inst_t inst); /* system call inst */ 00124 00125 /* syscall proxy handler from an EIO trace, architect registers 00126 and memory are assumed to be precise when this function is called, 00127 register and memory are updated with the results of the sustem call */ 00128 void 00129 eio_read_trace(FILE *eio_fd, /* EIO stream file desc */ 00130 counter_t icnt, /* instruction count */ 00131 struct regs_t *regs, /* registers to update */ 00132 mem_access_fn mem_fn, /* generic memory accessor */ 00133 struct mem_t *mem, /* memory to update */ 00134 md_inst_t inst); /* system call inst */ 00135 00136 /* fast forward EIO trace EIO_FD to the transaction just after ICNT */ 00137 void eio_fast_forward(FILE *eio_fd, counter_t icnt); 00138 00139 #endif /* EIO_H */