vudefs.h
2.93 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#define TAB_SIZE (sizeof (tab) / sizeof (tab[0]) )
#define OPTAB_SIZE (sizeof (optab) / sizeof (optab[0]))
#define ELTAB_SIZE (sizeof (eltab) / sizeof (eltab[0]))
#define REGTAB_SIZE (sizeof (regtab) / sizeof (regtab[0]))
#define RIDX_SIZE (sizeof (reg_index) / sizeof (reg_index[0]))
typedef signed char i8; /* signed */
typedef short int i16;
typedef long int i32;
typedef long long int i64;
typedef unsigned char u8; /* unsigned */
typedef unsigned short int u16;
typedef unsigned long int u32;
typedef unsigned long long int u64;
typedef enum
{
SRC =0,
TRG =1,
DST =2,
ACCL=3,
ACCM =4,
ACCH =5,
DST_EXP =6,
ACCL_EXP =7,
ACCM_EXP =8,
ACCH_EXP =9,
TEMP =10,
V4000 =11,
V0001 =12,
VTH =13,
VTL =14,
VDH =15,
VDL =16,
VDH_Exp =17,
VDL_Exp =18,
VSH =19,
VSL =20
} REG_TYPE;
typedef enum
{
V_SRC,
V_TRG,
V_DDATA,
V_ACCL,
V_ACCM,
V_ACCH,
INVCO,
INVCE,
INVCO_H,
INVCO_L,
INVCC,
V_ELM,
OPER,
START,
END,
COMMENT,
C_RETURN,
PROG_NAME,
R_ASSIGN,
VSH_OFF,
ELH_OFF
} LINE_TYPE;
typedef enum
{
/*ADD GROUP */
VADD,
VSUB,
VSUT,
VABS,
VADDC,
VSUBC,
VADDB,
VSUBB,
VACCB,
VSUCB,
VSAD,
VSAC,
VSUM,
VSAW,
/*LOGIC GROUP */
VAND,
VNAND,
VOR,
VNOR,
VXOR,
VXNOR,
/*MUL GROUP */
VMULF,
VMACF,
VMULU,
VMACU,
VRNDP,
VRNDN,
VMULQ,
VMACQ,
VMUDL,
VMADL,
VMUDM,
VMADM,
VMUDN,
VMADN,
VMUDH,
VMADH,
/*SELECT GROUP */
VLT,
VEQ,
VNE,
VGE,
VCH,
VCL,
VCR,
VMRG,
/* INS, EXTR GROUP */
VINS_T,
VINS_Q,
VINS_N,
VEXT_T,
VEXT_Q,
VEXT_N,
/*DIV GROUP */
SP_RECP,
SP_SQRT,
DP_RECP,
DP_SQRT,
DP_RECP_CHAIN,
DP_SQRT_CHAIN,
INIT_DIV,
VMOV,
DP_MUL
/*LOAD GROUP */
/*STORE GROUP */
} OP_TYPE;
typedef struct
{
char *name;
int enu_name;
} TABLE;
typedef struct
{
char *name;
int enu_name;
int rnum;
} RTABLE;
typedef struct
{
char *name;
int enu_name;
char *op_tmplt;
} OP_TABLE;
typedef struct
{
char *name;
int el_value;
char *sub_field;
} EL_TABLE;
extern TABLE tab[], reg_index[];
extern OP_TABLE optab[];
extern RTABLE regtab[];
extern EL_TABLE eltab[];
extern u16 vs[8], vt[8], vd[8], in_vco, el, out_vco, in_vcc, out_vcc;
extern u8 in_vce, out_vce;
extern u16 data[2048];
extern int data_pntr;
extern int test_num;
extern int index, opindex, elindex, rtabindex, ridx;
extern char el_sf[10];
extern u16 out_vaccl[8], out_vaccm[8], out_vacch[8];
extern u16 in_vaccl[8], in_vaccm[8], in_vacch[8];
extern char prog_name[];
extern i64 vacc[8], vacc_B[8],dp_res[8];
extern u32 div_in[8],div_out[8];
extern u32 dp_vs[8],dp_vt[8];
extern u16 vdh[8],vdl[8],vth[8],vtl[8],vsh[8],vsl[8];
extern int div_in_cnt;
extern int div_vsh[8],div_vsl[8],div_elh[8],div_ell[8];
extern u16 rom[1024];
extern int div_vsh_offset,div_elh_offset;