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 2

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

Line No. Rev Author Line
1 2 nuxi1209
-- Copyright (c) 2013 VariStream
2
-- Author : Yu Peng 
3
 
4
library ieee;
5
use ieee.std_logic_1164.all;
6
use ieee.std_logic_unsigned.all;
7
 
8
entity HandShake is port
9
        (
10
                iResetSync_Clk                  : in            std_logic;                                              -- Active Hi Reset
11
                iClk                                    : in            std_logic;                                              -- Clock         
12
 
13
                iExternalDemand                 : in            std_logic;                                              -- Async External Demand : one positive pulse
14
                oInternalDemand                 : out           std_logic;                                              -- Sync with iClk Internal demand 
15
                iInternalClrDemand              : in            std_logic                                               -- Clr Internal Demand
16
                );
17
end HandShake;
18
 
19
architecture HandShake of HandShake is
20
 
21
        signal sClrDemand                       :       std_logic;
22
        signal sAsyncDemand                     :       std_logic;
23
        signal sAsyncDemandPipe         :       std_logic;
24
 
25
 
26
 
27
begin
28
 
29
 
30
        -- Edge detection for Tranfer requests
31
 
32
        hand_shake_tx_proc:
33
        process(sClrDemand, iResetSync_Clk, iExternalDemand)
34
        begin
35
                if (sClrDemand = '1') or (iResetSync_Clk = '1') then
36
                        sAsyncDemand <= '0';
37
                elsif rising_edge(iExternalDemand) then
38
                        sAsyncDemand <= '1';
39
                end if;
40
        end process hand_shake_tx_proc;
41
 
42
        sync_tx_proc:
43
        process(iClk)
44
        begin
45
                if rising_edge(iClk) then
46
                        if (iResetSync_Clk = '1') then
47
                                oInternalDemand         <= '0';
48
                                sClrDemand                      <= '0';
49
                                sAsyncDemandPipe        <= '0';
50
                        else
51
                                if iInternalClrDemand = '1' then
52
                                        sClrDemand                      <= '1';
53
                                        sAsyncDemandPipe    <= '0';
54
                                        oInternalDemand         <= '0';
55
                                else
56
                                        sAsyncDemandPipe        <= sAsyncDemand;
57
                                        oInternalDemand         <= sAsyncDemandPipe;
58
                                        sClrDemand                      <= '0';
59
                                end if;
60
                        end if;
61
                end if;
62
        end process sync_tx_proc;
63
 
64
 
65
end HandShake;
66
 

powered by: WebSVN 2.1.0

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