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

Subversion Repositories ffr16

[/] [ffr16/] [branches/] [APERT/] [rtl/] [050803kn/] [cf_fat16_reader.vhd] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 armando
--===========================================================================--
2
-- 
3
-- FAT16 FAT PROCESSOR UNIT (FPU)
4
--
5
--  - JANUARY 2003
6
--  - UPV / EHU.  
7
--
8
--  - APPLIED ELECTRONICS RESEARCH TEAM (APERT)-
9
--  DEPARTMENT OF ELECTRONICS AND TELECOMMUNICATIONS - BASQUE COUNTRY UNIVERSITY
10
--
11
-- THIS CODE IS DISTRIBUTED UNDER :
12
-- OpenIPCore Hardware General Public License "OHGPL" 
13
-- http://www.opencores.org/OIPC/OHGPL.shtml
14
--
15
-- Design units   : COMPACT FLASH TOOLS
16
--
17
-- File name      : cf_fat16_reader.vhd
18
--
19
-- Purpose        : fat16 computations
20
--                  
21
-- Library        : WORK
22
--
23
-- Dependencies   : IEEE.Std_Logic_1164,IEEE.STD_LOGIC_ARITH,IEEE.STD_LOGIC_UNSIGNED
24
--
25
-- Simulator      : ModelSim SE version 5.5e on a WindowsXP PC
26
--===========================================================================--
27
-------------------------------------------------------------------------------
28
-- Revision list
29
-- Version   Author                 Date           Changes
30
--
31
-- 240103     Armando Astarloa     24   January                 First VHDL synthesizable code
32
-- 190503     Armando Astarloa     19   May                             Added four more external TMP reg
33
-- 280503         Armando Astarloa        28 May                                        KCPSM V.1002 - with reset
34
-- 240603         Armando Astarloa        24    June                            Quit soft reset signals (with kcpsm 
35
--                                                                                                                                              v.1002)
36
-------------------------------------------------------------------------------
37
-- Description    : FA16 Computations. KCPSM & SOFT Instantation and ports.
38
--                  
39
-------------------------------------------------------------------------------
40
-- Entity for cf_fat16_reader Unit                                                        --
41
-------------------------------------------------------------------------------
42
library IEEE;
43
use IEEE.STD_LOGIC_1164.ALL;
44
use IEEE.STD_LOGIC_ARITH.ALL;
45
use IEEE.STD_LOGIC_UNSIGNED.ALL;
46
 
47
entity cf_fat16_reader is
48
    Port (
49
                                --
50
                                -- WISHBONE SIGNALS
51
                                --
52
                                RST_I:  in  std_logic;                                                                                                          -- WB : Global RESET signal
53
                        CLK_I:  in  std_logic;                                                                                                          -- WB : Global bus clock
54
 
55
                                --
56
                                -- MASTER INTERFACE
57
                                --
58
                                ACK_I_M:  in std_logic;                                                                                                         -- WB : Ack from the slave
59
            ADR_O_M:  out  std_logic;                                                                                                   -- WB : Register selection
60
            DAT_M:  inout  std_logic_vector(15 downto 0 );                                               -- WB : 16 bits data bus input
61
            STB_O_M:  out std_logic;                                                                                                    -- WB : Access request to the slave
62
            WE_O_M:   out  std_logic;                                                                                                   -- WB : Read/write request to the slave
63
                                TAG0_ERROR_I_M: in  std_logic;
64
                                --
65
                                -- SLAVE INTERFACE
66
                                --
67
 
68
                                ACK_O_S:  out std_logic;                                                                                                                -- WB : Ack to the master
69
--          ADR_I:  in  std_logic_vector(1 downto 0 );                                                  -- WB : Register selection
70
            DAT_O_S:  out  std_logic_vector(15 downto 0 );                                               -- WB : 16 bits data bus input
71
            STB_I_S:  in  std_logic;                                                                                                    -- WB : Access qualify from master
72
            WE_I_S:   in  std_logic;                                                                                                    -- WB : Read/write request from master
73
                                TAG0_WORD_AVAILABLE_O_S:  out  std_logic;
74
                                TAG1_ERROR_O_S:  out  std_logic                                                                                 -- Error on cf access
75
                                );
76
end cf_fat16_reader;
77
 
78
architecture Behavioral of cf_fat16_reader is
79
--
80
-- COMPONENT : KCPSM MICRO PICOBLAZE
81
--
82
component kcpsm is
83
                Port (
84
                                          address:      out std_logic_vector(7 downto 0);
85
                 instruction : in std_logic_vector(15 downto 0);
86
                     port_id : out std_logic_vector(7 downto 0);
87
                write_strobe : out std_logic;
88
                    out_port : out std_logic_vector(7 downto 0);
89
                 read_strobe : out std_logic;
90
                     in_port : in std_logic_vector(7 downto 0);
91
                   interrupt : in std_logic;
92
                       reset : in std_logic;
93
                         clk : in std_logic
94
                                );
95
end component;
96
 
97
--
98
-- COMPONENT :FIRMWARE ROM
99
--
100
component fat16rd is
101
    Port (
102
                                instruction: out std_logic_vector(15 downto 0);
103
                                address: in std_logic_vector(7 downto 0);
104
                                clk: in std_logic
105
                        );
106
 
