rsp.h
2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**************************************************************************
* *
* 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