OpenCores
URL https://opencores.org/ocsvn/potato/potato/trunk

Subversion Repositories potato

[/] [potato/] [trunk/] [src/] [pp_writeback.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 skordal
-- The Potato Processor - A simple processor for FPGAs
2
-- (c) Kristian Klomsten Skordal 2014 - 2015 <kristian.skordal@wafflemail.net>
3 3 skordal
-- Report bugs and issues on <http://opencores.org/project,potato,bugtracker>
4 2 skordal
 
5
library ieee;
6
use ieee.std_logic_1164.all;
7
use ieee.numeric_std.all;
8
 
9
use work.pp_types.all;
10
use work.pp_csr.all;
11
 
12
entity pp_writeback is
13
        port(
14
                clk    : in std_logic;
15
                reset  : in std_logic;
16
 
17
                -- Count instruction:
18
                count_instr_in  : in std_logic;
19
                count_instr_out : out std_logic;
20
 
21
                -- Exception signals:
22
                exception_ctx_in  : in  csr_exception_context;
23
                exception_in      : in  std_logic;
24
                exception_ctx_out : out csr_exception_context;
25
                exception_out     : out std_logic;
26
 
27
                -- CSR signals:
28
                csr_write_in  : in  csr_write_mode;
29
                csr_write_out : out csr_write_mode;
30
                csr_data_in   : in  std_logic_vector(31 downto 0);
31
                csr_data_out  : out std_logic_vector(31 downto 0);
32
                csr_addr_in   : in  csr_address;
33
                csr_addr_out  : out csr_address;
34
 
35
                -- Destination register interface:
36
                rd_addr_in   : in  register_address;
37
                rd_addr_out  : out register_address;
38
                rd_write_in  : in  std_logic;
39
                rd_write_out : out std_logic;
40
                rd_data_in   : in  std_logic_vector(31 downto 0);
41
                rd_data_out  : out std_logic_vector(31 downto 0)
42
        );
43
end entity pp_writeback;
44
 
45
architecture behaviour of pp_writeback is
46
begin
47
 
48
        pipeline_register: process(clk)
49
        begin
50
                if rising_edge(clk) then
51
                        if reset = '1' then
52
                                rd_write_out <= '0';
53
                                exception_out <= '0';
54
                                count_instr_out <= '0';
55
                        else
56
                                count_instr_out <= count_instr_in;
57
                                rd_data_out <= rd_data_in;
58
                                rd_write_out <= rd_write_in;
59
                                rd_addr_out <= rd_addr_in;
60
 
61
                                exception_out <= exception_in;
62
                                exception_ctx_out <= exception_ctx_in;
63
 
64
                                csr_write_out <= csr_write_in;
65
                                csr_data_out <= csr_data_in;
66
                                csr_addr_out <= csr_addr_in;
67
                        end if;
68
                end if;
69
        end process pipeline_register;
70
 
71
end architecture behaviour;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.