]> cvs.zerfleddert.de Git - raggedstone/blame - dhwk/source/pci/connecting_fsm.vhd
correct instance
[raggedstone] / dhwk / source / pci / connecting_fsm.vhd
CommitLineData
696ded12 1-- J.STELZNER
2-- INFORMATIK-3 LABOR
3-- 23.08.2006
4-- File: CONNECTING_FSM.VHD
5
2612d712 6library ieee;
7use ieee.std_logic_1164.all;
696ded12 8
9entity CONNECTING_FSM is
2612d712 10 port
11 (
12 PCI_CLOCK :in std_logic;
13 RESET :in std_logic;
14 PSC_ENABLE :in std_logic;
15 SYNC_S_FIFO_EFn :in std_logic;
16 SPC_ENABLE :in std_logic;
17 SYNC_R_FIFO_FFn :in std_logic;
18 S_FIFO_Q_OUT :in std_logic_vector(7 downto 0);
19 S_FIFO_READn :out std_logic;
20 R_FIFO_WRITEn :out std_logic;
21 R_FIFO_D_IN :out std_logic_vector(7 downto 0)
22 );
696ded12 23end entity CONNECTING_FSM;
24
25architecture CONNECTING_FSM_DESIGN of CONNECTING_FSM is
26
2612d712 27 signal REG :std_logic_vector(7 downto 0);
28 signal HELP_0,HELP_1 :std_logic;
29 signal SIG_LOAD :std_logic;
30
31
32 --**********************************************************
33 --*** CONNECTING FSM CODIERUNG ***
34 --**********************************************************
35 --
36 --
37 -- ---------- HELP_0
38 -- |--------- HELP_1
39 -- ||-------- LOAD
40 -- |||------- WRITE
41 -- ||||------ READ
42 -- |||||
43 constant S0 :std_logic_vector(4 downto 0) := "00011";--
44 constant S1 :std_logic_vector(4 downto 0) := "01010";--READ
45 constant S2 :std_logic_vector(4 downto 0) := "10010";--READ
46 constant S3 :std_logic_vector(4 downto 0) := "11110";--READ,LOAD
47 constant S4 :std_logic_vector(4 downto 0) := "11011";--
48 constant S5 :std_logic_vector(4 downto 0) := "01001";--WRITE
49 constant S6 :std_logic_vector(4 downto 0) := "10001";--WRITE
50 constant S7 :std_logic_vector(4 downto 0) := "11001";--WRITE
51
52 signal STATES :std_logic_vector(4 downto 0);
53
54 --************************************************************
55 --*** FSM SPEICHER-AUTOMAT ***
56 --************************************************************
57
58 attribute syn_state_machine : boolean;
59 attribute syn_state_machine of STATES : signal is false;
696ded12 60
61--************************************************************
2612d712 62--*** REGISTER BESCHREIBUNG ***
696ded12 63--************************************************************
64
2612d712 65begin
696ded12 66
2612d712 67 process (PCI_CLOCK)
68 begin
e687cadb 69 if (rising_edge(PCI_CLOCK)) then
2612d712 70 if SIG_LOAD = '1' then
71 REG <= S_FIFO_Q_OUT;
72
73 elsif SIG_LOAD = '0' then
74 REG <= REG;
75 end if;
76 end if;
77 end process;
78
79 --************************************************************
80 --*** FSM BESCHREIBUNG ***
81 --************************************************************
696ded12 82
2612d712 83process (PCI_CLOCK)
696ded12 84begin
e687cadb 85 if (rising_edge(PCI_CLOCK)) then
696ded12 86
2612d712 87 if RESET = '1' then
88 STATES <= S0;
89 else
696ded12 90
2612d712 91 case STATES is
696ded12 92
2612d712 93 when S0 =>
94 if PSC_ENABLE = '1' and SPC_ENABLE = '1' and SYNC_S_FIFO_EFn = '1' then
95 STATES <= S1;
96 else
97 STATES <= S0;
98 end if;
696ded12 99
2612d712 100 when S1 =>
101 STATES <= S2;
696ded12 102
2612d712 103 when S2 =>
104 STATES <= S3;
696ded12 105
2612d712 106 when S3 =>
107 STATES <= S4;
696ded12 108
2612d712 109 when S4 =>
110 if SYNC_R_FIFO_FFn = '1' then
111 STATES <= S5;
112 else
113 STATES <= S4;
114 end if;
696ded12 115
2612d712 116 when S5 =>
117 STATES <= S6;
696ded12 118
2612d712 119 when S6 =>
120 STATES <= S7;
696ded12 121
2612d712 122 when S7 =>
123 STATES <= S0;
696ded12 124
2612d712 125 when others =>
126 STATES <= S0;
696ded12 127
2612d712 128 end case; -- STATES
129 end if; -- RESET
130 end if; -- PCI_CLOCK
131end process; -- PROCESS
696ded12 132
2612d712 133 --************************************************************
134 --*** ZUWEISUNG signal/out <= STATES ***
135 --************************************************************
696ded12 136
2612d712 137HELP_0 <= STATES(4);
138HELP_1 <= STATES(3);
139SIG_LOAD <= STATES(2);
140R_FIFO_WRITEn <= STATES(1);
141S_FIFO_READn <= STATES(0);
696ded12 142
2612d712 143R_FIFO_D_IN <= REG;
696ded12 144
145end architecture CONNECTING_FSM_DESIGN;
Impressum, Datenschutz