gamma.h
3.54 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
/*
* Copyright (C) 1998 by the Board of Trustees
* of Leland Stanford Junior University.
* Copyright (C) 1998 Digital Equipment Corporation
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
#ifndef GAMMA_H
#define GAMMA_H
#include "simtypes.h"
#include "alpha.h"
typedef struct GammaParams {
int debugLoadStore;
int recognizePrefetches;
} GammaParams;
extern GammaParams gammaParams;
typedef void (*OperateFunction)(Reg,Reg,const Reg *rcp,Reg *rdestp);
typedef void (*MemoryFunction)(Reg *rdestp,const Reg *rap, Reg *, PA, VA);
typedef void (*FPFunction)(const double *a, const double *b, const double *c, double *dest, Reg *fpcr);
extern OperateFunction gammaOperateTable[];
extern MemoryFunction gammaMemoryTable[];
extern FPFunction gammaFPTable[];
extern void GammaInitTables(void);
extern void GammaStall(AlphaState *,CPUStatus);
/* **********************************************************
* Opcode flags
* **********************************************************/
#define AXPTYPE_INT (1<<0)
#define AXPTYPE_INT_CONDITIONAL (1<<1)
#define AXPTYPE_FP (1<<2)
#define AXPTYPE_FP_SINGLE (1<<3)
#define AXPTYPE_FP_CVT (1<<4)
#define AXPTYPE_FP_EMPTY (1<<5)
#define AXPTYPE_FP_CONDITIONAL (1<<6)
#define AXPTYPE_CANTRAP (1<<7)
#define AXPTYPE_GAMMA (1<<8) /* implemented in gamma but not delta, so callout */
extern uint gammaOperateFlags[];
extern uint gammaFPFlags[];
/* **********************************************************
* LL/SC support. Functions defined in gamma.c
* **********************************************************/
extern void ldl_l_ff(Reg *, const Reg *, Reg *, PA, VA);
extern void stl_c_ff(Reg *, const Reg *, Reg *, PA, VA);
extern void ldq_l_ff(Reg *, const Reg *, Reg *, PA, VA);
extern void stq_c_ff(Reg *, const Reg *, Reg *, PA, VA);
extern void GammaFPInit(); /* installs SIGFPE handler */
extern int GammaFPCRIndicatesTrap(AlphaState *P);
int GammaBranchOpcode( AlphaState *P, int opcode, Reg *pra, Reg_s r, double f);
int GammaOperateOpcode(AlphaState *P, int code_func, Reg ra, Reg rb, const Reg *rcPtr, Reg *rdestPtr);
int GammaFloatingOpcode(AlphaState *P,int opcode,int func,
const double *rap, const double *rbp, const double *rcp, double *rdestp);
int GammaMiscOpcode(AlphaState *P, uint instr, Reg *rdestp);
Result GammaUncachedOperation(VA vAddr, int type, void *data);
int GammaMemoryReadOpcode(int opcode,Reg *rdestp, Reg vAddr);
int GammaMemoryWriteOpcode(int opcode, Reg *rdestp, const Reg *raPtr, Reg vAddr);
/* ******************************
* debugging interface. in cpu_interface.c
* ******************************/
extern void GammaCPUVectorInit(void);
extern SimTime GammaCycleCount(int);
extern SimTime GammaInstructionCount(int);
extern int GammaDebug(int cpunum, int is_break_instruction);
extern Result GammaPutReg(int cpunum, int regnum, Reg val);
extern Result GammaPutMem(int cpunum, VA vAddr, uint nbytes, char *buf);
extern void GammaUnstall(int cpuNum);
extern void GammaTakeBusError(int cpuNum, bool isIRef, VA vAddr);
extern void GammaTurnOnCaches(void);
extern void GammaTurnOffCaches(void);
extern bool GammaCachesAreOn(void);
extern char *GammaStats(void);
#define GAMMA_NOBREAK (-2)
#define GAMMA_BREAKANYCPU (-1)
extern int gamma_debug_mode;
extern int gamma_break_nexti;
extern int gamma_sigusr;
extern int gammaArithTrap;
extern int gammaSkipCaches;
extern void DeltaGammaRun(AlphaState *);
void GammaInitStats(void);
#endif /* GAMMA_H */