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 type decode_rom_array_t is array(ppc_insn_t) of decode_rom_t;
27 -- Note: reformat with column -t -o ' '
28 constant decode_rom_array : decode_rom_array_t := (
29 -- unit internal in1 in2 in3 out const const const CR CR cry cry ldst BR sgn upd rsrv mul mul rc lk sgl
30 -- op 1 2 3 in out in out len ext 32 sgn pipe
31 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'),
32 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'),
33 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', '1'),
34 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', '1'),
36 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', '1'),
37 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', '1'),
38 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', '1'),
39 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', '1'),
42 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', '1'),
43 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'),
44 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'),
45 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', '1'),
46 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', '1'),
47 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', '1'),
48 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', '1'),
50 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', '1'),
52 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'),
54 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'),
57 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'),
58 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'),
60 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', '1'),
61 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'),
62 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', '1'),
64 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'),
65 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'),
66 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'),
67 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'),
77 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'),
78 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'),
79 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'),
80 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'),
82 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'),
83 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'),
84 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'),
85 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'),
86 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'),
89 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'),
90 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'),
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_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'),
93 --CONST_LI matches CONST_SI, so reuse it
94 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', '1'),
95 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', '1'),
96 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'),
97 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'),
98 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', '1'),
99 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'),
100 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'),
101 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', '1'),
102 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'),
103 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'),
104 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', '1'),
105 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'),
106 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', '1'),
107 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'),
108 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'),
109 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'),
110 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', '1'),
111 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', '1'),
112 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'),
113 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'),
114 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', '1'),
115 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'),
116 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'),
117 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'),
118 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'),
119 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', '1'),
120 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', '1'),
121 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'),
122 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'),
129 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'),
130 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'),
131 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', '1'),
132 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', '1'),
133 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', '1'),
134 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', '1'),
135 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', '1'),
137 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'),
138 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'),
139 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'),
141 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'),
142 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'),
143 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'),
144 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'),
145 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'),
146 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', '1'),
147 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'),
148 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'),
149 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'),
150 PPC_NOP => (ALU, OP_NOP, NONE, NONE, NONE, NONE, NONE, NONE, NONE, '0', '0', '0', '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '1'),
151 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'),
152 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'),
153 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'),
154 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', '1'),
155 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', '1'),
156 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'),
157 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'),
158 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'),
159 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'),
160 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'),
161 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'),
162 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'),
163 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'),
164 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'),
165 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'),
166 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'),
167 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', '1'),
168 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', '1'),
169 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', '1'),
171 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'),
172 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'),
173 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'),
174 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'),
175 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'),
176 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'),
177 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'),
178 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'),
179 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', '1'),
180 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'),
181 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', '1'),
182 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'),
183 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'),
184 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', '1'),
185 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'),
186 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'),
187 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', '1'),
188 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'),
189 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'),
190 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', '1'),
191 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'),
192 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'),
193 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', '1'),
194 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'),
195 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'),
196 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', '1'),
197 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'),
198 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'),
199 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', '1'),
200 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'),
201 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'),
202 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'),
203 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', '1'),
204 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', '1'),
205 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', '1'),
207 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', '1'),
208 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'),
210 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', '1'),
211 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'),
213 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'),
214 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', '1'),
215 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', '1'),
216 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', '1'),
218 others => decode_rom_init
222 decode1_0: process(clk)
224 if rising_edge(clk) then
225 -- Output state remains unchanged on stall, unless we are flushing
226 if rst = '1' or flush_in = '1' or stall_in = '0' then
232 decode1_1: process(all)
233 variable v : Decode1ToDecode2Type;
234 variable ppc_insn: ppc_insn_t;
238 v.valid := f_in.valid;
242 ppc_insn := PPC_ILLEGAL;
244 if f_in.valid = '1' then
245 report "Decode insn " & to_hstring(f_in.insn) & " at " & to_hstring(f_in.nia);
247 if std_match(f_in.insn, "011111---------------0100001010-") then
250 elsif std_match(f_in.insn, "011111---------------0000001010-") then
252 ppc_insn := PPC_ADDC;
253 elsif std_match(f_in.insn, "011111---------------0010001010-") then
255 ppc_insn := PPC_ADDE;
256 elsif std_match(f_in.insn, "011111---------------0010101010-") then
258 ppc_insn := PPC_ADDEX;
259 elsif std_match(f_in.insn, "001110--------------------------") then
261 ppc_insn := PPC_ADDI;
262 elsif std_match(f_in.insn, "001100--------------------------") then
264 ppc_insn := PPC_ADDIC;
265 elsif std_match(f_in.insn, "001101--------------------------") then
267 ppc_insn := PPC_ADDIC_RC;
268 elsif std_match(f_in.insn, "001111--------------------------") then
270 ppc_insn := PPC_ADDIS;
271 elsif std_match(f_in.insn, "011111---------------0011101010-") then
273 ppc_insn := PPC_ADDME;
274 elsif std_match(f_in.insn, "010011--------------------00010-") then
275 report "PPC_addpcis";
276 ppc_insn := PPC_ADDPCIS;
277 elsif std_match(f_in.insn, "011111---------------0011001010-") then
279 ppc_insn := PPC_ADDZE;
280 elsif std_match(f_in.insn, "011111---------------0000011100-") then
283 elsif std_match(f_in.insn, "011111---------------0000111100-") then
285 ppc_insn := PPC_ANDC;
286 elsif std_match(f_in.insn, "011100--------------------------") then
288 ppc_insn := PPC_ANDI_RC;
289 elsif std_match(f_in.insn, "011101--------------------------") then
291 ppc_insn := PPC_ANDIS_RC;
292 elsif std_match(f_in.insn, "000000---------------0100000000-") then
294 ppc_insn := PPC_ATTN;
295 elsif std_match(f_in.insn, "010010------------------------0-") then
298 elsif std_match(f_in.insn, "010010------------------------1-") then
301 elsif std_match(f_in.insn, "010000------------------------0-") then
304 elsif std_match(f_in.insn, "010000------------------------10") then
307 elsif std_match(f_in.insn, "010011---------------1000010000-") then
309 ppc_insn := PPC_BCCTR;
310 elsif std_match(f_in.insn, "010000------------------------11") then
312 ppc_insn := PPC_BCLA;
313 elsif std_match(f_in.insn, "010011---------------0000010000-") then
315 ppc_insn := PPC_BCLR;
316 elsif std_match(f_in.insn, "010011---------------1000110000-") then
318 ppc_insn := PPC_BCTAR;
319 elsif std_match(f_in.insn, "011111---------------0011111100-") then
321 ppc_insn := PPC_BPERM;
322 elsif std_match(f_in.insn, "011111---------------0000000000-") then
325 elsif std_match(f_in.insn, "011111---------------0111111100-") then
327 ppc_insn := PPC_CMPB;
328 elsif std_match(f_in.insn, "011111---------------0011100000-") then
330 ppc_insn := PPC_CMPEQB;
331 elsif std_match(f_in.insn, "001011--------------------------") then
333 ppc_insn := PPC_CMPI;
334 elsif std_match(f_in.insn, "011111---------------0000100000-") then
336 ppc_insn := PPC_CMPL;
337 elsif std_match(f_in.insn, "001010--------------------------") then
339 ppc_insn := PPC_CMPLI;
340 elsif std_match(f_in.insn, "011111---------------0011000000-") then
342 ppc_insn := PPC_CMPRB;
343 elsif std_match(f_in.insn, "011111---------------0000111010-") then
345 ppc_insn := PPC_CNTLZD;
346 elsif std_match(f_in.insn, "011111---------------0000011010-") then
348 ppc_insn := PPC_CNTLZW;
349 elsif std_match(f_in.insn, "011111---------------1000111010-") then
351 ppc_insn := PPC_CNTTZD;
352 elsif std_match(f_in.insn, "011111---------------1000011010-") then
354 ppc_insn := PPC_CNTTZW;
355 elsif std_match(f_in.insn, "010011---------------0100000001-") then
357 ppc_insn := PPC_CRAND;
358 elsif std_match(f_in.insn, "010011---------------0010000001-") then
360 ppc_insn := PPC_CRANDC;
361 elsif std_match(f_in.insn, "010011---------------0100100001-") then
363 ppc_insn := PPC_CREQV;
364 elsif std_match(f_in.insn, "010011---------------0011100001-") then
366 ppc_insn := PPC_CRNAND;
367 elsif std_match(f_in.insn, "010011---------------0000100001-") then
369 ppc_insn := PPC_CRNOR;
370 elsif std_match(f_in.insn, "010011---------------0111000001-") then
372 ppc_insn := PPC_CROR;
373 elsif std_match(f_in.insn, "010011---------------0110100001-") then
375 ppc_insn := PPC_CRORC;
376 elsif std_match(f_in.insn, "010011---------------0011000001-") then
378 ppc_insn := PPC_CRXOR;
379 elsif std_match(f_in.insn, "011111---------------1011110011-") then
381 ppc_insn := PPC_DARN;
382 elsif std_match(f_in.insn, "011111---------------0001010110-") then
384 ppc_insn := PPC_DCBF;
385 elsif std_match(f_in.insn, "011111---------------0000110110-") then
387 ppc_insn := PPC_DCBST;
388 elsif std_match(f_in.insn, "011111---------------0100010110-") then
390 ppc_insn := PPC_DCBT;
391 elsif std_match(f_in.insn, "011111---------------0011110110-") then
393 ppc_insn := PPC_DCBTST;
394 elsif std_match(f_in.insn, "011111---------------1111110110-") then
396 ppc_insn := PPC_DCBZ;
397 elsif std_match(f_in.insn, "011111----------------11--010-1-") then
400 elsif std_match(f_in.insn, "011111---------------0100011100-") then
403 elsif std_match(f_in.insn, "011111---------------1110111010-") then
405 ppc_insn := PPC_EXTSB;
406 elsif std_match(f_in.insn, "011111---------------1110011010-") then
408 ppc_insn := PPC_EXTSH;
409 elsif std_match(f_in.insn, "011111---------------1111011010-") then
411 ppc_insn := PPC_EXTSW;
412 elsif std_match(f_in.insn, "011111---------------110111101--") then
413 report "PPC_extswsli";
414 ppc_insn := PPC_EXTSWSLI;
415 elsif std_match(f_in.insn, "011111---------------1111010110-") then
417 ppc_insn := PPC_ICBI;
418 elsif std_match(f_in.insn, "011111---------------0000010110-") then
420 ppc_insn := PPC_ICBT;
421 elsif std_match(f_in.insn, "011111--------------------01111-") then
423 ppc_insn := PPC_ISEL;
424 elsif std_match(f_in.insn, "010011---------------0010010110-") then
426 ppc_insn := PPC_ISYNC;
427 elsif std_match(f_in.insn, "011111---------------0000110100-") then
429 ppc_insn := PPC_LBARX;
430 elsif std_match(f_in.insn, "100010--------------------------") then
433 elsif std_match(f_in.insn, "100011--------------------------") then
435 ppc_insn := PPC_LBZU;
436 elsif std_match(f_in.insn, "011111---------------0001110111-") then
438 ppc_insn := PPC_LBZUX;
439 elsif std_match(f_in.insn, "011111---------------0001010111-") then
441 ppc_insn := PPC_LBZX;
442 elsif std_match(f_in.insn, "111010------------------------00") then
445 elsif std_match(f_in.insn, "011111---------------0001010100-") then
447 ppc_insn := PPC_LDARX;
448 elsif std_match(f_in.insn, "011111---------------1000010100-") then
450 ppc_insn := PPC_LDBRX;
451 elsif std_match(f_in.insn, "111010------------------------01") then
454 elsif std_match(f_in.insn, "011111---------------0000110101-") then
456 ppc_insn := PPC_LDUX;
457 elsif std_match(f_in.insn, "011111---------------0000010101-") then
460 elsif std_match(f_in.insn, "101010--------------------------") then
463 elsif std_match(f_in.insn, "011111---------------0001110100-") then
465 ppc_insn := PPC_LHARX;
466 elsif std_match(f_in.insn, "101011--------------------------") then
468 ppc_insn := PPC_LHAU;
469 elsif std_match(f_in.insn, "011111---------------0101110111-") then
471 ppc_insn := PPC_LHAUX;
472 elsif std_match(f_in.insn, "011111---------------0101010111-") then
474 ppc_insn := PPC_LHAX;
475 elsif std_match(f_in.insn, "011111---------------1100010110-") then
477 ppc_insn := PPC_LHBRX;
478 elsif std_match(f_in.insn, "101000--------------------------") then
481 elsif std_match(f_in.insn, "101001--------------------------") then
483 ppc_insn := PPC_LHZU;
484 elsif std_match(f_in.insn, "011111---------------0100110111-") then
486 ppc_insn := PPC_LHZUX;
487 elsif std_match(f_in.insn, "011111---------------0100010111-") then
489 ppc_insn := PPC_LHZX;
490 elsif std_match(f_in.insn, "111010------------------------10") then
493 elsif std_match(f_in.insn, "011111---------------0000010100-") then
495 ppc_insn := PPC_LWARX;
496 elsif std_match(f_in.insn, "011111---------------0101110101-") then
498 ppc_insn := PPC_LWAUX;
499 elsif std_match(f_in.insn, "011111---------------0101010101-") then
501 ppc_insn := PPC_LWAX;
502 elsif std_match(f_in.insn, "011111---------------1000010110-") then
504 ppc_insn := PPC_LWBRX;
505 elsif std_match(f_in.insn, "100000--------------------------") then
508 elsif std_match(f_in.insn, "100001--------------------------") then
510 ppc_insn := PPC_LWZU;
511 elsif std_match(f_in.insn, "011111---------------0000110111-") then
513 ppc_insn := PPC_LWZUX;
514 elsif std_match(f_in.insn, "011111---------------0000010111-") then
516 ppc_insn := PPC_LWZX;
517 elsif std_match(f_in.insn, "000100--------------------110000") then
519 ppc_insn := PPC_MADDHD;
520 elsif std_match(f_in.insn, "000100--------------------110001") then
521 report "PPC_maddhdu";
522 ppc_insn := PPC_MADDHDU;
523 elsif std_match(f_in.insn, "000100--------------------110011") then
525 ppc_insn := PPC_MADDLD;
526 elsif std_match(f_in.insn, "010011---------------0000000000-") then
528 ppc_insn := PPC_MCRF;
529 elsif std_match(f_in.insn, "011111---------------1000000000-") then
531 ppc_insn := PPC_MCRXR;
532 elsif std_match(f_in.insn, "011111---------------1001000000-") then
534 ppc_insn := PPC_MCRXRX;
535 elsif std_match(f_in.insn, "011111-----0---------0000010011-") then
537 ppc_insn := PPC_MFCR;
538 elsif std_match(f_in.insn, "011111-----1---------0000010011-") then
540 ppc_insn := PPC_MFOCRF;
541 -- Specific MF/MT SPR encodings first
542 elsif std_match(f_in.insn, "011111-----01001000000101010011-") then
544 ppc_insn := PPC_MFCTR;
545 elsif std_match(f_in.insn, "011111-----01000000000101010011-") then
547 ppc_insn := PPC_MFLR;
548 elsif std_match(f_in.insn, "011111-----01100010000101010011-") then
550 ppc_insn := PPC_MFTB;
551 elsif std_match(f_in.insn, "011111-----01001000000111010011-") then
553 ppc_insn := PPC_MTCTR;
554 elsif std_match(f_in.insn, "011111-----01000000000111010011-") then
556 ppc_insn := PPC_MTLR;
557 elsif std_match(f_in.insn, "011111---------------0101010011-") then
559 ppc_insn := PPC_MFSPR;
560 elsif std_match(f_in.insn, "011111----------------1000010-1-") then
563 elsif std_match(f_in.insn, "011111-----0---------0010010000-") then
565 ppc_insn := PPC_MTCRF;
566 elsif std_match(f_in.insn, "011111-----1---------0010010000-") then
568 ppc_insn := PPC_MTOCRF;
569 elsif std_match(f_in.insn, "011111---------------0111010011-") then
571 ppc_insn := PPC_MTSPR;
572 elsif std_match(f_in.insn, "011111----------------001001001-") then
574 ppc_insn := PPC_MULHD;
575 elsif std_match(f_in.insn, "011111----------------000001001-") then
577 ppc_insn := PPC_MULHDU;
578 elsif std_match(f_in.insn, "011111----------------001001011-") then
580 ppc_insn := PPC_MULHW;
581 elsif std_match(f_in.insn, "011111----------------000001011-") then
583 ppc_insn := PPC_MULHWU;
584 elsif std_match(f_in.insn, "011111---------------0011101001-") then
586 ppc_insn := PPC_MULLD;
587 elsif std_match(f_in.insn, "000111--------------------------") then
589 ppc_insn := PPC_MULLI;
590 elsif std_match(f_in.insn, "011111---------------0011101011-") then
592 ppc_insn := PPC_MULLW;
593 elsif std_match(f_in.insn, "011111---------------0111011100-") then
595 ppc_insn := PPC_NAND;
596 elsif std_match(f_in.insn, "011111---------------0001101000-") then
599 elsif std_match(f_in.insn, "011111---------------0001111100-") then
602 elsif std_match(f_in.insn, "011111---------------0110111100-") then
605 elsif std_match(f_in.insn, "011111---------------0110011100-") then
608 -- Has to be before ori
609 elsif std_match(f_in.insn, "01100000000000000000000000000000") then
612 elsif std_match(f_in.insn, "011000--------------------------") then
615 elsif std_match(f_in.insn, "011001--------------------------") then
617 ppc_insn := PPC_ORIS;
618 elsif std_match(f_in.insn, "011111---------------0001111010-") then
619 report "PPC_popcntb";
620 ppc_insn := PPC_POPCNTB;
621 elsif std_match(f_in.insn, "011111---------------0111111010-") then
622 report "PPC_popcntd";
623 ppc_insn := PPC_POPCNTD;
624 elsif std_match(f_in.insn, "011111---------------0101111010-") then
625 report "PPC_popcntw";
626 ppc_insn := PPC_POPCNTW;
627 elsif std_match(f_in.insn, "011111---------------0010111010-") then
629 ppc_insn := PPC_PRTYD;
630 elsif std_match(f_in.insn, "011111---------------0010011010-") then
632 ppc_insn := PPC_PRTYW;
633 elsif std_match(f_in.insn, "011110---------------------1000-") then
635 ppc_insn := PPC_RLDCL;
636 elsif std_match(f_in.insn, "011110---------------------1001-") then
638 ppc_insn := PPC_RLDCR;
639 elsif std_match(f_in.insn, "011110---------------------010--") then
641 ppc_insn := PPC_RLDIC;
642 elsif std_match(f_in.insn, "011110---------------------000--") then
644 ppc_insn := PPC_RLDICL;
645 elsif std_match(f_in.insn, "011110---------------------001--") then
647 ppc_insn := PPC_RLDICR;
648 elsif std_match(f_in.insn, "011110---------------------011--") then
650 ppc_insn := PPC_RLDIMI;
651 elsif std_match(f_in.insn, "010100--------------------------") then
653 ppc_insn := PPC_RLWIMI;
654 elsif std_match(f_in.insn, "010101--------------------------") then
656 ppc_insn := PPC_RLWINM;
657 elsif std_match(f_in.insn, "010111--------------------------") then
659 ppc_insn := PPC_RLWNM;
660 elsif std_match(f_in.insn, "011111---------------0010000000-") then
662 ppc_insn := PPC_SETB;
663 elsif std_match(f_in.insn, "011111---------------0000011011-") then
666 elsif std_match(f_in.insn, "011111---------------0000011000-") then
669 elsif std_match(f_in.insn, "011111---------------1100011010-") then
671 ppc_insn := PPC_SRAD;
672 elsif std_match(f_in.insn, "011111---------------110011101--") then
674 ppc_insn := PPC_SRADI;
675 elsif std_match(f_in.insn, "011111---------------1100011000-") then
677 ppc_insn := PPC_SRAW;
678 elsif std_match(f_in.insn, "011111---------------1100111000-") then
680 ppc_insn := PPC_SRAWI;
681 elsif std_match(f_in.insn, "011111---------------1000011011-") then
684 elsif std_match(f_in.insn, "011111---------------1000011000-") then
687 elsif std_match(f_in.insn, "100110--------------------------") then
690 elsif std_match(f_in.insn, "011111---------------1010110110-") then
692 ppc_insn := PPC_STBCX;
693 elsif std_match(f_in.insn, "100111--------------------------") then
695 ppc_insn := PPC_STBU;
696 elsif std_match(f_in.insn, "011111---------------0011110111-") then
698 ppc_insn := PPC_STBUX;
699 elsif std_match(f_in.insn, "011111---------------0011010111-") then
701 ppc_insn := PPC_STBX;
702 elsif std_match(f_in.insn, "111110------------------------00") then
705 elsif std_match(f_in.insn, "011111---------------1010010100-") then
707 ppc_insn := PPC_STDBRX;
708 elsif std_match(f_in.insn, "011111---------------0011010110-") then
710 ppc_insn := PPC_STDCX;
711 elsif std_match(f_in.insn, "111110------------------------01") then
713 ppc_insn := PPC_STDU;
714 elsif std_match(f_in.insn, "011111---------------0010110101-") then
716 ppc_insn := PPC_STDUX;
717 elsif std_match(f_in.insn, "011111---------------0010010101-") then
719 ppc_insn := PPC_STDX;
720 elsif std_match(f_in.insn, "101100--------------------------") then
723 elsif std_match(f_in.insn, "011111---------------1110010110-") then
725 ppc_insn := PPC_STHBRX;
726 elsif std_match(f_in.insn, "011111---------------1011010110-") then
728 ppc_insn := PPC_STHCX;
729 elsif std_match(f_in.insn, "101101--------------------------") then
731 ppc_insn := PPC_STHU;
732 elsif std_match(f_in.insn, "011111---------------0110110111-") then
734 ppc_insn := PPC_STHUX;
735 elsif std_match(f_in.insn, "011111---------------0110010111-") then
737 ppc_insn := PPC_STHX;
738 elsif std_match(f_in.insn, "100100--------------------------") then
741 elsif std_match(f_in.insn, "011111---------------1010010110-") then
743 ppc_insn := PPC_STWBRX;
744 elsif std_match(f_in.insn, "011111---------------0010010110-") then
746 ppc_insn := PPC_STWCX;
747 elsif std_match(f_in.insn, "100101--------------------------") then
749 ppc_insn := PPC_STWU;
750 elsif std_match(f_in.insn, "011111---------------0010110111-") then
752 ppc_insn := PPC_STWUX;
753 elsif std_match(f_in.insn, "011111---------------0010010111-") then
755 ppc_insn := PPC_STWX;
756 elsif std_match(f_in.insn, "011111---------------0000101000-") then
758 ppc_insn := PPC_SUBF;
759 elsif std_match(f_in.insn, "011111---------------0000001000-") then
761 ppc_insn := PPC_SUBFC;
762 elsif std_match(f_in.insn, "011111---------------0010001000-") then
764 ppc_insn := PPC_SUBFE;
765 elsif std_match(f_in.insn, "001000--------------------------") then
767 ppc_insn := PPC_SUBFIC;
768 elsif std_match(f_in.insn, "011111---------------0011101000-") then
770 ppc_insn := PPC_SUBFME;
771 elsif std_match(f_in.insn, "011111---------------0011001000-") then
773 ppc_insn := PPC_SUBFZE;
774 elsif std_match(f_in.insn, "011111---------------1001010110-") then
776 ppc_insn := PPC_SYNC;
777 elsif std_match(f_in.insn, "011111---------------0001000100-") then
780 elsif std_match(f_in.insn, "000010--------------------------") then
783 elsif std_match(f_in.insn, "011111---------------0000000100-") then
786 elsif std_match(f_in.insn, "000011--------------------------") then
789 elsif std_match(f_in.insn, "011111---------------0100111100-") then
792 elsif std_match(f_in.insn, "011010--------------------------") then
794 ppc_insn := PPC_XORI;
795 elsif std_match(f_in.insn, "011011--------------------------") then
797 ppc_insn := PPC_XORIS;
798 elsif std_match(f_in.insn, "000001---------------0000000011-") then
799 report "PPC_SIM_CONFIG";
800 ppc_insn := PPC_SIM_CONFIG;
802 report "PPC_illegal";
803 ppc_insn := PPC_ILLEGAL;
806 v.decode := decode_rom_array(ppc_insn);
809 if flush_in = '1' then
814 v := Decode1ToDecode2Init;
823 end architecture behaviour;