rsp.h 2.83 KB

/**************************************************************************
 *                                                                        *
 *               Copyright (C) 1994, Silicon Graphics, Inc.               *
 *                                                                        *
 *  These coded instructions, statements, and computer programs  contain  *
 *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
 *  are protected by Federal copyright  law.  They  may not be disclosed  *
 *  to  third  parties  or copied or duplicated in any form, in whole or  *
 *  in part, without the prior written consent of Silicon Graphics, Inc.  *
 *                                                                        *
 *************************************************************************/

/*
 * File:	nsp.h
 * Creator:	hsa@sgi.com
 * Create Date:	Thu Jan 27 16:59:26 PST 1994
 *
 * This file holds "global" definitions for the RSP simulator.
 *
 */

#ifndef _rsp_rsp_h_
#define _rsp_rsp_h_ 1

#include <rcp.h>

#define RSP_VERSION		"1.0"
#define RSP_VERSION_DATE	__DATE__
#define RSP_VERSION_TIME	__TIME__

/*
 * Basic defines:
 */

#ifndef TRUE
#   define TRUE		1
#endif

#ifndef FALSE
#   define FALSE	0
#endif

#define Flagged(a, b)	((a) & (b))
#define Flag(a, b)	((a) | (b))
#define UnFlag(a, b)	((a) & ~(b))

/*
 * Basic data types:
 */

typedef char		boolean;	/* holds true/false */

typedef signed char	i8;		/* signed */
typedef short int	i16;
typedef long int	i32;
typedef long long int	i64;

#if 0
/* these are obsolete, they are now in rcp.h
 * Thu Mar 23 14:27:15 PST 1995
 */
typedef unsigned char		u8;	/* unsigned */
typedef unsigned short int	u16;
typedef unsigned long int	u32;
typedef unsigned long long int	u64;
#endif

typedef struct {
#ifdef __sgi__
    char	b[16];
#else
    unsigned char	b[16]; /*XXXblythe mips chars ARE unsigned */
#endif
} i128;

typedef struct {
    unsigned char	b[16];
} u128;

typedef i16 coord;	/* signed 16-bit integer +/- 32K */
typedef i16 frac16;	/* signed 16-bit fixed-point fraction */
typedef i32 fix16;	/* 31-bit signed fixed-point w/15-bit fraction */

/* fixed-point conversion macros... */
#define Fix16Log	(15)
#define Fix16Scale	(1 << 15)
#define IntToFix16(a)	((a) << Fix16Log)

/*
 * These routines need to be defined (for the simulator) or stubbed
 * (verilog).
 */

/* setting verbose to FALSE will disable some messages */
extern boolean	rsp_SetVerbose(boolean value);

/* fprintf version that obeys verbose flag */
extern void	rsp_Verbose(FILE *out, char *fmt, ...);

/* fprintf version that is routed either to the screen or to curses windows */

extern void	rsp_fprintf(FILE *out, char *fmt, ...);
extern void	rsp_eprintf(FILE *out, char *fmt, ...);
extern int	rsp_fgets(char *s, int n, FILE *in);

/* verilog trace file */
extern FILE	*vtout;

extern boolean	XBUS_stdout;

#endif