]> rtime.felk.cvut.cz Git - fpga/pwm.git/blob - mcc_exec.vhd
Corrected generic parameters in MCC entity.
[fpga/pwm.git] / mcc_exec.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 mcc_exec is
9   port (
10     -- Clock & reset
11     CLK_I      : in  std_logic;
12     RST_I      : in  std_logic;
13     -- MCC execution
14     MCC_EN_I   : in  std_logic;
15     MCC_EXEC_I : in  std_logic;
16     MCC_ERR_O  : out std_logic;
17     -- MCC master interface
18     MCC_ACK_I  : in  std_logic;
19     MCC_STB_O  : out std_logic);
20 end entity mcc_exec;
21
22 --------------------------------------------------------------------------------
23
24 architecture behavioral of mcc_exec is
25
26   signal mcc_stb : std_logic := '0';
27   
28 --------------------------------------------------------------------------------
29
30 begin
31
32   MCC_STB_O <= mcc_stb;
33   
34   MCC_ERR_O <= MCC_EXEC_I and (mcc_stb or MCC_ACK_I);
35
36   
37   process (CLK_I, RST_I) is
38   begin
39     if rising_edge(CLK_I) then
40       if RST_I = '1' or MCC_ACK_I = '1' then
41         mcc_stb <= '0';
42       elsif MCC_EN_I = '1' and MCC_EXEC_I = '1' then
43         mcc_stb <= '1';
44       end if;
45     end if;
46   end process;
47   
48 end architecture behavioral;
49