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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [reg_file_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       = REG_FILE             --
19
--  version      = 1.0                      --
20
--  last update  = 11/09/00         --
21
--  author       = Jose Nunez           --
22
------------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- 16 bit wide treshold register
27
 
28
 
29
--  PIN LIST
30
 
31
 
32
--  DIN   = 16 bit input data
33
 
34
--  ADDRESS = 2 bit to address 
35
 
36
--  RW = read and write
37
 
38
--  ENABLE = enable the load
39
--  CLEAR = asynchronous clear of register
40
--  CLK   = clock
41
--  DOUT  = 16 bit output of flip-flops
42
 
43
--  C_BS_OUT = compressed block size 
44
 
45
--  U_BS_OUT = uncompressed block size
46
 
47
--  START_C = start the compression engine
48
 
49
--  START_D = start the decompression engine
50
 
51
--  STOP = stop the process
52
 
53
--  THRESHOLD_LEVEL = the threshold level of the buffers
54
 
55
 
56
 
57
library ieee,dzx;
58
use ieee.std_logic_1164.all;
59
use dzx.attributes.all;
60
 
61
entity REG_FILE_D is
62
port
63
(
64
      DIN : in bit_vector(31 downto 0);
65
          ADDRESS : in bit_vector(1 downto 0);
66
          CRC_IN : in bit_vector(31 downto 0);
67
          LOAD_CRC : in bit;
68
      RW : in bit;
69
      CLEAR_CR : in bit;
70
      ENABLE : in bit;
71
      CLEAR : in bit;
72
        CLK : in bit;
73
        DOUT : out std_logic_vector(31 downto 0);
74
        C_BS_OUT : out bit_vector(31 downto 0);
75
        U_BS_OUT : out bit_vector(31 downto 0);
76
        CRC_OUT : out bit_vector(31 downto 0);
77
        START_D : out bit;
78
        STOP :out bit;
79
        THRESHOLD_LEVEL : out bit_vector(7 downto 0)
80
 
81
);
82
end REG_FILE_D;
83
 
84
 
85
architecture LATCH of REG_FILE_D is
86
 
87
component CONTROL_REG
88
port
89
(
90
      DIN : in bit_vector(31 downto 0);
91
      ENABLE : in bit;
92
      CLEAR : in bit;
93
        CLK : in bit;
94
      DOUT : out bit_vector(31 downto 0)
95
);
96
end component;
97
 
98
type TYPE_ARRAY is array(3 downto 0) of bit_vector(31 downto 0);
99
signal ARRAY_OUT : TYPE_ARRAY;
100
 
101
signal ENABLE_INT : bit_vector(3 downto 0);
102
signal ENABLE_CODE : bit_vector(3 downto 0);
103
 
104
 
105
signal ENABLE_REG_CBS : bit;
106
signal DIN_REG_CBS: bit_vector(31 downto 0);
107
 
108
 
109
 
110
signal ENABLE_REG_CR : bit;
111
signal DIN_REG_CR: bit_vector(31 downto 0);
112
 
113
 
114
 
115
signal ENABLE_REG_CRC : bit;
116
 
117
signal DIN_REG_CRC: bit_vector(31 downto 0);
118
 
119
 
120
 
121
 
122
 
123
 
124
begin
125
 
126
ENABLE_CODE <= ADDRESS & RW & ENABLE;
127
 
128
-- RW write =0
129
-- ENABLE active =0
130
 
131
WRITE : process(ENABLE_CODE)
132
begin
133
case ENABLE_CODE is
134
    when "0000" => ENABLE_INT <= "0001";
135
    when "0100" => ENABLE_INT <= "0010";
136
    when "1000" => ENABLE_INT <= "0100";
137
        when "1100" => ENABLE_INT <= "1000";
138
    when others => ENABLE_INT <= "0000";
139
end case;
140
end process WRITE;
141
 
142
READ : process(ENABLE_CODE, ARRAY_OUT)
143
begin
144
case ENABLE_CODE is
145
    when "0010" => DOUT <= To_X01Z(ARRAY_OUT(0));
146
    when "0110" => DOUT <= To_X01Z(ARRAY_OUT(1));
147
    when "1010" => DOUT <= To_X01Z(ARRAY_OUT(2));
148
        when "1110" => DOUT <= To_X01Z(ARRAY_OUT(3));
149
    when others => DOUT  <= X"00000000";
150
end case;
151
end process READ;
152
 
153
 
154
 
155
REG_CR : CONTROL_REG
156
 
157
port map ( DIN => DIN_REG_CR,
158
 
159
      ENABLE => ENABLE_REG_CR,
160
 
161
      CLEAR => CLEAR,
162
 
163
 
164
      CLK => CLK,
165
 
166
      DOUT => ARRAY_OUT(0));
167
 
168
 
169
 
170
 
171
REG_UBS : CONTROL_REG
172
 
173
port map ( DIN => DIN,
174
      ENABLE => ENABLE_INT(1),
175
      CLEAR => CLEAR,
176
      CLK => CLK,
177
      DOUT => ARRAY_OUT(1));
178
 
179
 
180
 
181
REG_CBS : CONTROL_REG
182
port map ( DIN => DIN_REG_CBS,
183
      ENABLE => ENABLE_REG_CBS,
184
      CLEAR => CLEAR,
185
      CLK => CLK,
186
      DOUT => ARRAY_OUT(2));
187
 
188
 
189
REG_CRC : CONTROL_REG
190
port map ( DIN => DIN_REG_CRC,
191
      ENABLE => ENABLE_REG_CRC,
192
      CLEAR => CLEAR,
193
      CLK => CLK,
194
      DOUT => ARRAY_OUT(3));
195
 
196
 
197
ENABLE_REG_CRC <= ENABLE_INT(3) when LOAD_CRC = '1' else '1';
198
DIN_REG_CRC <= DIN when LOAD_CRC = '1' else CRC_IN;
199
 
200
ENABLE_REG_CBS <= ENABLE_INT(2);
201
DIN_REG_CBS <= DIN;
202
 
203
 
204
ENABLE_REG_CR <= ENABLE_INT(0) when CLEAR_CR = '1' else '1'; -- clear the CR at the end of the decompression phase
205
 
206
DIN_REG_CR <= DIN when CLEAR_CR = '1' else "11111111111111111111111111111111";  -- clear the CR
207
 
208
 
209
CRC_OUT <= ARRAY_OUT(3);
210
C_BS_OUT <= ARRAY_OUT(2);
211
U_BS_OUT <= ARRAY_OUT(1);
212
START_D <= ARRAY_OUT(0)(12) or ARRAY_OUT(0)(15);  -- if both zeros engage decompression engine
213
STOP <= ARRAY_OUT(0)(14);
214
THRESHOLD_LEVEL <= ARRAY_OUT(0)(11 downto 4);
215
--THRESHOLD_LEVEL <= "00001000"; 
216
 
217
 
218
end LATCH;
219
 

powered by: WebSVN 2.1.0

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