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

Subversion Repositories dirac

[/] [dirac/] [tags/] [dirac_0_0_1_0/] [src/] [decoder/] [STORAGE_REGISTER.vhd] - Blame information for rev 14

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 petebleack
-- ***** BEGIN LICENSE BLOCK *****
2
-- 
3
-- $Id: STORAGE_REGISTER.vhd,v 1.1.1.1 2005-03-30 10:09:49 petebleackley Exp $ $Name: not supported by cvs2svn $
4
-- *
5
-- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
-- *
7
-- * The contents of this file are subject to the Mozilla Public License
8
-- * Version 1.1 (the "License"); you may not use this file except in compliance
9
-- * with the License. You may obtain a copy of the License at
10
-- * http://www.mozilla.org/MPL/
11
-- *
12
-- * Software distributed under the License is distributed on an "AS IS" basis,
13
-- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
14
-- * the specific language governing rights and limitations under the License.
15
-- *
16
-- * The Original Code is BBC Research and Development code.
17
-- *
18
-- * The Initial Developer of the Original Code is the British Broadcasting
19
-- * Corporation.
20
-- * Portions created by the Initial Developer are Copyright (C) 2004.
21
-- * All Rights Reserved.
22
-- *
23
-- * Contributor(s): Peter Bleackley (Original author)
24
-- *
25
-- * Alternatively, the contents of this file may be used under the terms of
26
-- * the GNU General Public License Version 2 (the "GPL"), or the GNU Lesser
27
-- * Public License Version 2.1 (the "LGPL"), in which case the provisions of
28
-- * the GPL or the LGPL are applicable instead of those above. If you wish to
29
-- * allow use of your version of this file only under the terms of the either
30
-- * the GPL or LGPL and not to allow others to use your version of this file
31
-- * under the MPL, indicate your decision by deleting the provisions above
32
-- * and replace them with the notice and other provisions required by the GPL
33
-- * or LGPL. If you do not delete the provisions above, a recipient may use
34
-- * your version of this file under the terms of any one of the MPL, the GPL
35
-- * or the LGPL.
36
-- * ***** END LICENSE BLOCK ***** */
37
 
38
 
39
library IEEE;
40
use IEEE.STD_LOGIC_1164.ALL;
41
use IEEE.STD_LOGIC_ARITH.ALL;
42
use IEEE.STD_LOGIC_UNSIGNED.ALL;
43
 
44
--  Uncomment the following lines to use the declarations that are
45
--  provided for instantiating Xilinx primitive components.
46
--library UNISIM;
47
--use UNISIM.VComponents.all;
48
 
49
entity STORAGE_REGISTER is
50
    Port ( LOAD : in std_logic_vector(15 downto 0);
51
                          SHIFT_IN : in std_logic;
52
           SET_VALUE : in std_logic;
53
           SHIFT_ALL : in std_logic;
54
           SHIFT_MOST : in std_logic;
55
                          RESET : in std_logic;
56
           CLOCK : in std_logic;
57
           OUTPUT : out std_logic_vector(15 downto 0));
58
end entity STORAGE_REGISTER;
59
 
60
architecture RTL of STORAGE_REGISTER is
61
        component STORE_BLOCK
62
        port(LOAD_IN, SHIFT_IN, SHIFT, ENABLE, CLK:     in std_logic;
63
        OUTPUT: out std_logic);
64
        end component STORE_BLOCK;
65
        signal SHIFT_LSBS: std_logic;
66
        signal SET_RESET: std_logic;
67
        signal ENABLE_MSB: std_logic;
68
        signal ENABLE_LSBS: std_logic;
69
        signal D0,D1,D2,D3,D4,D5,D6,D7,D8,D9,D10,D11,D12,D13,D14,D15:   std_logic;
70
        signal Q0,Q1,Q2,Q3,Q4,Q5,Q6,Q7,Q8,Q9,Q10,Q11,Q12,Q13,Q14,Q15:   std_logic;
71
begin
72
 
