1 |
2 |
arniml |
-------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- T400 Core
|
4 |
|
|
--
|
5 |
179 |
arniml |
-- $Id: t400_por.vhd 179 2009-04-01 19:48:38Z arniml $
|
6 |
2 |
arniml |
--
|
7 |
|
|
-- Wrapper for technology dependent power-on reset circuitry.
|
8 |
|
|
--
|
9 |
|
|
-- Altera Cyclone flavor.
|
10 |
|
|
--
|
11 |
|
|
-- Generate a reset upon power-on for specified number of clocks.
|
12 |
|
|
--
|
13 |
|
|
-------------------------------------------------------------------------------
|
14 |
|
|
--
|
15 |
|
|
-- Copyright (c) 2006, Arnim Laeuger (arnim.laeuger@gmx.net)
|
16 |
|
|
--
|
17 |
|
|
-- All rights reserved
|
18 |
|
|
--
|
19 |
|
|
-- Redistribution and use in source and synthezised forms, with or without
|
20 |
|
|
-- modification, are permitted provided that the following conditions are met:
|
21 |
|
|
--
|
22 |
|
|
-- Redistributions of source code must retain the above copyright notice,
|
23 |
|
|
-- this list of conditions and the following disclaimer.
|
24 |
|
|
--
|
25 |
|
|
-- Redistributions in synthesized form must reproduce the above copyright
|
26 |
|
|
-- notice, this list of conditions and the following disclaimer in the
|
27 |
|
|
-- documentation and/or other materials provided with the distribution.
|
28 |
|
|
--
|
29 |
|
|
-- Neither the name of the author nor the names of other contributors may
|
30 |
|
|
-- be used to endorse or promote products derived from this software without
|
31 |
|
|
-- specific prior written permission.
|
32 |
|
|
--
|
33 |
|
|
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
34 |
|
|
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
35 |
|
|
-- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
36 |
|
|
-- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
|
37 |
|
|
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
38 |
|
|
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
39 |
|
|
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
40 |
|
|
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
41 |
|
|
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
42 |
|
|
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
43 |
|
|
-- POSSIBILITY OF SUCH DAMAGE.
|
44 |
|
|
--
|
45 |
|
|
-- Please report bugs to the author, but before you do so, please
|
46 |
|
|
-- make sure that this is not a derivative work and that
|
47 |
|
|
-- you have the latest version of this file.
|
48 |
|
|
--
|
49 |
|
|
-------------------------------------------------------------------------------
|
50 |
|
|
|
51 |
|
|
library ieee;
|
52 |
|
|
use ieee.std_logic_1164.all;
|
53 |
|
|
|
54 |
|
|
entity t400_por is
|
55 |
|
|
|
56 |
|
|
generic (
|
57 |
|
|
delay_g : integer := 4;
|
58 |
|
|
cnt_width_g : integer := 2
|
59 |
|
|
);
|
60 |
|
|
port (
|
61 |
|
|
clk_i : in std_logic;
|
62 |
|
|
por_n_o : out std_logic
|
63 |
|
|
);
|
64 |
|
|
|
65 |
|
|
end t400_por;
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
library ieee;
|
69 |
|
|
use ieee.numeric_std.all;
|
70 |
|
|
|
71 |
|
|
architecture cyclone of t400_por is
|
72 |
|
|
|
73 |
|
|
signal por_cnt_q : unsigned(cnt_width_g-1 downto 0)
|
74 |
|
|
-- pragma translate_off
|
75 |
|
|
-- initialize for simulation only
|
76 |
|
|
:= (others => '0')
|
77 |
|
|
-- pragma translate_on
|
78 |
|
|
;
|
79 |
|
|
signal por_n_q : std_logic
|
80 |
|
|
-- pragma translate_off
|
81 |
|
|
-- initialize for simulation only
|
82 |
|
|
:= '0'
|
83 |
|
|
-- pragma translate_on
|
84 |
|
|
;
|
85 |
|
|
|
86 |
|
|
-- Specify power-up level of por counter and por source.
|
87 |
|
|
-- Refer to "Quartus II Integrated Synthesis", section "Altera Attribute".
|
88 |
|
|
attribute altera_attribute : string;
|
89 |
|
|
attribute altera_attribute of por_cnt_q : signal is "-name POWER_UP_LEVEL LOW";
|
90 |
|
|
attribute altera_attribute of por_n_q : signal is "-name POWER_UP_LEVEL LOW";
|
91 |
|
|
|
92 |
|
|
begin
|
93 |
|
|
|
94 |
|
|
-----------------------------------------------------------------------------
|
95 |
|
|
-- Process por_cnt
|
96 |
|
|
--
|
97 |
|
|
-- Purpose:
|
98 |
|
|
-- Generate a power-on reset for the specifiec number of clocks.
|
99 |
|
|
--
|
100 |
|
|
por_cnt: process (clk_i)
|
101 |
|
|
begin
|
102 |
|
|
if clk_i'event and clk_i = '1' then
|
103 |
|
|
if por_cnt_q = delay_g-1 then
|
104 |
|
|
por_n_q <= '1';
|
105 |
|
|
else
|
106 |
|
|
por_cnt_q <= por_cnt_q + 1;
|
107 |
|
|
end if;
|
108 |
|
|
end if;
|
109 |
|
|
end process por_cnt;
|
110 |
|
|
--
|
111 |
|
|
-----------------------------------------------------------------------------
|
112 |
|
|
|
113 |
|
|
por_n_o <= por_n_q;
|
114 |
|
|
|
115 |
|
|
end cyclone;
|