2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
7 use work.decode_types.all;
14 stall_in : in std_ulogic;
15 flush_in : in std_ulogic;
17 f_in : in Fetch2ToDecode1Type;
18 d_out : out Decode1ToDecode2Type
22 architecture behaviour of decode1 is
23 signal r, rin : Decode1ToDecode2Type;
25 subtype major_opcode_t is unsigned(5 downto 0);
26 type major_rom_array_t is array(0 to 63) of decode_rom_t;
27 type minor_rom_array_2_t is array(0 to 3) of decode_rom_t;
29 type decode_rom_array_t is array(ppc_insn_t) of decode_rom_t;
31 constant illegal_inst : decode_rom_t :=
32 (ALU, OP_ILLEGAL, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1');
34 constant major_decode_rom_array : major_rom_array_t := (
35 -- unit internal in1 in2 in3 out const const const CR CR cry cry ldst BR sgn upd rsrv mul mul rc lk sgl
36 -- op 1 2 3 in out in out len ext 32 sgn pipe
37 12 => (ALU, OP_ADDE, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'), -- addic
38 13 => (ALU, OP_ADDE, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', ONE, '0', '1'), -- addic.
39 14 => (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', '1'), -- addi
40 15 => (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', '1'), -- addis
41 28 => (ALU, OP_AND, RS, CONST_UI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', ONE, '0', '1'), -- andi.
42 29 => (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', '1'), -- andis.
43 18 => (ALU, OP_B, NONE, CONST_LI, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '1', '1'), -- b
44 16 => (ALU, OP_BC, NONE, CONST_BD, NONE, NONE, BO, BI, NONE, '1', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '1', '1'), -- bc
45 11 => (ALU, OP_CMP, RA, CONST_SI, NONE, NONE, BF, L, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'), -- cmpi
46 10 => (ALU, OP_CMPL, RA, CONST_UI, NONE, NONE, BF, L, NONE, '0', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'), -- cmpli
47 34 => (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', '1'), -- lbz
48 35 => (LDST, OP_LOAD, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '1', '0', '0', '0', NONE, '0', '1'), -- lbzu
49 42 => (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', '1'), -- lha
50 43 => (LDST, OP_LOAD, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '1', '1', '0', '0', '0', NONE, '0', '1'), -- lhau
51 40 => (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', '1'), -- lhz
52 41 => (LDST, OP_LOAD, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '1', '0', '0', '0', NONE, '0', '1'), -- lhzu
53 32 => (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', '1'), -- lwz
54 33 => (LDST, OP_LOAD, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '1', '0', '0', '0', NONE, '0', '1'), -- lwz
55 7 => (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', '1'), -- mulli
56 24 => (ALU, OP_OR, RS, CONST_UI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'), -- ori
57 25 => (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', '1'), -- oris
58 20 => (ALU, OP_RLWIMI, RA, RS, NONE, RA, SH32, MB32, ME32, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'), -- rlwimi
59 21 => (ALU, OP_RLWINM, RS, NONE, NONE, RA, SH32, MB32, ME32, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'), -- rlwinm
60 23 => (ALU, OP_RLWNM, RS, RB, NONE, RA, NONE, MB32, ME32, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'), -- rlwnm
61 38 => (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', '1'), -- stb
62 39 => (LDST, OP_STORE, RA, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is1B, '0', '0', '1', '0', '0', '0', RC, '0', '1'), -- stbu
63 44 => (LDST, OP_STORE, RA, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '0', '0', '0', '0', NONE, '0', '1'), -- sth
64 45 => (LDST, OP_STORE, RA, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is2B, '0', '0', '1', '0', '0', '0', NONE, '0', '1'), -- sthu
65 36 => (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', '1'), -- stw
66 37 => (LDST, OP_STORE, RA, CONST_SI, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is4B, '0', '0', '1', '0', '0', '0', NONE, '0', '1'), -- stwu
67 8 => (ALU, OP_SUBFE, RA, CONST_SI, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'), -- subfic
68 2 => (ALU, OP_TDI, RA, CONST_SI, NONE, NONE, TOO, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'), -- tdi
70 26 => (ALU, OP_XOR, RS, CONST_UI, NONE, RA, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'), -- xori
71 27 => (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', '1'), -- xoris
72 others => illegal_inst
75 constant decode_op_19_array : decode_rom_array_t := (
76 -- unit internal in1 in2 in3 out const const const CR CR cry cry ldst BR sgn upd rsrv mul mul rc lk sgl
77 -- op 1 2 3 in out in out len ext 32 sgn pipe
78 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', '1'),
80 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', '1'),
81 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', '1'),
91 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', '1'),
92 PPC_MCRF => (ALU, OP_MCRF, NONE, NONE, NONE, NONE, BF, BFA, NONE, '1', '1', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'),
93 others => decode_rom_init
96 constant decode_op_30_array : decode_rom_array_t := (
97 -- unit internal in1 in2 in3 out const const const CR CR cry cry ldst BR sgn upd rsrv mul mul rc lk sgl
98 -- op 1 2 3 in out in out len ext 32 sgn pipe
99 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', '1'),
100 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', '1'),
101 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', '1'),
102 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', '1'),
103 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', '1'),
104 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', '1'),
105 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', '1'),
106 others => decode_rom_init
109 -- Note: reformat with column -t -o ' '
110 constant decode_op_31_array : decode_rom_array_t := (
111 -- unit internal in1 in2 in3 out const const const CR CR cry cry ldst BR sgn upd rsrv mul mul rc lk sgl
112 -- op 1 2 3 in out in out len ext 32 sgn pipe
113 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', '1'),
114 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', '1'),
115 PPC_ADDC => (ALU, OP_ADDE, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'),
116 PPC_ADDE => (ALU, OP_ADDE, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '1', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'),
119 PPC_ADDZE => (ALU, OP_ADDE, RA, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '1', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'),
120 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', '1'),
121 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', '1'),
123 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', '1'),
124 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', '1'),
126 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', '1'),
128 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', '1'),
129 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', '1'),
130 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', '1'),
131 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', '1'),
133 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', '1'),
134 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', '1'),
135 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', '1'),
136 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', '1'),
138 PPC_DIV => (DIV, OP_DIV, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'),
139 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', '1'),
140 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', '1'),
141 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', '1'),
142 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', '1'),
145 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', '1'),
146 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', '1'),
147 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', '1'),
148 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', '1'),
149 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', '1'),
150 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', '1'),
151 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', '1'),
152 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', '1'),
153 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', '1'),
154 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', '1'),
155 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', '1'),
156 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', '1'),
157 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', '1'),
158 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', '1'),
159 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', '1'),
160 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', '1'),
161 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', '1'),
162 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', '1'),
163 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', '1'),
164 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', '1'),
165 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', '1'),
168 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', '1'),
169 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', '1'),
170 PPC_MFSPR => (ALU, OP_MFSPR, NONE, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'),
171 PPC_MOD => (DIV, OP_MOD, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'),
172 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', '1'),
173 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', '1'),
174 PPC_MTSPR => (ALU, OP_MTSPR, RS, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'),
175 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', '1'),
176 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', '1'),
177 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', '1'),
178 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', '1'),
179 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', '1'),
180 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', '1'),
181 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', '1'),
182 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', '1'),
183 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', '1'),
184 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', '1'),
185 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', '1'),
186 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', '1'),
187 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', '1'),
188 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', '1'),
189 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', '1'),
190 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', '1'),
192 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', '1'),
193 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', '1'),
194 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', '1'),
195 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', '1'),
196 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', '1'),
197 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', '1'),
198 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', '1'),
199 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', '1'),
200 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', '1'),
201 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', '1'),
202 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', '1'),
203 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', '1'),
204 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', '1'),
205 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', '1'),
206 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', '1'),
207 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', '1'),
208 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', '1'),
209 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', '1'),
210 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', '1'),
211 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', '1'),
212 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', '1'),
213 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', '1'),
214 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', '1'),
215 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', '1'),
216 PPC_SUBFC => (ALU, OP_SUBFE, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'),
217 PPC_SUBFE => (ALU, OP_SUBFE, RA, RB, NONE, RT, NONE, NONE, NONE, '0', '0', '1', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'),
219 PPC_SUBFZE => (ALU, OP_SUBFE, RA, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '1', '1', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1'),
220 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', '1'),
222 PPC_TW => (ALU, OP_TW, RA, RB, NONE, NONE, TOO, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'),
223 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', '1'),
224 others => decode_rom_init
227 constant decode_op_58_array : minor_rom_array_2_t := (
228 -- unit internal in1 in2 in3 out const const const CR CR cry cry ldst BR sgn upd rsrv mul mul rc lk sgl
229 -- op 1 2 3 in out in out len ext 32 sgn pipe
230 0 => (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', '1'), -- ld
231 1 => (LDST, OP_LOAD, RA, CONST_DS, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '1', '0', '0', '0', NONE, '0', '1'), -- ldu
232 2 => (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', '1'), -- lwa
233 others => decode_rom_init
236 constant decode_op_62_array : minor_rom_array_2_t := (
237 -- unit internal in1 in2 in3 out const const const CR CR cry cry ldst BR sgn upd rsrv mul mul rc lk sgl
238 -- op 1 2 3 in out in out len ext 32 sgn pipe
239 0 => (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', '1'), -- std
240 1 => (LDST, OP_STORE, RA, CONST_DS, RS, NONE, NONE, NONE, NONE, '0', '0', '0', '0', is8B, '0', '0', '1', '0', '0', '0', NONE, '0', '1'), -- stdu
241 others => decode_rom_init
244 constant attn_instr : decode_rom_t := (ALU, OP_ILLEGAL, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', RC, '0', '1');
245 constant nop_instr : decode_rom_t := (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1');
246 constant sim_cfg_instr : decode_rom_t := (ALU, OP_SIM_CONFIG,NONE, NONE, NONE, RT, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1');
249 decode1_0: process(clk)
251 if rising_edge(clk) then
252 -- Output state remains unchanged on stall, unless we are flushing
253 if rst = '1' or flush_in = '1' or stall_in = '0' then
259 decode1_1: process(all)
260 variable v : Decode1ToDecode2Type;
261 variable ppc_insn: ppc_insn_t;
262 variable majorop : major_opcode_t;
266 v.valid := f_in.valid;
269 v.stop_mark := f_in.stop_mark;
271 ppc_insn := PPC_ILLEGAL;
273 if f_in.valid = '1' then
274 report "Decode insn " & to_hstring(f_in.insn) & " at " & to_hstring(f_in.nia);
277 majorop := unsigned(f_in.insn(31 downto 26));
278 if majorop = "011111" then
279 -- major opcode 31, lots of things
280 if std_match(f_in.insn, "---------------------0100001010-") then
283 elsif std_match(f_in.insn, "---------------------0000001010-") then
285 ppc_insn := PPC_ADDC;
286 elsif std_match(f_in.insn, "---------------------0010001010-") then
288 ppc_insn := PPC_ADDE;
289 elsif std_match(f_in.insn, "---------------------0010101010-") then
291 ppc_insn := PPC_ADDEX;
292 elsif std_match(f_in.insn, "---------------------0011101010-") then
294 ppc_insn := PPC_ADDME;
295 elsif std_match(f_in.insn, "---------------------0011001010-") then
297 ppc_insn := PPC_ADDZE;
298 elsif std_match(f_in.insn, "---------------------0000011100-") then
301 elsif std_match(f_in.insn, "---------------------0000111100-") then
303 ppc_insn := PPC_ANDC;
304 elsif std_match(f_in.insn, "---------------------0011111100-") then
306 ppc_insn := PPC_BPERM;
307 elsif std_match(f_in.insn, "---------------------0000000000-") then
310 elsif std_match(f_in.insn, "---------------------0111111100-") then
312 ppc_insn := PPC_CMPB;
313 elsif std_match(f_in.insn, "---------------------0011100000-") then
315 ppc_insn := PPC_CMPEQB;
316 elsif std_match(f_in.insn, "---------------------0000100000-") then
318 ppc_insn := PPC_CMPL;
319 elsif std_match(f_in.insn, "---------------------0011000000-") then
321 ppc_insn := PPC_CMPRB;
322 elsif std_match(f_in.insn, "---------------------0000111010-") then
324 ppc_insn := PPC_CNTLZD;
325 elsif std_match(f_in.insn, "---------------------0000011010-") then
327 ppc_insn := PPC_CNTLZW;
328 elsif std_match(f_in.insn, "---------------------1000111010-") then
330 ppc_insn := PPC_CNTTZD;
331 elsif std_match(f_in.insn, "---------------------1000011010-") then
333 ppc_insn := PPC_CNTTZW;
334 elsif std_match(f_in.insn, "---------------------1011110011-") then
336 ppc_insn := PPC_DARN;
337 elsif std_match(f_in.insn, "---------------------0001010110-") then
339 ppc_insn := PPC_DCBF;
340 elsif std_match(f_in.insn, "---------------------0000110110-") then
342 ppc_insn := PPC_DCBST;
343 elsif std_match(f_in.insn, "---------------------0100010110-") then
345 ppc_insn := PPC_DCBT;
346 elsif std_match(f_in.insn, "---------------------0011110110-") then
348 ppc_insn := PPC_DCBTST;
349 elsif std_match(f_in.insn, "---------------------1111110110-") then
351 ppc_insn := PPC_DCBZ;
352 elsif std_match(f_in.insn, "----------------------11--010-1-") then
355 elsif std_match(f_in.insn, "---------------------0100011100-") then
358 elsif std_match(f_in.insn, "---------------------1110111010-") then
360 ppc_insn := PPC_EXTSB;
361 elsif std_match(f_in.insn, "---------------------1110011010-") then
363 ppc_insn := PPC_EXTSH;
364 elsif std_match(f_in.insn, "---------------------1111011010-") then
366 ppc_insn := PPC_EXTSW;
367 elsif std_match(f_in.insn, "---------------------110111101--") then
368 report "PPC_extswsli";
369 ppc_insn := PPC_EXTSWSLI;
370 elsif std_match(f_in.insn, "---------------------1111010110-") then
372 ppc_insn := PPC_ICBI;
373 elsif std_match(f_in.insn, "---------------------0000010110-") then
375 ppc_insn := PPC_ICBT;
376 elsif std_match(f_in.insn, "--------------------------01111-") then
378 ppc_insn := PPC_ISEL;
379 elsif std_match(f_in.insn, "---------------------0000110100-") then
381 ppc_insn := PPC_LBARX;
382 elsif std_match(f_in.insn, "---------------------0001110111-") then
384 ppc_insn := PPC_LBZUX;
385 elsif std_match(f_in.insn, "---------------------0001010111-") then
387 ppc_insn := PPC_LBZX;
388 elsif std_match(f_in.insn, "---------------------0001010100-") then
390 ppc_insn := PPC_LDARX;
391 elsif std_match(f_in.insn, "---------------------1000010100-") then
393 ppc_insn := PPC_LDBRX;
394 elsif std_match(f_in.insn, "---------------------0000110101-") then
396 ppc_insn := PPC_LDUX;
397 elsif std_match(f_in.insn, "---------------------0000010101-") then
400 elsif std_match(f_in.insn, "---------------------0001110100-") then
402 ppc_insn := PPC_LHARX;
403 elsif std_match(f_in.insn, "---------------------0101110111-") then
405 ppc_insn := PPC_LHAUX;
406 elsif std_match(f_in.insn, "---------------------0101010111-") then
408 ppc_insn := PPC_LHAX;
409 elsif std_match(f_in.insn, "---------------------1100010110-") then
411 ppc_insn := PPC_LHBRX;
412 elsif std_match(f_in.insn, "---------------------0100110111-") then
414 ppc_insn := PPC_LHZUX;
415 elsif std_match(f_in.insn, "---------------------0100010111-") then
417 ppc_insn := PPC_LHZX;
418 elsif std_match(f_in.insn, "---------------------0000010100-") then
420 ppc_insn := PPC_LWARX;
421 elsif std_match(f_in.insn, "---------------------0101110101-") then
423 ppc_insn := PPC_LWAUX;
424 elsif std_match(f_in.insn, "---------------------0101010101-") then
426 ppc_insn := PPC_LWAX;
427 elsif std_match(f_in.insn, "---------------------1000010110-") then
429 ppc_insn := PPC_LWBRX;
430 elsif std_match(f_in.insn, "---------------------0000110111-") then
432 ppc_insn := PPC_LWZUX;
433 elsif std_match(f_in.insn, "---------------------0000010111-") then
435 ppc_insn := PPC_LWZX;
436 elsif std_match(f_in.insn, "---------------------1000000000-") then
438 ppc_insn := PPC_MCRXR;
439 elsif std_match(f_in.insn, "---------------------1001000000-") then
441 ppc_insn := PPC_MCRXRX;
442 elsif std_match(f_in.insn, "-----------0---------0000010011-") then
444 ppc_insn := PPC_MFCR;
445 elsif std_match(f_in.insn, "-----------1---------0000010011-") then
447 ppc_insn := PPC_MFOCRF;
448 elsif std_match(f_in.insn, "---------------------0101010011-") then
450 ppc_insn := PPC_MFSPR;
451 elsif std_match(f_in.insn, "----------------------1000010-1-") then
454 elsif std_match(f_in.insn, "-----------0---------0010010000-") then
456 ppc_insn := PPC_MTCRF;
457 elsif std_match(f_in.insn, "-----------1---------0010010000-") then
459 ppc_insn := PPC_MTOCRF;
460 elsif std_match(f_in.insn, "---------------------0111010011-") then
462 ppc_insn := PPC_MTSPR;
463 elsif std_match(f_in.insn, "----------------------001001001-") then
465 ppc_insn := PPC_MULHD;
466 elsif std_match(f_in.insn, "----------------------000001001-") then
468 ppc_insn := PPC_MULHDU;
469 elsif std_match(f_in.insn, "----------------------001001011-") then
471 ppc_insn := PPC_MULHW;
472 elsif std_match(f_in.insn, "----------------------000001011-") then
474 ppc_insn := PPC_MULHWU;
475 elsif std_match(f_in.insn, "---------------------0011101001-") then
477 ppc_insn := PPC_MULLD;
478 elsif std_match(f_in.insn, "---------------------0011101011-") then
480 ppc_insn := PPC_MULLW;
481 elsif std_match(f_in.insn, "---------------------0111011100-") then
483 ppc_insn := PPC_NAND;
484 elsif std_match(f_in.insn, "---------------------0001101000-") then
487 elsif std_match(f_in.insn, "---------------------0001111100-") then
490 elsif std_match(f_in.insn, "---------------------0110111100-") then
493 elsif std_match(f_in.insn, "---------------------0110011100-") then
496 -- Has to be before ori
497 elsif std_match(f_in.insn, "---------------------0001111010-") then
498 report "PPC_popcntb";
499 ppc_insn := PPC_POPCNTB;
500 elsif std_match(f_in.insn, "---------------------0111111010-") then
501 report "PPC_popcntd";
502 ppc_insn := PPC_POPCNTD;
503 elsif std_match(f_in.insn, "---------------------0101111010-") then
504 report "PPC_popcntw";
505 ppc_insn := PPC_POPCNTW;
506 elsif std_match(f_in.insn, "---------------------0010111010-") then
508 ppc_insn := PPC_PRTYD;
509 elsif std_match(f_in.insn, "---------------------0010011010-") then
511 ppc_insn := PPC_PRTYW;
512 elsif std_match(f_in.insn, "---------------------0010000000-") then
514 ppc_insn := PPC_SETB;
515 elsif std_match(f_in.insn, "---------------------0000011011-") then
518 elsif std_match(f_in.insn, "---------------------0000011000-") then
521 elsif std_match(f_in.insn, "---------------------1100011010-") then
523 ppc_insn := PPC_SRAD;
524 elsif std_match(f_in.insn, "---------------------110011101--") then
526 ppc_insn := PPC_SRADI;
527 elsif std_match(f_in.insn, "---------------------1100011000-") then
529 ppc_insn := PPC_SRAW;
530 elsif std_match(f_in.insn, "---------------------1100111000-") then
532 ppc_insn := PPC_SRAWI;
533 elsif std_match(f_in.insn, "---------------------1000011011-") then
536 elsif std_match(f_in.insn, "---------------------1000011000-") then
539 elsif std_match(f_in.insn, "---------------------1010110110-") then
541 ppc_insn := PPC_STBCX;
542 elsif std_match(f_in.insn, "---------------------0011110111-") then
544 ppc_insn := PPC_STBUX;
545 elsif std_match(f_in.insn, "---------------------0011010111-") then
547 ppc_insn := PPC_STBX;
548 elsif std_match(f_in.insn, "---------------------1010010100-") then
550 ppc_insn := PPC_STDBRX;
551 elsif std_match(f_in.insn, "---------------------0011010110-") then
553 ppc_insn := PPC_STDCX;
554 elsif std_match(f_in.insn, "---------------------0010110101-") then
556 ppc_insn := PPC_STDUX;
557 elsif std_match(f_in.insn, "---------------------0010010101-") then
559 ppc_insn := PPC_STDX;
560 elsif std_match(f_in.insn, "---------------------1110010110-") then
562 ppc_insn := PPC_STHBRX;
563 elsif std_match(f_in.insn, "---------------------1011010110-") then
565 ppc_insn := PPC_STHCX;
566 elsif std_match(f_in.insn, "---------------------0110110111-") then
568 ppc_insn := PPC_STHUX;
569 elsif std_match(f_in.insn, "---------------------0110010111-") then
571 ppc_insn := PPC_STHX;
572 elsif std_match(f_in.insn, "---------------------1010010110-") then
574 ppc_insn := PPC_STWBRX;
575 elsif std_match(f_in.insn, "---------------------0010010110-") then
577 ppc_insn := PPC_STWCX;
578 elsif std_match(f_in.insn, "---------------------0010110111-") then
580 ppc_insn := PPC_STWUX;
581 elsif std_match(f_in.insn, "---------------------0010010111-") then
583 ppc_insn := PPC_STWX;
584 elsif std_match(f_in.insn, "---------------------0000101000-") then
586 ppc_insn := PPC_SUBF;
587 elsif std_match(f_in.insn, "---------------------0000001000-") then
589 ppc_insn := PPC_SUBFC;
590 elsif std_match(f_in.insn, "---------------------0010001000-") then
592 ppc_insn := PPC_SUBFE;
593 elsif std_match(f_in.insn, "---------------------0011101000-") then
595 ppc_insn := PPC_SUBFME;
596 elsif std_match(f_in.insn, "---------------------0011001000-") then
598 ppc_insn := PPC_SUBFZE;
599 elsif std_match(f_in.insn, "---------------------1001010110-") then
601 ppc_insn := PPC_SYNC;
602 elsif std_match(f_in.insn, "---------------------0001000100-") then
605 elsif std_match(f_in.insn, "---------------------0000000100-") then
608 elsif std_match(f_in.insn, "---------------------0100111100-") then
612 report "PPC_illegal";
613 ppc_insn := PPC_ILLEGAL;
615 v.decode := decode_op_31_array(ppc_insn);
617 elsif majorop = "010011" then
618 if std_match(f_in.insn, "--------------------------00010-") then
619 report "PPC_addpcis";
620 ppc_insn := PPC_ADDPCIS;
621 elsif std_match(f_in.insn, "---------------------1000010000-") then
623 ppc_insn := PPC_BCCTR;
624 elsif std_match(f_in.insn, "---------------------0000010000-") then
626 ppc_insn := PPC_BCLR;
627 elsif std_match(f_in.insn, "---------------------1000110000-") then
629 ppc_insn := PPC_BCTAR;
630 elsif std_match(f_in.insn, "---------------------0100000001-") then
632 ppc_insn := PPC_CRAND;
633 elsif std_match(f_in.insn, "---------------------0010000001-") then
635 ppc_insn := PPC_CRANDC;
636 elsif std_match(f_in.insn, "---------------------0100100001-") then
638 ppc_insn := PPC_CREQV;
639 elsif std_match(f_in.insn, "---------------------0011100001-") then
641 ppc_insn := PPC_CRNAND;
642 elsif std_match(f_in.insn, "---------------------0000100001-") then
644 ppc_insn := PPC_CRNOR;
645 elsif std_match(f_in.insn, "---------------------0111000001-") then
647 ppc_insn := PPC_CROR;
648 elsif std_match(f_in.insn, "---------------------0110100001-") then
650 ppc_insn := PPC_CRORC;
651 elsif std_match(f_in.insn, "---------------------0011000001-") then
653 ppc_insn := PPC_CRXOR;
654 elsif std_match(f_in.insn, "---------------------0010010110-") then
656 ppc_insn := PPC_ISYNC;
657 elsif std_match(f_in.insn, "---------------------0000000000-") then
659 ppc_insn := PPC_MCRF;
661 report "PPC_illegal";
662 ppc_insn := PPC_ILLEGAL;
664 v.decode := decode_op_19_array(ppc_insn);
666 elsif majorop = "011110" then
667 if std_match(f_in.insn, "---------------------------1000-") then
669 ppc_insn := PPC_RLDCL;
670 elsif std_match(f_in.insn, "---------------------------1001-") then
672 ppc_insn := PPC_RLDCR;
673 elsif std_match(f_in.insn, "---------------------------010--") then
675 ppc_insn := PPC_RLDIC;
676 elsif std_match(f_in.insn, "---------------------------000--") then
678 ppc_insn := PPC_RLDICL;
679 elsif std_match(f_in.insn, "---------------------------001--") then
681 ppc_insn := PPC_RLDICR;
682 elsif std_match(f_in.insn, "---------------------------011--") then
684 ppc_insn := PPC_RLDIMI;
686 report "PPC_illegal";
687 ppc_insn := PPC_ILLEGAL;
689 v.decode := decode_op_30_array(ppc_insn);
691 elsif majorop = "111010" then
692 v.decode := decode_op_58_array(to_integer(unsigned(f_in.insn(1 downto 0))));
694 elsif majorop = "111110" then
695 v.decode := decode_op_62_array(to_integer(unsigned(f_in.insn(1 downto 0))));
697 elsif std_match(f_in.insn, "01100000000000000000000000000000") then
699 v.decode := nop_instr;
700 elsif std_match(f_in.insn, "000001---------------0000000011-") then
701 report "PPC_SIM_CONFIG";
702 v.decode := sim_cfg_instr;
703 elsif std_match(f_in.insn, "000000---------------0100000000-") then
705 v.decode := attn_instr;
708 v.decode := major_decode_rom_array(to_integer(majorop));
711 if flush_in = '1' then
716 v := Decode1ToDecode2Init;
725 end architecture behaviour;