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

Subversion Repositories xmatchpro

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 eejlny
--This library is free software; you can redistribute it and/or
2
--modify it under the terms of the GNU Lesser General Public
3
--License as published by the Free Software Foundation; either
4
--version 2.1 of the License, or (at your option) any later version.
5
 
6
--This library is distributed in the hope that it will be useful,
7
--but WITHOUT ANY WARRANTY; without even the implied warranty of
8
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9
--Lesser General Public License for more details.
10
 
11
--You should have received a copy of the GNU Lesser General Public
12
--License along with this library; if not, write to the Free Software
13
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
14
 
15
-- e_mail : j.l.nunez-yanez@byacom.co.uk
16
 
17
---------------------------------------------
18
--  ENTITY       = INPUT_BUFFER_32_32     --
19
--  version      = 1.0                     --
20
--  last update  = 30/05/00                --
21
--  author       = Jose Nunez              --
22
---------------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- This input buffer loads 32 bits of data from the input bus and writes 32 bit of data to the parsing unit
27
-- 256x32 bit word to handle a block of 1 Kbyte. Then the buffer waits for the all data processed signal before requesting more data.
28
 
29
--  PIN LIST
30
 
31
--  START = activate the buffer
32
--  FINISHED = the buffer block has been process in the engine. load more data if required
33
--  READY = data ready to be processed in the buffer.
34
--  DATA_IN_32  = input data from the 32 bit input bus
35
--  BUS_ACKNOWLEDGE = Data is available in the input bus.
36
--  DATA_OUT_32  = output data to the 32 bit wide output bus
37
--  EMPTY = all the data present in the buffer has been processed
38
--  BUS_REQUEST = output requesting data to be processed
39
--  CLEAR    = asynchronous clear
40
--  CLK      = master clock
41
 
42
 
43
library ieee,dzx;
44
use ieee.std_logic_1164.all;
45
use IEEE.std_logic_arith.all;
46
use dzx.bit_arith.all;
47
library xil_lib;
48
use xil_lib.xil_comp.all;
49
use work.tech_package.all;
50
 
51
 
52
entity INPUT_BUFFER_32_32 is
53
port
54
(
55
  OVERFLOW_CONTROL : in bit;
56
  FORCE_STOP : in bit;
57
        START : in bit;
58
        COMP : in bit;
59
        STOP : in bit;
60
        READ : in bit;
61
        WAITN : in bit;
62
        DATA_IN_32 : in bit_vector(31 downto 0);
63
        BUS_ACKNOWLEDGE : in bit;
64
        CLEAR : in bit ;
65
        CLK : in bit ;
66
        DATA_OUT_32: out bit_vector(31 downto 0);
67
        READY : out bit; -- data ready for the parser
68
        INC_TC : out bit;
69
        RESET_TOTAL_COUNTER : out bit;
70
        BUS_REQUEST : out bit
71
);
72
 
73
end INPUT_BUFFER_32_32;
74
 
75
 
76
architecture STRUCTURAL of INPUT_BUFFER_32_32 is
77
 
78
-- xilinx memory
79
 
80
component DP_RAM_XILINX_256
81
        port (
82
        addra: IN std_logic_VECTOR(7 downto 0);
83
        clka: IN std_logic;
84
        addrb: IN std_logic_VECTOR(7 downto 0);
85
        clkb: IN std_logic;
86
        dina: IN std_logic_VECTOR(31 downto 0);
87
        wea: IN std_logic_vector (0 downto 0);
88
        enb: IN std_logic;
89
        doutb: OUT std_logic_VECTOR(31 downto 0));
90
end component;
91
 
92
-- Synplicity black box declaration
93
--attribute black_box : boolean;
94
--attribute black_box of DP_RAM_XILINX: component is true;
95
 
96
 
97
 
98
-- Actel memory
99
 
100
-- component MY_MEMORY
101
 
102
--   port(DO : out std_logic_vector (31 downto 0);
103
--      RCLOCK : in std_logic;
104
--      WCLOCK : in std_logic;
105
--      DI : in std_logic_vector (31 downto 0);
106
--      WRB : in std_logic;
107
--      RDB : in std_logic;
108
--      WADDR : in std_logic_vector (7 downto 0);
109
--      RADDR : in std_logic_vector (7 downto 0));
110
 
111
--end component;
112
 
113
 
114
 