107
end component;
108
--
109
-- MODULE INTERCONNECTION SIGNALS
110
--
111
signal ADDRESS_BUS : std_logic_vector(7 downto 0);                                               -- FIRMWARE ROM ADDRESSES BUS
112
signal INSTRUCTIONS_BUS : std_logic_vector(15 downto 0);                         -- INSTRUCTIONS BUS
113
signal INPUTS_BUS : std_logic_vector(7 downto 0);                                                -- INPUTS BUS
114
signal OUTPUTS_BUS : std_logic_vector(7 downto 0);                                               -- OUTPUTS BUS
115
signal PORTS_ID : std_logic_vector(7 downto 0);                                                  -- PORTS ID
116
signal READ_STROBE : std_logic;
117
signal WRITE_STROBE : std_logic;
118
signal INTERRUPT : std_logic;
119
 
120
--
121
-- INTERNAL REGISTERS
122
--
123
 
124
 
125
signal DATA_WB_OUT_7_0_MASTER: std_logic_vector(7 downto 0);             -- WISHBONE DATA OUTPUT BUS
126
signal DATA_WB_OUT_15_8_MASTER: std_logic_vector(7 downto 0);            -- WISHBONE DATA OUTPUT BUS 
127
signal CONTROL_WB_OUT_MASTER: std_logic_vector(2 downto 0);                      -- WISHBONE CONTROL SIGNALS
128
signal DATA_WB_OUT_7_0_SLAVE: std_logic_vector(7 downto 0);                      -- WISHBONE DATA OUTPUT BUS
129
signal DATA_WB_OUT_15_8_SLAVE: std_logic_vector(7 downto 0);             -- WISHBONE DATA OUTPUT BUS 
130
signal CONTROL_WB_OUT_SLAVE: std_logic_vector(2 downto 0);                       -- WISHBONE CONTROL SIGNALS
131
signal CONTROL_OUT_MASTER: std_logic;                                                                           -- WRITE ENABLE FOR TRIESTATE BUSES
132
signal CONTROL_OUT_SLAVE: std_logic;                                                                            -- WRITE ENABLE FOR TRIESTATE BUSES
133
 
134
signal TMP_0 : std_logic_vector(7 downto 0);                                                             -- EXTERNAL TEMPORAL REGISTER 0
135
signal TMP_1 : std_logic_vector(7 downto 0);                                                             -- EXTERNAL TEMPORAL REGISTER 1
136
signal TMP_2 : std_logic_vector(7 downto 0);                                                             -- EXTERNAL TEMPORAL REGISTER 2
137
signal TMP_3 : std_logic_vector(7 downto 0);                                                             -- EXTERNAL TEMPORAL REGISTER 3
138
signal TMP_4 : std_logic_vector(7 downto 0);                                                             -- EXTERNAL TEMPORAL REGISTER 0
139
signal TMP_5 : std_logic_vector(7 downto 0);                                                             -- EXTERNAL TEMPORAL REGISTER 1
140
signal TMP_6 : std_logic_vector(7 downto 0);                                                             -- EXTERNAL TEMPORAL REGISTER 2
141
signal TMP_7 : std_logic_vector(7 downto 0);                                                             -- EXTERNAL TEMPORAL REGISTER 3
142
 
143
signal DATA_WB_IN_7_0_MASTER: std_logic_vector(7 downto 0);                      -- WISHBONE DATA OUTPUT BUS
144
signal DATA_WB_IN_15_8_MASTER: std_logic_vector(7 downto 0);             -- WISHBONE DATA OUTPUT BUS 
145
 
146
signal CONTROL_WB_IN_MASTER : std_logic_vector(1 downto 0);
147
signal CONTROL_WB_IN_SLAVE : std_logic_vector(1 downto 0);
148
 
149
--
150
-- CLOCK ENABLE FOR THE REGISTERS
151
--
152
signal DATA_WB_OUT_7_0_MASTER_CE : std_logic;
153
signal DATA_WB_OUT_15_8_MASTER_CE : std_logic;
154
signal CONTROL_WB_OUT_MASTER_CE : std_logic;
155
signal DATA_WB_OUT_7_0_SLAVE_CE : std_logic;
156
signal DATA_WB_OUT_15_8_SLAVE_CE : std_logic;
157
signal CONTROL_WB_OUT_SLAVE_CE : std_logic;
158
signal CONTROL_OUT_MASTER_CE : std_logic;
159
signal CONTROL_OUT_SLAVE_CE : std_logic;
160
 
161
signal TMP_0_CE : std_logic;
162
signal TMP_1_CE : std_logic;
163
signal TMP_2_CE : std_logic;
164
signal TMP_3_CE : std_logic;
165
signal TMP_4_CE : std_logic;
166
signal TMP_5_CE : std_logic;
167
signal TMP_6_CE : std_logic;
168
signal TMP_7_CE : std_logic;
169
 
170
--
171
-- OUTPUTS ENABLES (TO THE INPUTS BUS)FOR THE INPUTS REGISTER
172
--
173
signal DATA_WB_IN_7_0_MASTER_OE: std_logic;
174
signal DATA_WB_IN_15_8_MASTER_OE: std_logic;
175
 
176
signal CONTROL_WB_IN_MASTER_OE : std_logic;
177
signal CONTROL_WB_IN_SLAVE_OE : std_logic;
178
 
179
signal TMP_0_OE : std_logic;
180
signal TMP_1_OE : std_logic;
181
signal TMP_2_OE : std_logic;
182
signal TMP_3_OE : std_logic;
183
signal TMP_4_OE : std_logic;
184
signal TMP_5_OE : std_logic;
185
signal TMP_6_OE : std_logic;
186
signal TMP_7_OE : std_logic;
187
--
188
-- INTERNAL SIGNALS
189
--
190
 
