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

Subversion Repositories highload

[/] [highload/] [trunk/] [lc_use.vhd] - Blame information for rev 3

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

Line No. Rev Author Line
1 2 alexadmin
-- High load test project.
2
-- Alexey Fedorov, 2014
3
-- email: FPGA@nerudo.com
4
--
5
-- It implements 256 LUT/DFFs per one row (NUM_ROWS parameter) 
6
-- with default other parameters
7
 
8
library ieee;
9
use ieee.std_logic_1164.all;
10
use ieee.numeric_std.all;
11
 
12
 
13
entity lc_use is
14
        generic (
15
                DATA_WIDTH : positive := 128;
16
                ARITH_SIZE : positive := 16; -- Should be divider of DATA_WIDTH
17 3 alexadmin
                NUM_ROWS: positive := 6;        -- Input pins
18
                ADD_PIPL_FF : boolean := false
19 2 alexadmin
                );
20
        port
21
        (
22
                clk     : in  std_logic;
23
                inputs: in std_logic_vector(DATA_WIDTH-1 downto 0);
24
                dataout: out std_logic_vector(DATA_WIDTH-1 downto 0)
25
        );
26
end lc_use;
27
 
28
 
29
architecture rtl of lc_use is
30
type TArr is array (natural range <>) of unsigned(127 downto 0);
31 3 alexadmin
signal arr : TArr(0 to 3*NUM_ROWS) := (others => (others => '0'));
32 2 alexadmin
 
33
begin
34
 
35
assert DATA_WIDTH mod ARITH_SIZE = 0 report "ARITH_SIZE should be divider of DATA_WIDTH" severity error;
36
 
37
process(clk)
38
begin
39
if rising_edge(clk) then
40
        arr(0)(DATA_WIDTH-1 downto 0) <= unsigned(inputs);
41
        for i in 0 to NUM_ROWS-1 loop
42 3 alexadmin
                arr(3*i+1) <= arr(3*i) xor (arr(3*i) rol 1) xor (arr(3*i) rol 2) xor (arr(3*i) rol 3);
43 2 alexadmin
                for j in 0 to DATA_WIDTH/ARITH_SIZE-1 loop
44 3 alexadmin
                        arr(3*i+2)((j+1)*ARITH_SIZE - 1 downto j*ARITH_SIZE) <=
45
                                arr(3*i+0)((j+1)*ARITH_SIZE - 1 downto j*ARITH_SIZE) +
46
                                arr(3*i+1)((j+1)*ARITH_SIZE - 1 downto j*ARITH_SIZE);
47 2 alexadmin
                end loop;
48 3 alexadmin
                if ADD_PIPL_FF then
49
                  arr(3*i+3) <= arr(3*i+2);
50
                end if;
51 2 alexadmin
        end loop;
52
 
53 3 alexadmin
        dataout <= std_logic_vector(arr(3*NUM_ROWS));
54 2 alexadmin
 
55
end if;
56
 
57
end process;
58
 
59 3 alexadmin
no_ff_gen: if not ADD_PIPL_FF generate
60
    ff_loop_gen: for i in 0 to NUM_ROWS-1 generate
61
        arr(3*i+3) <= arr(3*i+2);
62
    end generate;
63
end generate;
64
 
65
 
66 2 alexadmin
end rtl;

powered by: WebSVN 2.1.0

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