Line 70... |
Line 70... |
signal wb_count_instruction : std_logic;
|
signal wb_count_instruction : std_logic;
|
|
|
-- CSR read port signals:
|
-- CSR read port signals:
|
signal csr_read_data : std_logic_vector(31 downto 0);
|
signal csr_read_data : std_logic_vector(31 downto 0);
|
signal csr_read_writeable : boolean;
|
signal csr_read_writeable : boolean;
|
|
signal csr_read_address, csr_read_address_p : csr_address;
|
|
|
-- Status register outputs:
|
-- Status register outputs:
|
signal status : csr_status_register;
|
signal status : csr_status_register;
|
signal evec : std_logic_vector(31 downto 0);
|
signal evec : std_logic_vector(31 downto 0);
|
|
|
Line 184... |
Line 185... |
count_instruction => wb_count_instruction,
|
count_instruction => wb_count_instruction,
|
fromhost_data => fromhost_data,
|
fromhost_data => fromhost_data,
|
fromhost_updated => fromhost_write_en,
|
fromhost_updated => fromhost_write_en,
|
tohost_data => tohost_data,
|
tohost_data => tohost_data,
|
tohost_updated => tohost_write_en,
|
tohost_updated => tohost_write_en,
|
read_address => id_csr_address,
|
read_address => csr_read_address,
|
read_data_out => csr_read_data,
|
read_data_out => csr_read_data,
|
read_writeable => csr_read_writeable,
|
read_writeable => csr_read_writeable,
|
write_address => wb_csr_address,
|
write_address => wb_csr_address,
|
write_data_in => wb_csr_data,
|
write_data_in => wb_csr_data,
|
write_mode => wb_csr_write,
|
write_mode => wb_csr_write,
|
Line 196... |
Line 197... |
exception_context_write => wb_exception,
|
exception_context_write => wb_exception,
|
status_out => status,
|
status_out => status,
|
evec_out => evec
|
evec_out => evec
|
);
|
);
|
|
|
|
csr_read_address <= id_csr_address when stall_ex = '0' else csr_read_address_p;
|
|
|
|
store_previous_csr_addr: process(clk, stall_ex)
|
|
begin
|
|
if rising_edge(clk) and stall_ex = '0' then
|
|
csr_read_address_p <= id_csr_address;
|
|
end if;
|
|
end process store_previous_csr_addr;
|
|
|
------- Register file -------
|
------- Register file -------
|
regfile: entity work.pp_register_file
|
regfile: entity work.pp_register_file
|
port map(
|
port map(
|
clk => clk,
|
clk => clk,
|
rs1_addr => rs1_address,
|
rs1_addr => rs1_address,
|
Line 303... |
Line 313... |
shamt_in => id_shamt,
|
shamt_in => id_shamt,
|
immediate_in => id_immediate,
|
immediate_in => id_immediate,
|
funct3_in => id_funct3,
|
funct3_in => id_funct3,
|
pc_in => id_pc,
|
pc_in => id_pc,
|
pc_out => ex_pc,
|
pc_out => ex_pc,
|
csr_addr_in => id_csr_address,
|
csr_addr_in => csr_read_address,
|
csr_addr_out => ex_csr_address,
|
csr_addr_out => ex_csr_address,
|
csr_write_in => id_csr_write,
|
csr_write_in => id_csr_write,
|
csr_write_out => ex_csr_write,
|
csr_write_out => ex_csr_write,
|
csr_value_in => csr_read_data,
|
csr_value_in => csr_read_data,
|
csr_value_out => ex_csr_data,
|
csr_value_out => ex_csr_data,
|