@ -7,6 +7,10 @@ use work.common.all;
use work.decode_types.all;
use work.decode_types.all;
entity decode1 is
entity decode1 is
generic (
-- Non-zero to enable log data collection
LOG_LENGTH : natural := 0
);
port (
port (
clk : in std_ulogic;
clk : in std_ulogic;
rst : in std_ulogic;
rst : in std_ulogic;
@ -357,8 +361,6 @@ architecture behaviour of decode1 is
constant nop_instr : decode_rom_t := (ALU, OP_NOP, NONE, NONE, NONE, NONE, '0', '0', '0', '0', ZERO, '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '0');
constant nop_instr : decode_rom_t := (ALU, OP_NOP, NONE, NONE, NONE, NONE, '0', '0', '0', '0', ZERO, '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '0');
constant fetch_fail_inst: decode_rom_t := (LDST, OP_FETCH_FAILED, NONE, NONE, NONE, NONE, '0', '0', '0', '0', ZERO, '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '0');
constant fetch_fail_inst: decode_rom_t := (LDST, OP_FETCH_FAILED, NONE, NONE, NONE, NONE, '0', '0', '0', '0', ZERO, '0', NONE, '0', '0', '0', '0', '0', '0', NONE, '0', '0');
signal log_data : std_ulogic_vector(12 downto 0);
begin
begin
decode1_0: process(clk)
decode1_0: process(clk)
begin
begin
@ -524,15 +526,19 @@ begin
flush_out <= f.redirect;
flush_out <= f.redirect;
end process;
end process;
dec1_log : process(clk)
d1_log: if LOG_LENGTH > 0 generate
signal log_data : std_ulogic_vector(12 downto 0);
begin
begin
if rising_edge(clk) then
dec1_log : process(clk)
log_data <= std_ulogic_vector(to_unsigned(insn_type_t'pos(r.decode.insn_type), 6)) &
begin
r.nia(5 downto 2) &
if rising_edge(clk) then
std_ulogic_vector(to_unsigned(unit_t'pos(r.decode.unit), 2)) &
log_data <= std_ulogic_vector(to_unsigned(insn_type_t'pos(r.decode.insn_type), 6)) &
r.valid;
r.nia(5 downto 2) &
end if;
std_ulogic_vector(to_unsigned(unit_t'pos(r.decode.unit), 2)) &
end process;
r.valid;
log_out <= log_data;
end if;
end process;
log_out <= log_data;
end generate;
end architecture behaviour;
end architecture behaviour;