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

Subversion Repositories manchesterwireless

[/] [manchesterwireless/] [trunk/] [waitForStart/] [waitForStart.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 kingmu
-----------------------------------------------------------------------------
2
--      Copyright (C) 2009 Sam Green
3
--
4
-- This code is free software; you can redistribute it and/or
5
-- modify it under the terms of the GNU Lesser General Public
6
-- License as published by the Free Software Foundation; either
7
-- version 2.1 of the License, or (at your option) any later version.
8
--
9
-- This code 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 GNU
12
-- Lesser General Public License for more details.
13
--
14
--
15
--  Revision  Date        Author                Comment
16
--  --------  ----------  --------------------  ----------------
17
--  1.0       09/06/09    S. Green              Initial version
18
-----------------------------------------------------------------------------
19
 
20
library ieee;
21
use ieee.std_logic_1164.all;
22
use ieee.numeric_std.all;
23
use work.globals.all;
24
 
25
entity waitForStart is
26
  port (
27
    data_i : in  std_logic;
28
    clk_i : in  std_logic;
29
    rst_i : in std_logic;
30
    ready_o : out  std_logic
31
  );
32
end waitForStart;
33
 
34
architecture behavioral of waitForStart is
35
begin
36
  process (clk_i, rst_i)
37
    variable counter : integer;
38
    variable lock : std_logic;
39
  begin
40
    if (rst_i = '1') then
41
      ready_o <= '0';
42
      counter := 0;
43
      lock := '0';
44
    elsif rising_edge(clk_i) then
45
      if data_i = '1' then
46
        counter := counter + 1;
47
      else
48
        counter := 0;
49
      end if;
50
 
51
      if counter > INTERVAL_QUADRUPLE or lock = '1' then
52
        ready_o <= '1';
53
        lock := '1';
54
      else
55
        ready_o <= '0';
56
      end if;
57
    end if;
58
  end process;
59
 
60
 end behavioral;
61
 

powered by: WebSVN 2.1.0

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