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

Subversion Repositories twofish

[/] [twofish/] [trunk/] [vhdl/] [twofish_testbenches_secondary_circuits.vhd] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 spyros
-- Twofish_testbenches_secondary_circuits.vhd
2
-- Copyright (C) 2006 Spyros Ninos
3
--
4
-- This program is free software; you can redistribute it and/or modify 
5
-- it under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation; either version 2 of the License, or
7
-- (at your option) any later version.
8
-- 
9
-- This program is distributed in the hope that it will be useful,
10
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
-- GNU General Public License for more details.
13
-- 
14
-- You should have received a copy of the GNU General Public License
15
-- along with this library; see the file COPYING.  If not, write to:
16
-- 
17
-- Free Software Foundation
18
-- 59 Temple Place - Suite 330
19
-- Boston, MA  02111-1307, USA.
20
--
21
-- description  :       this file contains all the secondary circuits that are needed for running the testbenches
22
--
23
 
24
 
25
--
26
-- reg128
27
--
28
 
29
library ieee;
30
use ieee.std_logic_1164.all;
31
 
32
entity reg128 is
33
port ( in_reg128 : in std_logic_vector(127 downto 0);
34
                out_reg128 : out std_logic_vector(127 downto 0);
35
                enable_reg128, reset_reg128,clk_reg128 : in std_logic
36
        );
37
end reg128;
38
 
39
architecture reg128_arch of reg128 is
40
begin
41
        clk_proc: process(clk_reg128, reset_reg128,enable_reg128)
42
                variable        internal_state : std_logic_vector(127 downto 0);
43
        begin
44
                if reset_reg128 = '1' then
45
                        internal_state := ( others => '0' );
46
                elsif (clk_reg128'event and clk_reg128 = '1') then
47
                        if enable_reg128='1' then
48
                                internal_state := in_reg128;
49
                        else
50
                                internal_state := internal_state;
51
                        end if;
52
                end if;
53
        out_reg128 <= internal_state;
54
        end process clk_proc;
55
end reg128_arch;
56
 
57
 
58
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --
59
--                                                                                                                                                      --
60
--                                                              new component                                                           --
61
--                                                                                                                                                      --
62
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --
63
 
64
--
65
-- mux128
66
--
67
 
68
library ieee;
69
use ieee.std_logic_1164.all;
70
 
71
entity mux128 is
72
port ( in1_mux128, in2_mux128   : in std_logic_vector(127 downto 0);
73
                selection_mux128        : in std_logic;
74
                out_mux128 : out std_logic_vector(127 downto 0)
75
        );
76
end mux128;
77
 
78
architecture mux128_arch of mux128 is
79
begin
80
        with selection_mux128 select
81
                out_mux128 <= in1_mux128 when '0',
82
                                                                in2_mux128 when others;
83
end mux128_arch;
84
 
85
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --
86
--                                                                                                                                                      --
87
--                                                              new component                                                           --
88
--                                                                                                                                                      --
89
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --
90
 
91
--
92
-- demux128
93
--
94
 
95
library ieee;
96
use ieee.std_logic_1164.all;
97
 
98
entity demux128 is
99
port    ( in_demux128 : in std_logic_vector(127 downto 0);
100
                out1_demux128, out2_demux128 : out std_logic_vector(127 downto 0);
101
                selection_demux128 : in std_logic
102
        );
103
end demux128;
104
 
105
architecture demux128_arch of demux128 is
106
begin
107
        demux_proc: process(in_demux128, selection_demux128)
108
        begin
109
                if selection_demux128 = '0' then
110
                        out1_demux128 <= in_demux128;
111
                else
112
                        out2_demux128 <= in_demux128;
113
                end if;
114
        end process demux_proc;
115
end demux128_arch;

powered by: WebSVN 2.1.0

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