191
signal WB_MASTER_BUS_WRITE_ENABLE : std_logic;
192
signal WB_SLAVE_BUS_WRITE_ENABLE : std_logic;
193
 
194
begin
195
 
196
--
197
-- COMPONENTS INSTANTATION
198
--
199
 
200
--
201
-- KCPSM INSTANTATION
202
--
203
micro:kcpsm port map (
204
                                address => ADDRESS_BUS,
205
                                instruction => INSTRUCTIONS_BUS,
206
                                port_id => PORTS_ID,
207
                                write_strobe => WRITE_STROBE,
208
                                out_port => OUTPUTS_BUS,
209
                                read_strobe => READ_STROBE,
210
                                in_port => INPUTS_BUS,
211
                                interrupt => INTERRUPT,
212
                                reset => RST_I,
213
                                clk => CLK_I);
214
--
215
-- FIRMWARE ROM INSTANTATION
216
--
217
rom:fat16rd port map (
218
                                instruction => INSTRUCTIONS_BUS,
219
                                address => ADDRESS_BUS,
220
                                clk => CLK_I);
221
 
222
--
223
-- BUSES CONTROL
224
--
225
        INTERRUPT <= '0';
226
--
227
-- WB MASTER 
228
--
229
                                                                                                                                                        -- WISHBONE BUS COMPOSITION
230
 
231
        DAT_M <= (DATA_WB_OUT_15_8_MASTER & DATA_WB_OUT_7_0_MASTER) when
232
        WB_MASTER_BUS_WRITE_ENABLE='1' else (others => 'Z');
233
        DATA_WB_IN_15_8_MASTER <= DAT_M(15 downto 8);
234
        DATA_WB_IN_7_0_MASTER <= DAT_M(7 downto 0);
235
                                                                                                                                                        -- WB MASTER INTERFACE CONTROL                  
236
                                                                                                                                                        -- D2 = A0_MASTER
237
                                                                                                                                                        -- D1 = W_WE_MASTER
238
                                                                                                                                                        -- D0 = STB_O_MASTER
239
        ADR_O_M <= CONTROL_WB_OUT_MASTER(2);
240
        WE_O_M <= CONTROL_WB_OUT_MASTER(1);
241
        STB_O_M <= CONTROL_WB_OUT_MASTER(0);
242
                                                                                                                                                        -- GENERAL CONTROL SIG. MASTER
243
                                                                                                                                                        -- D0 = WB_BUS_MASTER_WRITE_ENABLE
244
 
245
        WB_MASTER_BUS_WRITE_ENABLE <= CONTROL_OUT_MASTER;
246
 
247
 
248
--
249
-- WB SLAVE 
250
--
251
        DAT_O_S <= DATA_WB_OUT_15_8_SLAVE & DATA_WB_OUT_7_0_SLAVE;
252
                                                                                                                                                        -- WB SLAVE INTERFACE CONTROL
253
                                                                                                                                                        -- D2 = TAG1_ERROR
254
                                                                                                                                                        -- D1 = TAG0_WORD_AVAILABLE
255
                                                                                                                                                        -- D0 = ACK_O_SLAVE
256
 
257
        TAG1_ERROR_O_S <= CONTROL_WB_OUT_SLAVE(2);
258
        TAG0_WORD_AVAILABLE_O_S <= CONTROL_WB_OUT_SLAVE(1);
259
        ACK_O_S <= CONTROL_WB_OUT_SLAVE(0);
260
                                                                                                                                                        -- GENERAL CONTROL SIG. SLAVE
261
                                                                                                                                                        -- D0 = WB_BUS_SLAVE_WRITE_ENABLE
262
 
263
        WB_SLAVE_BUS_WRITE_ENABLE <= CONTROL_OUT_SLAVE;
264
 
265
--
266
-- INPUTS
267
--
268
--
269
-- WB MASTER 
270
--
271
                                                                                                                                                        -- D1 = ERROR_INPUT
272
                                                                                                                                                        -- D0 = ACK_I_MASTER
273
 
274
 
275
        CONTROL_WB_IN_MASTER (1) <= TAG0_ERROR_I_M;
276
        CONTROL_WB_IN_MASTER (0) <= ACK_I_M;
277
 
278
--
279
-- WB SLAVE
280
--
281
                                                                                                                                                        -- D1 = TAG0_FORCE_RESET
282
                                                                                                                                                        -- D0 = STB_I_SLAVE     
283
        CONTROL_WB_IN_SLAVE (0) <= STB_I_S;
284
 
285
--
286
-- INPUT PORTS DECODING
287
--
288
-- KCPSM DATASHEET NOTE: 
289
-- The user interface logic is required to decode the port address value 
290
-- and supply the correct data. Note that the Read_Strobe provides an 
291
-- indicator that a port has been read, but in not vital to qualify a valid address.
292
--
293
process (CLK_I, RST_I)
294
begin
295
                                --
296
                                -- INPUT PORTS RESET STATE
297
                                --
298
        if RST_I='1' then
299
 
300
                                INPUTS_BUS <= (others => '0');   -- WISHBONE CONTROL INPUT SIGNALS
301
                                --
302
                                -- SYNCRONOUS INPUT SIGNALS SAMPLE
303
                                --
