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

Subversion Repositories powerseq

[/] [powerseq/] [trunk/] [pseq_3redundant.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 buenos
----------------------------------------------------------------------------------
2
-- Engineer: Istvan Nagy
3
-- Create Date: 10/06/2024 10:10:13 AM 
4
---Version 1.0
5
-- License: 0BSD, no restrictions for use, no need to publish modified versions. 
6
--   The BSD 0-clause license: Copyright (C) 2024 by Istvan Nagy buenoshun@gmail.com 
7
--   Permission to use, copy, modify, and/or distribute this software for any purpose 
8
--   with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND 
9
--   THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
10
-- Module Name: pseq_3redundant - Behavioral
11
-- Target devices: Microchip Igloo preferred, due to attributes.
12
-- This code is a wrapper for the powerseq_mod.
13
--   It creates a triple-redundant and SEU-immune sequencer by using 3 instances
14
--   of the original sequencer and voting logic on its outputs.
15
----------------------------------------------------------------------------------
16
library IEEE;
17
use IEEE.STD_LOGIC_1164.ALL;
18
use IEEE.NUMERIC_STD.ALL;
19
library IEEE;
20
use IEEE.STD_LOGIC_1164.ALL;
21
use IEEE.STD_LOGIC_ARITH.ALL;
22
use IEEE.STD_LOGIC_UNSIGNED.ALL;
23
--entity header  ----------------------------------------------------------------
24
entity pseq_3redundant is
25
    Port (
26
           clk  : in std_logic; --25MHz clock
27
           reset_n  : in std_logic; --FPGA reset, needs 1ms from standby 3.3V on
28
           forcepoweron  : in std_logic; --from dip switch, avoid failure response
29
           PSEQ_RAIL_EN : out std_logic_vector(127 downto 0); --map to rails
30
           PSEQ_RAIL_PG : in std_logic_vector(127 downto 0); --map to rails
31
           thermal_n : in std_logic; --thermal shutdown, externally combine multiple sources 
32
           failed_rails : out std_logic_vector(255 downto 0); --bits=1 for failed rails
33
           pfailure : out std_logic; --assers during failure --1 if one or more railes failed.
34
           tick_out : out std_logic; --available if needed outside, 1pulse in every several thousand clk
35
           pseqstate_out  : out std_logic_vector(3 downto 0); --we can monitor status through a pin with TopJtag
36
           all_on  : in std_logic; --power master ordered the sequence to commence on
37
           all_pgood: out std_logic --tell the power master that all is on
38
           );
39
 
40
 end pseq_3redundant;
41
 
42
 
43
--architecture start ------------------------------------------------------------
44
architecture Behavioral of pseq_3redundant is
45
 
46
attribute syn_preserve : boolean;
47
attribute syn_preserve of Behavioral: architecture is true;
48
 
49
-- INTERNAL SIGNALS -------------------------------------------------------------
50
 
51
           SIGNAL PSEQ_RAIL_ENa :  std_logic_vector(127 downto 0); --map to rails
52
           SIGNAL failed_railsa :  std_logic_vector(255 downto 0); --bits=1 for failed rails
53
           SIGNAL pfailurea :  std_logic; --assers during failure --1 if one or more railes failed.
54
           SIGNAL tick_outa :  std_logic; --available if needed outside, 1pulse in every several thousand clk
55
           SIGNAL pseqstate_outa  :  std_logic_vector(3 downto 0); --we can monitor status through a pin with TopJtag
56
           SIGNAL all_pgooda:  std_logic; --tell the power master that all is on
57
 
58
           SIGNAL PSEQ_RAIL_ENb :  std_logic_vector(127 downto 0); --map to rails
59
           SIGNAL failed_railsb :  std_logic_vector(255 downto 0); --bits=1 for failed rails
60
           SIGNAL pfailureb :  std_logic; --assers during failure --1 if one or more railes failed.
61
           SIGNAL tick_outb :  std_logic; --available if needed outside, 1pulse in every several thousand clk
62
           SIGNAL pseqstate_outb  :  std_logic_vector(3 downto 0); --we can monitor status through a pin with TopJtag
63
           SIGNAL all_pgoodb:  std_logic; --tell the power master that all is on
64
 
65
           SIGNAL PSEQ_RAIL_ENc :  std_logic_vector(127 downto 0); --map to rails
66
           SIGNAL failed_railsc :  std_logic_vector(255 downto 0); --bits=1 for failed rails
67
           SIGNAL pfailurec :  std_logic; --assers during failure --1 if one or more railes failed.
68
           SIGNAL tick_outc :  std_logic; --available if needed outside, 1pulse in every several thousand clk
69
           SIGNAL pseqstate_outc  :  std_logic_vector(3 downto 0); --we can monitor status through a pin with TopJtag
70
           SIGNAL all_pgoodc:  std_logic; --tell the power master that all is on
71
 
72
 
73
--------- COMPONENT DECLARATIONS (introducing the IPs) --------------------------
74
        COMPONENT powerseq_mod
75
        PORT(
76
                clk : IN std_logic;
77
                reset_n : IN std_logic;
78
                forcepoweron : IN std_logic;
79
                PSEQ_RAIL_PG : IN std_logic_vector(127 downto 0);
80
                thermal_n : IN std_logic;
81
                all_on : IN std_logic;
82
                PSEQ_RAIL_EN : OUT std_logic_vector(127 downto 0);
83
                failed_rails : OUT std_logic_vector(255 downto 0);
84
                pfailure : OUT std_logic;
85
                tick_out : OUT std_logic;
86
                pseqstate_out : OUT std_logic_vector(3 downto 0);
87
                all_pgood : OUT std_logic
88
                );
89
        END COMPONENT;
90
 
91
 
92
--architecture body start -------------------------------------------------------
93
begin
94
 
95
 
96
        Inst_powerseq_mod1: powerseq_mod PORT MAP(
97
                clk => clk,
98
                reset_n => reset_n,
99
                forcepoweron => forcepoweron,
100
                PSEQ_RAIL_EN => PSEQ_RAIL_ENa,
101
                PSEQ_RAIL_PG => PSEQ_RAIL_PG,
102
                thermal_n => thermal_n,
103
                failed_rails => failed_railsa,
104
                pfailure => pfailurea,
105
                tick_out => tick_outa,
106
                pseqstate_out => pseqstate_outa,
107
                all_on => all_on,
108
                all_pgood => all_pgooda
109
        );
110
        Inst_powerseq_mod2: powerseq_mod PORT MAP(
111
                clk => clk,
112
                reset_n => reset_n,
113
                forcepoweron => forcepoweron,
114
                PSEQ_RAIL_EN => PSEQ_RAIL_ENb,
115
                PSEQ_RAIL_PG => PSEQ_RAIL_PG,
116
                thermal_n => thermal_n,
117
                failed_rails => failed_railsb,
118
                pfailure => pfailureb,
119
                tick_out => tick_outb,
120
                pseqstate_out => pseqstate_outb,
121
                all_on => all_on,
122
                all_pgood => all_pgoodb
123
        );
124
        Inst_powerseq_mod3: powerseq_mod PORT MAP(
125
                clk => clk,
126
                reset_n => reset_n,
127
                forcepoweron => forcepoweron,
128
                PSEQ_RAIL_EN => PSEQ_RAIL_ENc,
129
                PSEQ_RAIL_PG => PSEQ_RAIL_PG,
130
                thermal_n => thermal_n,
131
                failed_rails => failed_railsc,
132
                pfailure => pfailurec,
133
                tick_out => tick_outc,
134
                pseqstate_out => pseqstate_outc,
135
                all_on => all_on,
136
                all_pgood => all_pgoodc
137
        );
138
 
139
 
140
--3 input voting logic:
141
--T = (A * B) + (B * C) + (C * A)
142
 
143
PSEQ_RAIL_EN <= (PSEQ_RAIL_ENa AND PSEQ_RAIL_ENb) OR (PSEQ_RAIL_ENa AND PSEQ_RAIL_ENc) OR (PSEQ_RAIL_ENb AND PSEQ_RAIL_ENc);
144
failed_rails <= (failed_railsa AND failed_railsb) OR (failed_railsa AND failed_railsc) OR (failed_railsb AND failed_railsc);
145
pfailure <= (pfailurea AND pfailureb) OR (pfailurea AND pfailurec) OR (pfailureb AND pfailurec);
146
tick_out <= (tick_outa AND tick_outb) OR (tick_outa AND tick_outc) OR (tick_outb AND tick_outc);
147
pseqstate_out <= (pseqstate_outa AND pseqstate_outb) OR (pseqstate_outa AND pseqstate_outc) OR (pseqstate_outb AND pseqstate_outc);
148
all_pgood <= (all_pgooda AND all_pgoodb) OR (all_pgooda AND all_pgoodc) OR (all_pgoodb AND all_pgoodc);
149
 
150
 
151
--end file ----------------------------------------------------------------------
152
end Behavioral;

powered by: WebSVN 2.1.0

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