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

Subversion Repositories potato

[/] [potato/] [tags/] [v0.1/] [soc/] [pp_soc_dummy.vhd] - Diff between revs 7 and 47

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 7 Rev 47
-- The Potato Processor - A simple processor for FPGAs
-- The Potato Processor - A simple processor for FPGAs
-- (c) Kristian Klomsten Skordal 2014 - 2015 <kristian.skordal@wafflemail.net>
-- (c) Kristian Klomsten Skordal 2014 - 2015 <kristian.skordal@wafflemail.net>
-- Report bugs and issues on <https://github.com/skordal/potato/issues>
-- Report bugs and issues on <https://github.com/skordal/potato/issues>
 
 
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
 
 
--! @brief Dummy module for an SoC implementation.
--! @brief Dummy module for an SoC implementation.
--! Reads returns whatever was last written into the module.
--! Reads returns whatever was last written into the module.
entity pp_soc_dummy is
entity pp_soc_dummy is
        port(
        port(
                clk : in std_logic;
                clk : in std_logic;
                reset : in std_logic;
                reset : in std_logic;
 
 
                -- Wishbone signals:
                -- Wishbone signals:
                wb_dat_in  : in  std_logic_vector(31 downto 0);
                wb_dat_in  : in  std_logic_vector(31 downto 0);
                wb_dat_out : out std_logic_vector(31 downto 0);
                wb_dat_out : out std_logic_vector(31 downto 0);
                wb_cyc_in  : in  std_logic;
                wb_cyc_in  : in  std_logic;
                wb_stb_in  : in  std_logic;
                wb_stb_in  : in  std_logic;
                wb_we_in   : in  std_logic;
                wb_we_in   : in  std_logic;
                wb_ack_out : out std_logic
                wb_ack_out : out std_logic
        );
        );
end entity pp_soc_dummy;
end entity pp_soc_dummy;
 
 
architecture behaviour of pp_soc_dummy is
architecture behaviour of pp_soc_dummy is
 
 
        signal reg : std_logic_vector(31 downto 0);
        signal reg : std_logic_vector(31 downto 0);
        signal ack : std_logic;
        signal ack : std_logic;
 
 
begin
begin
 
 
        wb_ack_out <= ack and wb_cyc_in and wb_stb_in;
        wb_ack_out <= ack and wb_cyc_in and wb_stb_in;
 
 
        wishbone: process(clk)
        wishbone: process(clk)
        begin
        begin
                if rising_edge(clk) then
                if rising_edge(clk) then
                        if reset = '1' then
                        if reset = '1' then
                                reg <= (others => '0');
                                reg <= (others => '0');
                                ack <= '0';
                                ack <= '0';
                        else
                        else
                                if wb_cyc_in = '1' and wb_stb_in = '1' and ack = '0' then
                                if wb_cyc_in = '1' and wb_stb_in = '1' and ack = '0' then
                                        if wb_we_in = '1' then
                                        if wb_we_in = '1' then
                                                reg <= wb_dat_in;
                                                reg <= wb_dat_in;
                                                ack <= '1';
                                                ack <= '1';
                                        else
                                        else
                                                wb_dat_out <= reg;
                                                wb_dat_out <= reg;
                                                ack <= '1';
                                                ack <= '1';
                                        end if;
                                        end if;
                                elsif wb_stb_in = '0' then
                                elsif wb_stb_in = '0' then
                                        ack <= '0';
                                        ack <= '0';
                                end if;
                                end if;
                        end if;
                        end if;
                end if;
                end if;
        end process wishbone;
        end process wishbone;
 
 
end architecture behaviour;
end architecture behaviour;
 
 

powered by: WebSVN 2.1.0

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