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

Subversion Repositories mcip_open

[/] [mcip_open/] [trunk/] [MCIPopen_XilinxISEproject/] [Reset_module.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 mezzah
--------------------------------------------------------------------------------
2
-- Company:        Ferhat Abbas University - Algeria
3
-- Engineer:       Ibrahim MEZZAH
4
-- Progect Supervisor: Dr H. Chemali
5
-- Create Date:    14:24:19 06/01/05
6
-- Design Name:    Reset device
7
-- Module Name:    Rest_module - reset
8
-- Project Name:   Microcontroller IP (MCIP)
9
-- Target Device:  xc3s500e-4fg320
10
-- Tool versions:  Xilinx ISE 9.1.03i
11
-- Description:  This module generate the global reset of the device (nreset).
12
--                                               nreset is active (low) if one of following events occure:
13
--                                               soft reset, stack overflow, Watchdog time out, external reset.
14
-- Revision:             07/09/2008
15
-- Revision 3 - Extend a soft reset time.
16
--------------------------------------------------------------------------------
17
library IEEE;
18
use IEEE.STD_LOGIC_1164.ALL;
19
use IEEE.STD_LOGIC_UNSIGNED.ALL;
20
 
21
entity reset_module is
22
    Port ( clock                                : in std_logic;
23
           nExternal_reset      : in std_logic;
24
                          Soft_reset            : in std_logic;
25
           WDT_reset                    : in std_logic;
26
           Stack_reset          : in std_logic;
27
           nreset                               : out std_logic);
28
end reset_module;
29
 
30
architecture reset of reset_module is
31
        constant reset_counter_length : integer := 5;
32
        signal reset_enable : std_logic;
33
        signal reset_counter : std_logic_vector(reset_counter_length downto 1);
34
        signal disable_counter_value : std_logic_vector(reset_counter_length downto 1);
35
begin
36
 
37
        disable_counter_value <= (others => '1');
38
 
39
        Enabling_reset : process(nExternal_reset, clock, reset_counter,
40
                                                                         disable_counter_value, Soft_reset, WDT_reset,
41
                                                                         Stack_reset)
42
        begin
43
          if nExternal_reset = '0' then
44
                 reset_enable <= '0';
45
          else
46
                 if clock'event and clock = '1' then
47
                        if reset_counter = disable_counter_value then
48
                                reset_enable <= '0';
49
                        else
50
                                if Soft_reset = '1' or WDT_reset = '1' or Stack_reset = '1' then
51
                                        reset_enable <= '1';
52
                                else
53
                                        reset_enable <= reset_enable;
54
                                end if;
55
                        end if;
56
                 else
57
                        reset_enable <= reset_enable;
58
                 end if;
59
          end if;
60
        end process;
61
 
62
        Counter : process(reset_enable, clock)
63
        begin
64
          if reset_enable = '0' then
65
                 reset_counter <= (others => '0');
66
          else
67
                 if clock'event and clock = '1' then
68
                        reset_counter <= reset_counter + "1";
69
                 else
70
                        reset_counter <= reset_counter;
71
                 end if;
72
          end if;
73
        end process;
74
 
75
        nreset <= '0' when ( nExternal_reset = '0' or reset_enable = '1') else
76
                                 '1';
77
 
78
end reset;

powered by: WebSVN 2.1.0

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