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

Subversion Repositories potato

[/] [potato/] [trunk/] [soc/] [pp_soc_dummy.vhd] - Blame information for rev 58

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 skordal
-- The Potato Processor - A simple processor for FPGAs
2
-- (c) Kristian Klomsten Skordal 2014 - 2015 <kristian.skordal@wafflemail.net>
3
-- Report bugs and issues on <https://github.com/skordal/potato/issues>
4
 
5
library ieee;
6
use ieee.std_logic_1164.all;
7
 
8
--! @brief Dummy module for an SoC implementation.
9
--! Reads returns whatever was last written into the module.
10
entity pp_soc_dummy is
11
        port(
12
                clk : in std_logic;
13
                reset : in std_logic;
14
 
15
                -- Wishbone signals:
16
                wb_dat_in  : in  std_logic_vector(31 downto 0);
17
                wb_dat_out : out std_logic_vector(31 downto 0);
18
                wb_cyc_in  : in  std_logic;
19
                wb_stb_in  : in  std_logic;
20
                wb_we_in   : in  std_logic;
21
                wb_ack_out : out std_logic
22
        );
23
end entity pp_soc_dummy;
24
 
25
architecture behaviour of pp_soc_dummy is
26
 
27
        signal reg : std_logic_vector(31 downto 0);
28
        signal ack : std_logic;
29
 
30
begin
31
 
32
        wb_ack_out <= ack and wb_cyc_in and wb_stb_in;
33
 
34
        wishbone: process(clk)
35
        begin
36
                if rising_edge(clk) then
37
                        if reset = '1' then
38
                                reg <= (others => '0');
39
                                ack <= '0';
40
                        else
41
                                if wb_cyc_in = '1' and wb_stb_in = '1' and ack = '0' then
42
                                        if wb_we_in = '1' then
43
                                                reg <= wb_dat_in;
44
                                                ack <= '1';
45
                                        else
46
                                                wb_dat_out <= reg;
47
                                                ack <= '1';
48
                                        end if;
49
                                elsif wb_stb_in = '0' then
50
                                        ack <= '0';
51
                                end if;
52
                        end if;
53
                end if;
54
        end process wishbone;
55
 
56
end architecture behaviour;

powered by: WebSVN 2.1.0

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