Project

General

Profile

Download (10.3 KB) Statistics
| Branch: | Tag: | Revision:
1

    
2
-- Copyright (C) 1996 Morgan Kaufmann Publishers, Inc
3

    
4
-- This file is part of VESTs (Vhdl tESTs).
5

    
6
-- VESTs is free software; you can redistribute it and/or modify it
7
-- under the terms of the GNU General Public License as published by the
8
-- Free Software Foundation; either version 2 of the License, or (at
9
-- your option) any later version. 
10

    
11
-- VESTs is distributed in the hope that it will be useful, but WITHOUT
12
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14
-- for more details. 
15

    
16
-- You should have received a copy of the GNU General Public License
17
-- along with VESTs; if not, write to the Free Software Foundation,
18
-- Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
19

    
20
-- ---------------------------------------------------------------------
21
--
22
-- $Id: ch_15_dlxi.vhd,v 1.2 2001-10-26 16:29:36 paw Exp $
23
-- $Revision: 1.2 $
24
--
25
-- ---------------------------------------------------------------------
26

    
27
use work.dlx_types.all;
28

    
29
package dlx_instr is
30

    
31
  subtype dlx_opcode is bit_vector(0 to 5);
32
  subtype dlx_sp_func is bit_vector(0 to 5);
33
  subtype dlx_fp_func is bit_vector(0 to 4);
34
  subtype dlx_reg_addr is bit_vector(0 to 4);
35
  subtype dlx_immed16 is bit_vector(0 to 15);
36
  subtype dlx_immed26 is bit_vector(0 to 25);
37

    
38
  constant op_special   : dlx_opcode := B"000000";
39
  constant op_fparith   : dlx_opcode := B"000001";
40
  constant op_j         : dlx_opcode := B"000010";
41
  constant op_jal       : dlx_opcode := B"000011";
42
  constant op_beqz      : dlx_opcode := B"000100";
43
  constant op_bnez      : dlx_opcode := B"000101";
44
  constant op_bfpt      : dlx_opcode := B"000110";
45
  constant op_bfpf      : dlx_opcode := B"000111";
46
  constant op_addi      : dlx_opcode := B"001000";
47
  constant op_addui     : dlx_opcode := B"001001";
48
  constant op_subi	: dlx_opcode := B"001010";
49
  constant op_subui	: dlx_opcode := B"001011";
50
  constant op_andi	: dlx_opcode := B"001100";
51
  constant op_ori	: dlx_opcode := B"001101";
52
  constant op_xori	: dlx_opcode := B"001110";
53
  constant op_lhi	: dlx_opcode := B"001111";
54

    
55
  constant op_rfe	: dlx_opcode := B"010000";
56
  constant op_trap	: dlx_opcode := B"010001";
57
  constant op_jr	: dlx_opcode := B"010010";
58
  constant op_jalr	: dlx_opcode := B"010011";
59
  constant op_slli	: dlx_opcode := B"010100";
60
  constant op_undef_15	: dlx_opcode := B"010101";
61
  constant op_srli	: dlx_opcode := B"010110";
62
  constant op_srai	: dlx_opcode := B"010111";
63
  constant op_seqi	: dlx_opcode := B"011000";
64
  constant op_snei	: dlx_opcode := B"011001";
65
  constant op_slti	: dlx_opcode := B"011010";
66
  constant op_sgti	: dlx_opcode := B"011011";
67
  constant op_slei	: dlx_opcode := B"011100";
68
  constant op_sgei	: dlx_opcode := B"011101";
69
  constant op_undef_1E	: dlx_opcode := B"011110";
70
  constant op_undef_1F	: dlx_opcode := B"011111";
71

    
72
  constant op_lb	: dlx_opcode := B"100000";
73
  constant op_lh	: dlx_opcode := B"100001";
74
  constant op_undef_22	: dlx_opcode := B"100010";
75
  constant op_lw	: dlx_opcode := B"100011";
76
  constant op_lbu	: dlx_opcode := B"100100";
77
  constant op_lhu	: dlx_opcode := B"100101";
78
  constant op_lf	: dlx_opcode := B"100110";
79
  constant op_ld	: dlx_opcode := B"100111";
80
  constant op_sb	: dlx_opcode := B"101000";
81
  constant op_sh	: dlx_opcode := B"101001";
82
  constant op_undef_2A	: dlx_opcode := B"101010";
83
  constant op_sw	: dlx_opcode := B"101011";
84
  constant op_undef_2C	: dlx_opcode := B"101100";
85
  constant op_undef_2D	: dlx_opcode := B"101101";
86
  constant op_sf	: dlx_opcode := B"101110";
87
  constant op_sd	: dlx_opcode := B"101111";
88

    
89
  constant op_sequi	: dlx_opcode := B"110000";
