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

Subversion Repositories btc_dsha256

[/] [btc_dsha256/] [trunk/] [rtl/] [vhdl/] [misc/] [HandShake.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
library ieee;
29
use ieee.std_logic_1164.all;
30
use ieee.std_logic_unsigned.all;
31
 
32
entity HandShake is port
33
        (
34
                iResetSync_Clk                  : in            std_logic;                                              -- Active Hi Reset
35
                iClk                                    : in            std_logic;                                              -- Clock         
36
 
37
                iExternalDemand                 : in            std_logic;                                              -- Async External Demand : one positive pulse
38
                oInternalDemand                 : out           std_logic;                                              -- Sync with iClk Internal demand 
39
                iInternalClrDemand              : in            std_logic                                               -- Clr Internal Demand
40
                );
41
end HandShake;
42
 
43
architecture HandShake of HandShake is
44
 
45
        signal sClrDemand                       :       std_logic;
46
        signal sAsyncDemand                     :       std_logic;
47
        signal sAsyncDemandPipe         :       std_logic;
48
 
49
 
50
 
51
begin
52
 
53
 
54
        -- Edge detection for Tranfer requests
55
 
56
        hand_shake_tx_proc:
57
        process(sClrDemand, iResetSync_Clk, iExternalDemand)
58
        begin
59
                if (sClrDemand = '1') or (iResetSync_Clk = '1') then
60
                        sAsyncDemand <= '0';
61
                elsif rising_edge(iExternalDemand) then
62
                        sAsyncDemand <= '1';
63
                end if;
64
        end process hand_shake_tx_proc;
65
 
66
        sync_tx_proc:
67
        process(iClk)
68
        begin
69
                if rising_edge(iClk) then
70
                        if (iResetSync_Clk = '1') then
71
                                oInternalDemand         <= '0';
72
                                sClrDemand                      <= '0';
73
                                sAsyncDemandPipe        <= '0';
74
                        else
75
                                if iInternalClrDemand = '1' then
76
                                        sClrDemand                      <= '1';
77
                                        sAsyncDemandPipe    <= '0';
78
                                        oInternalDemand         <= '0';
79
                                else
80
                                        sAsyncDemandPipe        <= sAsyncDemand;
81
                                        oInternalDemand         <= sAsyncDemandPipe;
82
                                        sClrDemand                      <= '0';
83
                                end if;
84
                        end if;
85
                end if;
86
        end process sync_tx_proc;
87
 
88
 
89
end HandShake;
90
 

powered by: WebSVN 2.1.0

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