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

Subversion Repositories bluetooth

[/] [bluetooth/] [trunk/] [code/] [cores/] [correlator/] [core/] [correlator.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 khatib
-------------------------------------------------------------------------------
2
-- Title      :  Correlator
3
-- Project    :  Bluetooth baseband core
4
-------------------------------------------------------------------------------
5
-- File        : correlator.vhd
6
-- Author      : Jamil Khatib  (khatib@ieee.org)
7
-- Organization: OpenIPCore Project
8
-- Created     : 2000/12/18
9
-- Last update : 2000/12/18
10
-- Platform    : 
11
-- Simulators  : Modelsim 5.3XE/Windows98
12
-- Synthesizers: Leonardo/WindowsNT
13
-- Target      : 
14
-- Dependency  : ieee.std_logic_1164
15
-------------------------------------------------------------------------------
16
-- Description: correlator core
17
-------------------------------------------------------------------------------
18
-- Copyright (c) 2000 Jamil Khatib
19
-- 
20
-- This VHDL design file is an open design; you can redistribute it and/or
21
-- modify it and/or implement it after contacting the author
22
-- You can check the draft license at
23
-- http://www.opencores.org/OIPC/license.shtml
24
 
25
-------------------------------------------------------------------------------
26
-- Revisions  :
27
-- Revision Number :   1
28
-- Version         :   0.1
29
-- Date            :   18 Nov 2000
30
-- Modifier        :   Jamil Khatib (khatib@ieee.org)
31
-- Desccription    :   Created
32
-- Known bugs      :   
33
-- To Optimze      :   
34
-------------------------------------------------------------------------------
35
library ieee;
36
use ieee.std_logic_1164.all;
37
 
38
entity correlator_core_ent is
39
  generic (
40
    REG_WIDTH :     integer := 72);     -- Register width
41
  port (
42
    clk       : in  std_logic;          -- system clock
43
    rst       : in  std_logic;          -- system reset
44
    Din       : in  std_logic;          -- Input Data
45
    Dout      : out std_logic;          -- Output Data
46
    enable    : in  std_logic;          -- correlator enable
47
    pattern   : in  std_logic_vector(REG_WIDTH-1 downto 0);  -- Match pattern
48
    Threshold : out std_logic_vector(REG_WIDTH-1 downto 0));  -- Threshold
49
 
50
end correlator_core_ent;
51
 
52
 
53
architecture correlator_core_beh of correlator_core_ent is
54
  signal data_reg    : std_logic_vector(REG_WIDTH-1 downto 0);  -- data register
55
  signal pattern_reg : std_logic_vector(REG_WIDTH-1 downto 0);  -- pattern register
56
begin  -- correlator_core_beh
57
 
58
  -- purpose: Correlator core
59
  -- type   : sequential
60
  -- inputs : clk, rst
61
  -- outputs: 
62
  correlate_proc : process (clk, rst)
63
 
64
 
65
 
66
  begin  -- process correlate_proc
67
    if rst = '0' then                   -- asynchronous reset (active low)
68
 
69
      data_reg    <= (others => '0');
70
      pattern_reg <= (others => '0');
71
      Dout        <= '0';
72
      Threshold   <= (others => '0');
73
    elsif clk'event and clk = '1' then  -- rising clock edge
74
 
75
      if enable = '1' then
76
 
77
        pattern_reg <= pattern;
78
 
79
      else
80
 
81
        data_reg  <= Din & data_reg(REG_WIDTH-1 downto 1);
82
        Threshold <= data_reg xor pattern_reg;
83
 
84
      end if;
85
 
86
      Dout <= data_reg(0);
87
 
88
    end if;
89
  end process correlate_proc;
90
 
91
end correlator_core_beh;

powered by: WebSVN 2.1.0

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