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/] [FSM_SEL_HEADER.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:    12:59:05 05/03/2011 
6
-- Design Name: 
7
-- Module Name:    FSM_SEL_HEADER - 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 FSM_SEL_HEADER is
31
    Port ( rst : in  STD_LOGIC;
32
           clk : in  STD_LOGIC;
33
           usr_phase_en : in  STD_LOGIC;
34
           sel : out  STD_LOGIC);
35
end FSM_SEL_HEADER;
36
 
37
architecture Behavioral of FSM_SEL_HEADER is
38
 
39
TYPE state is (rst_state,
40
                                        idle_state,
41
                                        header_state,
42
                                        data_state
43
                                        );
44
 
45
signal current_st,next_st: state;
46
 
47
begin
48
 
49
process(clk)
50
begin
51
if (rst='1') then
52
        current_st<= rst_state;
53
elsif (clk'event and clk='1') then
54
        current_st <= next_st;
55
end if;
56
end process;
57
 
58
process(current_st,usr_phase_en)
59
begin
60
case current_st is
61
 
62
when rst_state =>
63
 
64
        sel<='0';
65
 
66
        next_st<=idle_state;
67
 
68
when idle_state =>
69
 
70
        sel<='0';
71
 
72
        if usr_phase_en='1' then
73
                next_st <= header_state;
74
        else
75
                next_st <= idle_state;
76
        end if;
77
 
78
when header_state =>
79
 
80
        sel<='1';
81
 
82
        next_st <= data_state;
83
 
84
when data_state =>
85
 
86
        sel<='0';
87
 
88
        if usr_phase_en='1' then
89
                next_st <= data_state;
90
        else
91
                next_st <= rst_state;
92
        end if;
93
 
94
end case;
95
end process;
96
 
97
end Behavioral;
98
 

powered by: WebSVN 2.1.0

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