]> rtime.felk.cvut.cz Git - fpga/pwm.git/blob - irc_dump.vhd
Wave_table initialization data format modified.
[fpga/pwm.git] / irc_dump.vhd
1 library ieee;
2 use ieee.std_logic_1164.all;
3 use ieee.std_logic_arith.all;
4 use ieee.std_logic_unsigned.all;
5
6 --------------------------------------------------------------------------------
7
8 entity irc_dump is
9   generic (
10     IRF_ADR_W : integer := 5;
11     IRC_BASE  : integer := 1);
12   port (
13     -- Primary slave intefrace
14     ACK_O     : out std_logic;
15     CLK_I     : in  std_logic;
16     RST_I     : in  std_logic;
17     STB_I     : in  std_logic;
18     -- IRC interface
19     IRC_DAT_I : in  std_logic_vector (15 downto 0);
20     -- Shared dual-port memory
21     IRF_ACK_I : in  std_logic;
22     IRF_ADR_O : out std_logic_vector (IRF_ADR_W-1 downto 0);
23     IRF_DAT_O : out std_logic_vector (15 downto 0);
24     IRF_STB_O : out std_logic;
25     IRF_WE_O  : out std_logic);
26 end entity irc_dump;
27
28 --------------------------------------------------------------------------------
29
30 architecture behavioral of irc_dump is
31
32   subtype irf_adr_t is std_logic_vector (IRF_ADR_W-1 downto 0);
33
34   constant IRC_ADR : irf_adr_t :=  conv_std_logic_vector(IRC_BASE, IRF_ADR_W);
35   
36   signal INNER_ACK : std_logic := '0';
37   
38 --------------------------------------------------------------------------------
39
40 begin
41
42   ACK_O <= STB_I;
43
44   IRF_DAT_O <= IRC_DAT_I;
45   
46   IRF_ADR_O <= IRC_ADR;
47   IRF_STB_O <= STB_I and not INNER_ACK;
48   IRF_WE_O  <= STB_I and not INNER_ACK;
49
50
51   process (CLK_I, RST_I) is
52   begin
53     if rising_edge(CLK_I) then
54       if RST_I = '1' then
55         INNER_ACK <= '0';
56       else
57         INNER_ACK <= STB_I;
58       end if;
59     end if;
60   end process;
61   
62 end architecture behavioral;
63