2 use ieee.std_logic_1164.all;
3 use ieee.numeric_std.all;
9 insn_i : in std_ulogic_vector(31 downto 0);
10 ispr1_o : out std_ulogic_vector(5 downto 0);
11 spr_o : out std_ulogic_vector (9 downto 0)
15 architecture behaviour of repro is
17 subtype spr_num_t is integer range 0 to 1023;
19 function decode_spr_num(insn: std_ulogic_vector(31 downto 0)) return spr_num_t;
21 constant SPR_XER : spr_num_t := 1;
22 constant SPR_LR : spr_num_t := 8;
23 constant SPR_CTR : spr_num_t := 9;
25 -- Extended GPR indice (can hold an SPR)
26 subtype gspr_index_t is std_ulogic_vector(5 downto 0);
28 function decode_spr_num(insn: std_ulogic_vector(31 downto 0)) return spr_num_t is
30 return to_integer(unsigned(insn(15 downto 11) & insn(20 downto 16)));
32 function fast_spr_num(spr: spr_num_t) return gspr_index_t is
33 variable n : integer range 0 to 31;
46 return "1" & std_ulogic_vector(to_unsigned(n, 5));
50 ispr1_o <= fast_spr_num(decode_spr_num(insn_i));
51 spr_o <= std_ulogic_vector (to_unsigned (decode_spr_num(insn_i), 10));
52 end architecture behaviour;