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/] [TARGET_EOF.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:    16:22:56 11/30/2009 
6
-- Design Name: 
7
-- Module Name:    TARGET_EOF - 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 TARGET_EOF is
31
    Port ( rst : in  STD_LOGIC;
32
           clk : in  STD_LOGIC;
33
           start : in  STD_LOGIC;
34
                          total_length_from_reg : in STD_LOGIC_VECTOR(15 downto 0);
35
           eof_O : out  STD_LOGIC);
36
end TARGET_EOF;
37
 
38
architecture Behavioral of TARGET_EOF is
39
 
40
signal count_end : std_logic:='0';
41
signal count_en_sig : std_logic:='0';
42
signal rst_counter : std_logic:='0';
43
 
44
component COUNTER_11B_EN_TRANS is
45
    Port ( rst : in  STD_LOGIC;
46
           clk : in  STD_LOGIC;
47
           count_en : in  STD_LOGIC;
48
           value_O : inout  STD_LOGIC_VECTOR (10 downto 0));
49
end component;
50
 
51
signal value_O_tmp : std_logic_vector(10 downto 0);
52
 
53
component comp_11b_equal is
54
  port (
55
    qa_eq_b : out STD_LOGIC;
56
    clk : in STD_LOGIC := 'X';
57
    a : in STD_LOGIC_VECTOR ( 10 downto 0 );
58
    b : in STD_LOGIC_VECTOR ( 10 downto 0 )
59
  );
60
end component;
61
 
62
signal last_byte,last_byte_reg_in,last_byte_reg_out : std_logic;
63
 
64
begin
65
 
66
process(clk)
67
begin
68
if (rst='1' or count_end='1') then
69
        count_en_sig<='0';
70
        rst_counter<='1';
71
else
72
   rst_counter<='0';
73
        if clk'event and clk='1' then
74
                if (start='1' and count_en_sig='0') then
75
                        count_en_sig<='1';
76
                end if;
77
        end if;
78
end if;
79
end process;
80
 
81
 
82
COUNT_TRANFERED_BYTES : COUNTER_11B_EN_TRANS port map
83
(         rst =>rst_counter,
84
          clk =>clk,
85
          count_en => count_en_sig,
86
          value_O =>value_O_tmp
87
);
88
 
89
COMP_TO_TARGET_LAST_BYTE : comp_11b_equal port map
90
(
91
   qa_eq_b =>last_byte_reg_in,
92
    clk =>clk,
93
    a =>value_O_tmp,
94
    b =>total_length_from_reg(10 downto 0)
95
);
96
 
97
process(clk)
98
begin
99
if clk'event and clk='1' then
100
        last_byte_reg_out<=last_byte_reg_in;
101
end if;
102
end process;
103
eof_O<=not last_byte_reg_out;
104
count_end<=last_byte_reg_out;
105
end Behavioral;
106
 

powered by: WebSVN 2.1.0

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