Line 52... |
Line 52... |
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
|
|
entity sha256_regs is
|
entity sha256_regs is
|
port (
|
port (
|
clk_i : in std_logic := 'X'; -- system clock
|
clk_i : in std_logic := 'U'; -- system clock
|
ce_i : in std_logic := 'X'; -- clock enable from control logic
|
ce_i : in std_logic := 'U'; -- clock enable from control logic
|
ld_i : in std_logic := 'X'; -- internal mux selection from control logic
|
ld_i : in std_logic := 'U'; -- internal mux selection from control logic
|
A_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
A_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
B_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
B_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
C_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
C_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
D_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
D_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
E_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
E_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
F_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
F_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
G_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
G_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
H_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
H_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
K0_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
K0_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
K1_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
K1_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
K2_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
K2_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
K3_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
K3_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
K4_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
K4_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
K5_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
K5_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
K6_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
K6_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
K7_i : in std_logic_vector (31 downto 0) := (others => 'X');
|
K7_i : in std_logic_vector (31 downto 0) := (others => 'U');
|
N0_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
N0_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
N1_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
N1_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
N2_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
N2_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
N3_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
N3_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
N4_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
N4_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
N5_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
N5_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
N6_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
N6_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
N7_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
N7_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
H0_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
H0_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
H1_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
H1_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
H2_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
H2_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
H3_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
H3_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
H4_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
H4_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
H5_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
H5_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
H6_o : out std_logic_vector (31 downto 0) := (others => 'X');
|
H6_o : out std_logic_vector (31 downto 0) := (others => 'U');
|
H7_o : out std_logic_vector (31 downto 0) := (others => 'X')
|
H7_o : out std_logic_vector (31 downto 0) := (others => 'U')
|
);
|
);
|
end sha256_regs;
|
end sha256_regs;
|
|
|
architecture rtl of sha256_regs is
|
architecture rtl of sha256_regs is
|
-- output result registers
|
-- output result registers
|
Line 101... |
Line 101... |
signal reg_H4 : unsigned (31 downto 0) := (others => '0');
|
signal reg_H4 : unsigned (31 downto 0) := (others => '0');
|
signal reg_H5 : unsigned (31 downto 0) := (others => '0');
|
signal reg_H5 : unsigned (31 downto 0) := (others => '0');
|
signal reg_H6 : unsigned (31 downto 0) := (others => '0');
|
signal reg_H6 : unsigned (31 downto 0) := (others => '0');
|
signal reg_H7 : unsigned (31 downto 0) := (others => '0');
|
signal reg_H7 : unsigned (31 downto 0) := (others => '0');
|
-- word shifter wires
|
-- word shifter wires
|
signal next_reg_H0 : unsigned (31 downto 0) := (others => '0');
|
signal next_reg_H0 : unsigned (31 downto 0);
|
signal next_reg_H1 : unsigned (31 downto 0) := (others => '0');
|
signal next_reg_H1 : unsigned (31 downto 0);
|
signal next_reg_H2 : unsigned (31 downto 0) := (others => '0');
|
signal next_reg_H2 : unsigned (31 downto 0);
|
signal next_reg_H3 : unsigned (31 downto 0) := (others => '0');
|
signal next_reg_H3 : unsigned (31 downto 0);
|
signal next_reg_H4 : unsigned (31 downto 0) := (others => '0');
|
signal next_reg_H4 : unsigned (31 downto 0);
|
signal next_reg_H5 : unsigned (31 downto 0) := (others => '0');
|
signal next_reg_H5 : unsigned (31 downto 0);
|
signal next_reg_H6 : unsigned (31 downto 0) := (others => '0');
|
signal next_reg_H6 : unsigned (31 downto 0);
|
signal next_reg_H7 : unsigned (31 downto 0) := (others => '0');
|
signal next_reg_H7 : unsigned (31 downto 0);
|
-- internal modulo adders
|
-- internal modulo adders
|
signal sum0 : unsigned (31 downto 0) := (others => '0');
|
signal sum0 : unsigned (31 downto 0);
|
signal sum1 : unsigned (31 downto 0) := (others => '0');
|
signal sum1 : unsigned (31 downto 0);
|
signal sum2 : unsigned (31 downto 0) := (others => '0');
|
signal sum2 : unsigned (31 downto 0);
|
signal sum3 : unsigned (31 downto 0) := (others => '0');
|
signal sum3 : unsigned (31 downto 0);
|
signal sum4 : unsigned (31 downto 0) := (others => '0');
|
signal sum4 : unsigned (31 downto 0);
|
signal sum5 : unsigned (31 downto 0) := (others => '0');
|
signal sum5 : unsigned (31 downto 0);
|
signal sum6 : unsigned (31 downto 0) := (others => '0');
|
signal sum6 : unsigned (31 downto 0);
|
signal sum7 : unsigned (31 downto 0) := (others => '0');
|
signal sum7 : unsigned (31 downto 0);
|
begin
|
begin
|
--=============================================================================================
|
--=============================================================================================
|
-- OUTPUT RESULT REGISTERS LOGIC
|
-- OUTPUT RESULT REGISTERS LOGIC
|
--=============================================================================================
|
--=============================================================================================
|
-- The output result registers hold the intermediate values for the hash update blocks, and also the final 256bit hash value.
|
-- The output result registers hold the intermediate values for the hash update blocks, and also the final 256bit hash value.
|