115
--component syn_dpram_256x32_rawr
116
--port (
117
--              Data : in std_logic_vector(31 downto 0);
118
--              RdAddress : in std_logic_vector(7 downto 0);
119
--              WrAddress : in std_logic_vector(7 downto 0);
120
--              RdEn : in std_logic;
121
--              WrEn : in std_logic;
122
--              Q : out std_logic_vector(31 downto 0);
123
--              RdClock : in std_logic;
124
--              RdClken : in std_logic;
125
--              WrClock : in std_logic;
126
--              WrClken : in std_logic
127
--           );
128
--end component;
129
 
130
-- TSMC DPRAM
131
 
132
  component ra2sh_256W_32B_8MX_offWRMSK_8WRGRAN
133
 
134
  port (
135
        CLKA: in std_logic;
136
        CENA: in std_logic;
137
        WENA: in std_logic;
138
        AA: in std_logic_vector(7 downto 0);
139
        DA: in std_logic_vector(31 downto 0);
140
        QA: out std_logic_vector(31 downto 0);
141
        CLKB: in std_logic;
142
        CENB: in std_logic;
143
        WENB: in std_logic;
144
        AB: in std_logic_vector(7 downto 0);
145
        DB: in std_logic_vector(31 downto 0);
146
        QB: out std_logic_vector(31 downto 0)
147
    );
148
 
149
    end component;
150
 
151
-- component LPM_RAM_DP
152
--      generic (LPM_WIDTH    : positive ;
153
--               LPM_WIDTHAD  : positive;
154
--               LPM_NUMWORDS : positive;
155
--               LPM_INDATA   : string ;
156
--               LPM_RDADDRESS_CONTROL : string ;
157
--               LPM_WRADDRESS_CONTROL : string ;
158
--               LPM_OUTDATA  : string ;
159
--               LPM_TYPE     : string ;
160
--               LPM_FILE     : string ;
161
--             LPM_HINT     : string );
162
--      port (RDCLOCK : in std_logic;
163
--            RDCLKEN : in std_logic;
164
--            RDADDRESS : in std_logic_vector(7 downto 0);
165
--            RDEN : in std_logic;
166
--            DATA : in std_logic_vector(31 downto 0);
167
--           WRADDRESS : in std_logic_vector(7 downto 0);
168
--            WREN : in std_logic;
169
--            WRCLOCK : in std_logic;
170
--            WRCLKEN : in std_logic;
171
--            Q : out std_logic_vector(31 downto 0));
172
--end component;
173
 
174
--attribute noopt: boolean;
175
--attribute noopt of LPM_RAM_DP: component is true;
176
 
177
 
178
component INPUT_BUFFER_CU
179
 
180
port (
181
    OVERFLOW_CONTROL : in bit;
182
    FORCE_STOP : in bit;
183
          START : in bit;
184
          STOP : in bit;
185
          BUS_ACKNOWLEDGE : in bit;
186
          WAITN : in bit;
187
          CODING_READ_ADDRESS : in bit_vector(7 downto 0);
188
          CODING_WRITE_ADDRESS : in bit_vector(7 downto 0);
189
          CLK : in bit;
190
          CLEAR : in bit;
191
          BUS_REQUEST : out bit;
192
      CLEAR_COUNTERS : out bit;
193
          RESET_TOTAL_COUNTER : out bit; -- only once per whole block
194
          ENABLE_PARSER : out bit;
195
          ENABLE_WRITE : out bit;
196
          ENABLE_READ : out bit
197
         );
198
end component;
199
 
200
 
201
component INPUT_COUNTER
202
 
203
port (ENABLE : in bit;
204
          CLEAR : in bit;
205
          CLEAR_COUNTERS : in bit;
206
          CLK : in bit;
207
          COUNT : out bit_vector(7 downto 0)
208
     );
209
 
210
end component;
211
 
212
 
213
-- 1 bit for the 64-to-32 multiplexor
214
 
215
signal CODING_READ_ADDRESS : bit_vector(7 downto 0);
216
signal CODING_WRITE_ADDRESS : bit_vector(7 downto 0);
217
signal ENABLE_WRITE : bit;
218
signal ENABLE_READ  : bit;
219
signal DATA_OUT_AUX : std_logic_vector(31 downto 0);
220
signal READ_CLK : bit;
221
signal WRITE_CLK : bit;
222
signal WRITE_CLK_ENABLE : bit;
223
signal READ_CLK_ENABLE : bit;
224
signal ENABLE_READ_INT : bit;
225
signal ENABLE_WRITE_INT : bit;
226
signal BUS_REQUEST_INT : bit;
227
signal CLEAR_COUNTERS : bit;
228
 
