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

Subversion Repositories pc_fpga_com

[/] [pc_fpga_com/] [trunk/] [PC_FPGA_PLATFPORM/] [HARDWARE/] [D_TYPE_LEN_CNTRL.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:    11:37:32 05/03/2011 
6
-- Design Name: 
7
-- Module Name:    D_TYPE_LEN_CNTRL - 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 D_TYPE_LEN_CNTRL is
31
    Port ( rst : in  STD_LOGIC;
32
           clk : in  STD_LOGIC;
33
           locked : in  STD_LOGIC;
34
           trans_en : in  STD_LOGIC;
35
           d_type : in  STD_LOGIC_VECTOR (2 downto 0);
36
           d_len : in  STD_LOGIC_VECTOR (15 downto 0);
37
           d_type_byte : out  STD_LOGIC_VECTOR (7 downto 0);
38
           d_length_out : out  STD_LOGIC_VECTOR (15 downto 0));
39
end D_TYPE_LEN_CNTRL;
40
 
41
architecture Behavioral of D_TYPE_LEN_CNTRL is
42
 
43
begin
44
 
45
process(clk)
46
begin
47
if rst='1' then
48
        d_type_byte <= "00000000";
49
        d_length_out <= "0000000000000000";
50
else
51
        if clk'event and clk='1' then
52
                if locked='1' then
53
                        if trans_en = '1' then
54
                                if d_type="001" then
55
                                        d_type_byte(2 downto 0) <= d_type;
56
                                        d_length_out <= d_len+ "0000000000000001";
57
                                elsif d_type="010" then
58
                                        d_type_byte(2 downto 0) <= d_type;
59
                                        d_length_out(15 downto 1) <= d_len(14 downto 0);
60
                                        d_length_out(0)<='1';
61
                                elsif d_type="011" then
62
                                        d_type_byte(2 downto 0) <= d_type;
63
                                        d_length_out(15 downto 2) <= d_len(13 downto 0);
64
                                        d_length_out(1 downto 0)<="01";
65
                                elsif d_type="100" then
66
                                        d_type_byte(2 downto 0) <= d_type;
67
                                        d_length_out(15 downto 2) <= d_len(13 downto 0);
68
                                        d_length_out(1 downto 0)<="01";
69
                                elsif d_type="101" then
70
                                        d_type_byte(2 downto 0) <= d_type;
71
                                        d_length_out(15 downto 3) <= d_len(12 downto 0);
72
                                        d_length_out(2 downto 0)<="001";
73
                                elsif d_type="110" then
74
                                        d_type_byte(2 downto 0) <= d_type;
75
                                        d_length_out(15 downto 3) <= d_len(12 downto 0);
76
                                        d_length_out(2 downto 0)<="001";
77
                                else
78
                                        d_type_byte <= "00000000";
79
                                        d_length_out <= "0000000000000001";
80
                                end if;
81
                        end if;
82
                else
83
                        d_type_byte <= "00000000";
84
                        d_length_out <= "0000000000000001";
85
                end if;
86
        end if;
87
end if;
88
end process;
89
 
90
 
91
end Behavioral;
92
 

powered by: WebSVN 2.1.0

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