OpenCores
URL https://opencores.org/ocsvn/core_arm/core_arm/trunk

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [vhdl/] [sparc/] [libs/] [sparcdecode.vhd] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tarookumic
library ieee;
2
use ieee.std_logic_1164.all;
3
use work.config.all;
4
 
5
-- PREFIX: sde_xxx
6
package spacedecode is
7
 
8
-------------------------------------------------------------------------------
9
 
10
type sde_decinsn is (
11
 sde_insn_ldsb, sde_insn_ldsh, sde_insn_ldst_ub, sde_insn_ldst_uh,
12
 sde_insn_ldst, sde_insn_ldst_d, sde_insn_ldst_f, sde_insn_ldst_df,
13
 sde_insn_ldst_fsr, sde_insn_stdfq, sde_insn_ldst_c, sde_insn_ldst_dc,
14
 sde_insn_ldst_csr, sde_insn_stdcq, sde_insn_ldstb, sde_insn_swp,
15
 sde_insn_sethi, sde_insn_nop, sde_insn_and, sde_insn_or, sde_insn_xor,
16
 sde_insn_sll, sde_insn_srl, sde_insn_sra, sde_insn_sadd, sde_insn_tsadd,
17
 sde_insn_tsaddtv, sde_insn_mulscc, sde_insn_divscc, sde_insn_sv,
18
 sde_insn_rest, sde_insn_bra, sde_insn_fbra, sde_insn_cbra, sde_insn_jmp,
19
 sde_insn_jml, sde_insn_ret, sde_insn_trap,
20
 sde_insn_rd, sde_insn_rdp, sde_insn_rdw, sde_insn_rdt, sde_insn_wd, sde_insn_wdp,
21
 sde_insn_wdw, sde_insn_wdt, sde_insn_stbar, sde_insn_unimp
22
);
23
 
24
function sde_decode_v8(
25
  insn : in std_logic_vector(31 downto 0)
26
) return sde_decinsn;
27
 
28
end spacedecode;
29
 
30
package body spacedecode is
31
 
32
function sde_decode_v8(
33
  insn : in std_logic_vector(31 downto 0)
34
) return sde_decinsn is
35
begin
36
case insn(31 downto 30) is
37
when "00"=>
38
 case insn(24 downto 24) is
39
 when "0"=>
40
  case insn(23 downto 23) is
41
  when "0"=>
42
   case insn(22 downto 22) is
43
   when "0"=>
44
    return sde_insn_unimp;
45
   when others =>
46
   end case;
47
  when "1"=>
48
   case insn(22 downto 22) is
49
   when "0"=>
50
    return sde_insn_bra;
51
   when others =>
52
   end case;
53
  when others =>
54
  end case;
55
 when "1"=>
56
  case insn(23 downto 23) is
57
  when "1"=>
58
   case insn(22 downto 22) is
59
   when "1"=>
60
    return sde_insn_cbra;
61
   when "0"=>
62
    return sde_insn_fbra;
63
   when others =>
64
   end case;
65
  when "0"=>
66
   case insn(22 downto 22) is
67
   when "0"=>
68
    case insn(29 downto 25) is
69
    when "00000"=>
70
     return sde_insn_nop;
71
    when others =>
72
    end case;
73
    return sde_insn_sethi; --default
74
   when others =>
75
   end case;
76
  when others =>
77
  end case;
78
 when others =>
79
 end case;
80
when "10"=>
81
 case insn(24 downto 24) is
82
 when "1"=>
83
  case insn(23 downto 23) is
84
  when "0"=>
85
   case insn(22 downto 22) is
86
   when "1"=>
87
    case insn(21 downto 21) is
88
    when "0"=>
89
     case insn(20 downto 20) is
90
     when "0"=>
91
      case insn(19 downto 19) is
92
      when "0"=>
93
       case insn(29 downto 25) is
94
       when "00000"=>
95
        case insn(18 downto 13) is