73
-- control logic
74
        SET_RESET <= SET_VALUE or RESET;
75
        ENABLE_MSB <= SET_RESET or SHIFT_ALL;
76
        SHIFT_LSBS <= SHIFT_ALL or SHIFT_MOST;
77
        ENABLE_LSBS <= SET_RESET or SHIFT_LSBS;
78
 
79
-- outputs
80
 
81
        OUTPUT(0) <= Q0;
82
        OUTPUT(1) <= Q1;
83
        OUTPUT(2) <= Q2;
84
        OUTPUT(3) <= Q3;
85
        OUTPUT(4) <= Q4;
86
        OUTPUT(5) <= Q5;
87
        OUTPUT(6) <= Q6;
88
        OUTPUT(7) <= Q7;
89
        OUTPUT(8) <= Q8;
90
        OUTPUT(9) <= Q9;
91
        OUTPUT(10) <= Q10;
92
        OUTPUT(11) <= Q11;
93
        OUTPUT(12) <= Q12;
94
        OUTPUT(13) <= Q13;
95
        OUTPUT(14) <= Q14;
96
        OUTPUT(15) <= Q15;
97
 
98
-- initialisation
99
 
100
INIT:   process(RESET,LOAD)
101
begin
102
        if RESET = '1' then
103
        D0 <= '0';
104
        D1 <= '0';
105
        D2 <= '0';
106
        D3 <= '0';
107
        D4 <= '0';
108
        D5 <= '0';
109
        D6 <= '0';
110
        D7 <= '0';
111
        D8 <= '0';
112
        D9 <= '0';
113
        D10 <= '0';
114
        D11 <= '0';
115
        D12 <= '0';
116
        D13 <= '0';
117
        D14 <= '0';
118
        D15 <= '0';
119
        else
120
        D0 <= LOAD(0);
121
        D1 <= LOAD(1);
122
        D2 <= LOAD(2);
123
        D3 <= LOAD(3);
124
        D4 <= LOAD(4);
125
        D5 <= LOAD(5);
126
        D6 <= LOAD(6);
127
        D7 <= LOAD(7);
128
        D8 <= LOAD(8);
129
        D9 <= LOAD(9);
130
        D10 <= LOAD(10);
131
        D11 <= LOAD(11);
132
        D12 <= LOAD(12);
133
        D13 <= LOAD(13);
134
        D14 <= LOAD(14);
135
        D15 <= LOAD(15);
136
        end if;
137
end process INIT;
138
 
139
-- storage
140
 
141
        STORE0: STORE_BLOCK
142
        port map(LOAD_IN => D0,
143
                                SHIFT_IN => SHIFT_IN,
144
                                SHIFT => SHIFT_LSBS,
145
                                ENABLE => ENABLE_LSBS,
146
                                CLK => CLOCK,
147
                                OUTPUT => Q0);
148
 
149
        STORE1: STORE_BLOCK
150
        port map(LOAD_IN => D1,
151
                                SHIFT_IN => Q0,
152
                                SHIFT => SHIFT_LSBS,
153
                                ENABLE => ENABLE_LSBS,
154
                                CLK => CLOCK,
155
                                OUTPUT => Q1);
156
 
157
        STORE2: STORE_BLOCK
158
        port map(LOAD_IN => D2,
159
                                SHIFT_IN => Q1,
160
                                SHIFT => SHIFT_LSBS,
161
                                ENABLE => ENABLE_LSBS,
162
                                CLK => CLOCK,
163
                                OUTPUT => Q2);
164
 
165
        STORE3: STORE_BLOCK
166
        port map(LOAD_IN => D3,
167
                                SHIFT_IN => Q2,
168
                                SHIFT => SHIFT_LSBS,
169
                                ENABLE => ENABLE_LSBS,
170
                                CLK => CLOCK,
171
                                OUTPUT => Q3);
172
 
173
        STORE4: STORE_BLOCK