229
 
230
signal DATA_SB :std_logic_vector(31 downto 0);
231
signal RDADDRESS_SB :std_logic_vector(7 downto 0);
232
signal WRADDRESS_SB :std_logic_vector(7 downto 0);
233
signal RDEN_SB :std_logic;
234
signal WREN_SB :std_logic;
235
signal RDCLOCK_SB :std_logic;
236
signal RDCLKEN_SB :std_logic;
237
signal WRCLOCK_SB :std_logic;
238
signal WRCLKEN_SB :std_logic;
239
signal READY_AUX : bit;
240
signal ENABLE_WRITE_WITH_WAIT : bit;
241
 
242
 
243
signal LOGIC_0 : std_logic := '0';
244
signal tsmc_cena_n , tsmc_cenb_n : std_logic;
245
signal tsmc_wena_n , tsmc_wenb_n : std_logic;
246
 
247
begin
248
 
249
 
250
CONTROL_UNIT : INPUT_BUFFER_CU
251
port map(
252
    OVERFLOW_CONTROL => OVERFLOW_CONTROL,
253
    FORCE_STOP => FORCE_STOP,
254
          START => START,
255
          STOP => STOP,
256
          BUS_ACKNOWLEDGE => BUS_ACKNOWLEDGE,
257
          WAITN => WAITN,
258
          CODING_READ_ADDRESS => CODING_READ_ADDRESS,
259
          CODING_WRITE_ADDRESS => CODING_WRITE_ADDRESS,
260
          CLK => CLK,
261
          CLEAR => CLEAR,
262
          ENABLE_WRITE => ENABLE_WRITE_INT,
263
          ENABLE_READ => ENABLE_READ_INT,
264
          ENABLE_PARSER => READY_AUX, -- data for the parser ready 
265
      CLEAR_COUNTERS => CLEAR_COUNTERS,
266
          RESET_TOTAL_COUNTER => RESET_TOTAL_COUNTER,
267
          BUS_REQUEST => BUS_REQUEST_INT
268
         );
269
 
270
 
271
 
272
READ_COUNTER : INPUT_COUNTER
273
port map(ENABLE => ENABLE_READ,
274
          CLEAR => CLEAR,
275
          CLEAR_COUNTERS => CLEAR_COUNTERS,
276
          CLK => CLK,
277
          COUNT => CODING_READ_ADDRESS
278
     );
279
 
280
 
281
WRITE_COUNTER : INPUT_COUNTER
282
port map(ENABLE => ENABLE_WRITE_WITH_WAIT,
283
          CLEAR =>CLEAR,
284
         CLEAR_COUNTERS => CLEAR_COUNTERS,
285
          CLK => CLK,
286
          COUNT => CODING_WRITE_ADDRESS
287
     );
288
 
289
ENABLE_WRITE_WITH_WAIT <= ENABLE_WRITE and WAITN;
290
 
291
-- xilinx memory
292
 
293
RAM_SB: DP_RAM_XILINX_256
294
        port map(
295
                        addra => WRADDRESS_SB,
296
                        clka =>  WRCLOCK_SB,
297
                        addrb => RDADDRESS_SB,
298
                        clkb => RDCLOCK_SB,
299
                        dina => DATA_SB,
300
                        wea(0) => WREN_SB,
301
                        enb =>  RDEN_SB,
302
                        doutb =>  DATA_OUT_AUX(31 downto 0));
303
 
304
-- Actel memory
305
 
306
--RAM_SB : MY_MEMORY
307
--port map(DO => DATA_OUT_AUX(31 downto 0),
308
--      RCLOCK =>RDCLOCK_SB,
309
--      WCLOCK =>WRCLOCK_SB,
310
--      DI => DATA_SB,
311
--      WRB => WREN_SB,
312
--      RDB =>RDEN_SB,
313
--      WADDR => WRADDRESS_SB,
314
--      RADDR => RDADDRESS_SB
315
--);
316
 
317
-- Altera memory
318
 
319
-- Altera memory
320
 
321
-- pragma translate off
322
 