96
        when "011110"=>
97
         return sde_insn_stbar;
98
        when others =>
99
        end case;
100
       when others =>
101
       end case;
102
       return sde_insn_rd; --default
103
      when "1"=>
104
       return sde_insn_rdp;
105
      when others =>
106
      end case;
107
     when "1"=>
108
      case insn(19 downto 19) is
109
      when "1"=>
110
       return sde_insn_rdt;
111
      when "0"=>
112
       return sde_insn_rdw;
113
      when others =>
114
      end case;
115
     when others =>
116
     end case;
117
    when others =>
118
    end case;
119
   when "0"=>
120
    case insn(21 downto 21) is
121
    when "0"=>
122
     case insn(20 downto 20) is
123
     when "1"=>
124
      return sde_insn_tsaddtv;
125
     when "0"=>
126
      return sde_insn_tsadd;
127
     when others =>
128
     end case;
129
    when "1"=>
130
     case insn(20 downto 20) is
131
     when "1"=>
132
      case insn(19 downto 19) is
133
      when "1"=>
134
       return sde_insn_sra;
135
      when "0"=>
136
       return sde_insn_srl;
137
      when others =>
138
      end case;
139
     when "0"=>
140
      case insn(19 downto 19) is
141
      when "1"=>
142
       return sde_insn_sll;
143
      when others =>
144
      end case;
145
     when others =>
146
     end case;
147
    when others =>
148
    end case;
149
   when others =>
150
   end case;
151
  when "1"=>
152
   case insn(22 downto 22) is
153
   when "0"=>
154
    case insn(21 downto 21) is
155
    when "0"=>
156
     case insn(20 downto 20) is
157
     when "1"=>
158
      case insn(19 downto 19) is
159
      when "1"=>
160
       return sde_insn_wdt;
161
      when "0"=>
162
       return sde_insn_wdw;
163
      when others =>
164
      end case;
165
     when "0"=>
166
      case insn(19 downto 19) is
167
      when "1"=>
168
       return sde_insn_wdp;
169
      when "0"=>
170
       return sde_insn_wd;
171
      when others =>
172
      end case;
173
     when others =>
174
     end case;
175
    when others =>
176
    end case;
177
   when "1"=>
178
    case insn(21 downto 21) is
179
    when "0"=>
180
     case insn(20 downto 20) is
181
     when "1"=>
182
      case insn(19 downto 19) is
183
      when "0"=>
184
       return sde_insn_trap;
185
      when others =>
186
      end case;
187
     when "0"=>
188
      case insn(19 downto 19) is
189
      when "1"=>
190
       return sde_insn_ret;
191
      when "0"=>
192
       return sde_insn_jml;
193
      when others =>
194
      end case;
195
     when others =>
196
     end case;
197
    when "1"=>
198
     case insn(20 downto 20) is
199
     when "0"=>
200
      case insn(19 downto 19) is
201
      when "1"=>
202
       return sde_insn_rest;
203
      when "0"=>
204
       return sde_insn_sv;
205
      when others =>
206
      end case;
207
     when others =>
208
     end case;
209
    when others =>
210
    end case;
211
   when others =>
212
   end case;
213
  when others =>
214
  end case;
215
 when "0"=>
216
  case insn(20 downto 20) is
217
  when "1"=>
218
   case insn(22 downto 22) is
219
   when "1"=>
220
    case insn(21 downto 21) is
221
    when "1"=>
222
     return sde_insn_divscc;
223
    when "0"=>
224
     return sde_insn_mulscc;
225
    when others =>
226
    end case;
227
   when "0"=>
228
    case insn(19 downto 19) is
229
    when "1"=>
230
     return sde_insn_xor;
231
    when "0"=>
232
     return sde_insn_or;
233
    when others =>
234
    end case;
235
   when others =>
236
   end case;
237
  when "0"=>
238
   case insn(19 downto 19) is
239
   when "0"=>
240
    return sde_insn_sadd;