304
        elsif (CLK_I='1' and CLK_I'event) then
305
                                if DATA_WB_IN_7_0_MASTER_OE = '1' then
306
                                        INPUTS_BUS <= DATA_WB_IN_7_0_MASTER;
307
                                elsif DATA_WB_IN_15_8_MASTER_OE = '1' THEN
308
                                        INPUTS_BUS <= DATA_WB_IN_15_8_MASTER;
309
                                elsif CONTROL_WB_IN_MASTER_OE = '1' THEN
310
                                        INPUTS_BUS(7 downto 2) <= (others => '0');
311
                                        INPUTS_BUS(1 downto 0) <= CONTROL_WB_IN_MASTER;
312
                                elsif CONTROL_WB_IN_SLAVE_OE = '1' THEN
313
                                        INPUTS_BUS(7 downto 2) <= (others => '0');
314
                                        INPUTS_BUS(1 downto 0) <= CONTROL_WB_IN_SLAVE;
315
                                elsif TMP_0_OE = '1' THEN
316
                                        INPUTS_BUS <= TMP_0;
317
                                elsif TMP_1_OE = '1' THEN
318
                                        INPUTS_BUS <= TMP_1;
319
                                elsif TMP_2_OE = '1' THEN
320
                                        INPUTS_BUS <= TMP_2;
321
                                elsif TMP_3_OE = '1' THEN
322
                                        INPUTS_BUS <= TMP_3;
323
                                elsif TMP_4_OE = '1' THEN
324
                                        INPUTS_BUS <= TMP_4;
325
                                elsif TMP_5_OE = '1' THEN
326
                                        INPUTS_BUS <= TMP_5;
327
                                elsif TMP_6_OE = '1' THEN
328
                                        INPUTS_BUS <= TMP_6;
329
                                elsif TMP_7_OE = '1' THEN
330
                                        INPUTS_BUS <= TMP_7;
331
                                else
332
                                        INPUTS_BUS <= (others => '0');
333
                                end if;
334
 
335
        end if;
336
end process;
337
 
338
--
339
-- OUTPUT PORTS DECODING
340
--
341
-- KCPSM DATASHEET NOTE: The user interface logic is required to decode the port 
342
-- address value and enable the correct logic to capture the data value. The
343
---Write_Strobe must be used in this case ensure the transfer of valid data only.
344
--
345
--
346
process (CLK_I, RST_I)
347
begin
348
                                --
349
                                -- OUTPUT PORTS RESET STATE
350
                                --
351
        if      RST_I = '1' then
352
 
353
 
354
 
355
                        DATA_WB_OUT_7_0_MASTER <= (others => 'Z');
356
                        DATA_WB_OUT_15_8_MASTER <= (others => 'Z');
357
                        CONTROL_WB_OUT_MASTER <= (others => 'Z');
358
                        DATA_WB_OUT_7_0_SLAVE <= (others => 'Z');
359
                        DATA_WB_OUT_15_8_SLAVE <= (others => 'Z');
360
                        CONTROL_WB_OUT_SLAVE <= (others => 'Z');
361
                        CONTROL_OUT_MASTER <= 'Z';
362
                        CONTROL_OUT_SLAVE <= 'Z';
363
 
364
                                --
365
                                -- SYNC LOAD
366
                                --
367
        elsif (CLK_I='1' and CLK_I'event) then
368
                if DATA_WB_OUT_7_0_MASTER_CE='1' then
369
                        DATA_WB_OUT_7_0_MASTER<= OUTPUTS_BUS;
370
                elsif DATA_WB_OUT_15_8_MASTER_CE='1' then
371
                        DATA_WB_OUT_15_8_MASTER <= OUTPUTS_BUS;
372
                elsif CONTROL_WB_OUT_MASTER_CE='1' then
373
                        CONTROL_WB_OUT_MASTER <= OUTPUTS_BUS(2 downto 0);
374
                elsif DATA_WB_OUT_7_0_SLAVE_CE='1' then
375
                        DATA_WB_OUT_7_0_SLAVE <= OUTPUTS_BUS;
376
                elsif DATA_WB_OUT_15_8_SLAVE_CE='1' then
377
                        DATA_WB_OUT_15_8_SLAVE <= OUTPUTS_BUS;
378
                elsif CONTROL_WB_OUT_SLAVE_CE='1' then
379
                        CONTROL_WB_OUT_SLAVE <= OUTPUTS_BUS (2 downto 0);
380
                elsif CONTROL_OUT_MASTER_CE='1' then
381
                        CONTROL_OUT_MASTER <= OUTPUTS_BUS(0);
382
                elsif CONTROL_OUT_SLAVE_CE='1' then
383
                        CONTROL_OUT_SLAVE <= OUTPUTS_BUS(0);
384
                elsif TMP_0_CE='1' then
385
                        TMP_0 <= OUTPUTS_BUS;
386
                elsif TMP_1_CE='1' then
387
                        TMP_1 <= OUTPUTS_BUS;
388
                elsif TMP_2_CE='1' then
389
                        TMP_2 <= OUTPUTS_BUS;
390
                elsif TMP_3_CE='1' then
391
                        TMP_3 <= OUTPUTS_BUS;
392
                elsif TMP_4_CE='1' then
393
                        TMP_4 <= OUTPUTS_BUS;
394
                elsif TMP_5_CE='1' then
395
                        TMP_5 <= OUTPUTS_BUS;
396
                elsif TMP_6_CE='1' then
397
                        TMP_6 <= OUTPUTS_BUS;
398
                elsif TMP_7_CE='1' then
399
                        TMP_7 <= OUTPUTS_BUS;
400
                else
401
                        null;
402
                end if;
403
        end if;
404
end process;
405
--
406
-- CLOCK ENABLE GENERATION (COMBINATIONAL => STUDY SYNC. IMPROVEMENTS)
407
--
408
--
409
-- OUTPUTS
410
--
411
process (WRITE_STROBE,PORTS_ID)
412
begin
413
        if WRITE_STROBE = '1' then
414
                case PORTS_ID is
415
                        when "00000000" =>
416
                                DATA_WB_OUT_7_0_MASTER_CE <= '1';
417
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
418
                                CONTROL_WB_OUT_MASTER_CE <= '0';
419
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
420
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
421
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
422
                                CONTROL_OUT_MASTER_CE <= '0';
423
                                CONTROL_OUT_SLAVE_CE <= '0';
424
                                TMP_0_CE <= '0';
425
                                TMP_1_CE <= '0';
426
                                TMP_2_CE <= '0';
427
                                TMP_3_CE <= '0';
428
                                TMP_4_CE <= '0';
429
                                TMP_5_CE <= '0';
430
                                TMP_6_CE <= '0';
431
                                TMP_7_CE <= '0';
432
 
433
                        when "00000001" =>
434
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
435
                                DATA_WB_OUT_15_8_MASTER_CE <= '1';
436
                                CONTROL_WB_OUT_MASTER_CE <= '0';
437
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
438
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
439
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
440
                                CONTROL_OUT_MASTER_CE <= '0';
441
                                CONTROL_OUT_SLAVE_CE <= '0';
442
                                TMP_0_CE <= '0';
443
                                TMP_1_CE <= '0';
444
                                TMP_2_CE <= '0';
445
                                TMP_3_CE <= '0';
446
                                TMP_4_CE <= '0';
447
                                TMP_5_CE <= '0';
448
                                TMP_6_CE <= '0';
449
                                TMP_7_CE <= '0';
450
 
451
                        when "00000010" =>
452
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
453
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
454
                                CONTROL_WB_OUT_MASTER_CE <= '1';
455
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
456
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
457
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
458
                                CONTROL_OUT_MASTER_CE <= '0';
459
                                CONTROL_OUT_SLAVE_CE <= '0';
460
                                TMP_0_CE <= '0';
461
                                TMP_1_CE <= '0';
462
                                TMP_2_CE <= '0';
463
                                TMP_3_CE <= '0';
464
                                TMP_4_CE <= '0';
465
                                TMP_5_CE <= '0';
466
                                TMP_6_CE <= '0';
467
                                TMP_7_CE <= '0';
468
 
469
                        when "00000011" =>
470
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
471
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
472
                                CONTROL_WB_OUT_MASTER_CE <= '0';
473
                                DATA_WB_OUT_7_0_SLAVE_CE <= '1';
474
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
475
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
476
                                CONTROL_OUT_MASTER_CE <= '0';
477
                                CONTROL_OUT_SLAVE_CE <= '0';
478
                                TMP_0_CE <= '0';
479
                                TMP_1_CE <= '0';
480
                                TMP_2_CE <= '0';
481
                                TMP_3_CE <= '0';
482
                                TMP_4_CE <= '0';
483
                                TMP_5_CE <= '0';
484
                                TMP_6_CE <= '0';
485
                                TMP_7_CE <= '0';
486
 
487
                        when "00000100" =>
488
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
489
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
490
                                CONTROL_WB_OUT_MASTER_CE <= '0';
491
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
492
                                DATA_WB_OUT_15_8_SLAVE_CE <= '1';
493
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
494
                                CONTROL_OUT_MASTER_CE <= '0';
495
                                CONTROL_OUT_SLAVE_CE <= '0';
496
                                TMP_0_CE <= '0';
497
                                TMP_1_CE <= '0';
498
                                TMP_2_CE <= '0';
499
                                TMP_3_CE <= '0';
500
                                TMP_4_CE <= '0';
501
                                TMP_5_CE <= '0';
502
                                TMP_6_CE <= '0';
503
                                TMP_7_CE <= '0';
504
 
505
                        when "00000101" =>
506
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
507
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
508
                                CONTROL_WB_OUT_MASTER_CE <= '0';
509
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
510
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
511
                                CONTROL_WB_OUT_SLAVE_CE <= '1';
512
                                CONTROL_OUT_MASTER_CE <= '0';
513
                                CONTROL_OUT_SLAVE_CE <= '0';
514
                                TMP_0_CE <= '0';
515
                                TMP_1_CE <= '0';
516
                                TMP_2_CE <= '0';
517
                                TMP_3_CE <= '0';
518
                                TMP_4_CE <= '0';
519
                                TMP_5_CE <= '0';
520
                                TMP_6_CE <= '0';
521
                                TMP_7_CE <= '0';
522
 
523
                        when "00000110" =>
524
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
525
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
526
                                CONTROL_WB_OUT_MASTER_CE <= '0';
527
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
528
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
529
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
530
                                CONTROL_OUT_MASTER_CE <= '1';
531
                                CONTROL_OUT_SLAVE_CE <= '0';
532
                                TMP_0_CE <= '0';
533
                                TMP_1_CE <= '0';
534
                                TMP_2_CE <= '0';
535
                                TMP_3_CE <= '0';
536
                                TMP_4_CE <= '0';
537
                                TMP_5_CE <= '0';
538
                                TMP_6_CE <= '0';
539
                                TMP_7_CE <= '0';
540
 
541
                        when "00000111" =>
542
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
543
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
544
                                CONTROL_WB_OUT_MASTER_CE <= '0';
545
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
546
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
547
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
548
                                CONTROL_OUT_MASTER_CE <= '0';
549
                                CONTROL_OUT_SLAVE_CE <= '1';
550
                                TMP_0_CE <= '0';
551
                                TMP_1_CE <= '0';
552
                                TMP_2_CE <= '0';
553
                                TMP_3_CE <= '0';
554
                                TMP_4_CE <= '0';
555
                                TMP_5_CE <= '0';
556
                                TMP_6_CE <= '0';
557
                                TMP_7_CE <= '0';
558
 
559
                        when "00001000" =>
560
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
561
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
562
                                CONTROL_WB_OUT_MASTER_CE <= '0';
563
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
564
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
565
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
566
                                CONTROL_OUT_MASTER_CE <= '0';
567
                                CONTROL_OUT_SLAVE_CE <= '0';
568
                                TMP_0_CE <= '1';
569
                                TMP_1_CE <= '0';
570
                                TMP_2_CE <= '0';
571
                                TMP_3_CE <= '0';
572
                                TMP_4_CE <= '0';
573
                                TMP_5_CE <= '0';
574
                                TMP_6_CE <= '0';
575
                                TMP_7_CE <= '0';
576
 
577
                        when "00001001" =>
578
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
579
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
580
                                CONTROL_WB_OUT_MASTER_CE <= '0';
581
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
582
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
583
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
584
                                CONTROL_OUT_MASTER_CE <= '0';
585
                                CONTROL_OUT_SLAVE_CE <= '0';
586
                                TMP_0_CE <= '0';
587
                                TMP_1_CE <= '1';
588
                                TMP_2_CE <= '0';
589
                                TMP_3_CE <= '0';
590
                                TMP_4_CE <= '0';
591
                                TMP_5_CE <= '0';
592
                                TMP_6_CE <= '0';
593
                                TMP_7_CE <= '0';
594
 
595
                        when "00001010" =>
596
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
597
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
598
                                CONTROL_WB_OUT_MASTER_CE <= '0';
599
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
600
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
601
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
602
                                CONTROL_OUT_MASTER_CE <= '0';
603
                                CONTROL_OUT_SLAVE_CE <= '0';
604
                                TMP_0_CE <= '0';
605
                                TMP_1_CE <= '0';
606
                                TMP_2_CE <= '1';
607
                                TMP_3_CE <= '0';
608
                                TMP_4_CE <= '0';
609
                                TMP_5_CE <= '0';
610
                                TMP_6_CE <= '0';
611
                                TMP_7_CE <= '0';
612
 
613
                        when "00001011" =>
614
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
615
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
616
                                CONTROL_WB_OUT_MASTER_CE <= '0';
617
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
618
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
619
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
620
                                CONTROL_OUT_MASTER_CE <= '0';
621
                                CONTROL_OUT_SLAVE_CE <= '0';
622
                                TMP_0_CE <= '0';
623
                                TMP_1_CE <= '0';
624
                                TMP_2_CE <= '0';
625
                                TMP_3_CE <= '1';
626
                                TMP_4_CE <= '0';
627
                                TMP_5_CE <= '0';
628
                                TMP_6_CE <= '0';
629
                                TMP_7_CE <= '0';
630
 
631
                        when "00001100" =>
632
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
633
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
634
                                CONTROL_WB_OUT_MASTER_CE <= '0';
635
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
636
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
637
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
638
                                CONTROL_OUT_MASTER_CE <= '0';
639
                                CONTROL_OUT_SLAVE_CE <= '0';
640
                                TMP_0_CE <= '0';
641
                                TMP_1_CE <= '0';
642
                                TMP_2_CE <= '0';
643
                                TMP_3_CE <= '0';
644
                                TMP_4_CE <= '1';
645
                                TMP_5_CE <= '0';
646
                                TMP_6_CE <= '0';
647
                                TMP_7_CE <= '0';
648
 
649
                        when "00001101" =>
650
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
651
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
652
                                CONTROL_WB_OUT_MASTER_CE <= '0';
653
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
654
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
655
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
656
                                CONTROL_OUT_MASTER_CE <= '0';
657
                                CONTROL_OUT_SLAVE_CE <= '0';
658
                                TMP_0_CE <= '0';
659
                                TMP_1_CE <= '0';
660
                                TMP_2_CE <= '0';
661
                                TMP_3_CE <= '0';
662
                                TMP_4_CE <= '0';
663
                                TMP_5_CE <= '1';
664
                                TMP_6_CE <= '0';
665
                                TMP_7_CE <= '0';
666
 
667
                        when "00001110" =>
668
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
669
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
670
                                CONTROL_WB_OUT_MASTER_CE <= '0';
671
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
672
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
673
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
674
                                CONTROL_OUT_MASTER_CE <= '0';
675
                                CONTROL_OUT_SLAVE_CE <= '0';
676
                                TMP_0_CE <= '0';
677
                                TMP_1_CE <= '0';
678
                                TMP_2_CE <= '0';
679
                                TMP_3_CE <= '0';
680
                                TMP_4_CE <= '0';
681
                                TMP_5_CE <= '0';
682
                                TMP_6_CE <= '1';
683
                                TMP_7_CE <= '0';
684
 
685
                        when "00001111" =>
686
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
687
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
688
                                CONTROL_WB_OUT_MASTER_CE <= '0';
689
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
690
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
691
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
692
                                CONTROL_OUT_MASTER_CE <= '0';
693
                                CONTROL_OUT_SLAVE_CE <= '0';
694
                                TMP_0_CE <= '0';
695
                                TMP_1_CE <= '0';
696
                                TMP_2_CE <= '0';
697
                                TMP_3_CE <= '0';
698
                                TMP_4_CE <= '0';
699
                                TMP_5_CE <= '0';
700
                                TMP_6_CE <= '0';
701
                                TMP_7_CE <= '1';
702
 
703
                        when others =>
704
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
705
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
706
                                CONTROL_WB_OUT_MASTER_CE <= '0';
707
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
708
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
709
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
710
                                CONTROL_OUT_MASTER_CE <= '0';
711
                                CONTROL_OUT_SLAVE_CE <= '0';
712
                                TMP_0_CE <= '0';
713
                                TMP_1_CE <= '0';
714
                                TMP_2_CE <= '0';
715
                                TMP_3_CE <= '0';
716
                                TMP_4_CE <= '0';
717
                                TMP_5_CE <= '0';
718
                                TMP_6_CE <= '0';
719
                                TMP_7_CE <= '0';
720
                end case;
721
        else
722
                                DATA_WB_OUT_7_0_MASTER_CE <= '0';
723
                                DATA_WB_OUT_15_8_MASTER_CE <= '0';
724
                                CONTROL_WB_OUT_MASTER_CE <= '0';
725
                                DATA_WB_OUT_7_0_SLAVE_CE <= '0';
726
                                DATA_WB_OUT_15_8_SLAVE_CE <= '0';
727
                                CONTROL_WB_OUT_SLAVE_CE <= '0';
728
                                CONTROL_OUT_MASTER_CE <= '0';
729
                                CONTROL_OUT_SLAVE_CE <= '0';
730
                                TMP_0_CE <= '0';
731
                                TMP_1_CE <= '0';
732
                                TMP_2_CE <= '0';
733
                                TMP_3_CE <= '0';
734
                                TMP_4_CE <= '0';
735
                                TMP_5_CE <= '0';
736
                                TMP_6_CE <= '0';
737
                                TMP_7_CE <= '0';
738
 
739
        end if;
740
end process;
741
--
742
-- INPUTS
743
--
744
process (PORTS_ID)
745
begin
746
if WRITE_STROBE = '0' then
747
        case PORTS_ID is
748
                when "00000000" =>
749
                        CONTROL_WB_IN_MASTER_OE <= '1';
750
                        CONTROL_WB_IN_SLAVE_OE <= '0';
751
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
752
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
753
                        TMP_0_OE <= '0';
754
                        TMP_1_OE <= '0';
755
                        TMP_2_OE <= '0';
756
                        TMP_3_OE <= '0';
757
                        TMP_4_OE <= '0';
758
                        TMP_5_OE <= '0';
759
                        TMP_6_OE <= '0';
760
                        TMP_7_OE <= '0';
761
 
762
                when "00000001" =>
763
                        CONTROL_WB_IN_MASTER_OE <= '0';
764
                        CONTROL_WB_IN_SLAVE_OE <= '1';
765
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
766
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
767
                        TMP_0_OE <= '0';
768
                        TMP_1_OE <= '0';
769
                        TMP_2_OE <= '0';
770
                        TMP_3_OE <= '0';
771
                        TMP_4_OE <= '0';
772
                        TMP_5_OE <= '0';
773
                        TMP_6_OE <= '0';
774
                        TMP_7_OE <= '0';
775
 
776
                when "00000010" =>
777
                        CONTROL_WB_IN_MASTER_OE <= '0';
778
                        CONTROL_WB_IN_SLAVE_OE <= '0';
779
                        DATA_WB_IN_7_0_MASTER_OE <= '1';
780
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
781
                        TMP_0_OE <= '0';
782
                        TMP_1_OE <= '0';
783
                        TMP_2_OE <= '0';
784
                        TMP_3_OE <= '0';
785
                        TMP_4_OE <= '0';
786
                        TMP_5_OE <= '0';
787
                        TMP_6_OE <= '0';
788
                        TMP_7_OE <= '0';
789
 
790
                 when "00000011" =>
791
                        CONTROL_WB_IN_MASTER_OE <= '0';
792
                        CONTROL_WB_IN_SLAVE_OE <= '0';
793
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
794
                        DATA_WB_IN_15_8_MASTER_OE <= '1';
795
                        TMP_0_OE <= '0';
796
                        TMP_1_OE <= '0';
797
                        TMP_2_OE <= '0';
798
                        TMP_3_OE <= '0';
799
                        TMP_4_OE <= '0';
800
                        TMP_5_OE <= '0';
801
                        TMP_6_OE <= '0';
802
                        TMP_7_OE <= '0';
803
 
804
                 when "00000100" =>
805
                        CONTROL_WB_IN_MASTER_OE <= '0';
806
                        CONTROL_WB_IN_SLAVE_OE <= '0';
807
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
808
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
809
                        TMP_0_OE <= '1';
810
                        TMP_1_OE <= '0';
811
                        TMP_2_OE <= '0';
812
                        TMP_3_OE <= '0';
813
                        TMP_4_OE <= '0';
814
                        TMP_5_OE <= '0';
815
                        TMP_6_OE <= '0';
816
                        TMP_7_OE <= '0';
817
 
818
                when "00000101" =>
819
                        CONTROL_WB_IN_MASTER_OE <= '0';
820
                        CONTROL_WB_IN_SLAVE_OE <= '0';
821
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
822
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
823
                        TMP_0_OE <= '0';
824
                        TMP_1_OE <= '1';
825
                        TMP_2_OE <= '0';
826
                        TMP_3_OE <= '0';
827
                        TMP_4_OE <= '0';
828
                        TMP_5_OE <= '0';
829
                        TMP_6_OE <= '0';
830
                        TMP_7_OE <= '0';
831
 
832
                when "00000110" =>
833
                        CONTROL_WB_IN_MASTER_OE <= '0';
834
                        CONTROL_WB_IN_SLAVE_OE <= '0';
835
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
836
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
837
                        TMP_0_OE <= '0';
838
                        TMP_1_OE <= '0';
839
                        TMP_2_OE <= '1';
840
                        TMP_3_OE <= '0';
841
                        TMP_4_OE <= '0';
842
                        TMP_5_OE <= '0';
843
                        TMP_6_OE <= '0';
844
                        TMP_7_OE <= '0';
845
 
846
 
847
                when "00000111" =>
848
                        CONTROL_WB_IN_MASTER_OE <= '0';
849
                        CONTROL_WB_IN_SLAVE_OE <= '0';
850
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
851
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
852
                        TMP_0_OE <= '0';
853
                        TMP_1_OE <= '0';
854
                        TMP_2_OE <= '0';
855
                        TMP_3_OE <= '1';
856
                        TMP_4_OE <= '0';
857
                        TMP_5_OE <= '0';
858
                        TMP_6_OE <= '0';
859
                        TMP_7_OE <= '0';
860
 
861
                when "00001000" =>
862
                        CONTROL_WB_IN_MASTER_OE <= '0';
863
                        CONTROL_WB_IN_SLAVE_OE <= '0';
864
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
865
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
866
                        TMP_0_OE <= '0';
867
                        TMP_1_OE <= '0';
868
                        TMP_2_OE <= '0';
869
                        TMP_3_OE <= '0';
870
                        TMP_4_OE <= '1';
871
                        TMP_5_OE <= '0';
872
                        TMP_6_OE <= '0';
873
                        TMP_7_OE <= '0';
874
 
875
                when "00001001" =>
876
                        CONTROL_WB_IN_MASTER_OE <= '0';
877
                        CONTROL_WB_IN_SLAVE_OE <= '0';
878
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
879
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
880
                        TMP_0_OE <= '0';
881
                        TMP_1_OE <= '0';
882
                        TMP_2_OE <= '0';
883
                        TMP_3_OE <= '0';
884
                        TMP_4_OE <= '0';
885
                        TMP_5_OE <= '1';
886
                        TMP_6_OE <= '0';
887
                        TMP_7_OE <= '0';
888
 
889
                when "00001010" =>
890
                        CONTROL_WB_IN_MASTER_OE <= '0';
891
                        CONTROL_WB_IN_SLAVE_OE <= '0';
892
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
893
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
894
                        TMP_0_OE <= '0';
895
                        TMP_1_OE <= '0';
896
                        TMP_2_OE <= '0';
897
                        TMP_3_OE <= '0';
898
                        TMP_4_OE <= '0';
899
                        TMP_5_OE <= '0';
900
                        TMP_6_OE <= '1';
901
                        TMP_7_OE <= '0';
902
 
903
                when "00001011" =>
904
                        CONTROL_WB_IN_MASTER_OE <= '0';
905
                        CONTROL_WB_IN_SLAVE_OE <= '0';
906
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
907
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
908
                        TMP_0_OE <= '0';
909
                        TMP_1_OE <= '0';
910
                        TMP_2_OE <= '0';
911
                        TMP_3_OE <= '0';
912
                        TMP_4_OE <= '0';
913
                        TMP_5_OE <= '0';
914
                        TMP_6_OE <= '0';
915
                        TMP_7_OE <= '1';
916
 
917
                when others =>
918
                        CONTROL_WB_IN_MASTER_OE <= '0';
919
                        CONTROL_WB_IN_SLAVE_OE <= '0';
920
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
921
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
922
                        TMP_0_OE <= '0';
923
                        TMP_1_OE <= '0';
924
                        TMP_2_OE <= '0';
925
                        TMP_3_OE <= '0';
926
                        TMP_4_OE <= '0';
927
                        TMP_5_OE <= '0';
928
                        TMP_6_OE <= '0';
929
                        TMP_7_OE <= '0';
930
 
931
                end case;
932
 
933
        else
934
                        CONTROL_WB_IN_MASTER_OE <= '0';
935
                        CONTROL_WB_IN_SLAVE_OE <= '0';
936
                        DATA_WB_IN_7_0_MASTER_OE <= '0';
937
                        DATA_WB_IN_15_8_MASTER_OE <= '0';
938
                        TMP_0_OE <= '0';
939
                        TMP_1_OE <= '0';
940
                        TMP_2_OE <= '0';
941
                        TMP_3_OE <= '0';
942
                        TMP_4_OE <= '0';
943
                        TMP_5_OE <= '0';
944
                        TMP_6_OE <= '0';
945
                        TMP_7_OE <= '0';
946
 
947
end if;
948
 
949
end process;
950
 
951
end Behavioral;

powered by: WebSVN 2.1.0

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