Rework CR file and add forwarding
[microwatt.git] / decode1.vhdl
1 library ieee;
2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
4
5 library work;
6 use work.common.all;
7 use work.decode_types.all;
8
9 entity decode1 is
10 port (
11 clk : in std_ulogic;
12
13 f_in : in Fetch2ToDecode1Type;
14 d_out : out Decode1ToDecode2Type
15 );
16 end entity decode1;
17
18 architecture behaviour of decode1 is
19 signal f : Fetch2ToDecode1Type := Fetch2ToDecode1Init;
20
21 type decode_rom_array_t is array(ppc_insn_t) of decode_rom_t;
22
23 -- Note: reformat with column -t -o ' '
24 constant decode_rom_array : decode_rom_array_t := (
25 -- unit internal in1 in2 in3 out const const const CR CR cry cry ldst ld BR sgn upd mul mul rc lk
26 -- op 1 2 3 in out in out len ext 32 sgn
27 PPC_ILLEGAL => (ALU, OP_ILLEGAL, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
28 PPC_ADD => (ALU, OP_ADD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
29 PPC_ADDC => (ALU, OP_ADDC, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
30 PPC_ADDE => (ALU, OP_ADDC, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '1', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
31 --PPC_ADDEX
32 PPC_ADDI => (ALU, OP_ADD, RA_OR_ZERO, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
33 PPC_ADDIC => (ALU, OP_ADDC, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
34 PPC_ADDIC_RC => (ALU, OP_ADDC, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', ONE, '0'),
35 PPC_ADDIS => (ALU, OP_ADD, RA_OR_ZERO, CONST_SI_HI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
36 --PPC_ADDME
37 --PPC_ADDPCIS
38 PPC_ADDZE => (ALU, OP_ADDC, RA, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '1', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
39 PPC_AND => (ALU, OP_AND, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
40 PPC_ANDC => (ALU, OP_ANDC, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
41 PPC_ANDI_RC => (ALU, OP_AND, RS, CONST_UI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', ONE, '0'),
42 PPC_ANDIS_RC => (ALU, OP_AND, RS, CONST_UI_HI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', ONE, '0'),
43 PPC_ATTN => (ALU, OP_ILLEGAL, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
44 PPC_B => (ALU, OP_B, NONE, CONST_LI, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '1'),
45 --PPC_BA
46 PPC_BC => (ALU, OP_BC, NONE, CONST_BD, NONE, NONE, BO, BI, NONE, '1', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '1'),
47 --PPC_BCA
48 PPC_BCCTR => (ALU, OP_BCCTR, NONE, NONE, NONE, NONE, BO, BI, BH, '1', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '1'),
49 --PPC_BCLA
50 PPC_BCLR => (ALU, OP_BCLR, NONE, NONE, NONE, NONE, BO, BI, BH, '1', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '1'),
51 --PPC_BCTAR
52 --PPC_BPERM
53 PPC_CMP => (ALU, OP_CMP, RA, RB, NONE, NONE, BF, L, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
54 PPC_CMPB => (ALU, OP_CMPB, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
55 --PPC_CMPEQB
56 PPC_CMPI => (ALU, OP_CMP, RA, CONST_SI, NONE, NONE, BF, L, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
57 PPC_CMPL => (ALU, OP_CMPL, RA, RB, NONE, NONE, BF, L, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
58 PPC_CMPLI => (ALU, OP_CMPL, RA, CONST_UI, NONE, NONE, BF, L, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
59 --PPC_CMPRB
60 PPC_CNTLZD => (ALU, OP_CNTLZD, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
61 PPC_CNTLZW => (ALU, OP_CNTLZW, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
62 PPC_CNTTZD => (ALU, OP_CNTTZD, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
63 PPC_CNTTZW => (ALU, OP_CNTTZW, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
64 --PPC_CRAND
65 --PPC_CRANDC
66 --PPC_CREQV
67 --PPC_CRNAND
68 --PPC_CRNOR
69 --PPC_CROR
70 --PPC_CRORC
71 --PPC_CRXOR
72 --PPC_DARN
73 PPC_DCBF => (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
74 PPC_DCBST => (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
75 PPC_DCBT => (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
76 PPC_DCBTST => (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
77 --PPC_DCBZ
78 PPC_DIVD => (ALU, OP_DIVD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
79 --PPC_DIVDE
80 --PPC_DIVDEU
81 PPC_DIVDU => (ALU, OP_DIVDU, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
82 PPC_DIVW => (ALU, OP_DIVW, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
83 --PPC_DIVWE
84 --PPC_DIVWEU
85 PPC_DIVWU => (ALU, OP_DIVWU, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
86 PPC_EQV => (ALU, OP_EQV, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
87 PPC_EXTSB => (ALU, OP_EXTSB, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
88 PPC_EXTSH => (ALU, OP_EXTSH, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
89 PPC_EXTSW => (ALU, OP_EXTSW, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
90 --PPC_EXTSWSLI
91 --PPC_ICBI
92 PPC_ICBT => (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
93 PPC_ISEL => (ALU, OP_ISEL, RA_OR_ZERO, RB, NONE, RT, BC, NONE, NONE, '1', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
94 PPC_ISYNC => (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
95 PPC_LBARX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '0', '1', '0', '0', NONE, '0'),
96 --CONST_LI matches CONST_SI, so reuse it
97 PPC_LBZ => (LDST, OP_LOAD, RA_OR_ZERO, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '0', '0', '0', '0', NONE, '0'),
98 PPC_LBZU => (LDST, OP_LOAD, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '1', '0', '0', '0', NONE, '0'),
99 PPC_LBZUX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '1', '0', '0', '0', NONE, '0'),
100 PPC_LBZX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '0', '0', '0', '0', NONE, '0'),
101 PPC_LD => (LDST, OP_LOAD, RA_OR_ZERO, CONST_DS, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '0', '0', '0', '0', NONE, '0'),
102 PPC_LDARX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '0', '1', '0', '0', NONE, '0'),
103 PPC_LDBRX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '1', '0', '0', '0', '0', '0', NONE, '0'),
104 PPC_LDU => (LDST, OP_LOAD, RA, CONST_DS, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '1', '0', '0', '0', NONE, '0'),
105 PPC_LDUX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '1', '0', '0', '0', NONE, '0'),
106 PPC_LDX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '0', '0', '0', '0', NONE, '0'),
107 PPC_LHA => (LDST, OP_LOAD, RA_OR_ZERO, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '1', '0', '0', '0', '0', NONE, '0'),
108 PPC_LHARX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '0', '1', '0', '0', NONE, '0'),
109 PPC_LHAU => (LDST, OP_LOAD, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '1', '1', '0', '0', '0', NONE, '0'),
110 PPC_LHAUX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '1', '1', '0', '0', '0', NONE, '0'),
111 PPC_LHAX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '1', '0', '0', '0', '0', NONE, '0'),
112 PPC_LHBRX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '1', '0', '0', '0', '0', '0', NONE, '0'),
113 PPC_LHZ => (LDST, OP_LOAD, RA_OR_ZERO, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '0', '0', '0', '0', NONE, '0'),
114 PPC_LHZU => (LDST, OP_LOAD, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '1', '0', '0', '0', NONE, '0'),
115 PPC_LHZUX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '1', '0', '0', '0', NONE, '0'),
116 PPC_LHZX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '0', '0', '0', '0', NONE, '0'),
117 PPC_LWA => (LDST, OP_LOAD, RA_OR_ZERO, CONST_DS, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '1', '0', '0', '0', '0', NONE, '0'),
118 PPC_LWARX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '0', '1', '0', '0', NONE, '0'),
119 PPC_LWAUX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '1', '1', '0', '0', '0', NONE, '0'),
120 PPC_LWAX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '1', '0', '0', '0', '0', NONE, '0'),
121 PPC_LWBRX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '1', '0', '0', '0', '0', '0', NONE, '0'),
122 PPC_LWZ => (LDST, OP_LOAD, RA_OR_ZERO, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '0', '0', '0', '0', NONE, '0'),
123 PPC_LWZU => (LDST, OP_LOAD, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '1', '0', '0', '0', NONE, '0'),
124 PPC_LWZUX => (LDST, OP_LOAD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '1', '0', '0', '0', NONE, '0'),
125 PPC_LWZX => (LDST, OP_LOAD, RA_OR_ZERO, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '0', '0', '0', '0', NONE, '0'),
126 --PPC_MADDHD
127 --PPC_MADDHDU
128 --PPC_MADDLD
129 --PPC_MCRF
130 --PPC_MCRXR
131 --PPC_MCRXRX
132 PPC_MFCR => (ALU, OP_MFCR, NONE, NONE, NONE, RT, NONE, NONE, NONE, '1', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
133 PPC_MFOCRF => (ALU, OP_MFOCRF, NONE, NONE, NONE, RT, FXM, NONE, NONE, '1', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
134 PPC_MFCTR => (ALU, OP_MFCTR, NONE, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
135 PPC_MFLR => (ALU, OP_MFLR, NONE, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
136 PPC_MFTB => (ALU, OP_MFTB, NONE, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
137 PPC_MTCTR => (ALU, OP_MTCTR, RS, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
138 PPC_MTLR => (ALU, OP_MTLR, RS, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
139 --PPC_MFSPR
140 --PPC_MODSD
141 --PPC_MODSW
142 --PPC_MODUD
143 --PPC_MODUW
144 PPC_MTCRF => (ALU, OP_MTCRF, RS, NONE, NONE, NONE, FXM, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
145 PPC_MTOCRF => (ALU, OP_MTOCRF, RS, NONE, NONE, NONE, FXM, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
146 --PPC_MTSPR
147 PPC_MULHD => (MUL, OP_MUL_H64, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '1', RC, '0'),
148 PPC_MULHDU => (MUL, OP_MUL_H64, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
149 PPC_MULHW => (MUL, OP_MUL_H32, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '1', '1', RC, '0'),
150 PPC_MULHWU => (MUL, OP_MUL_H32, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '1', '0', RC, '0'),
151 PPC_MULLD => (MUL, OP_MUL_L64, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '1', RC, '0'),
152 PPC_MULLI => (MUL, OP_MUL_L64, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '1', NONE, '0'),
153 PPC_MULLW => (MUL, OP_MUL_L64, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '1', '1', RC, '0'),
154 PPC_NAND => (ALU, OP_NAND, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
155 PPC_NEG => (ALU, OP_NEG, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
156 PPC_NOR => (ALU, OP_NOR, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
157 PPC_OR => (ALU, OP_OR, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
158 PPC_ORC => (ALU, OP_ORC, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
159 PPC_ORI => (ALU, OP_OR, RS, CONST_UI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
160 PPC_ORIS => (ALU, OP_OR, RS, CONST_UI_HI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
161 PPC_POPCNTB => (ALU, OP_POPCNTB, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
162 PPC_POPCNTD => (ALU, OP_POPCNTD, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
163 PPC_POPCNTW => (ALU, OP_POPCNTW, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
164 PPC_PRTYD => (ALU, OP_PRTYD, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
165 PPC_PRTYW => (ALU, OP_PRTYW, RS, NONE, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
166 PPC_RLDCL => (ALU, OP_RLDCL, RS, RB, NONE, RA, NONE, MB, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
167 PPC_RLDCR => (ALU, OP_RLDCR, RS, RB, NONE, RA, NONE, MB, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
168 PPC_RLDIC => (ALU, OP_RLDIC, RS, NONE, NONE, RA, SH, MB, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
169 PPC_RLDICL => (ALU, OP_RLDICL, RS, NONE, NONE, RA, SH, MB, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
170 PPC_RLDICR => (ALU, OP_RLDICR, RS, NONE, NONE, RA, SH, ME, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
171 PPC_RLDIMI => (ALU, OP_RLDIMI, RA, RS, NONE, RA, SH, MB, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
172 PPC_RLWIMI => (ALU, OP_RLWIMI, RA, RS, NONE, RA, SH32, MB32, ME32, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
173 PPC_RLWINM => (ALU, OP_RLWINM, RS, NONE, NONE, RA, SH32, MB32, ME32, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
174 PPC_RLWNM => (ALU, OP_RLWNM, RS, RB, NONE, RA, NONE, MB32, ME32, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
175 --PPC_SETB
176 PPC_SLD => (ALU, OP_SLD, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
177 PPC_SLW => (ALU, OP_SLW, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
178 PPC_SRAD => (ALU, OP_SRAD, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
179 PPC_SRADI => (ALU, OP_SRADI, RS, NONE, NONE, RA, SH, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
180 PPC_SRAW => (ALU, OP_SRAW, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
181 PPC_SRAWI => (ALU, OP_SRAWI, RS, NONE, NONE, RA, SH, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
182 PPC_SRD => (ALU, OP_SRD, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
183 PPC_SRW => (ALU, OP_SRW, RS, RB, RS, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
184 PPC_STB => (LDST, OP_STORE, RA_OR_ZERO, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '0', '0', '0', '0', RC, '0'),
185 PPC_STBCX => (LDST, OP_STORE, RA, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '0', '1', '0', '0', RC, '0'),
186 PPC_STBU => (LDST, OP_STORE, RA, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '1', '0', '0', '0', RC, '0'),
187 PPC_STBUX => (LDST, OP_STORE, RA, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '1', '0', '0', '0', RC, '0'),
188 PPC_STBX => (LDST, OP_STORE, RA_OR_ZERO, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '0', '0', '0', '0', RC, '0'),
189 PPC_STD => (LDST, OP_STORE, RA_OR_ZERO, CONST_DS, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '0', '0', '0', '0', NONE, '0'),
190 PPC_STDBRX => (LDST, OP_STORE, RA_OR_ZERO, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '1', '0', '0', '0', '0', '0', NONE, '0'),
191 PPC_STDCX => (LDST, OP_STORE, RA, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '0', '1', '0', '0', NONE, '0'),
192 PPC_STDU => (LDST, OP_STORE, RA, CONST_DS, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '1', '0', '0', '0', NONE, '0'),
193 PPC_STDUX => (LDST, OP_STORE, RA, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '1', '0', '0', '0', NONE, '0'),
194 PPC_STDX => (LDST, OP_STORE, RA_OR_ZERO, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '0', '0', '0', '0', NONE, '0'),
195 PPC_STH => (LDST, OP_STORE, RA, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '0', '0', '0', '0', NONE, '0'),
196 PPC_STHBRX => (LDST, OP_STORE, RA_OR_ZERO, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '1', '0', '0', '0', '0', '0', NONE, '0'),
197 PPC_STHCX => (LDST, OP_STORE, RA, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '0', '1', '0', '0', NONE, '0'),
198 PPC_STHU => (LDST, OP_STORE, RA, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '1', '0', '0', '0', NONE, '0'),
199 PPC_STHUX => (LDST, OP_STORE, RA, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '1', '0', '0', '0', NONE, '0'),
200 PPC_STHX => (LDST, OP_STORE, RA_OR_ZERO, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '0', '0', '0', '0', NONE, '0'),
201 PPC_STW => (LDST, OP_STORE, RA_OR_ZERO, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '0', '0', '0', '0', NONE, '0'),
202 PPC_STWBRX => (LDST, OP_STORE, RA_OR_ZERO, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '1', '0', '0', '0', '0', '0', NONE, '0'),
203 PPC_STWCX => (LDST, OP_STORE, RA, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '0', '1', '0', '0', NONE, '0'),
204 PPC_STWU => (LDST, OP_STORE, RA, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '1', '0', '0', '0', NONE, '0'),
205 PPC_STWUX => (LDST, OP_STORE, RA, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '1', '0', '0', '0', NONE, '0'),
206 PPC_STWX => (LDST, OP_STORE, RA_OR_ZERO, RB, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '0', '0', '0', '0', NONE, '0'),
207 PPC_SUBF => (ALU, OP_SUBF, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
208 PPC_SUBFC => (ALU, OP_SUBFC, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
209 PPC_SUBFE => (ALU, OP_SUBFC, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '1', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
210 PPC_SUBFIC => (ALU, OP_SUBFC, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
211 --PPC_SUBFME
212 PPC_SUBFZE => (ALU, OP_SUBFC, RA, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '1', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
213 PPC_SYNC => (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
214 --PPC_TD
215 PPC_TDI => (ALU, OP_TDI, RA, CONST_SI, NONE, NONE, TOO, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
216 --PPC_TW
217 --PPC_TWI
218 PPC_XOR => (ALU, OP_XOR, RS, RB, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0'),
219 PPC_XORI => (ALU, OP_XOR, RS, CONST_UI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
220 PPC_XORIS => (ALU, OP_XOR, RS, CONST_UI_HI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
221 PPC_SIM_READ => (ALU, OP_SIM_READ, NONE, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
222 PPC_SIM_POLL => (ALU, OP_SIM_POLL, NONE, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
223 PPC_SIM_WRITE => (ALU, OP_SIM_WRITE, RS, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
224 PPC_SIM_CONFIG => (ALU, OP_SIM_CONFIG,NONE, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0'),
225
226 others => decode_rom_init
227 );
228
229 begin
230 decode1_0: process(clk)
231 begin
232 if rising_edge(clk) then
233 f <= f_in;
234 end if;
235 end process;
236
237 decode1_1: process(all)
238 variable ppc_insn: ppc_insn_t;
239 begin
240 d_out <= Decode1ToDecode2Init;
241 ppc_insn := PPC_ILLEGAL;
242
243 d_out.valid <= f.valid;
244
245 if f.valid then
246 d_out.nia <= f.nia;
247 d_out.insn <= f.insn;
248
249 report "Decode insn " & to_hstring(f.insn);
250 if std_match(f.insn, "011111---------------0100001010-") then
251 report "PPC_add";
252 ppc_insn := PPC_ADD;
253 elsif std_match(f.insn, "011111---------------0000001010-") then
254 report "PPC_addc";
255 ppc_insn := PPC_ADDC;
256 elsif std_match(f.insn, "011111---------------0010001010-") then
257 report "PPC_adde";
258 ppc_insn := PPC_ADDE;
259 elsif std_match(f.insn, "011111---------------0010101010-") then
260 report "PPC_addex";
261 ppc_insn := PPC_ADDEX;
262 elsif std_match(f.insn, "001110--------------------------") then
263 report "PPC_addi";
264 ppc_insn := PPC_ADDI;
265 elsif std_match(f.insn, "001100--------------------------") then
266 report "PPC_addic";
267 ppc_insn := PPC_ADDIC;
268 elsif std_match(f.insn, "001101--------------------------") then
269 report "PPC_addic.";
270 ppc_insn := PPC_ADDIC_RC;
271 elsif std_match(f.insn, "001111--------------------------") then
272 report "PPC_addis";
273 ppc_insn := PPC_ADDIS;
274 elsif std_match(f.insn, "011111---------------0011101010-") then
275 report "PPC_addme";
276 ppc_insn := PPC_ADDME;
277 elsif std_match(f.insn, "010011--------------------00010-") then
278 report "PPC_addpcis";
279 ppc_insn := PPC_ADDPCIS;
280 elsif std_match(f.insn, "011111---------------0011001010-") then
281 report "PPC_addze";
282 ppc_insn := PPC_ADDZE;
283 elsif std_match(f.insn, "011111---------------0000011100-") then
284 report "PPC_and";
285 ppc_insn := PPC_AND;
286 elsif std_match(f.insn, "011111---------------0000111100-") then
287 report "PPC_andc";
288 ppc_insn := PPC_ANDC;
289 elsif std_match(f.insn, "011100--------------------------") then
290 report "PPC_andi.";
291 ppc_insn := PPC_ANDI_RC;
292 elsif std_match(f.insn, "011101--------------------------") then
293 report "PPC_andis.";
294 ppc_insn := PPC_ANDIS_RC;
295 elsif std_match(f.insn, "000000---------------0100000000-") then
296 report "PPC_attn";
297 ppc_insn := PPC_ATTN;
298 elsif std_match(f.insn, "010010------------------------0-") then
299 report "PPC_b";
300 ppc_insn := PPC_B;
301 elsif std_match(f.insn, "010010------------------------1-") then
302 report "PPC_ba";
303 ppc_insn := PPC_BA;
304 elsif std_match(f.insn, "010000------------------------0-") then
305 report "PPC_bc";
306 ppc_insn := PPC_BC;
307 elsif std_match(f.insn, "010000------------------------10") then
308 report "PPC_bca";
309 ppc_insn := PPC_BCA;
310 elsif std_match(f.insn, "010011---------------1000010000-") then
311 report "PPC_bcctr";
312 ppc_insn := PPC_BCCTR;
313 elsif std_match(f.insn, "010000------------------------11") then
314 report "PPC_bcla";
315 ppc_insn := PPC_BCLA;
316 elsif std_match(f.insn, "010011---------------0000010000-") then
317 report "PPC_bclr";
318 ppc_insn := PPC_BCLR;
319 elsif std_match(f.insn, "010011---------------1000110000-") then
320 report "PPC_bctar";
321 ppc_insn := PPC_BCTAR;
322 elsif std_match(f.insn, "011111---------------0011111100-") then
323 report "PPC_bperm";
324 ppc_insn := PPC_BPERM;
325 elsif std_match(f.insn, "011111---------------0000000000-") then
326 report "PPC_cmp";
327 ppc_insn := PPC_CMP;
328 elsif std_match(f.insn, "011111---------------0111111100-") then
329 report "PPC_cmpb";
330 ppc_insn := PPC_CMPB;
331 elsif std_match(f.insn, "011111---------------0011100000-") then
332 report "PPC_cmpeqb";
333 ppc_insn := PPC_CMPEQB;
334 elsif std_match(f.insn, "001011--------------------------") then
335 report "PPC_cmpi";
336 ppc_insn := PPC_CMPI;
337 elsif std_match(f.insn, "011111---------------0000100000-") then
338 report "PPC_cmpl";
339 ppc_insn := PPC_CMPL;
340 elsif std_match(f.insn, "001010--------------------------") then
341 report "PPC_cmpli";
342 ppc_insn := PPC_CMPLI;
343 elsif std_match(f.insn, "011111---------------0011000000-") then
344 report "PPC_cmprb";
345 ppc_insn := PPC_CMPRB;
346 elsif std_match(f.insn, "011111---------------0000111010-") then
347 report "PPC_cntlzd";
348 ppc_insn := PPC_CNTLZD;
349 elsif std_match(f.insn, "011111---------------0000011010-") then
350 report "PPC_cntlzw";
351 ppc_insn := PPC_CNTLZW;
352 elsif std_match(f.insn, "011111---------------1000111010-") then
353 report "PPC_cnttzd";
354 ppc_insn := PPC_CNTTZD;
355 elsif std_match(f.insn, "011111---------------1000011010-") then
356 report "PPC_cnttzw";
357 ppc_insn := PPC_CNTTZW;
358 elsif std_match(f.insn, "010011---------------0100000001-") then
359 report "PPC_crand";
360 ppc_insn := PPC_CRAND;
361 elsif std_match(f.insn, "010011---------------0010000001-") then
362 report "PPC_crandc";
363 ppc_insn := PPC_CRANDC;
364 elsif std_match(f.insn, "010011---------------0100100001-") then
365 report "PPC_creqv";
366 ppc_insn := PPC_CREQV;
367 elsif std_match(f.insn, "010011---------------0011100001-") then
368 report "PPC_crnand";
369 ppc_insn := PPC_CRNAND;
370 elsif std_match(f.insn, "010011---------------0000100001-") then
371 report "PPC_crnor";
372 ppc_insn := PPC_CRNOR;
373 elsif std_match(f.insn, "010011---------------0111000001-") then
374 report "PPC_cror";
375 ppc_insn := PPC_CROR;
376 elsif std_match(f.insn, "010011---------------0110100001-") then
377 report "PPC_crorc";
378 ppc_insn := PPC_CRORC;
379 elsif std_match(f.insn, "010011---------------0011000001-") then
380 report "PPC_crxor";
381 ppc_insn := PPC_CRXOR;
382 elsif std_match(f.insn, "011111---------------1011110011-") then
383 report "PPC_darn";
384 ppc_insn := PPC_DARN;
385 elsif std_match(f.insn, "011111---------------0001010110-") then
386 report "PPC_dcbf";
387 ppc_insn := PPC_DCBF;
388 elsif std_match(f.insn, "011111---------------0000110110-") then
389 report "PPC_dcbst";
390 ppc_insn := PPC_DCBST;
391 elsif std_match(f.insn, "011111---------------0100010110-") then
392 report "PPC_dcbt";
393 ppc_insn := PPC_DCBT;
394 elsif std_match(f.insn, "011111---------------0011110110-") then
395 report "PPC_dcbtst";
396 ppc_insn := PPC_DCBTST;
397 elsif std_match(f.insn, "011111---------------1111110110-") then
398 report "PPC_dcbz";
399 ppc_insn := PPC_DCBZ;
400 elsif std_match(f.insn, "011111---------------0111101001-") then
401 report "PPC_divd";
402 ppc_insn := PPC_DIVD;
403 elsif std_match(f.insn, "011111---------------0110101001-") then
404 report "PPC_divde";
405 ppc_insn := PPC_DIVDE;
406 elsif std_match(f.insn, "011111---------------0110001001-") then
407 report "PPC_divdeu";
408 ppc_insn := PPC_DIVDEU;
409 elsif std_match(f.insn, "011111---------------0111001001-") then
410 report "PPC_divdu";
411 ppc_insn := PPC_DIVDU;
412 elsif std_match(f.insn, "011111---------------0111101011-") then
413 report "PPC_divw";
414 ppc_insn := PPC_DIVW;
415 elsif std_match(f.insn, "011111---------------0110101011-") then
416 report "PPC_divwe";
417 ppc_insn := PPC_DIVWE;
418 elsif std_match(f.insn, "011111---------------0110001011-") then
419 report "PPC_divweu";
420 ppc_insn := PPC_DIVWEU;
421 elsif std_match(f.insn, "011111---------------0111001011-") then
422 report "PPC_divwu";
423 ppc_insn := PPC_DIVWU;
424 elsif std_match(f.insn, "011111---------------0100011100-") then
425 report "PPC_eqv";
426 ppc_insn := PPC_EQV;
427 elsif std_match(f.insn, "011111---------------1110111010-") then
428 report "PPC_extsb";
429 ppc_insn := PPC_EXTSB;
430 elsif std_match(f.insn, "011111---------------1110011010-") then
431 report "PPC_extsh";
432 ppc_insn := PPC_EXTSH;
433 elsif std_match(f.insn, "011111---------------1111011010-") then
434 report "PPC_extsw";
435 ppc_insn := PPC_EXTSW;
436 elsif std_match(f.insn, "011111---------------110111101--") then
437 report "PPC_extswsli";
438 ppc_insn := PPC_EXTSWSLI;
439 elsif std_match(f.insn, "011111---------------1111010110-") then
440 report "PPC_icbi";
441 ppc_insn := PPC_ICBI;
442 elsif std_match(f.insn, "011111---------------0000010110-") then
443 report "PPC_icbt";
444 ppc_insn := PPC_ICBT;
445 elsif std_match(f.insn, "011111--------------------01111-") then
446 report "PPC_isel";
447 ppc_insn := PPC_ISEL;
448 elsif std_match(f.insn, "010011---------------0010010110-") then
449 report "PPC_isync";
450 ppc_insn := PPC_ISYNC;
451 elsif std_match(f.insn, "011111---------------0000110100-") then
452 report "PPC_lbarx";
453 ppc_insn := PPC_LBARX;
454 elsif std_match(f.insn, "100010--------------------------") then
455 report "PPC_lbz";
456 ppc_insn := PPC_LBZ;
457 elsif std_match(f.insn, "100011--------------------------") then
458 report "PPC_lbzu";
459 ppc_insn := PPC_LBZU;
460 elsif std_match(f.insn, "011111---------------0001110111-") then
461 report "PPC_lbzux";
462 ppc_insn := PPC_LBZUX;
463 elsif std_match(f.insn, "011111---------------0001010111-") then
464 report "PPC_lbzx";
465 ppc_insn := PPC_LBZX;
466 elsif std_match(f.insn, "111010------------------------00") then
467 report "PPC_ld";
468 ppc_insn := PPC_LD;
469 elsif std_match(f.insn, "011111---------------0001010100-") then
470 report "PPC_ldarx";
471 ppc_insn := PPC_LDARX;
472 elsif std_match(f.insn, "011111---------------1000010100-") then
473 report "PPC_ldbrx";
474 ppc_insn := PPC_LDBRX;
475 elsif std_match(f.insn, "111010------------------------01") then
476 report "PPC_ldu";
477 ppc_insn := PPC_LDU;
478 elsif std_match(f.insn, "011111---------------0000110101-") then
479 report "PPC_ldux";
480 ppc_insn := PPC_LDUX;
481 elsif std_match(f.insn, "011111---------------0000010101-") then
482 report "PPC_ldx";
483 ppc_insn := PPC_LDX;
484 elsif std_match(f.insn, "101010--------------------------") then
485 report "PPC_lha";
486 ppc_insn := PPC_LHA;
487 elsif std_match(f.insn, "011111---------------0001110100-") then
488 report "PPC_lharx";
489 ppc_insn := PPC_LHARX;
490 elsif std_match(f.insn, "101011--------------------------") then
491 report "PPC_lhau";
492 ppc_insn := PPC_LHAU;
493 elsif std_match(f.insn, "011111---------------0101110111-") then
494 report "PPC_lhaux";
495 ppc_insn := PPC_LHAUX;
496 elsif std_match(f.insn, "011111---------------0101010111-") then
497 report "PPC_lhax";
498 ppc_insn := PPC_LHAX;
499 elsif std_match(f.insn, "011111---------------1100010110-") then
500 report "PPC_lhbrx";
501 ppc_insn := PPC_LHBRX;
502 elsif std_match(f.insn, "101000--------------------------") then
503 report "PPC_lhz";
504 ppc_insn := PPC_LHZ;
505 elsif std_match(f.insn, "101001--------------------------") then
506 report "PPC_lhzu";
507 ppc_insn := PPC_LHZU;
508 elsif std_match(f.insn, "011111---------------0100110111-") then
509 report "PPC_lhzux";
510 ppc_insn := PPC_LHZUX;
511 elsif std_match(f.insn, "011111---------------0100010111-") then
512 report "PPC_lhzx";
513 ppc_insn := PPC_LHZX;
514 elsif std_match(f.insn, "111010------------------------10") then
515 report "PPC_lwa";
516 ppc_insn := PPC_LWA;
517 elsif std_match(f.insn, "011111---------------0000010100-") then
518 report "PPC_lwarx";
519 ppc_insn := PPC_LWARX;
520 elsif std_match(f.insn, "011111---------------0101110101-") then
521 report "PPC_lwaux";
522 ppc_insn := PPC_LWAUX;
523 elsif std_match(f.insn, "011111---------------0101010101-") then
524 report "PPC_lwax";
525 ppc_insn := PPC_LWAX;
526 elsif std_match(f.insn, "011111---------------1000010110-") then
527 report "PPC_lwbrx";
528 ppc_insn := PPC_LWBRX;
529 elsif std_match(f.insn, "100000--------------------------") then
530 report "PPC_lwz";
531 ppc_insn := PPC_LWZ;
532 elsif std_match(f.insn, "100001--------------------------") then
533 report "PPC_lwzu";
534 ppc_insn := PPC_LWZU;
535 elsif std_match(f.insn, "011111---------------0000110111-") then
536 report "PPC_lwzux";
537 ppc_insn := PPC_LWZUX;
538 elsif std_match(f.insn, "011111---------------0000010111-") then
539 report "PPC_lwzx";
540 ppc_insn := PPC_LWZX;
541 elsif std_match(f.insn, "000100--------------------110000") then
542 report "PPC_maddhd";
543 ppc_insn := PPC_MADDHD;
544 elsif std_match(f.insn, "000100--------------------110001") then
545 report "PPC_maddhdu";
546 ppc_insn := PPC_MADDHDU;
547 elsif std_match(f.insn, "000100--------------------110011") then
548 report "PPC_maddld";
549 ppc_insn := PPC_MADDLD;
550 elsif std_match(f.insn, "010011---------------0000000000-") then
551 report "PPC_mcrf";
552 ppc_insn := PPC_MCRF;
553 elsif std_match(f.insn, "011111---------------1000000000-") then
554 report "PPC_mcrxr";
555 ppc_insn := PPC_MCRXR;
556 elsif std_match(f.insn, "011111---------------1001000000-") then
557 report "PPC_mcrxrx";
558 ppc_insn := PPC_MCRXRX;
559 elsif std_match(f.insn, "011111-----0---------0000010011-") then
560 report "PPC_mfcr";
561 ppc_insn := PPC_MFCR;
562 elsif std_match(f.insn, "011111-----1---------0000010011-") then
563 report "PPC_mfocrf";
564 ppc_insn := PPC_MFOCRF;
565 -- Specific MF/MT SPR encodings first
566 elsif std_match(f.insn, "011111-----01001000000101010011-") then
567 report "PPC_mfctr";
568 ppc_insn := PPC_MFCTR;
569 elsif std_match(f.insn, "011111-----01000000000101010011-") then
570 report "PPC_mflr";
571 ppc_insn := PPC_MFLR;
572 elsif std_match(f.insn, "011111-----01100010000101010011-") then
573 report "PPC_mftb";
574 ppc_insn := PPC_MFTB;
575 elsif std_match(f.insn, "011111-----01001000000111010011-") then
576 report "PPC_mtctr";
577 ppc_insn := PPC_MTCTR;
578 elsif std_match(f.insn, "011111-----01000000000111010011-") then
579 report "PPC_mtlr";
580 ppc_insn := PPC_MTLR;
581 elsif std_match(f.insn, "011111---------------0101010011-") then
582 report "PPC_mfspr";
583 ppc_insn := PPC_MFSPR;
584 elsif std_match(f.insn, "011111---------------1100001001-") then
585 report "PPC_modsd";
586 ppc_insn := PPC_MODSD;
587 elsif std_match(f.insn, "011111---------------1100001011-") then
588 report "PPC_modsw";
589 ppc_insn := PPC_MODSW;
590 elsif std_match(f.insn, "011111---------------0100001001-") then
591 report "PPC_modud";
592 ppc_insn := PPC_MODUD;
593 elsif std_match(f.insn, "011111---------------0100001011-") then
594 report "PPC_moduw";
595 ppc_insn := PPC_MODUW;
596 elsif std_match(f.insn, "011111-----0---------0010010000-") then
597 report "PPC_mtcrf";
598 ppc_insn := PPC_MTCRF;
599 elsif std_match(f.insn, "011111-----1---------0010010000-") then
600 report "PPC_mtocrf";
601 ppc_insn := PPC_MTOCRF;
602 elsif std_match(f.insn, "011111---------------0111010011-") then
603 report "PPC_mtspr";
604 ppc_insn := PPC_MTSPR;
605 elsif std_match(f.insn, "011111----------------001001001-") then
606 report "PPC_mulhd";
607 ppc_insn := PPC_MULHD;
608 elsif std_match(f.insn, "011111----------------000001001-") then
609 report "PPC_mulhdu";
610 ppc_insn := PPC_MULHDU;
611 elsif std_match(f.insn, "011111----------------001001011-") then
612 report "PPC_mulhw";
613 ppc_insn := PPC_MULHW;
614 elsif std_match(f.insn, "011111----------------000001011-") then
615 report "PPC_mulhwu";
616 ppc_insn := PPC_MULHWU;
617 elsif std_match(f.insn, "011111---------------0011101001-") then
618 report "PPC_mulld";
619 ppc_insn := PPC_MULLD;
620 elsif std_match(f.insn, "000111--------------------------") then
621 report "PPC_mulli";
622 ppc_insn := PPC_MULLI;
623 elsif std_match(f.insn, "011111---------------0011101011-") then
624 report "PPC_mullw";
625 ppc_insn := PPC_MULLW;
626 elsif std_match(f.insn, "011111---------------0111011100-") then
627 report "PPC_nand";
628 ppc_insn := PPC_NAND;
629 elsif std_match(f.insn, "011111---------------0001101000-") then
630 report "PPC_neg";
631 ppc_insn := PPC_NEG;
632 elsif std_match(f.insn, "011111---------------0001111100-") then
633 report "PPC_nor";
634 ppc_insn := PPC_NOR;
635 elsif std_match(f.insn, "011111---------------0110111100-") then
636 report "PPC_or";
637 ppc_insn := PPC_OR;
638 elsif std_match(f.insn, "011111---------------0110011100-") then
639 report "PPC_orc";
640 ppc_insn := PPC_ORC;
641 elsif std_match(f.insn, "011000--------------------------") then
642 report "PPC_ori";
643 ppc_insn := PPC_ORI;
644 elsif std_match(f.insn, "011001--------------------------") then
645 report "PPC_oris";
646 ppc_insn := PPC_ORIS;
647 elsif std_match(f.insn, "011111---------------0001111010-") then
648 report "PPC_popcntb";
649 ppc_insn := PPC_POPCNTB;
650 elsif std_match(f.insn, "011111---------------0111111010-") then
651 report "PPC_popcntd";
652 ppc_insn := PPC_POPCNTD;
653 elsif std_match(f.insn, "011111---------------0101111010-") then
654 report "PPC_popcntw";
655 ppc_insn := PPC_POPCNTW;
656 elsif std_match(f.insn, "011111---------------0010111010-") then
657 report "PPC_prtyd";
658 ppc_insn := PPC_PRTYD;
659 elsif std_match(f.insn, "011111---------------0010011010-") then
660 report "PPC_prtyw";
661 ppc_insn := PPC_PRTYW;
662 elsif std_match(f.insn, "011110---------------------1000-") then
663 report "PPC_rldcl";
664 ppc_insn := PPC_RLDCL;
665 elsif std_match(f.insn, "011110---------------------1001-") then
666 report "PPC_rldcr";
667 ppc_insn := PPC_RLDCR;
668 elsif std_match(f.insn, "011110---------------------010--") then
669 report "PPC_rldic";
670 ppc_insn := PPC_RLDIC;
671 elsif std_match(f.insn, "011110---------------------000--") then
672 report "PPC_rldicl";
673 ppc_insn := PPC_RLDICL;
674 elsif std_match(f.insn, "011110---------------------001--") then
675 report "PPC_rldicr";
676 ppc_insn := PPC_RLDICR;
677 elsif std_match(f.insn, "011110---------------------011--") then
678 report "PPC_rldimi";
679 ppc_insn := PPC_RLDIMI;
680 elsif std_match(f.insn, "010100--------------------------") then
681 report "PPC_rlwimi";
682 ppc_insn := PPC_RLWIMI;
683 elsif std_match(f.insn, "010101--------------------------") then
684 report "PPC_rlwinm";
685 ppc_insn := PPC_RLWINM;
686 elsif std_match(f.insn, "010111--------------------------") then
687 report "PPC_rlwnm";
688 ppc_insn := PPC_RLWNM;
689 elsif std_match(f.insn, "011111---------------0010000000-") then
690 report "PPC_setb";
691 ppc_insn := PPC_SETB;
692 elsif std_match(f.insn, "011111---------------0000011011-") then
693 report "PPC_sld";
694 ppc_insn := PPC_SLD;
695 elsif std_match(f.insn, "011111---------------0000011000-") then
696 report "PPC_slw";
697 ppc_insn := PPC_SLW;
698 elsif std_match(f.insn, "011111---------------1100011010-") then
699 report "PPC_srad";
700 ppc_insn := PPC_SRAD;
701 elsif std_match(f.insn, "011111---------------110011101--") then
702 report "PPC_sradi";
703 ppc_insn := PPC_SRADI;
704 elsif std_match(f.insn, "011111---------------1100011000-") then
705 report "PPC_sraw";
706 ppc_insn := PPC_SRAW;
707 elsif std_match(f.insn, "011111---------------1100111000-") then
708 report "PPC_srawi";
709 ppc_insn := PPC_SRAWI;
710 elsif std_match(f.insn, "011111---------------1000011011-") then
711 report "PPC_srd";
712 ppc_insn := PPC_SRD;
713 elsif std_match(f.insn, "011111---------------1000011000-") then
714 report "PPC_srw";
715 ppc_insn := PPC_SRW;
716 elsif std_match(f.insn, "100110--------------------------") then
717 report "PPC_stb";
718 ppc_insn := PPC_STB;
719 elsif std_match(f.insn, "011111---------------1010110110-") then
720 report "PPC_stbcx";
721 ppc_insn := PPC_STBCX;
722 elsif std_match(f.insn, "100111--------------------------") then
723 report "PPC_stbu";
724 ppc_insn := PPC_STBU;
725 elsif std_match(f.insn, "011111---------------0011110111-") then
726 report "PPC_stbux";
727 ppc_insn := PPC_STBUX;
728 elsif std_match(f.insn, "011111---------------0011010111-") then
729 report "PPC_stbx";
730 ppc_insn := PPC_STBX;
731 elsif std_match(f.insn, "111110------------------------00") then
732 report "PPC_std";
733 ppc_insn := PPC_STD;
734 elsif std_match(f.insn, "011111---------------1010010100-") then
735 report "PPC_stdbrx";
736 ppc_insn := PPC_STDBRX;
737 elsif std_match(f.insn, "011111---------------0011010110-") then
738 report "PPC_stdcx";
739 ppc_insn := PPC_STDCX;
740 elsif std_match(f.insn, "111110------------------------01") then
741 report "PPC_stdu";
742 ppc_insn := PPC_STDU;
743 elsif std_match(f.insn, "011111---------------0010110101-") then
744 report "PPC_stdux";
745 ppc_insn := PPC_STDUX;
746 elsif std_match(f.insn, "011111---------------0010010101-") then
747 report "PPC_stdx";
748 ppc_insn := PPC_STDX;
749 elsif std_match(f.insn, "101100--------------------------") then
750 report "PPC_sth";
751 ppc_insn := PPC_STH;
752 elsif std_match(f.insn, "011111---------------1110010110-") then
753 report "PPC_sthbrx";
754 ppc_insn := PPC_STHBRX;
755 elsif std_match(f.insn, "011111---------------1011010110-") then
756 report "PPC_sthcx";
757 ppc_insn := PPC_STHCX;
758 elsif std_match(f.insn, "101101--------------------------") then
759 report "PPC_sthu";
760 ppc_insn := PPC_STHU;
761 elsif std_match(f.insn, "011111---------------0110110111-") then
762 report "PPC_sthux";
763 ppc_insn := PPC_STHUX;
764 elsif std_match(f.insn, "011111---------------0110010111-") then
765 report "PPC_sthx";
766 ppc_insn := PPC_STHX;
767 elsif std_match(f.insn, "100100--------------------------") then
768 report "PPC_stw";
769 ppc_insn := PPC_STW;
770 elsif std_match(f.insn, "011111---------------1010010110-") then
771 report "PPC_stwbrx";
772 ppc_insn := PPC_STWBRX;
773 elsif std_match(f.insn, "011111---------------0010010110-") then
774 report "PPC_stwcx";
775 ppc_insn := PPC_STWCX;
776 elsif std_match(f.insn, "100101--------------------------") then
777 report "PPC_stwu";
778 ppc_insn := PPC_STWU;
779 elsif std_match(f.insn, "011111---------------0010110111-") then
780 report "PPC_stwux";
781 ppc_insn := PPC_STWUX;
782 elsif std_match(f.insn, "011111---------------0010010111-") then
783 report "PPC_stwx";
784 ppc_insn := PPC_STWX;
785 elsif std_match(f.insn, "011111---------------0000101000-") then
786 report "PPC_subf";
787 ppc_insn := PPC_SUBF;
788 elsif std_match(f.insn, "011111---------------0000001000-") then
789 report "PPC_subfc";
790 ppc_insn := PPC_SUBFC;
791 elsif std_match(f.insn, "011111---------------0010001000-") then
792 report "PPC_subfe";
793 ppc_insn := PPC_SUBFE;
794 elsif std_match(f.insn, "001000--------------------------") then
795 report "PPC_subfic";
796 ppc_insn := PPC_SUBFIC;
797 elsif std_match(f.insn, "011111---------------0011101000-") then
798 report "PPC_subfme";
799 ppc_insn := PPC_SUBFME;
800 elsif std_match(f.insn, "011111---------------0011001000-") then
801 report "PPC_subfze";
802 ppc_insn := PPC_SUBFZE;
803 elsif std_match(f.insn, "011111---------------1001010110-") then
804 report "PPC_sync";
805 ppc_insn := PPC_SYNC;
806 elsif std_match(f.insn, "011111---------------0001000100-") then
807 report "PPC_td";
808 ppc_insn := PPC_TD;
809 elsif std_match(f.insn, "000010--------------------------") then
810 report "PPC_tdi";
811 ppc_insn := PPC_TDI;
812 elsif std_match(f.insn, "011111---------------0000000100-") then
813 report "PPC_tw";
814 ppc_insn := PPC_TW;
815 elsif std_match(f.insn, "000011--------------------------") then
816 report "PPC_twi";
817 ppc_insn := PPC_TWI;
818 elsif std_match(f.insn, "011111---------------0100111100-") then
819 report "PPC_xor";
820 ppc_insn := PPC_XOR;
821 elsif std_match(f.insn, "011010--------------------------") then
822 report "PPC_xori";
823 ppc_insn := PPC_XORI;
824 elsif std_match(f.insn, "011011--------------------------") then
825 report "PPC_xoris";
826 ppc_insn := PPC_XORIS;
827 elsif std_match(f.insn, "000001---------------0000000000-") then
828 report "PPC_SIM_READ";
829 ppc_insn := PPC_SIM_READ;
830 elsif std_match(f.insn, "000001---------------0000000001-") then
831 report "PPC_SIM_POLL";
832 ppc_insn := PPC_SIM_POLL;
833 elsif std_match(f.insn, "000001---------------0000000010-") then
834 report "PPC_SIM_WRITE";
835 ppc_insn := PPC_SIM_WRITE;
836 elsif std_match(f.insn, "000001---------------0000000011-") then
837 report "PPC_SIM_CONFIG";
838 ppc_insn := PPC_SIM_CONFIG;
839 else
840 report "PPC_illegal";
841 ppc_insn := PPC_ILLEGAL;
842 end if;
843
844 d_out.decode <= decode_rom_array(ppc_insn);
845 end if;
846 end process;
847 end architecture behaviour;