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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [csm_d.vhd] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 eejlny
--This library is free software; you can redistribute it and/or
2
--modify it under the terms of the GNU Lesser General Public
3
--License as published by the Free Software Foundation; either
4
--version 2.1 of the License, or (at your option) any later version.
5
 
6
--This library is distributed in the hope that it will be useful,
7
--but WITHOUT ANY WARRANTY; without even the implied warranty of
8
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9
--Lesser General Public License for more details.
10
 
11
--You should have received a copy of the GNU Lesser General Public
12
--License along with this library; if not, write to the Free Software
13
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
14
 
15
-- e_mail : j.l.nunez-yanez@byacom.co.uk
16
 
17
---------------------------------
18
--  ENTITY       = CSM         --
19
--  version      = 4.0         --
20
--  last update  = 20/04/00    --
21
--  author       = Jose Nunez --
22
---------------------------------
23
 
24
 
25
-- FUNCTION
26
-- control state machine.
27
 
28
 
29
--  PIN LIST
30
--  START        = indicates start of a compress or decompress operation
31
--  STOP         = forces the end of the current operation
32
--  COMPRESS     = selects compression mode
33
--  DECOMPRESS   = selects decompression mode
34
--  CLEAR        = asyncronous clear
35
--  END_OF_BLOCK = indicates that a complete block has been processed
36
--  FLUSH_END    = indicates end of flushing cycle during compression
37
--  CLK          = master clock
38
--  COMP         = indicates unit is compressing data
39
--  DECOMP       = indicates unit is decompressing data
40
--  FLUSH        = indicates unit is in a flush cycle during compression
41
--  FINISH       = end of current operation
42
--  LOAD_BS      = load block size for the current operation
43
--  INC_TC       = increment tuple counter
44
--  MOVE_ENABLE  = enable movement logic for the CAM array
45
--  CLEAR_INT    = asynchronously clear (or preset) all internal storage
46
 
47
 
48
library ieee;
49
use ieee.std_logic_1164.all;
50
 
51
entity CSM_D is
52
port
53
(
54
        START_C : in bit; -- start test mode
55
        START_D : in bit; -- load BS
56
        START_D_ENGINE : in bit; -- start engine
57
        STOP : in bit ;
58
        END_OF_BLOCK : in bit ;
59
        CLK : in bit ;
60
        CLEAR : in bit ;
61
        DECOMP : out bit ;
62
        FINISH : out bit ;
63
        MOVE_ENABLE : out bit ;
64
        RESET : out bit
65
);
66
 
67
 
68
end CSM_D;
69
 
70
architecture STATE of CSM_D is
71
 
72
 
73
 
74
--State S9 to delay the activation of the counter incrementation due to pipeline
75
--Now State S6 111001001111 INC disable same as S9
76
 
77
signal CURRENT_STATE : bit_vector(3 downto 0);
78
signal NEXT_STATE : bit_vector(3 downto 0);
79
signal CLEAR_AUX : bit;
80
 
81
 
82
begin
83
 
84
 
85
 
86
COMBINATIONAL : process (CURRENT_STATE , START_C, START_D, START_D_ENGINE, STOP , END_OF_BLOCK)
87
begin
88
 
89
case CURRENT_STATE is
90
        -- state S0
91
        when "1110" =>
92
                        if (((START_C = '0') or (START_D = '0'))) then
93
                                NEXT_STATE <= "1111";   -- goto state S10 load the BS
94
                        else
95
                                NEXT_STATE <= CURRENT_STATE;    -- remain in current state
96
                        end if;
97
 
98
        -- I am going to set bits 1 and 3 to 1 to activate the count for decompressing later due to pipelining
99
        -- state S6
100
        when "1011" =>
101
                        NEXT_STATE <= "1001";   -- goto state S7
102
 
103
        -- state S7
104
        when "1001" =>
105
                if ((END_OF_BLOCK = '0')) then
106
                        NEXT_STATE <= "0110";   -- goto state S8
107
                else
108
                     NEXT_STATE <= CURRENT_STATE;       -- remain in current state
109
                end if;
110
 
111
        -- state S8
112
        when "0110" =>
113
                        NEXT_STATE <= "1110";   -- goto state S0
114
 
115
        -- state S11 wait for the order to start decompression engine
116
        when "1111"=>
117
                if ((START_D_ENGINE = '0')) then
118
                                NEXT_STATE <= "1011";   -- goto state S6 
119
                        else
120
                                NEXT_STATE <= CURRENT_STATE;    -- remain in current state
121
                        end if;
122
 
123
 
124
        -- anything else (illegal states)
125
        when others =>
126
                NEXT_STATE <= "1110";   -- goto state S0
127
 
128
 
129
 
130
end case;
131
 
132
 
133
end process COMBINATIONAL;
134
 
135
 
136
 
137
FLIP_FLOPS : process(CLK,CLEAR)
138
 
139
begin
140
 
141
if (CLEAR = '0') then
142
        CURRENT_STATE <= "1110";        -- reset state is S0
143
elsif ((CLK'event) and (CLK='1')) then
144
        if ( STOP = '0') then
145
                        CURRENT_STATE <= "1110";        -- reset state is S0
146
  else
147
             CURRENT_STATE <= NEXT_STATE;               -- otherwise latch next state
148
  end if;
149
end if;
150
 
151
end process FLIP_FLOPS;
152
 
153
-- assign outputs directly from state register (Moore machine with registered outputs)
154
 
155
FINISH <= CURRENT_STATE(3) and END_OF_BLOCK;
156
DECOMP <= CURRENT_STATE(2);
157
MOVE_ENABLE <= CURRENT_STATE(1);
158
RESET <= CURRENT_STATE(0);
159
 
160
 
161
end STATE;  -- end of architecture
162
 
163
 
164
 

powered by: WebSVN 2.1.0

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