323
--ALT_RAM :
324
--
325
--if (not TSMC013) generate
326
--
327
--RAM_SB: LPM_RAM_DP
328
--generic map(LPM_WIDTH => 32,
329
--         LPM_WIDTHAD  => 8,
330
--         LPM_NUMWORDS => 256,
331
--                  LPM_INDATA => "REGISTERED",
332
--         LPM_OUTDATA  =>  "UNREGISTERED",
333
--                  LPM_RDADDRESS_CONTROL => "REGISTERED",
334
--                  LPM_WRADDRESS_CONTROL => "REGISTERED",
335
--                  LPM_FILE  => "UNUSED",
336
--                  LPM_TYPE  => "LPM_RAM_DP",
337
--                  LPM_HINT => "UNUSED")         
338
--port map(
339
--              DATA=> DATA_SB,
340
--              RDADDRESS=> RDADDRESS_SB,
341
--              WRADDRESS=> WRADDRESS_SB,
342
--              RDEN=> RDEN_SB,
343
--              WREN=> WREN_SB,
344
--              Q=> DATA_OUT_AUX(31 downto 0),
345
--              RDCLOCK=> RDCLOCK_SB,
346
--             RDCLKEN=> RDCLKEN_SB,
347
--              WRCLOCK=> WRCLOCK_SB,
348
--              WRCLKEN=> WRCLKEN_SB
349
--);
350
--
351
--end generate;
352
 
353
--pragma translate on
354
 
355
-- Port 1 = R
356
 
357
-- Port 2 = R/W
358
 
359
--TSMC013_RAM :
360
--
361
--  if (TSMC013) generate
362
--    TMSC_RAM : ra2sh_256W_32B_8MX_offWRMSK_8WRGRAN port map
363
--      (
364
--        clka        =>      RDCLOCK_SB,
365
--        cena        =>      tsmc_cena_n ,
366
--        wena        =>      tsmc_wena_n,
367
--        aa          =>      RDADDRESS_SB,
368
--        da          =>      DATA_SB,
369
--        qa          =>      DATA_OUT_AUX,
370
--        clkb        =>      WRCLOCK_SB,
371
--        cenb        =>      tsmc_cenb_n,
372
--        wenb        =>      tsmc_wenb_n,
373
--        ab          =>      WRADDRESS_SB,
374
--        db          =>      DATA_SB,
375
--        qb          =>      OPEN
376
--      ) ;      
377
--
378
--  end generate;
379
 
380
tsmc_cenb_n <= not (WRCLKEN_SB);
381
 
382
tsmc_cena_n <= not (RDCLKEN_SB);
383
 
384
tsmc_wena_n <='1';
385
 
386
--    not (RDEN_SB); Always in read-mode; read-enable used to
387
 
388
--    power-up ram
389
 
390
tsmc_wenb_n <= not (WREN_SB);
391
 
392
 
393
DATA_SB<=To_X01Z(DATA_IN_32) after 5 ns;
394
RDADDRESS_SB<= To_X01Z(CODING_READ_ADDRESS) after 5 ns;
395
WRADDRESS_SB<= To_X01Z(CODING_WRITE_ADDRESS)  after 5 ns;
396
RDEN_SB<= To_X01Z(ENABLE_READ)  after 5 ns;
397
WREN_SB<= To_X01Z(ENABLE_WRITE)  after 5 ns;
398
RDCLOCK_SB<= To_X01Z(READ_CLK);
399
RDCLKEN_SB<= To_X01Z(READ_CLK_ENABLE)  after 5 ns;
400
WRCLOCK_SB<= To_X01Z(WRITE_CLK);
401
WRCLKEN_SB<= To_X01Z(WRITE_CLK_ENABLE)  after 5 ns;
402
 
403
 
404
DATA_OUT_32 <= To_bitvector(DATA_OUT_AUX);-- when ENABLE_READ_INT = '1' else x"00000000";
405
WRITE_CLK <= CLK;
406
READ_CLK <= CLK;
407
ENABLE_READ <= (ENABLE_READ_INT and READ);
408
ENABLE_WRITE <= ENABLE_WRITE_INT;
409
WRITE_CLK_ENABLE <= ENABLE_WRITE_INT;
410
READ_CLK_ENABLE <= ENABLE_READ_INT;
411
BUS_REQUEST <= BUS_REQUEST_INT;
412
READY <=READY_AUX;
413
 
414
INC_TC <= ENABLE_WRITE_WITH_WAIT;
415
 
416
end STRUCTURAL;

powered by: WebSVN 2.1.0

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