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

Subversion Repositories potato

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

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

powered by: WebSVN 2.1.0

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