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

Subversion Repositories avr_hp

[/] [avr_hp/] [trunk/] [rtl/] [rtl_s3_cm4/] [reg_file.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tobil
--**********************************************************************************************
2
--  General purpose register file for the AVR Core
3
--  Version 1.4 (Special version for the JTAG OCD)
4
--  Modified 22.04.2004
5
--  Designed by Ruslan Lepetenok
6
--**********************************************************************************************
7
 
8
library IEEE;
9
use IEEE.std_logic_1164.all;
10
use IEEE.std_logic_unsigned.all;
11
 
12
use WORK.SynthCtrlPack.all; -- Synthesis control
13
 
14
entity reg_file_cm4 is port (
15
                cp2_cml_1 : in std_logic;
16
                cp2_cml_2 : in std_logic;
17
                cp2_cml_3 : in std_logic;
18
 
19
                                                  --Clock and reset
20
                                              cp2         : in  std_logic;
21
                                                  cp2en       : in  std_logic;
22
                          ireset      : in  std_logic;
23
 
24
                          reg_rd_in   : in  std_logic_vector(7 downto 0);
25
                          reg_rd_out  : out std_logic_vector(7 downto 0);
26
                          reg_rd_out_int  : out std_logic_vector(7 downto 0);
27
                          reg_rd_adr  : in  std_logic_vector(4 downto 0);
28
                          reg_rd_adr_int      : in std_logic_vector  (4 downto 0);
29
                          reg_rr_out  : out std_logic_vector(7 downto 0);
30
                          reg_rr_adr  : in  std_logic_vector(4 downto 0);
31
                          reg_rd_wr   : in  std_logic;
32
 
33
                          post_inc    : in  std_logic; -- POST INCREMENT FOR LD/ST INSTRUCTIONS
34
                          pre_dec     : in  std_logic; -- PRE DECREMENT FOR LD/ST INSTRUCTIONS
35
                          reg_h_wr    : in  std_logic;
36
                          reg_h_out   : out std_logic_vector(15 downto 0);
37
                          reg_h_adr   : in  std_logic_vector(2 downto 0);  -- x,y,z
38
                                  reg_z_out   : out std_logic_vector(15 downto 0) -- OUTPUT OF R31:R30 FOR LPM/ELPM/IJMP INSTRUCTIONS
39
                          );
40
end reg_file_cm4;
41
 
42
architecture RTL of reg_file_cm4 is
43
 
44
type register_file_type is array(0 to 25) of std_logic_vector(7 downto 0);
45
type register_mux_type is array(0 to 31) of std_logic_vector(7 downto 0);
46
signal register_file : register_file_type;
47
signal r26h : std_logic_vector(7 downto 0);
48
signal r27h : std_logic_vector(7 downto 0);
49
signal r28h : std_logic_vector(7 downto 0);
50
signal r29h : std_logic_vector(7 downto 0);
51
signal r30h : std_logic_vector(7 downto 0);
52
signal r31h : std_logic_vector(7 downto 0);
53
 
54
signal register_wr_en  : std_logic_vector(31 downto 0);
55
 
56
signal sg_rd_decode   : std_logic_vector (31 downto 0);
57
signal sg_rd_decode_int   : std_logic_vector (31 downto 0);
58
signal sg_rr_decode   : std_logic_vector (31 downto 0);
59
 
60
--signal sg_tmp_rd_data : register_mux_type;
61
signal sg_tmp_rd_data_0 : std_logic_vector(7 downto 0);
62
signal sg_tmp_rd_data_1 : std_logic_vector(7 downto 0);
63
signal sg_tmp_rd_data_2 : std_logic_vector(7 downto 0);
64
signal sg_tmp_rd_data_3 : std_logic_vector(7 downto 0);
65
signal sg_tmp_rd_data_4 : std_logic_vector(7 downto 0);
66
signal sg_tmp_rd_data_5 : std_logic_vector(7 downto 0);
67
signal sg_tmp_rd_data_6 : std_logic_vector(7 downto 0);
68
signal sg_tmp_rd_data_7 : std_logic_vector(7 downto 0);
69
signal sg_tmp_rd_data_8 : std_logic_vector(7 downto 0);
70
signal sg_tmp_rd_data_9 : std_logic_vector(7 downto 0);
71
signal sg_tmp_rd_data_10 : std_logic_vector(7 downto 0);
72
signal sg_tmp_rd_data_11 : std_logic_vector(7 downto 0);
73
signal sg_tmp_rd_data_12 : std_logic_vector(7 downto 0);
74
signal sg_tmp_rd_data_13 : std_logic_vector(7 downto 0);
75
signal sg_tmp_rd_data_14 : std_logic_vector(7 downto 0);
76
signal sg_tmp_rd_data_15 : std_logic_vector(7 downto 0);
77
signal sg_tmp_rd_data_16 : std_logic_vector(7 downto 0);
78
signal sg_tmp_rd_data_17 : std_logic_vector(7 downto 0);
79
signal sg_tmp_rd_data_18 : std_logic_vector(7 downto 0);
80
signal sg_tmp_rd_data_19 : std_logic_vector(7 downto 0);
81
signal sg_tmp_rd_data_20 : std_logic_vector(7 downto 0);
82
signal sg_tmp_rd_data_21 : std_logic_vector(7 downto 0);
83
signal sg_tmp_rd_data_22 : std_logic_vector(7 downto 0);
84
signal sg_tmp_rd_data_23 : std_logic_vector(7 downto 0);
85
signal sg_tmp_rd_data_24 : std_logic_vector(7 downto 0);
86
signal sg_tmp_rd_data_25 : std_logic_vector(7 downto 0);
87
signal sg_tmp_rd_data_26 : std_logic_vector(7 downto 0);
88
signal sg_tmp_rd_data_27 : std_logic_vector(7 downto 0);
89
signal sg_tmp_rd_data_28 : std_logic_vector(7 downto 0);
90
signal sg_tmp_rd_data_29 : std_logic_vector(7 downto 0);
91
signal sg_tmp_rd_data_30 : std_logic_vector(7 downto 0);
92
signal sg_tmp_rd_data_31 : std_logic_vector(7 downto 0);
93
signal sg_tmp_rd_data_0_int : std_logic_vector(7 downto 0);
94
signal sg_tmp_rd_data_1_int : std_logic_vector(7 downto 0);
95
signal sg_tmp_rd_data_2_int : std_logic_vector(7 downto 0);
96
signal sg_tmp_rd_data_3_int : std_logic_vector(7 downto 0);
97
signal sg_tmp_rd_data_4_int : std_logic_vector(7 downto 0);
98
signal sg_tmp_rd_data_5_int : std_logic_vector(7 downto 0);
99
signal sg_tmp_rd_data_6_int : std_logic_vector(7 downto 0);
100
signal sg_tmp_rd_data_7_int : std_logic_vector(7 downto 0);
101
signal sg_tmp_rd_data_8_int : std_logic_vector(7 downto 0);
102
signal sg_tmp_rd_data_9_int : std_logic_vector(7 downto 0);
103
signal sg_tmp_rd_data_10_int : std_logic_vector(7 downto 0);
104
signal sg_tmp_rd_data_11_int : std_logic_vector(7 downto 0);
105
signal sg_tmp_rd_data_12_int : std_logic_vector(7 downto 0);
106
signal sg_tmp_rd_data_13_int : std_logic_vector(7 downto 0);
107
signal sg_tmp_rd_data_14_int : std_logic_vector(7 downto 0);
108
signal sg_tmp_rd_data_15_int : std_logic_vector(7 downto 0);
109
signal sg_tmp_rd_data_16_int : std_logic_vector(7 downto 0);
110
signal sg_tmp_rd_data_17_int : std_logic_vector(7 downto 0);
111
signal sg_tmp_rd_data_18_int : std_logic_vector(7 downto 0);
112
signal sg_tmp_rd_data_19_int : std_logic_vector(7 downto 0);
113
signal sg_tmp_rd_data_20_int : std_logic_vector(7 downto 0);
114
signal sg_tmp_rd_data_21_int : std_logic_vector(7 downto 0);
115
signal sg_tmp_rd_data_22_int : std_logic_vector(7 downto 0);
116
signal sg_tmp_rd_data_23_int : std_logic_vector(7 downto 0);
117
signal sg_tmp_rd_data_24_int : std_logic_vector(7 downto 0);
118
signal sg_tmp_rd_data_25_int : std_logic_vector(7 downto 0);
119
signal sg_tmp_rd_data_26_int : std_logic_vector(7 downto 0);
120
signal sg_tmp_rd_data_27_int : std_logic_vector(7 downto 0);
121
signal sg_tmp_rd_data_28_int : std_logic_vector(7 downto 0);
122
signal sg_tmp_rd_data_29_int : std_logic_vector(7 downto 0);
123
signal sg_tmp_rd_data_30_int : std_logic_vector(7 downto 0);
124
signal sg_tmp_rd_data_31_int : std_logic_vector(7 downto 0);
125
--signal sg_tmp_rr_data : register_mux_type;
126
signal sg_tmp_rr_data_0 : std_logic_vector(7 downto 0);
127
signal sg_tmp_rr_data_1 : std_logic_vector(7 downto 0);
128
signal sg_tmp_rr_data_2 : std_logic_vector(7 downto 0);
129
signal sg_tmp_rr_data_3 : std_logic_vector(7 downto 0);
130
signal sg_tmp_rr_data_4 : std_logic_vector(7 downto 0);
131
signal sg_tmp_rr_data_5 : std_logic_vector(7 downto 0);
132
signal sg_tmp_rr_data_6 : std_logic_vector(7 downto 0);
133
signal sg_tmp_rr_data_7 : std_logic_vector(7 downto 0);
134
signal sg_tmp_rr_data_8 : std_logic_vector(7 downto 0);
135
signal sg_tmp_rr_data_9 : std_logic_vector(7 downto 0);
136
signal sg_tmp_rr_data_10 : std_logic_vector(7 downto 0);
137
signal sg_tmp_rr_data_11 : std_logic_vector(7 downto 0);
138
signal sg_tmp_rr_data_12 : std_logic_vector(7 downto 0);
139
signal sg_tmp_rr_data_13 : std_logic_vector(7 downto 0);
140
signal sg_tmp_rr_data_14 : std_logic_vector(7 downto 0);
141
signal sg_tmp_rr_data_15 : std_logic_vector(7 downto 0);
142
signal sg_tmp_rr_data_16 : std_logic_vector(7 downto 0);
143
signal sg_tmp_rr_data_17 : std_logic_vector(7 downto 0);
144
signal sg_tmp_rr_data_18 : std_logic_vector(7 downto 0);
145
signal sg_tmp_rr_data_19 : std_logic_vector(7 downto 0);
146
signal sg_tmp_rr_data_20 : std_logic_vector(7 downto 0);
147
signal sg_tmp_rr_data_21 : std_logic_vector(7 downto 0);
148
signal sg_tmp_rr_data_22 : std_logic_vector(7 downto 0);
149
signal sg_tmp_rr_data_23 : std_logic_vector(7 downto 0);
150
signal sg_tmp_rr_data_24 : std_logic_vector(7 downto 0);
151
signal sg_tmp_rr_data_25 : std_logic_vector(7 downto 0);
152
signal sg_tmp_rr_data_26 : std_logic_vector(7 downto 0);
153
signal sg_tmp_rr_data_27 : std_logic_vector(7 downto 0);
154
signal sg_tmp_rr_data_28 : std_logic_vector(7 downto 0);
155
signal sg_tmp_rr_data_29 : std_logic_vector(7 downto 0);
156
signal sg_tmp_rr_data_30 : std_logic_vector(7 downto 0);
157
signal sg_tmp_rr_data_31 : std_logic_vector(7 downto 0);
158
 
159
signal sg_adr16_postinc : std_logic_vector (15 downto 0);
160
signal sg_adr16_predec  : std_logic_vector (15 downto 0);
161
signal reg_h_in         : std_logic_vector  (15 downto 0);
162
 
163
signal sg_tmp_h_data    : std_logic_vector  (15 downto 0);
164
 
165
signal reg_rd_adr_cml_3 :  std_logic_vector ( 4 downto 0 );
166
signal reg_rd_adr_cml_2 :  std_logic_vector ( 4 downto 0 );
167
signal reg_rd_adr_cml_1 :  std_logic_vector ( 4 downto 0 );
168
signal reg_h_adr_cml_3 :  std_logic_vector ( 2 downto 0 );
169
signal reg_h_adr_cml_2 :  std_logic_vector ( 2 downto 0 );
170
signal reg_h_adr_cml_1 :  std_logic_vector ( 2 downto 0 );
171
signal register_file_cml_3 :  register_file_type;
172
signal register_file_cml_2 :  register_file_type;
173
signal register_file_cml_1 :  register_file_type;
174
signal r26h_cml_3 :  std_logic_vector ( 7 downto 0 );
175
signal r26h_cml_2 :  std_logic_vector ( 7 downto 0 );
176
signal r26h_cml_1 :  std_logic_vector ( 7 downto 0 );
177
signal r27h_cml_3 :  std_logic_vector ( 7 downto 0 );
178
signal r27h_cml_2 :  std_logic_vector ( 7 downto 0 );
179
signal r27h_cml_1 :  std_logic_vector ( 7 downto 0 );
180
signal r28h_cml_3 :  std_logic_vector ( 7 downto 0 );
181
signal r28h_cml_2 :  std_logic_vector ( 7 downto 0 );
182
signal r28h_cml_1 :  std_logic_vector ( 7 downto 0 );
183
signal r29h_cml_3 :  std_logic_vector ( 7 downto 0 );
184
signal r29h_cml_2 :  std_logic_vector ( 7 downto 0 );
185
signal r29h_cml_1 :  std_logic_vector ( 7 downto 0 );
186
signal reg_z_out_cml_out :  std_logic_vector ( 15 downto 0 );
187
signal r30h_cml_3 :  std_logic_vector ( 7 downto 0 );
188
signal r30h_cml_2 :  std_logic_vector ( 7 downto 0 );
189
signal r30h_cml_1 :  std_logic_vector ( 7 downto 0 );
190
signal r31h_cml_3 :  std_logic_vector ( 7 downto 0 );
191
signal r31h_cml_2 :  std_logic_vector ( 7 downto 0 );
192
signal r31h_cml_1 :  std_logic_vector ( 7 downto 0 );
193
signal sg_rd_decode_cml_1 :  std_logic_vector ( 31 downto 0 );
194
signal sg_adr16_predec_cml_3 :  std_logic_vector ( 15 downto 0 );
195
signal sg_adr16_predec_cml_2 :  std_logic_vector ( 15 downto 0 );
196
signal sg_tmp_h_data_cml_3 :  std_logic_vector ( 15 downto 0 );
197
signal sg_tmp_h_data_cml_2 :  std_logic_vector ( 15 downto 0 );
198
 
199
begin
200
 
201
 
202
 
203
process(cp2_cml_1) begin
204
if (cp2_cml_1 = '1' and cp2_cml_1'event) then
205
        reg_rd_adr_cml_1 <= reg_rd_adr;
206
        reg_h_adr_cml_1 <= reg_h_adr;
207
        register_file_cml_1 <= register_file;
208
        r26h_cml_1 <= r26h;
209
        r27h_cml_1 <= r27h;
210
        r28h_cml_1 <= r28h;
211
        r29h_cml_1 <= r29h;
212
        r30h_cml_1 <= r30h;
213
        r31h_cml_1 <= r31h;
214
        sg_rd_decode_cml_1 <= sg_rd_decode;
215
end if;
216
end process;
217
 
218
process(cp2_cml_2) begin
219
if (cp2_cml_2 = '1' and cp2_cml_2'event) then
220
        reg_rd_adr_cml_2 <= reg_rd_adr_cml_1;
221
        reg_h_adr_cml_2 <= reg_h_adr_cml_1;
222
        register_file_cml_2 <= register_file_cml_1;
223
        r26h_cml_2 <= r26h_cml_1;
224
        r27h_cml_2 <= r27h_cml_1;
225
        r28h_cml_2 <= r28h_cml_1;
226
        r29h_cml_2 <= r29h_cml_1;
227
        r30h_cml_2 <= r30h_cml_1;
228
        r31h_cml_2 <= r31h_cml_1;
229
        sg_adr16_predec_cml_2 <= sg_adr16_predec;
230
        sg_tmp_h_data_cml_2 <= sg_tmp_h_data;
231
end if;
232
end process;
233
 
234
process(cp2_cml_3) begin
235
if (cp2_cml_3 = '1' and cp2_cml_3'event) then
236
        reg_rd_adr_cml_3 <= reg_rd_adr_cml_2;
237
        reg_h_adr_cml_3 <= reg_h_adr_cml_2;
238
        register_file_cml_3 <= register_file_cml_2;
239
        r26h_cml_3 <= r26h_cml_2;
240
        r27h_cml_3 <= r27h_cml_2;
241
        r28h_cml_3 <= r28h_cml_2;
242
        r29h_cml_3 <= r29h_cml_2;
243
        r30h_cml_3 <= r30h_cml_2;
244
        r31h_cml_3 <= r31h_cml_2;
245
        sg_adr16_predec_cml_3 <= sg_adr16_predec_cml_2;
246
        sg_tmp_h_data_cml_3 <= sg_tmp_h_data_cml_2;
247
end if;
248
end process;
249
reg_z_out <= reg_z_out_cml_out;
250
 
251
 
252
write_decode: for i in 0 to 31 generate
253
-- SynEDA CoreMultiplier
254
-- assignment(s): register_wr_en
255
-- replace(s): reg_rd_adr
256
 
257
register_wr_en(i) <= '1' when (i=reg_rd_adr_cml_3 and reg_rd_wr='1') else '0';
258
end generate;
259
 
260
rd_mux_decode: for i in 0 to 31 generate
261
sg_rd_decode(i) <= '1' when (reg_rd_adr=i) else '0';
262
end generate;
263
 
264
rd_mux_decode_int: for i in 0 to 31 generate
265
sg_rd_decode_int(i) <= '1' when (reg_rd_adr_int=i) else '0';
266
end generate;
267
 
268
rr_mux_decode: for i in 0 to 31 generate
269
sg_rr_decode(i) <= '1' when (reg_rr_adr=i) else '0';
270
end generate;
271
 
272
-- SynEDA CoreMultiplier
273
-- assignment(s): reg_z_out
274
-- replace(s): r30h, r31h
275
 
276
reg_z_out_cml_out <= r31h_cml_3&r30h_cml_3; -- R31:R30 OUTPUT FOR LPM/ELPM INSTRUCTIONS 
277
 
278
--sg_tmp_rd_data(0) <= register_file(0) when sg_rd_decode(0)='1' else (others=>'0');
279
--read_rd_mux: for i in 1 to 25 generate
280
--sg_tmp_rd_data(i) <= register_file(i) when sg_rd_decode(i)='1' else sg_tmp_rd_data(i-1);
281
--end generate;
282
--sg_tmp_rd_data(26) <= r26h when sg_rd_decode(26)='1' else sg_tmp_rd_data(25);
283
--sg_tmp_rd_data(27) <= r27h when sg_rd_decode(27)='1' else sg_tmp_rd_data(26);
284
--sg_tmp_rd_data(28) <= r28h when sg_rd_decode(28)='1' else sg_tmp_rd_data(27);
285
--sg_tmp_rd_data(29) <= r29h when sg_rd_decode(29)='1' else sg_tmp_rd_data(28);
286
--sg_tmp_rd_data(30) <= r30h when sg_rd_decode(30)='1' else sg_tmp_rd_data(29);
287
--sg_tmp_rd_data(31) <= r31h when sg_rd_decode(31)='1' else sg_tmp_rd_data(30); 
288
--reg_rd_out <= sg_tmp_rd_data(31); 
289
 
290
-- SynEDA CoreMultiplier
291
-- assignment(s): sg_tmp_rd_data_0
292
-- replace(s): register_file, sg_rd_decode
293
 
294
sg_tmp_rd_data_0 <= register_file_cml_1(0) when sg_rd_decode_cml_1(0)='1' else (others=>'0');
295
-- SynEDA CoreMultiplier
296
-- assignment(s): sg_tmp_rd_data_1
297
-- replace(s): register_file, sg_rd_decode
298
 
299
sg_tmp_rd_data_1 <= register_file_cml_1(1) when sg_rd_decode_cml_1(1)='1' else sg_tmp_rd_data_0;
300
-- SynEDA CoreMultiplier
301
-- assignment(s): sg_tmp_rd_data_2
302
-- replace(s): register_file, sg_rd_decode
303
 
304
sg_tmp_rd_data_2 <= register_file_cml_1(2) when sg_rd_decode_cml_1(2)='1' else sg_tmp_rd_data_1;
305
-- SynEDA CoreMultiplier
306
-- assignment(s): sg_tmp_rd_data_3
307
-- replace(s): register_file, sg_rd_decode
308
 
309
sg_tmp_rd_data_3 <= register_file_cml_1(3) when sg_rd_decode_cml_1(3)='1' else sg_tmp_rd_data_2;
310
-- SynEDA CoreMultiplier
311
-- assignment(s): sg_tmp_rd_data_4
312
-- replace(s): register_file, sg_rd_decode
313
 
314
sg_tmp_rd_data_4 <= register_file_cml_1(4) when sg_rd_decode_cml_1(4)='1' else sg_tmp_rd_data_3;
315
-- SynEDA CoreMultiplier
316
-- assignment(s): sg_tmp_rd_data_5
317
-- replace(s): register_file, sg_rd_decode
318
 
319
sg_tmp_rd_data_5 <= register_file_cml_1(5) when sg_rd_decode_cml_1(5)='1' else sg_tmp_rd_data_4;
320
-- SynEDA CoreMultiplier
321
-- assignment(s): sg_tmp_rd_data_6
322
-- replace(s): register_file, sg_rd_decode
323
 
324
sg_tmp_rd_data_6 <= register_file_cml_1(6) when sg_rd_decode_cml_1(6)='1' else sg_tmp_rd_data_5;
325
-- SynEDA CoreMultiplier
326
-- assignment(s): sg_tmp_rd_data_7
327
-- replace(s): register_file, sg_rd_decode
328
 
329
sg_tmp_rd_data_7 <= register_file_cml_1(7) when sg_rd_decode_cml_1(7)='1' else sg_tmp_rd_data_6;
330
-- SynEDA CoreMultiplier
331
-- assignment(s): sg_tmp_rd_data_8
332
-- replace(s): register_file, sg_rd_decode
333
 
334
sg_tmp_rd_data_8 <= register_file_cml_1(8) when sg_rd_decode_cml_1(8)='1' else sg_tmp_rd_data_7;
335
-- SynEDA CoreMultiplier
336
-- assignment(s): sg_tmp_rd_data_9
337
-- replace(s): register_file, sg_rd_decode
338
 
339
sg_tmp_rd_data_9 <= register_file_cml_1(9) when sg_rd_decode_cml_1(9)='1' else sg_tmp_rd_data_8;
340
-- SynEDA CoreMultiplier
341
-- assignment(s): sg_tmp_rd_data_10
342
-- replace(s): register_file, sg_rd_decode
343
 
344
sg_tmp_rd_data_10 <= register_file_cml_1(10) when sg_rd_decode_cml_1(10)='1' else sg_tmp_rd_data_9;
345
-- SynEDA CoreMultiplier
346
-- assignment(s): sg_tmp_rd_data_11
347
-- replace(s): register_file, sg_rd_decode
348
 
349
sg_tmp_rd_data_11 <= register_file_cml_1(11) when sg_rd_decode_cml_1(11)='1' else sg_tmp_rd_data_10;
350
-- SynEDA CoreMultiplier
351
-- assignment(s): sg_tmp_rd_data_12
352
-- replace(s): register_file, sg_rd_decode
353
 
354
sg_tmp_rd_data_12 <= register_file_cml_1(12) when sg_rd_decode_cml_1(12)='1' else sg_tmp_rd_data_11;
355
-- SynEDA CoreMultiplier
356
-- assignment(s): sg_tmp_rd_data_13
357
-- replace(s): register_file, sg_rd_decode
358
 
359
sg_tmp_rd_data_13 <= register_file_cml_1(13) when sg_rd_decode_cml_1(13)='1' else sg_tmp_rd_data_12;
360
-- SynEDA CoreMultiplier
361
-- assignment(s): sg_tmp_rd_data_14
362
-- replace(s): register_file, sg_rd_decode
363
 
364
sg_tmp_rd_data_14 <= register_file_cml_1(14) when sg_rd_decode_cml_1(14)='1' else sg_tmp_rd_data_13;
365
-- SynEDA CoreMultiplier
366
-- assignment(s): sg_tmp_rd_data_15
367
-- replace(s): register_file, sg_rd_decode
368
 
369
sg_tmp_rd_data_15 <= register_file_cml_1(15) when sg_rd_decode_cml_1(15)='1' else sg_tmp_rd_data_14;
370
-- SynEDA CoreMultiplier
371
-- assignment(s): sg_tmp_rd_data_16
372
-- replace(s): register_file, sg_rd_decode
373
 
374
sg_tmp_rd_data_16 <= register_file_cml_1(16) when sg_rd_decode_cml_1(16)='1' else sg_tmp_rd_data_15;
375
-- SynEDA CoreMultiplier
376
-- assignment(s): sg_tmp_rd_data_17
377
-- replace(s): register_file, sg_rd_decode
378
 
379
sg_tmp_rd_data_17 <= register_file_cml_1(17) when sg_rd_decode_cml_1(17)='1' else sg_tmp_rd_data_16;
380
-- SynEDA CoreMultiplier
381
-- assignment(s): sg_tmp_rd_data_18
382
-- replace(s): register_file, sg_rd_decode
383
 
384
sg_tmp_rd_data_18 <= register_file_cml_1(18) when sg_rd_decode_cml_1(18)='1' else sg_tmp_rd_data_17;
385
-- SynEDA CoreMultiplier
386
-- assignment(s): sg_tmp_rd_data_19
387
-- replace(s): register_file, sg_rd_decode
388
 
389
sg_tmp_rd_data_19 <= register_file_cml_1(19) when sg_rd_decode_cml_1(19)='1' else sg_tmp_rd_data_18;
390
-- SynEDA CoreMultiplier
391
-- assignment(s): sg_tmp_rd_data_20
392
-- replace(s): register_file, sg_rd_decode
393
 
394
sg_tmp_rd_data_20 <= register_file_cml_1(20) when sg_rd_decode_cml_1(20)='1' else sg_tmp_rd_data_19;
395
-- SynEDA CoreMultiplier
396
-- assignment(s): sg_tmp_rd_data_21
397
-- replace(s): register_file, sg_rd_decode
398
 
399
sg_tmp_rd_data_21 <= register_file_cml_1(21) when sg_rd_decode_cml_1(21)='1' else sg_tmp_rd_data_20;
400
-- SynEDA CoreMultiplier
401
-- assignment(s): sg_tmp_rd_data_22
402
-- replace(s): register_file, sg_rd_decode
403
 
404
sg_tmp_rd_data_22 <= register_file_cml_1(22) when sg_rd_decode_cml_1(22)='1' else sg_tmp_rd_data_21;
405
-- SynEDA CoreMultiplier
406
-- assignment(s): sg_tmp_rd_data_23
407
-- replace(s): register_file, sg_rd_decode
408
 
409
sg_tmp_rd_data_23 <= register_file_cml_1(23) when sg_rd_decode_cml_1(23)='1' else sg_tmp_rd_data_22;
410
-- SynEDA CoreMultiplier
411
-- assignment(s): sg_tmp_rd_data_24
412
-- replace(s): register_file, sg_rd_decode
413
 
414
sg_tmp_rd_data_24 <= register_file_cml_1(24) when sg_rd_decode_cml_1(24)='1' else sg_tmp_rd_data_23;
415
-- SynEDA CoreMultiplier
416
-- assignment(s): sg_tmp_rd_data_25
417
-- replace(s): register_file, sg_rd_decode
418
 
419
sg_tmp_rd_data_25 <= register_file_cml_1(25) when sg_rd_decode_cml_1(25)='1' else sg_tmp_rd_data_24;
420
-- SynEDA CoreMultiplier
421
-- assignment(s): sg_tmp_rd_data_26
422
-- replace(s): r26h, sg_rd_decode
423
 
424
sg_tmp_rd_data_26 <= r26h_cml_1 when sg_rd_decode_cml_1(26)='1' else sg_tmp_rd_data_25;
425
-- SynEDA CoreMultiplier
426
-- assignment(s): sg_tmp_rd_data_27
427
-- replace(s): r27h, sg_rd_decode
428
 
429
sg_tmp_rd_data_27 <= r27h_cml_1 when sg_rd_decode_cml_1(27)='1' else sg_tmp_rd_data_26;
430
-- SynEDA CoreMultiplier
431
-- assignment(s): sg_tmp_rd_data_28
432
-- replace(s): r28h, sg_rd_decode
433
 
434
sg_tmp_rd_data_28 <= r28h_cml_1 when sg_rd_decode_cml_1(28)='1' else sg_tmp_rd_data_27;
435
-- SynEDA CoreMultiplier
436
-- assignment(s): sg_tmp_rd_data_29
437
-- replace(s): r29h, sg_rd_decode
438
 
439
sg_tmp_rd_data_29 <= r29h_cml_1 when sg_rd_decode_cml_1(29)='1' else sg_tmp_rd_data_28;
440
-- SynEDA CoreMultiplier
441
-- assignment(s): sg_tmp_rd_data_30
442
-- replace(s): r30h, sg_rd_decode
443
 
444
sg_tmp_rd_data_30 <= r30h_cml_1 when sg_rd_decode_cml_1(30)='1' else sg_tmp_rd_data_29;
445
-- SynEDA CoreMultiplier
446
-- assignment(s): sg_tmp_rd_data_31
447
-- replace(s): r31h, sg_rd_decode
448
 
449
sg_tmp_rd_data_31 <= r31h_cml_1 when sg_rd_decode_cml_1(31)='1' else sg_tmp_rd_data_30;
450
reg_rd_out <= sg_tmp_rd_data_31;
451
 
452
sg_tmp_rd_data_0_int <= register_file(0) when sg_rd_decode_int(0)='1' else (others=>'0');
453
sg_tmp_rd_data_1_int <= register_file(1) when sg_rd_decode_int(1)='1' else sg_tmp_rd_data_0_int;
454
sg_tmp_rd_data_2_int <= register_file(2) when sg_rd_decode_int(2)='1' else sg_tmp_rd_data_1_int;
455
sg_tmp_rd_data_3_int <= register_file(3) when sg_rd_decode_int(3)='1' else sg_tmp_rd_data_2_int;
456
sg_tmp_rd_data_4_int <= register_file(4) when sg_rd_decode_int(4)='1' else sg_tmp_rd_data_3_int;
457
sg_tmp_rd_data_5_int <= register_file(5) when sg_rd_decode_int(5)='1' else sg_tmp_rd_data_4_int;
458
sg_tmp_rd_data_6_int <= register_file(6) when sg_rd_decode_int(6)='1' else sg_tmp_rd_data_5_int;
459
sg_tmp_rd_data_7_int <= register_file(7) when sg_rd_decode_int(7)='1' else sg_tmp_rd_data_6_int;
460
sg_tmp_rd_data_8_int <= register_file(8) when sg_rd_decode_int(8)='1' else sg_tmp_rd_data_7_int;
461
sg_tmp_rd_data_9_int <= register_file(9) when sg_rd_decode_int(9)='1' else sg_tmp_rd_data_8_int;
462
sg_tmp_rd_data_10_int <= register_file(10) when sg_rd_decode_int(10)='1' else sg_tmp_rd_data_9_int;
463
sg_tmp_rd_data_11_int <= register_file(11) when sg_rd_decode_int(11)='1' else sg_tmp_rd_data_10_int;
464
sg_tmp_rd_data_12_int <= register_file(12) when sg_rd_decode_int(12)='1' else sg_tmp_rd_data_11_int;
465
sg_tmp_rd_data_13_int <= register_file(13) when sg_rd_decode_int(13)='1' else sg_tmp_rd_data_12_int;
466
sg_tmp_rd_data_14_int <= register_file(14) when sg_rd_decode_int(14)='1' else sg_tmp_rd_data_13_int;
467
sg_tmp_rd_data_15_int <= register_file(15) when sg_rd_decode_int(15)='1' else sg_tmp_rd_data_14_int;
468
sg_tmp_rd_data_16_int <= register_file(16) when sg_rd_decode_int(16)='1' else sg_tmp_rd_data_15_int;
469
sg_tmp_rd_data_17_int <= register_file(17) when sg_rd_decode_int(17)='1' else sg_tmp_rd_data_16_int;
470
sg_tmp_rd_data_18_int <= register_file(18) when sg_rd_decode_int(18)='1' else sg_tmp_rd_data_17_int;
471
sg_tmp_rd_data_19_int <= register_file(19) when sg_rd_decode_int(19)='1' else sg_tmp_rd_data_18_int;
472
sg_tmp_rd_data_20_int <= register_file(20) when sg_rd_decode_int(20)='1' else sg_tmp_rd_data_19_int;
473
sg_tmp_rd_data_21_int <= register_file(21) when sg_rd_decode_int(21)='1' else sg_tmp_rd_data_20_int;
474
sg_tmp_rd_data_22_int <= register_file(22) when sg_rd_decode_int(22)='1' else sg_tmp_rd_data_21_int;
475
sg_tmp_rd_data_23_int <= register_file(23) when sg_rd_decode_int(23)='1' else sg_tmp_rd_data_22_int;
476
sg_tmp_rd_data_24_int <= register_file(24) when sg_rd_decode_int(24)='1' else sg_tmp_rd_data_23_int;
477
sg_tmp_rd_data_25_int <= register_file(25) when sg_rd_decode_int(25)='1' else sg_tmp_rd_data_24_int;
478
sg_tmp_rd_data_26_int <= r26h when sg_rd_decode_int(26)='1' else sg_tmp_rd_data_25_int;
479
sg_tmp_rd_data_27_int <= r27h when sg_rd_decode_int(27)='1' else sg_tmp_rd_data_26_int;
480
sg_tmp_rd_data_28_int <= r28h when sg_rd_decode_int(28)='1' else sg_tmp_rd_data_27_int;
481
sg_tmp_rd_data_29_int <= r29h when sg_rd_decode_int(29)='1' else sg_tmp_rd_data_28_int;
482
sg_tmp_rd_data_30_int <= r30h when sg_rd_decode_int(30)='1' else sg_tmp_rd_data_29_int;
483
sg_tmp_rd_data_31_int <= r31h when sg_rd_decode_int(31)='1' else sg_tmp_rd_data_30_int;
484
reg_rd_out_int <= sg_tmp_rd_data_31_int;
485
 
486
--sg_tmp_rr_data(0) <= register_file(0) when sg_rr_decode(0)='1' else (others=>'0');
487
--read_rr_mux: for i in 1 to 25 generate
488
--sg_tmp_rr_data(i) <= register_file(i) when sg_rr_decode(i)='1' else sg_tmp_rr_data(i-1);
489
--end generate;
490
--sg_tmp_rr_data() <= register_file() when sg_rr_decode()='1' else sg_tmp_rr_data();
491
--sg_tmp_rr_data(26) <= r26h when sg_rr_decode(26)='1' else sg_tmp_rr_data(25);
492
--sg_tmp_rr_data(27) <= r27h when sg_rr_decode(27)='1' else sg_tmp_rr_data(26);
493
--sg_tmp_rr_data(28) <= r28h when sg_rr_decode(28)='1' else sg_tmp_rr_data(27);
494
--sg_tmp_rr_data(29) <= r29h when sg_rr_decode(29)='1' else sg_tmp_rr_data(28);
495
--sg_tmp_rr_data(30) <= r30h when sg_rr_decode(30)='1' else sg_tmp_rr_data(29);
496
--sg_tmp_rr_data(31) <= r31h when sg_rr_decode(31)='1' else sg_tmp_rr_data(30);
497
--reg_rr_out <= sg_tmp_rr_data(31);
498
 
499
 
500
sg_tmp_rr_data_0 <= register_file(0) when sg_rr_decode(0)='1' else (others=>'0');
501
sg_tmp_rr_data_1 <= register_file(1) when sg_rr_decode(1)='1' else sg_tmp_rr_data_0;
502
sg_tmp_rr_data_2 <= register_file(2) when sg_rr_decode(2)='1' else sg_tmp_rr_data_1;
503
sg_tmp_rr_data_3 <= register_file(3) when sg_rr_decode(3)='1' else sg_tmp_rr_data_2;
504
sg_tmp_rr_data_4 <= register_file(4) when sg_rr_decode(4)='1' else sg_tmp_rr_data_3;
505
sg_tmp_rr_data_5 <= register_file(5) when sg_rr_decode(5)='1' else sg_tmp_rr_data_4;
506
sg_tmp_rr_data_6 <= register_file(6) when sg_rr_decode(6)='1' else sg_tmp_rr_data_5;
507
sg_tmp_rr_data_7 <= register_file(7) when sg_rr_decode(7)='1' else sg_tmp_rr_data_6;
508
sg_tmp_rr_data_8 <= register_file(8) when sg_rr_decode(8)='1' else sg_tmp_rr_data_7;
509
sg_tmp_rr_data_9 <= register_file(9) when sg_rr_decode(9)='1' else sg_tmp_rr_data_8;
510
sg_tmp_rr_data_10 <= register_file(10) when sg_rr_decode(10)='1' else sg_tmp_rr_data_9;
511
sg_tmp_rr_data_11 <= register_file(11) when sg_rr_decode(11)='1' else sg_tmp_rr_data_10;
512
sg_tmp_rr_data_12 <= register_file(12) when sg_rr_decode(12)='1' else sg_tmp_rr_data_11;
513
sg_tmp_rr_data_13 <= register_file(13) when sg_rr_decode(13)='1' else sg_tmp_rr_data_12;
514
sg_tmp_rr_data_14 <= register_file(14) when sg_rr_decode(14)='1' else sg_tmp_rr_data_13;
515
sg_tmp_rr_data_15 <= register_file(15) when sg_rr_decode(15)='1' else sg_tmp_rr_data_14;
516
sg_tmp_rr_data_16 <= register_file(16) when sg_rr_decode(16)='1' else sg_tmp_rr_data_15;
517
sg_tmp_rr_data_17 <= register_file(17) when sg_rr_decode(17)='1' else sg_tmp_rr_data_16;
518
sg_tmp_rr_data_18 <= register_file(18) when sg_rr_decode(18)='1' else sg_tmp_rr_data_17;
519
sg_tmp_rr_data_19 <= register_file(19) when sg_rr_decode(19)='1' else sg_tmp_rr_data_18;
520
sg_tmp_rr_data_20 <= register_file(20) when sg_rr_decode(20)='1' else sg_tmp_rr_data_19;
521
sg_tmp_rr_data_21 <= register_file(21) when sg_rr_decode(21)='1' else sg_tmp_rr_data_20;
522
sg_tmp_rr_data_22 <= register_file(22) when sg_rr_decode(22)='1' else sg_tmp_rr_data_21;
523
sg_tmp_rr_data_23 <= register_file(23) when sg_rr_decode(23)='1' else sg_tmp_rr_data_22;
524
sg_tmp_rr_data_24 <= register_file(24) when sg_rr_decode(24)='1' else sg_tmp_rr_data_23;
525
sg_tmp_rr_data_25 <= register_file(25) when sg_rr_decode(25)='1' else sg_tmp_rr_data_24;
526
sg_tmp_rr_data_26 <= r26h when sg_rr_decode(26)='1' else sg_tmp_rr_data_25;
527
sg_tmp_rr_data_27 <= r27h when sg_rr_decode(27)='1' else sg_tmp_rr_data_26;
528
sg_tmp_rr_data_28 <= r28h when sg_rr_decode(28)='1' else sg_tmp_rr_data_27;
529
sg_tmp_rr_data_29 <= r29h when sg_rr_decode(29)='1' else sg_tmp_rr_data_28;
530
sg_tmp_rr_data_30 <= r30h when sg_rr_decode(30)='1' else sg_tmp_rr_data_29;
531
sg_tmp_rr_data_31 <= r31h when sg_rr_decode(31)='1' else sg_tmp_rr_data_30;
532
reg_rr_out <= sg_tmp_rr_data_31;
533
 
534
 
535
h_dat_mux_l:for i in 0 to 7 generate
536
sg_tmp_h_data(i) <= (r26h_cml_1(i) and reg_h_adr_cml_1(0)) or (r28h_cml_1(i) and reg_h_adr_cml_1(1)) or (r30h_cml_1(i) and reg_h_adr_cml_1(2));
537
end generate;
538
h_dat_mux_h:for i in 8 to 15 generate
539
-- SynEDA CoreMultiplier
540
-- assignment(s): sg_tmp_h_data
541
-- replace(s): reg_h_adr, r26h, r27h, r28h, r29h, r30h, r31h
542
 
543
sg_tmp_h_data(i) <= (r27h_cml_1(i-8) and reg_h_adr_cml_1(0)) or (r29h_cml_1(i-8) and reg_h_adr_cml_1(1)) or (r31h_cml_1(i-8) and reg_h_adr_cml_1(2));
544
end generate;
545
 
546
 
547
-- SynEDA CoreMultiplier
548
-- assignment(s): sg_adr16_postinc
549
-- replace(s): sg_tmp_h_data
550
 
551
sg_adr16_postinc <= sg_tmp_h_data_cml_3 +1;
552
sg_adr16_predec  <= sg_tmp_h_data -1;
553
-- OUTPUT TO THE ADDRESS BUS
554
reg_h_out <= sg_adr16_predec when (pre_dec='1') else           -- PREDECREMENT
555
             sg_tmp_h_data;            -- NO PREDECREMENT
556
 
557
-- SynEDA CoreMultiplier
558
-- assignment(s): reg_h_in
559
-- replace(s): sg_adr16_predec
560
 
561
-- TO REGISTERS
562
reg_h_in  <= sg_adr16_postinc when (post_inc='1') else         -- POST INC 
563
             sg_adr16_predec_cml_3;                                  -- PRE DEC
564
 
565
-- Register file with global reset (for simulation)
566
 
567
RegFileWithRst:if CResetRegFile generate
568
 
569
-- SynEDA CoreMultiplier
570
-- assignment(s): register_file
571
-- replace(s): register_file
572
 
573
R0_R25:process(cp2,ireset)
574
begin
575
 if ireset='0' then
576
  for i in 0 to 25 loop
577
   register_file(i) <= (others =>'0');
578
  end loop;
579
 elsif (cp2='1' and cp2'event) then register_file <= register_file_cml_3;
580
  if (cp2en='1') then                                                     -- Clock enable        
581
   for i in 0 to 25 loop
582
    if register_wr_en(i)='1' then
583
     register_file(i) <= reg_rd_in;
584
    end if;
585
   end loop;
586
  end if;
587
 end if;
588
end process;
589
 
590
 
591
-- SynEDA CoreMultiplier
592
-- assignment(s): r26h
593
-- replace(s): reg_h_adr, r26h
594
 
595
-- R26 (LOW)
596
R26:process(cp2,ireset)
597
begin
598
 if ireset='0' then
599
  r26h <= (others =>'0');
600
 elsif (cp2='1' and cp2'event) then r26h <= r26h_cml_3;
601
  if (cp2en='1') then                                                     -- Clock enable        
602
   if register_wr_en(26)='1' then
603
    r26h <= reg_rd_in;
604
   elsif (reg_h_adr_cml_3(0)='1'and reg_h_wr='1') then
605
    r26h <= reg_h_in(7 downto 0);
606
   end if;
607
  end if;
608
 end if;
609
end process;
610
 
611
-- SynEDA CoreMultiplier
612
-- assignment(s): r27h
613
-- replace(s): reg_h_adr, r27h
614
 
615
-- R27 (HIGH)
616
R27:process(cp2,ireset)
617
begin
618
 if ireset='0' then
619
  r27h <= (others =>'0');
620
 elsif (cp2='1' and cp2'event) then r27h <= r27h_cml_3;
621
  if (cp2en='1') then                                                     -- Clock enable        
622
   if register_wr_en(27)='1' then
623
    r27h <= reg_rd_in;
624
   elsif (reg_h_adr_cml_3(0)='1'and reg_h_wr='1') then
625
    r27h <= reg_h_in(15 downto 8);
626
   end if;
627
  end if;
628
 end if;
629
end process;
630
 
631
-- SynEDA CoreMultiplier
632
-- assignment(s): r28h
633
-- replace(s): reg_h_adr, r28h
634
 
635
-- R28 (LOW)
636
R28:process(cp2,ireset)
637
begin
638
 if ireset='0' then
639
  r28h <= (others =>'0');
640
 elsif (cp2='1' and cp2'event) then r28h <= r28h_cml_3;
641
  if (cp2en='1') then                                                     -- Clock enable        
642
   if register_wr_en(28)='1' then
643
    r28h <= reg_rd_in;
644
   elsif (reg_h_adr_cml_3(1)='1'and reg_h_wr='1') then
645
    r28h <= reg_h_in(7 downto 0);
646
   end if;
647
  end if;
648
 end if;
649
end process;
650
 
651
-- SynEDA CoreMultiplier
652
-- assignment(s): r29h
653
-- replace(s): reg_h_adr, r29h
654
 
655
-- R29 (HIGH)
656
R29:process(cp2,ireset)
657
begin
658
 if ireset='0' then
659
  r29h <= (others =>'0');
660
 elsif (cp2='1' and cp2'event) then r29h <= r29h_cml_3;
661
  if (cp2en='1') then                                                     -- Clock enable        
662
   if register_wr_en(29)='1' then
663
    r29h <= reg_rd_in;
664
   elsif (reg_h_adr_cml_3(1)='1'and reg_h_wr='1') then
665
    r29h <= reg_h_in(15 downto 8);
666
   end if;
667
  end if;
668
 end if;
669
end process;
670
 
671
-- SynEDA CoreMultiplier
672
-- assignment(s): r30h
673
-- replace(s): reg_h_adr, r30h
674
 
675
-- R30 (LOW)
676
R30:process(cp2,ireset)
677
begin
678
 if ireset='0' then
679
  r30h <= (others =>'0');
680
 elsif (cp2='1' and cp2'event) then r30h <= r30h_cml_3;
681
  if (cp2en='1') then                                                     -- Clock enable        
682
   if register_wr_en(30)='1' then
683
    r30h <= reg_rd_in;
684
   elsif (reg_h_adr_cml_3(2)='1'and reg_h_wr='1') then
685
    r30h <= reg_h_in(7 downto 0);
686
   end if;
687
  end if;
688
 end if;
689
end process;
690
 
691
-- SynEDA CoreMultiplier
692
-- assignment(s): r31h
693
-- replace(s): reg_h_adr, r31h
694
 
695
-- R31 (HIGH)
696
R31:process(cp2,ireset)
697
begin
698
 if ireset='0' then
699
  r31h <= (others =>'0');
700
 elsif (cp2='1' and cp2'event) then r31h <= r31h_cml_3;
701
  if (cp2en='1') then                                                     -- Clock enable        
702
   if register_wr_en(31)='1' then
703
    r31h <= reg_rd_in;
704
   elsif (reg_h_adr_cml_3(2)='1'and reg_h_wr='1') then
705
    r31h <= reg_h_in(15 downto 8);
706
   end if;
707
  end if;
708
 end if;
709
end process;
710
 
711
end generate;
712
 
713
 
714
-- Register file without global reset (for synthesis)
715
 
716
RegFileWithoutRst:if not CResetRegFile generate
717
 
718
R0_R25:process(cp2)
719
begin
720
 if (cp2='1' and cp2'event) then
721
  if (cp2en='1') then                                                     -- Clock enable        
722
   for i in 0 to 25 loop
723
    if register_wr_en(i)='1' then
724
     register_file(i) <= reg_rd_in;
725
    end if;
726
   end loop;
727
  end if;
728
 end if;
729
end process;
730
 
731
 
732
-- R26 (LOW)
733
R26:process(cp2)
734
begin
735
 if (cp2='1' and cp2'event) then
736
  if (cp2en='1') then                                                     -- Clock enable        
737
   if register_wr_en(26)='1' then
738
    r26h <= reg_rd_in;
739
   elsif (reg_h_adr(0)='1'and reg_h_wr='1') then
740
    r26h <= reg_h_in(7 downto 0);
741
   end if;
742
  end if;
743
 end if;
744
end process;
745
 
746
-- R27 (HIGH)
747
R27:process(cp2)
748
begin
749
 if (cp2='1' and cp2'event) then
750
  if (cp2en='1') then                                                     -- Clock enable        
751
   if register_wr_en(27)='1' then
752
    r27h <= reg_rd_in;
753
   elsif (reg_h_adr(0)='1'and reg_h_wr='1') then
754
    r27h <= reg_h_in(15 downto 8);
755
   end if;
756
  end if;
757
 end if;
758
end process;
759
 
760
-- R28 (LOW)
761
R28:process(cp2)
762
begin
763
 if (cp2='1' and cp2'event) then
764
  if (cp2en='1') then                                                     -- Clock enable        
765
   if register_wr_en(28)='1' then
766
    r28h <= reg_rd_in;
767
   elsif (reg_h_adr(1)='1'and reg_h_wr='1') then
768
    r28h <= reg_h_in(7 downto 0);
769
   end if;
770
  end if;
771
 end if;
772
end process;
773
 
774
-- R29 (HIGH)
775
R29:process(cp2)
776
begin
777
 if (cp2='1' and cp2'event) then
778
  if (cp2en='1') then                                                     -- Clock enable        
779
   if register_wr_en(29)='1' then
780
    r29h <= reg_rd_in;
781
   elsif (reg_h_adr(1)='1'and reg_h_wr='1') then
782
    r29h <= reg_h_in(15 downto 8);
783
   end if;
784
  end if;
785
 end if;
786
end process;
787
 
788
-- R30 (LOW)
789
R30:process(cp2)
790
begin
791
 if (cp2='1' and cp2'event) then
792
  if (cp2en='1') then                                                     -- Clock enable        
793
   if register_wr_en(30)='1' then
794
    r30h <= reg_rd_in;
795
   elsif (reg_h_adr(2)='1'and reg_h_wr='1') then
796
    r30h <= reg_h_in(7 downto 0);
797
   end if;
798
  end if;
799
 end if;
800
end process;
801
 
802
-- R31 (HIGH)
803
R31:process(cp2)
804
begin
805
 if (cp2='1' and cp2'event) then
806
  if (cp2en='1') then                                                     -- Clock enable        
807
   if register_wr_en(31)='1' then
808
    r31h <= reg_rd_in;
809
   elsif (reg_h_adr(2)='1'and reg_h_wr='1') then
810
    r31h <= reg_h_in(15 downto 8);
811
   end if;
812
  end if;
813
 end if;
814
end process;
815
 
816
end generate;
817
 
818
end RTL;

powered by: WebSVN 2.1.0

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