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/] [FLEX_CONTROL.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:    15:06:05 01/12/2011 
6
-- Design Name: 
7
-- Module Name:    FLEX_CONTROL - 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 FLEX_CONTROL is
31
    Port ( rst : in  STD_LOGIC;
32
           clk : in  STD_LOGIC;
33
           r_sof : in  STD_LOGIC;
34
                          r_usrvld : in STD_LOGIC;
35
           r_data : in  STD_LOGIC_VECTOR (7 downto 0);
36
                          r_usrdata: in STD_LOGIC_VECTOR (7 downto 0);
37
           r_eof : in  STD_LOGIC;
38
           l_wren : out  STD_LOGIC;
39
           l_addr : out  STD_LOGIC_VECTOR (5 downto 0);
40
           l_data : out  STD_LOGIC_VECTOR (7 downto 0);
41
                          checksum_baseval : out STD_LOGIC_VECTOR(15 downto 0);
42
                          locked : out  STD_LOGIC
43
                          );
44
end FLEX_CONTROL;
45
 
46
architecture Behavioral of FLEX_CONTROL is
47
 
48
component MATCH_CMD_CODE is
49
    Port ( clk : in  STD_LOGIC;
50
                     vld : in  STD_LOGIC;
51
           data_in : in  STD_LOGIC_VECTOR(7 downto 0);
52
           eof : in  STD_LOGIC;
53
           cmd_code : in  STD_LOGIC_VECTOR (7 downto 0);
54
           sig_out : out  STD_LOGIC);
55
end component;
56
 
57
component MATCH_CMD is
58
    Port ( rst : in  STD_LOGIC;
59
           clk : in  STD_LOGIC;
60
           sof : in  STD_LOGIC;
61
           vld_i : in  STD_LOGIC;
62
           val_i : in  STD_LOGIC_VECTOR (7 downto 0);
63
                          cmd_to_match : in  STD_LOGIC_VECTOR(7 downto 0);
64
           cmd_match : out  STD_LOGIC);
65
end component;
66
 
67
signal config_en, ulock_en, wren_checksum_1, wren_checksum_2,local_rst: std_logic;
68
 
69
component CONFIG_CONTROL is
70
    Port ( rst : in  STD_LOGIC;
71
           clk : in  STD_LOGIC;
72
           config_en : in  STD_LOGIC;
73
                          nxt_sof : in STD_LOGIC;
74
                          wren : out  STD_LOGIC;
75
           addr : out  STD_LOGIC_VECTOR (5 downto 0);
76
                          ulock_en : in  STD_LOGIC;
77
                          wren_checksum_1 : out STD_LOGIC;
78
                          wren_checksum_2 : out STD_LOGIC;
79
                          locked : out  STD_LOGIC
80
                        );
81
end component;
82
 
83
signal checksum_baseval_t: std_logic_vector(15 downto 0);
84
 
85
begin
86
 
87
MATCH_RST_CODE: MATCH_CMD Port Map
88
( rst => rst,
89
  clk => clk,
90
  sof => r_sof,
91
  vld_i => r_usrvld,
92
  val_i => r_usrdata,
93
  cmd_to_match => "00001111",
94
  cmd_match => config_en
95
 );
96
 
97
ulock_en <= '0';
98
 
99
CONFIG_CONTROL_FSM: CONFIG_CONTROL Port Map
100
( rst => rst,
101
  clk => clk,
102
  config_en => config_en,
103
  nxt_sof => r_sof,
104
  wren => l_wren,
105
  addr => l_addr,
106
  ulock_en => ulock_en,
107
  wren_checksum_1 => wren_checksum_1,
108
  wren_checksum_2 => wren_checksum_2,
109
  locked => locked
110
);
111
 
112
process(clk)
113
begin
114
if rst = '1' then
115
        checksum_baseval_t <= (others=>'0');
116
else
117
        if clk'event and clk='1' then
118
                if wren_checksum_1='1' then
119
                        checksum_baseval_t(15 downto 8) <= r_data;
120
                end if;
121
                if wren_checksum_2='1' then
122
                        checksum_baseval_t(7 downto 0) <= r_data;
123
                end if;
124
        end if;
125
end if;
126
end process;
127
 
128
checksum_baseval <= checksum_baseval_t;
129
 
130
process(clk)
131
begin
132
if clk'event and clk='1' then
133
        l_data <= r_data;
134
end if;
135
end process;
136
 
137
end Behavioral;
138
 

powered by: WebSVN 2.1.0

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