90
  constant op_sneui	: dlx_opcode := B"110001";
91
  constant op_sltui	: dlx_opcode := B"110010";
92
  constant op_sgtui	: dlx_opcode := B"110011";
93
  constant op_sleui	: dlx_opcode := B"110100";
94
  constant op_sgeui	: dlx_opcode := B"110101";
95
  constant op_undef_36	: dlx_opcode := B"110110";
96
  constant op_undef_37	: dlx_opcode := B"110111";
97
  constant op_undef_38	: dlx_opcode := B"111000";
98
  constant op_undef_39	: dlx_opcode := B"111001";
99
  constant op_undef_3A	: dlx_opcode := B"111010";
100
  constant op_undef_3B	: dlx_opcode := B"111011";
101
  constant op_undef_3C	: dlx_opcode := B"111100";
102
  constant op_undef_3D	: dlx_opcode := B"111101";
103
  constant op_undef_3E	: dlx_opcode := B"111110";
104
  constant op_undef_3F  : dlx_opcode := B"111111";
105

    
106
  constant sp_func_nop       : dlx_sp_func := B"000000";
107
  constant sp_func_undef_01  : dlx_sp_func := B"000001";
108
  constant sp_func_undef_02  : dlx_sp_func := B"000010";
109
  constant sp_func_undef_03  : dlx_sp_func := B"000011";
110
  constant sp_func_sll       : dlx_sp_func := B"000100";
111
  constant sp_func_undef_05  : dlx_sp_func := B"000101";
112
  constant sp_func_srl	     : dlx_sp_func := B"000110";
113
  constant sp_func_sra	     : dlx_sp_func := B"000111";
114
  constant sp_func_undef_08  : dlx_sp_func := B"001000";
115
  constant sp_func_undef_09  : dlx_sp_func := B"001001";
116
  constant sp_func_undef_0A  : dlx_sp_func := B"001010";
117
  constant sp_func_undef_0B  : dlx_sp_func := B"001011";
118
  constant sp_func_undef_0C  : dlx_sp_func := B"001100";
119
  constant sp_func_undef_0D  : dlx_sp_func := B"001101";
120
  constant sp_func_undef_0E  : dlx_sp_func := B"001110";
121
  constant sp_func_undef_0F  : dlx_sp_func := B"001111";
122
  
123
  constant sp_func_sequ	     : dlx_sp_func := B"010000";
124
  constant sp_func_sneu	     : dlx_sp_func := B"010001";
125
  constant sp_func_sltu	     : dlx_sp_func := B"010010";
126
  constant sp_func_sgtu	     : dlx_sp_func := B"010011";
127
  constant sp_func_sleu	     : dlx_sp_func := B"010100";
128
  constant sp_func_sgeu	     : dlx_sp_func := B"010101";
129
  constant sp_func_undef_16  : dlx_sp_func := B"010110";
130
  constant sp_func_undef_17  : dlx_sp_func := B"010111";
131
  constant sp_func_undef_18  : dlx_sp_func := B"011000";
132
  constant sp_func_undef_19  : dlx_sp_func := B"011001";
133
  constant sp_func_undef_1A  : dlx_sp_func := B"011010";
134
  constant sp_func_undef_1B  : dlx_sp_func := B"011011";
135
  constant sp_func_undef_1C  : dlx_sp_func := B"011100";
136
  constant sp_func_undef_1D  : dlx_sp_func := B"011101";
137
  constant sp_func_undef_1E  : dlx_sp_func := B"011110";
138
  constant sp_func_undef_1F  : dlx_sp_func := B"011111";
139
  
140
  constant sp_func_add	     : dlx_sp_func := B"100000";
141
  constant sp_func_addu	     : dlx_sp_func := B"100001";
142
  constant sp_func_sub	     : dlx_sp_func := B"100010";
143
  constant sp_func_subu	     : dlx_sp_func := B"100011";
144
  constant sp_func_and	     : dlx_sp_func := B"100100";
145
  constant sp_func_or	     : dlx_sp_func := B"100101";
146
  constant sp_func_xor	     : dlx_sp_func := B"100110";
147
  constant sp_func_undef_27  : dlx_sp_func := B"100111";
148
  constant sp_func_seq	     : dlx_sp_func := B"101000";
149
  constant sp_func_sne	     : dlx_sp_func := B"101001";
150
  constant sp_func_slt	     : dlx_sp_func := B"101010";
151
  constant sp_func_sgt	     : dlx_sp_func := B"101011";
152
  constant sp_func_sle	     : dlx_sp_func := B"101100";
153
  constant sp_func_sge	     : dlx_sp_func := B"101101";
154
  constant sp_func_undef_2E  : dlx_sp_func := B"101110";
155
  constant sp_func_undef_2F  : dlx_sp_func := B"101111";
