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

Subversion Repositories b163arith

[/] [b163arith/] [trunk/] [gf_163_bram_dsp.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 entactogen
 
2
-- Copyright (c) 2013 Antonio de la Piedra
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 3 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 program.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
library IEEE;
18
use IEEE.STD_LOGIC_1164.ALL;
19
 
20
entity gf_163_bram_dsp is
21
        port(clk : in std_logic;
22
             rst : in std_logic;
23
             a : in std_logic_vector(162 downto 0);
24
             b : in std_logic_vector(162 downto 0);
25
                  p : out std_logic_vector(162 downto 0));
26
end gf_163_bram_dsp;
27
 
28
architecture Behavioral of gf_163_bram_dsp is
29
 
30
        COMPONENT poly_rom
31
                PORT (clka : IN STD_LOGIC;
32
                                addra : IN STD_LOGIC_VECTOR(0 DOWNTO 0);
33
                                douta : OUT STD_LOGIC_VECTOR(162 DOWNTO 0));
34
        END COMPONENT;
35
 
36
        component dsp_xor is
37
                port (clk     : in std_logic;
38
                                op_1      : in std_logic_vector(47 downto 0);
39
                                op_2      : in std_logic_vector(47 downto 0);
40
                                op_3      : out std_logic_vector(47 downto 0));
41
        end component;
42
 
43
        component shift_xor_128 is
44
                port(clk : in std_logic;
45
                     a : in std_logic_vector(162 downto 0);
46
                          m : in std_logic_vector(162 downto 0);
47
                     c : out std_logic_vector(162 downto 0));
48
        end component;
49
 
50
        signal p_1_s : std_logic_vector(162 downto 0);
51
        signal p_2_s : std_logic_vector(162 downto 0);
52
        signal b_s : std_logic;
53
        signal p_s : std_logic_vector(162 downto 0);
54
        signal m_s : std_logic_vector(162 downto 0);
55
        signal c_s : std_logic_vector(162 downto 0);
56
 
57
        signal r_0_s : std_logic_vector(47 downto 0);
58
        signal r_1_s : std_logic_vector(47 downto 0);
59
        signal r_2_s : std_logic_vector(47 downto 0);
60
        signal r_3_s : std_logic_vector(47 downto 0);
61
 
62
        signal xor_in_aux_0_s : std_logic_vector(47 downto 0);
63
        signal xor_in_aux_1_s : std_logic_vector(47 downto 0);
64
        signal xor_out_aux_s : std_logic_vector(47 downto 0);
65
 
66
begin
67
 
68
        shr_p_2_pr : process(clk, rst, b)
69
        begin
70
                if rising_edge(clk) then
71
                        if rst = '1' then
72
                                p_2_s <= b;
73
                        else
74
                                p_2_s <= '0' & p_2_s(162 downto 1);
75
                        end if;
76
                end if;
77
 
78
                b_s <= p_2_s(0);
79
 
80
        end process;
81
 
82
        pr_1_seq: process(clk, rst, b_s, p_1_s, r_3_s, r_2_s, r_1_s, r_0_s)
83
        begin
84
                if rising_edge(clk) then
85
                        if rst = '1' then
86
                                p_s <= (others => '0');
87
                        elsif b_s = '1' then
88
                                p_s <= r_3_s(47 downto 29) & r_2_s & r_1_s & r_0_s;
89
                        end if;
90
                end if;
91
        end process;
92
 
93
        DSP_XOR_0 : dsp_xor port map (clk, p_s(47 downto 0),    p_1_s(47 downto 0),   r_0_s);
94
        DSP_XOR_1 : dsp_xor port map (clk, p_s(95 downto 48),   p_1_s(95 downto 48),  r_1_s);
95
        DSP_XOR_2 : dsp_xor port map (clk, p_s(143 downto 96),  p_1_s(143 downto 96),  r_2_s);
96
 
97
        xor_in_aux_0_s <= p_s(162 downto 134) & "0000000000000000000";
98
        xor_in_aux_1_s <= p_1_s(162 downto 134) & "0000000000000000000";
99
 
100
        DSP_XOR_3 : dsp_xor port map (clk, xor_in_aux_0_s,  xor_in_aux_1_s, r_3_s);
101
 
102
        SHIFT_XOR_0 : shift_xor_128 port map (clk, p_1_s, m_s, c_s);
103
 
104
        pr_2_seq: process(clk, a, c_s)
105
        begin
106
                if rising_edge(clk) then
107
                        if rst = '1' then
108
                                p_1_s <= a;
109
                        else
110
                                p_1_s <= c_s;
111
                        end if;
112
                end if;
113
        end process;
114
 
115
        p <= p_s;
116
 
117
        POLY_ROM_0 : poly_rom port map (clk, "0", m_s);
118
 
119
end Behavioral;
120
 

powered by: WebSVN 2.1.0

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