"I am a person who works hard and plays hard."

Yuan Wei
Second Year Graduate Student Department of Computer Science
University of Virginia Charlottesville, VA 22903
Email: yw3f@cs.virginia.edu


Source Code Analysis

Main Page   Compound List   File List   Compound Members   File Members  

range.h

Go to the documentation of this file.
00001 /*
00002  * range.h - program execution range definitions and interfaces
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) 1994, 1995, 1996, 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  * source file.  You are forbidden to forbid anyone else to use, share
00047  * and improve what you give them.
00048  *
00049  * INTERNET: dburger@cs.wisc.edu
00050  * US Mail:  1210 W. Dayton Street, Madison, WI 53706
00051  *
00052  * $Id: range.h,v 1.1.1.1 2000/05/26 15:18:59 taustin Exp $
00053  *
00054  * $Log: range.h,v $
00055  * Revision 1.1.1.1  2000/05/26 15:18:59  taustin
00056  * SimpleScalar Tool Set
00057  *
00058  *
00059  * Revision 1.2  1998/08/27 15:50:50  taustin
00060  * implemented host interface description in host.h
00061  * added target interface support
00062  *
00063  * Revision 1.1  1997/03/11  01:32:44  taustin
00064  * Initial revision
00065  *
00066  *
00067  */
00068 
00069 #ifndef RANGE_H
00070 #define RANGE_H
00071 
00072 #include <stdio.h>
00073 
00074 #include "host.h"
00075 #include "misc.h"
00076 #include "machine.h"
00077 
00078 enum range_ptype_t {
00079   pt_addr = 0,                  /* address position */
00080   pt_inst,                      /* instruction count position */
00081   pt_cycle,                     /* cycle count position */
00082   pt_NUM
00083 };
00084 
00085 /*
00086  * an execution position
00087  *
00088  *   by addr:           @<addr>
00089  *   by inst count:     <icnt>
00090  *   by cycle count:    #<cycle>
00091  *
00092  */
00093 struct range_pos_t {
00094   enum range_ptype_t ptype;     /* type of position */
00095   counter_t pos;                /* position */
00096 };
00097 
00098 /* an execution range */
00099 struct range_range_t {
00100   struct range_pos_t start;
00101   struct range_pos_t end;
00102 };
00103 
00104 /* parse execution position *PSTR to *POS */
00105 char *                                          /* error string, or NULL */
00106 range_parse_pos(char *pstr,                     /* execution position string */
00107                 struct range_pos_t *pos);       /* position return buffer */
00108 
00109 /* print execution position *POS */
00110 void
00111 range_print_pos(struct range_pos_t *pos,        /* execution position */
00112                 FILE *stream);                  /* output stream */
00113 
00114 /* parse execution range *RSTR to *RANGE */
00115 char *                                          /* error string, or NULL */
00116 range_parse_range(char *rstr,                   /* execution range string */
00117                   struct range_range_t *range); /* range return buffer */
00118 
00119 /* print execution range *RANGE */
00120 void
00121 range_print_range(struct range_range_t *range,  /* execution range */
00122                   FILE *stream);                /* output stream */
00123 
00124 /* determine if inputs match execution position */
00125 int                                             /* relation to position */
00126 range_cmp_pos(struct range_pos_t *pos,          /* execution position */
00127               counter_t val);                   /* position value */
00128 
00129 /* determine if inputs are in range */
00130 int                                             /* relation to range */
00131 range_cmp_range(struct range_range_t *range,    /* execution range */
00132                 counter_t val);                 /* position value */
00133 
00134 
00135 /* determine if inputs are in range, passes all possible info needed */
00136 int                                             /* relation to range */
00137 range_cmp_range1(struct range_range_t *range,   /* execution range */
00138                  md_addr_t addr,                /* address value */
00139                  counter_t icount,              /* instruction count */
00140                  counter_t cycle);              /* cycle count */
00141 
00142 
00143 /*
00144  *
00145  * <range> := {<start_val>}:{<end>}
00146  * <end>   := <end_val>
00147  *            | +<delta>
00148  *
00149  */
00150 
00151 #endif /* RANGE_H */


UVa CS Department of Computer Science
School of Engineering, University of Virginia
151 Engineer's Way, P.O. Box 400740
Charlottesville, Virginia 22904-4740

(434) 982-2200  Fax: (434) 982-2214