156
  
157
  constant sp_func_movi2s    : dlx_sp_func := B"110000";
158
  constant sp_func_movs2i    : dlx_sp_func := B"110001";
159
  constant sp_func_movf	     : dlx_sp_func := B"110010";
160
  constant sp_func_movd	     : dlx_sp_func := B"110011";
161
  constant sp_func_movfp2i   : dlx_sp_func := B"110100";
162
  constant sp_func_movi2fp   : dlx_sp_func := B"110101";
163
  constant sp_func_undef_36  : dlx_sp_func := B"110110";
164
  constant sp_func_undef_37  : dlx_sp_func := B"110111";
165
  constant sp_func_undef_38  : dlx_sp_func := B"111000";
166
  constant sp_func_undef_39  : dlx_sp_func := B"111001";
167
  constant sp_func_undef_3A  : dlx_sp_func := B"111010";
168
  constant sp_func_undef_3B  : dlx_sp_func := B"111011";
169
  constant sp_func_undef_3C  : dlx_sp_func := B"111100";
170
  constant sp_func_undef_3D  : dlx_sp_func := B"111101";
171
  constant sp_func_undef_3E  : dlx_sp_func := B"111110";
172
  constant sp_func_undef_3F  : dlx_sp_func := B"111111";
173
  
174
  constant fp_func_addf      : dlx_fp_func := B"00000";
175
  constant fp_func_subf      : dlx_fp_func := B"00001";
176
  constant fp_func_multf     : dlx_fp_func := B"00010";
177
  constant fp_func_divf	     : dlx_fp_func := B"00011";
178
  constant fp_func_addd	     : dlx_fp_func := B"00100";
179
  constant fp_func_subd	     : dlx_fp_func := B"00101";
180
  constant fp_func_multd     : dlx_fp_func := B"00110";
181
  constant fp_func_divd	     : dlx_fp_func := B"00111";
182
  constant fp_func_cvtf2d    : dlx_fp_func := B"01000";
183
  constant fp_func_cvtf2i    : dlx_fp_func := B"01001";
184
  constant fp_func_cvtd2f    : dlx_fp_func := B"01010";
185
  constant fp_func_cvtd2i    : dlx_fp_func := B"01011";
186
  constant fp_func_cvti2f    : dlx_fp_func := B"01100";
187
  constant fp_func_cvti2d    : dlx_fp_func := B"01101";
188
  constant fp_func_mult	     : dlx_fp_func := B"01110";
189
  constant fp_func_div	     : dlx_fp_func := B"01111";
190
  
191
  constant fp_func_eqf	     : dlx_fp_func := B"10000";
192
  constant fp_func_nef	     : dlx_fp_func := B"10001";
193
  constant fp_func_ltf	     : dlx_fp_func := B"10010";
194
  constant fp_func_gtf	     : dlx_fp_func := B"10011";
195
  constant fp_func_lef	     : dlx_fp_func := B"10100";
196
  constant fp_func_gef	     : dlx_fp_func := B"10101";
197
  constant fp_func_multu     : dlx_fp_func := B"10110";
198
  constant fp_func_divu	     : dlx_fp_func := B"10111";
199
  constant fp_func_eqd	     : dlx_fp_func := B"11000";
200
  constant fp_func_ned	     : dlx_fp_func := B"11001";
201
  constant fp_func_ltd	     : dlx_fp_func := B"11010";
202
  constant fp_func_gtd	     : dlx_fp_func := B"11011";
203
  constant fp_func_led	     : dlx_fp_func := B"11100";
204
  constant fp_func_ged	     : dlx_fp_func := B"11101";
205
  constant fp_func_undef_1E  : dlx_fp_func := B"11110";
206
  constant fp_func_undef_1F  : dlx_fp_func := B"11111";
207

    
208
  subtype dlx_opcode_num is natural range 0 to 63;
209
  subtype dlx_sp_func_num is natural range 0 to 63;
210
  subtype dlx_fp_func_num is natural range 0 to 31;
211

    
212
  subtype instr_name is string(1 to 8);
213
  type opcode_name_array is array (dlx_opcode_num) of instr_name;
214
  type sp_func_name_array is array (dlx_sp_func_num) of instr_name;
215
  type fp_func_name_array is array (dlx_fp_func_num) of instr_name;
216

    
217
  constant opcode_names : opcode_name_array;
218
  constant sp_func_names : sp_func_name_array;
219
  constant fp_func_names : fp_func_name_array;
220

    
221
  subtype reg_index is natural range 0 to 31;
222

    
223
  constant link_reg : reg_index := 31;
224

    
225
  procedure disassemble ( instr : dlx_bv_word;
226
			  disassembled_instr : out string;  len : out positive );
227

    
228
end package dlx_instr;
(207-207/267)