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

Subversion Repositories btc_dsha256

[/] [btc_dsha256/] [trunk/] [rtl/] [vhdl/] [misc/] [pipelines_without_reset.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 nuxi1209
------------------------------------------------------------------- 
2
--                                                               --
3
--  Copyright (C) 2013 Author and VariStream Studio              --
4
--  Author : Yu Peng                                             --
5
--                                                               -- 
6
--  This source file may be used and distributed without         -- 
7
--  restriction provided that this copyright statement is not    -- 
8
--  removed from the file and that any derivative work contains  -- 
9
--  the original copyright notice and the associated disclaimer. -- 
10
--                                                               -- 
11
--  This source file is free software; you can redistribute it   -- 
12
--  and/or modify it under the terms of the GNU Lesser General   -- 
13
--  Public License as published by the Free Software Foundation; -- 
14
--  either version 2.1 of the License, or (at your option) any   -- 
15
--  later version.                                               -- 
16
--                                                               -- 
17
--  This source is distributed in the hope that it will be       -- 
18
--  useful, but WITHOUT ANY WARRANTY; without even the implied   -- 
19
--  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      -- 
20
--  PURPOSE.  See the GNU Lesser General Public License for more -- 
21
--  details.                                                     -- 
22
--                                                               -- 
23
--  You should have received a copy of the GNU Lesser General    -- 
24
--  Public License along with this source; if not, download it   -- 
25
--  from http://www.opencores.org/lgpl.shtml                     -- 
26
--                                                               -- 
27
------------------------------------------------------------------- 
28 2 nuxi1209
 
29
LIBRARY ieee;
30
USE     ieee.std_logic_1164.all;
31
USE ieee.std_logic_unsigned.all;
32
 
33
ENTITY pipelines_without_reset IS
34
        GENERIC (gBUS_WIDTH : integer := 1; gNB_PIPELINES: integer range 1 to 255 := 2);
35
        PORT(
36
                iClk                            : IN            STD_LOGIC;
37
                iInput                          : IN            STD_LOGIC;
38
                ivInput                         : IN            STD_LOGIC_VECTOR(gBUS_WIDTH-1 downto 0);
39
                oDelayed_output         : OUT           STD_LOGIC;
40
                ovDelayed_output        : OUT           STD_LOGIC_VECTOR(gBUS_WIDTH-1 downto 0)
41
        );
42
END pipelines_without_reset;
43
 
44
ARCHITECTURE behavioral OF pipelines_without_reset IS
45
 
46
        type tPipeline_stages is array(gNB_PIPELINES downto 1) of std_logic_vector(gBUS_WIDTH-1 downto 0);
47
        signal svPipeline_stages        : tPipeline_stages;
48
 
49
        type single_bit_pipe_stage is array(gNB_PIPELINES downto 1) of std_logic;
50
        signal sPipeline_stages : single_bit_pipe_stage;
51
 
52
BEGIN
53
        ovDelayed_output <= svPipeline_stages(gNB_PIPELINES);
54
        oDelayed_output <= sPipeline_stages(gNB_PIPELINES);
55
 
56
        more_than_one_pipe:
57
        if (gNB_PIPELINES > 1) generate
58
                pipelinesGen:
59
                for i in 2 TO gNB_PIPELINES generate
60
                        process(iClk)
61
                        begin
62
                                if rising_edge(iClk) then
63
                                        svPipeline_stages(i) <= svPipeline_stages(i-1);
64
                                        sPipeline_stages(i) <= sPipeline_stages(i-1);
65
                                end if;
66
                        end process;
67
                end generate;
68
        end generate more_than_one_pipe;
69
 
70
        process(iClk)
71
        begin
72
                if rising_edge(iClk) then
73
                        svPipeline_stages(1) <= ivInput;
74
                        sPipeline_stages(1) <= iInput;
75
                end if;
76
        end process;
77
 
78
 
79
END behavioral;
80
 

powered by: WebSVN 2.1.0

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