241
   when "1"=>
242
    case insn(22 downto 22) is
243
    when "0"=>
244
     return sde_insn_and;
245
    when others =>
246
    end case;
247
   when others =>
248
   end case;
249
  when others =>
250
  end case;
251
 when others =>
252
 end case;
253
when "01"=>
254
 return sde_insn_jmp;
255
when "11"=>
256
 case insn(24 downto 24) is
257
 when "0"=>
258
  case insn(22 downto 22) is
259
  when "1"=>
260
   case insn(21 downto 21) is
261
   when "1"=>
262
    case insn(20 downto 20) is
263
    when "1"=>
264
     case insn(19 downto 19) is
265
     when "1"=>
266
      return sde_insn_swp;
267
     when others =>
268
     end case;
269
    when "0"=>
270
     case insn(19 downto 19) is
271
     when "1"=>
272
      return sde_insn_ldstb;
273
     when others =>
274
     end case;
275
    when others =>
276
    end case;
277
   when "0"=>
278
    case insn(20 downto 20) is
279
    when "1"=>
280
     case insn(19 downto 19) is
281
     when "0"=>
282
      return sde_insn_ldsh;
283
     when others =>
284
     end case;
285
    when "0"=>
286
     case insn(19 downto 19) is
287
     when "1"=>
288
      return sde_insn_ldsb;
289
     when others =>
290
     end case;
291
    when others =>
292
    end case;
293
   when others =>
294
   end case;
295
  when "0"=>
296
   case insn(20 downto 20) is
297
   when "1"=>
298
    case insn(19 downto 19) is
299
    when "1"=>
300
     return sde_insn_ldst_d;
301
    when "0"=>
302
     return sde_insn_ldst_uh;
303
    when others =>
304
    end case;
305
   when "0"=>
306
    case insn(19 downto 19) is
307
    when "0"=>
308
     return sde_insn_ldst;
309
    when "1"=>
310
     return sde_insn_ldst_ub;
311
    when others =>
312
    end case;
313
   when others =>
314
   end case;
315
  when others =>
316
  end case;
317
 when "1"=>
318
  case insn(23 downto 23) is
319
  when "1"=>
320
   case insn(22 downto 22) is
321
   when "0"=>
322
    case insn(20 downto 20) is
323
    when "1"=>
324
     case insn(19 downto 19) is
325
     when "1"=>
326
      case insn(21 downto 21) is
327
      when "1"=>
328
       return sde_insn_stdcq;
329
      when others =>
330
      end case;
331
      return sde_insn_ldst_dc; --default
332
     when others =>
333
     end case;
334
    when "0"=>
335
     case insn(19 downto 19) is
336
     when "1"=>
337
      return sde_insn_ldst_csr;
338
     when "0"=>
339
      return sde_insn_ldst_c;
340
     when others =>
341
     end case;
342
    when others =>
343
    end case;
344
   when others =>
345
   end case;
346
  when "0"=>
347
   case insn(22 downto 22) is
348
   when "0"=>
349
    case insn(20 downto 20) is
350
    when "1"=>
351
     case insn(19 downto 19) is
352
     when "0"=>
353
      case insn(21 downto 21) is
354
      when "1"=>
355
       return sde_insn_stdfq;
356
      when others =>
357
      end case;
358
     when "1"=>
359
      return sde_insn_ldst_df;
360
     when others =>
361
     end case;
362
    when "0"=>
363
     case insn(19 downto 19) is
364
     when "1"=>
365
      return sde_insn_ldst_fsr;
366
     when "0"=>
367
      return sde_insn_ldst_f;
368
     when others =>
369
     end case;
370
    when others =>
371
    end case;
372
   when others =>
373
   end case;
374
  when others =>
375
  end case;
376
 when others =>
377
 end case;
378
when others =>
379
end case;
380
    return sde_insn_unimp;
381
end;
382
 
383
 
384
end spacedecode;

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.