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

Subversion Repositories potato

[/] [potato/] [trunk/] [src/] [pp_potato.vhd] - Blame information for rev 48

Go to most recent revision | 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
 
8 45 skordal
use work.pp_types.all;
9
 
10 2 skordal
--! @brief The Potato Processor.
11
--! This file provides a Wishbone-compatible interface to the Potato processor.
12
entity pp_potato is
13
        generic(
14
                PROCESSOR_ID           : std_logic_vector(31 downto 0) := x"00000000"; --! Processor ID.
15
                RESET_ADDRESS          : std_logic_vector(31 downto 0) := x"00000000"  --! Address of the first instruction to execute.
16
        );
17
        port(
18
                clk   : in std_logic;
19
                reset : in std_logic;
20
 
21
                -- Interrupts:
22
                irq : in std_logic_vector(7 downto 0);
23
 
24
                -- Host/Target interface:
25
                fromhost_data    : in std_logic_vector(31 downto 0);
26
                fromhost_updated : in std_logic;
27
                tohost_data      : out std_logic_vector(31 downto 0);
28
                tohost_updated   : out std_logic;
29
 
30
                -- Wishbone interface:
31
                wb_adr_out : out std_logic_vector(31 downto 0);
32
                wb_sel_out : out std_logic_vector( 3 downto 0);
33
                wb_cyc_out : out std_logic;
34
                wb_stb_out : out std_logic;
35
                wb_we_out  : out std_logic;
36
                wb_dat_out : out std_logic_vector(31 downto 0);
37
                wb_dat_in  : in  std_logic_vector(31 downto 0);
38
                wb_ack_in  : in  std_logic
39
        );
40
end entity pp_potato;
41
 
42
architecture behaviour of pp_potato is
43
 
44
        -- Instruction memory signals:
45
        signal imem_address : std_logic_vector(31 downto 0);
46
        signal imem_data    : std_logic_vector(31 downto 0);
47
        signal imem_req, imem_ack : std_logic;
48
 
49
        -- Data memory signals:
50
        signal dmem_address   : std_logic_vector(31 downto 0);
51
        signal dmem_data_in   : std_logic_vector(31 downto 0);
52
        signal dmem_data_out  : std_logic_vector(31 downto 0);
53
        signal dmem_data_size : std_logic_vector( 1 downto 0);
54
        signal dmem_read_req  : std_logic;
55
        signal dmem_read_ack  : std_logic;
56
        signal dmem_write_req : std_logic;
57
        signal dmem_write_ack : std_logic;
58
 
59 45 skordal
        -- Wishbone signals:
60
        signal icache_inputs, dmem_if_inputs   : wishbone_master_inputs;
61
        signal icache_outputs, dmem_if_outputs : wishbone_master_outputs;
62
 
63 2 skordal
begin
64
        processor: entity work.pp_core
65
                generic map(
66
                        PROCESSOR_ID => PROCESSOR_ID,
67
                        RESET_ADDRESS => RESET_ADDRESS
68
                ) port map(
69
                        clk => clk,
70
                        reset => reset,
71
                        timer_clk => clk,
72
                        imem_address => imem_address,
73
                        imem_data_in => imem_data,
74
                        imem_req => imem_req,
75
                        imem_ack => imem_ack,
76
                        dmem_address => dmem_address,
77
                        dmem_data_in => dmem_data_in,
78
                        dmem_data_out => dmem_data_out,
79
                        dmem_data_size => dmem_data_size,
80
                        dmem_read_req => dmem_read_req,
81
                        dmem_read_ack => dmem_read_ack,
82
                        dmem_write_req => dmem_write_req,
83
                        dmem_write_ack => dmem_write_ack,
84
                        fromhost_data => fromhost_data,
85
                        fromhost_write_en => fromhost_updated,
86
                        tohost_data => tohost_data,
87
                        tohost_write_en => tohost_updated,
88
                        irq => irq
89
                );
90
 
91 45 skordal
        icache: entity work.pp_icache
92
                generic map(
93
                        LINE_SIZE => 4,
94
                        NUM_LINES => 128
95
                ) port map(
96
                        clk => clk,
97
                        reset => reset,
98
                        cache_enable => '1',
99
                        cache_flush => '0',
100
                        cached_areas => (others => '1'),
101
                        mem_address_in => imem_address,
102
                        mem_data_out => imem_data,
103
                        mem_data_in => (others => '0'),
104
                        mem_data_size => b"00",
105
                        mem_read_req => imem_req,
106
                        mem_read_ack => imem_ack,
107
                        mem_write_req => '0',
108
                        mem_write_ack => open,
109
                        wb_inputs => icache_inputs,
110
                        wb_outputs => icache_outputs
111
                );
112
 
113
        dmem_if: entity work.pp_wb_adapter
114 2 skordal
                port map(
115
                        clk => clk,
116
                        reset => reset,
117
                        dmem_address => dmem_address,
118
                        dmem_data_in => dmem_data_out,
119
                        dmem_data_out => dmem_data_in,
120
                        dmem_data_size => dmem_data_size,
121
                        dmem_read_req => dmem_read_req,
122 45 skordal
                        dmem_read_ack => dmem_read_ack,
123 2 skordal
                        dmem_write_req => dmem_write_req,
124
                        dmem_write_ack => dmem_write_ack,
125 45 skordal
                        wb_inputs => dmem_if_inputs,
126
                        wb_outputs => dmem_if_outputs
127
                );
128
 
129
        arbiter: entity work.pp_wb_arbiter
130
                port map(
131
                        clk => clk,
132
                        reset => reset,
133
                        --m1_inputs => dmem_if_inputs,
134
                        --m1_outputs => dmem_if_outputs,
135
                        m1_inputs => icache_inputs,
136
                        m1_outputs => icache_outputs,
137
                        m2_inputs => dmem_if_inputs,
138
                        m2_outputs => dmem_if_outputs,
139 2 skordal
                        wb_adr_out => wb_adr_out,
140
                        wb_sel_out => wb_sel_out,
141
                        wb_cyc_out => wb_cyc_out,
142
                        wb_stb_out => wb_stb_out,
143
                        wb_we_out => wb_we_out,
144
                        wb_dat_out => wb_dat_out,
145
                        wb_dat_in => wb_dat_in,
146
                        wb_ack_in => wb_ack_in
147
                );
148
 
149
end architecture behaviour;

powered by: WebSVN 2.1.0

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