174
        port map(LOAD_IN => D4,
175
                                SHIFT_IN => Q3,
176
                                SHIFT => SHIFT_LSBS,
177
                                ENABLE => ENABLE_LSBS,
178
                                CLK => CLOCK,
179
                                OUTPUT => Q4);
180
 
181
        STORE5: STORE_BLOCK
182
        port map(LOAD_IN => D5,
183
                                SHIFT_IN => Q4,
184
                                SHIFT => SHIFT_LSBS,
185
                                ENABLE => ENABLE_LSBS,
186
                                CLK => CLOCK,
187
                                OUTPUT => Q5);
188
 
189
        STORE6: STORE_BLOCK
190
        port map(LOAD_IN => D6,
191
                                SHIFT_IN => Q5,
192
                                SHIFT => SHIFT_LSBS,
193
                                ENABLE => ENABLE_LSBS,
194
                                CLK => CLOCK,
195
                                OUTPUT => Q6);
196
 
197
        STORE7: STORE_BLOCK
198
        port map(LOAD_IN => D7,
199
                                SHIFT_IN => Q6,
200
                                SHIFT => SHIFT_LSBS,
201
                                ENABLE => ENABLE_LSBS,
202
                                CLK => CLOCK,
203
                                OUTPUT => Q7);
204
 
205
        STORE8: STORE_BLOCK
206
        port map(LOAD_IN => D8,
207
                                SHIFT_IN => Q7,
208
                                SHIFT => SHIFT_LSBS,
209
                                ENABLE => ENABLE_LSBS,
210
                                CLK => CLOCK,
211
                                OUTPUT => Q8);
212
 
213
        STORE9: STORE_BLOCK
214
        port map(LOAD_IN => D9,
215
                                SHIFT_IN => Q8,
216
                                SHIFT => SHIFT_LSBS,
217
                                ENABLE => ENABLE_LSBS,
218
                                CLK => CLOCK,
219
                                OUTPUT => Q9);
220
 
221
        STORE10: STORE_BLOCK
222
        port map(LOAD_IN => D10,
223
                                SHIFT_IN => Q9,
224
                                SHIFT => SHIFT_LSBS,
225
                                ENABLE => ENABLE_LSBS,
226
                                CLK => CLOCK,
227
                                OUTPUT => Q10);
228
 
229
        STORE11: STORE_BLOCK
230
        port map(LOAD_IN => D11,
231
                                SHIFT_IN => Q10,
232
                                SHIFT => SHIFT_LSBS,
233
                                ENABLE => ENABLE_LSBS,
234
                                CLK => CLOCK,
235
                                OUTPUT => Q11);
236
 
237
        STORE12: STORE_BLOCK
238
        port map(LOAD_IN => D12,
239
                                SHIFT_IN => Q11,
240
                                SHIFT => SHIFT_LSBS,
241
                                ENABLE => ENABLE_LSBS,
242
                                CLK => CLOCK,
243
                                OUTPUT => Q12);
244
 
245
        STORE13: STORE_BLOCK
246
        port map(LOAD_IN => D13,
247
                                SHIFT_IN => Q12,
248
                                SHIFT => SHIFT_LSBS,
249
                                ENABLE => ENABLE_LSBS,
250
                                CLK => CLOCK,
251
                                OUTPUT => Q13);
252
 
253
        STORE14: STORE_BLOCK
254
        port map(LOAD_IN => D14,
255
                                SHIFT_IN => Q13,
256
                                SHIFT => SHIFT_LSBS,
257
                                ENABLE => ENABLE_LSBS,
258
                                CLK => CLOCK,
259
                                OUTPUT => Q14);
260
 
261
        STORE15: STORE_BLOCK
262
        port map(LOAD_IN => D15,
263
                                SHIFT_IN => Q14,
264
                                SHIFT => SHIFT_ALL,
265
                                ENABLE => ENABLE_MSB,
266
                                CLK => CLOCK,
267
                                OUTPUT => Q15);
268
 
269
 
270
 
271
end architecture RTL;
272
 

powered by: WebSVN 2.1.0

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