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

Subversion Repositories pc_fpga_com

[/] [pc_fpga_com/] [trunk/] [UDP_IP_CORE_FLEX_Spartan3/] [COUNTER_6B_LUT_FIFO_MODE.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 NikosAl
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    02:30:12 11/30/2009 
6
-- Design Name: 
7
-- Module Name:    COUNTER_6B_LUT_FIFO_MODE - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
use IEEE.STD_LOGIC_ARITH.ALL;
23
use IEEE.STD_LOGIC_UNSIGNED.ALL;
24
 
25
---- Uncomment the following library declaration if instantiating
26
---- any Xilinx primitives in this code.
27
--library UNISIM;
28
--use UNISIM.VComponents.all;
29
 
30
entity COUNTER_6B_LUT_FIFO_MODE is
31
    Port ( rst : in  STD_LOGIC;
32
           clk : in  STD_LOGIC;
33
           funct_sel : in  STD_LOGIC; -- 0 for lut addressing, 1 for fifo addressing
34
           count_en : in  STD_LOGIC;
35
           value_O : inout  STD_LOGIC_VECTOR (5 downto 0));
36
end COUNTER_6B_LUT_FIFO_MODE;
37
 
38
architecture Behavioral of COUNTER_6B_LUT_FIFO_MODE is
39
 
40
begin
41
 
42
process(clk)
43
begin
44
if rst='1' then
45
        if funct_sel='0' then
46
                value_O<=(others=>'0');
47
        else
48
                value_O<="100111";
49
        end if;
50
else
51
        if clk'event and clk='1' then
52
                if count_en='1' then
53
                        value_O<=value_O+"000001";
54
                else
55
                        value_O<=value_O;
56
                end if;
57
        end if;
58
end if;
59
end process;
60
 
61
 
62
end Behavioral;
63
 

powered by: WebSVN 2.1.0

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