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

Subversion Repositories gecko3

[/] [gecko3/] [trunk/] [GECKO3COM/] [gecko3com-ip/] [core/] [GECKO3COM_simple_test.vhd] - Blame information for rev 25

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

Line No. Rev Author Line
1 14 nussgipfel
--  GECKO3COM IP Core
2
--
3 23 nussgipfel
--  Copyright (C) 2010 by
4 14 nussgipfel
--   ___    ___   _   _
5
--  (  _ \ (  __)( ) ( )
6
--  | (_) )| (   | |_| |   Bern University of Applied Sciences
7
--  |  _ < |  _) |  _  |   School of Engineering and
8
--  | (_) )| |   | | | |   Information Technology
9
--  (____/ (_)   (_) (_)
10
--
11
--  This program is free software: you can redistribute it and/or modify
12
--  it under the terms of the GNU General Public License as published by
13
--  the Free Software Foundation, either version 3 of the License, or
14
--  (at your option) any later version.
15
--
16
--  This program is distributed in the hope that it will be useful,
17
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
--  GNU General Public License for more details. 
20
--  You should have received a copy of the GNU General Public License
21
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
--
23
--  URL to the project description: 
24
--    http://labs.ti.bfh.ch/gecko/wiki/systems/gecko3com/start
25 23 nussgipfel
--------------------------------------------------------------------------------
26 14 nussgipfel
--
27
--  Author:  Andreas Habegger, Christoph Zimmermann
28 23 nussgipfel
--  Date of creation: 11. February 2010
29 14 nussgipfel
--  Description:
30 23 nussgipfel
--      Test scenario for the GECKO3com simple IP core.
31
--      (Not the one for Xilinx EDK)
32
--      This test module has two operation mode (selectable by external switch):
33
--      - Send back a response message stored in rom
34 25 nussgipfel
--      - Send back a stream of pseudo random data. Size is defined as a
35
--        constant (currently 1 MiB)
36 14 nussgipfel
--
37
--  Target Devices:     general
38
--  Tool versions:      11.1
39
--  Dependencies:
40
--
41 23 nussgipfel
--------------------------------------------------------------------------------
42 14 nussgipfel
 
43 11 nussgipfel
library ieee;
44
use ieee.std_logic_1164.all;
45 24 nussgipfel
use ieee.std_logic_unsigned.all;
46 11 nussgipfel
 
47
library work;
48 14 nussgipfel
use work.GECKO3COM_defines.all;
49 11 nussgipfel
 
50 24 nussgipfel
 
51 23 nussgipfel
entity GECKO3COM_simple_test is
52 11 nussgipfel
  port (
53 23 nussgipfel
    i_nReset      : in    std_logic;
54
    i_sysclk      : in    std_logic;    -- FPGA System CLK
55
    -- Interface signals to the EZ-USB FX2
56
    i_IFCLK       : in    std_logic;    -- GPIF CLK
57
    i_WRU         : in    std_logic;    -- write from GPIF
58
    i_RDYU        : in    std_logic;    -- GPIF is ready
59
    o_WRX         : out   std_logic;    -- To write to GPIF
60
    o_RDYX        : out   std_logic;    -- IP Core is ready
61
    -- bidirect data bus
62 24 nussgipfel
    b_gpif_bus    : inout std_logic_vector(SIZE_DBUS_GPIF-1 downto 0);
63 23 nussgipfel
    -- simple test "user interface" signals
64
    o_LEDrx       : out   std_logic;    -- controll LED receive data
65
    o_LEDtx       : out   std_logic;    -- controll LED send data
66
    o_LEDrun      : out   std_logic;    -- power LED
67
    i_mode_switch : in    std_logic_vector(2 downto 0));
68
end GECKO3COM_simple_test;
69 11 nussgipfel
 
70
 
71
 
72 23 nussgipfel
architecture behavour of GECKO3COM_simple_test is
73 11 nussgipfel
 
74 23 nussgipfel
  ----------------------------------------------------------------------------- 
75
  --     CONSTANTS  
76
  -----------------------------------------------------------------------------
77
  constant BUSWIDTH : integer := 32; -- you can choose here 32 or 16
78
 
79
  -- lenght of the message stored in the response message rom:
80 24 nussgipfel
  signal c_transfer_size_rom : std_logic_vector(31 downto 0) := x"0000000E";
81 23 nussgipfel
 
82
  -- we will transmitt 1 MiB data when the pseude random number generator
83
  -- is used:
84 24 nussgipfel
  signal c_transfer_size_prng : std_logic_vector(31 downto 0) := x"00100000";
85 23 nussgipfel
 
86 11 nussgipfel
 
87 23 nussgipfel
  ----------------------------------------------------------------------------- 
88
  --     COMPONENTS  
89
  -----------------------------------------------------------------------------
90
  component GECKO3COM_simple
91
    generic (
92
      BUSWIDTH : integer);
93
    port (
94
      i_nReset                 : in    std_logic;
95
      i_sysclk                 : in    std_logic;
96
      i_receive_fifo_rd_en     : in    std_logic;
97
      o_receive_fifo_empty     : out   std_logic;
98
      o_receive_fifo_data      : out   std_logic_vector(BUSWIDTH-1 downto 0);
99
      o_receive_transfersize   : out   std_logic_vector(31 downto 0);
100
      o_receive_end_of_message : out   std_logic;
101
      o_receive_newdata        : out   std_logic;
102
      i_send_fifo_wr_en        : in    std_logic;
103
      o_send_fifo_full         : out   std_logic;
104
      i_send_fifo_data         : in    std_logic_vector(BUSWIDTH-1 downto 0);
105
      i_send_transfersize      : in    std_logic_vector(31 downto 0);
106
      i_send_transfersize_en   : in    std_logic;
107
      i_send_have_more_data    : in    std_logic;
108
      o_send_data_request      : out   std_logic;
109
      o_send_finished          : out   std_logic;
110
      o_rx                     : out   std_logic;
111
      o_tx                     : out   std_logic;
112
      i_IFCLK                  : in    std_logic;
113
      i_WRU                    : in    std_logic;
114
      i_RDYU                   : in    std_logic;
115
      o_WRX                    : out   std_logic;
116
      o_RDYX                   : out   std_logic;
117
      b_gpif_bus               : inout std_logic_vector(SIZE_DBUS_GPIF-1 downto 0));
118
  end component;
119
 
120
 
121
  component response_message_rom
122
    port (
123
      A : in  std_logic_vector(3 downto 0);
124
      D : out std_logic_vector(31 downto 0));
125
  end component;
126 11 nussgipfel
 
127 23 nussgipfel
  -----------------------------------------------------------------------------
128
  -- interconection signals
129
  -----------------------------------------------------------------------------
130 11 nussgipfel
 
131 23 nussgipfel
  signal s_receive_fifo_rd_en     : std_logic;
132
  signal s_receive_fifo_empty     : std_logic;
133
  signal s_receive_fifo_data      : std_logic_vector(BUSWIDTH-1 downto 0);
134
  signal s_receive_transfersize   : std_logic_vector(31 downto 0);
135
  signal s_receive_end_of_message : std_logic;
136
  signal s_receive_newdata        : std_logic;
137
  signal s_send_fifo_wr_en        : std_logic;
138
  signal s_send_fifo_full         : std_logic;
139
  signal s_send_fifo_data         : std_logic_vector(BUSWIDTH-1 downto 0);
140
  signal s_send_transfersize      : std_logic_vector(31 downto 0);
141
  signal s_send_transfersize_en   : std_logic;
142
  signal s_send_have_more_data    : std_logic;
143
  signal s_send_data_request      : std_logic;
144
  signal s_send_finished          : std_logic;
145
 
146
  signal s_mode                              : std_logic_vector(1 downto 0);
147
  signal s_transfer_size_reg_select          : std_logic;
148
  signal s_transfer_size_reg_en              : std_logic;
149
  signal s_send_counter_reset                : std_logic;
150
  signal s_send_counter_en                   : std_logic;
151
  signal s_send_counter_equals_transfer_size : std_logic;
152
  signal s_prng_en                           : std_logic;
153
  signal s_prng_feedback                     : std_logic;
154
  signal s_receive_data_error                : std_logic;
155
 
156
  signal s_receive_data_old        : std_logic_vector(31 downto 0);
157
  signal s_selected_transfer_size  : std_logic_vector(31 downto 0);
158
  signal s_remaining_transfer_size : std_logic_vector(31 downto 0);
159 24 nussgipfel
  signal s_subtract_value          : std_logic_vector(31 downto 0);
160 23 nussgipfel
  signal s_send_counter_value      : std_logic_vector(31 downto 0);
161
  signal s_prng_data               : std_logic_vector(31 downto 0);
162
  signal s_message_rom_data        : std_logic_vector(31 downto 0);
163
 
164 24 nussgipfel
 
165 11 nussgipfel
  -----------------------------------------------------------------------------
166 23 nussgipfel
  -- finite state machine signals
167 11 nussgipfel
  -----------------------------------------------------------------------------
168 23 nussgipfel
    -- XST specific synthesize attributes
169
  attribute safe_implementation: string;
170
  attribute safe_recovery_state: string;
171 11 nussgipfel
 
172 23 nussgipfel
  type t_fsmState is (st1_idle, st2_get_data, st3_load_total_transfer_size,
173
                      st4_save_remaining_transfer_size, st5_send_data,
174
                      st6_send_wait, st7_subtract_transfered_data,
175
                      st8_reset_send_counter);
176 11 nussgipfel
 
177 23 nussgipfel
  signal state, next_state : t_fsmState;
178
 
179
  -- XST specific synthesize attributes
180 24 nussgipfel
  attribute safe_recovery_state of state : signal is "st1_idle";
181
  attribute safe_implementation of state : signal is "yes";
182 14 nussgipfel
 
183
 
184 11 nussgipfel
 
185 23 nussgipfel
begin --  behavour
186 11 nussgipfel
 
187 23 nussgipfel
  GECKO3COM_simple_1: GECKO3COM_simple
188
    generic map (
189
      BUSWIDTH => BUSWIDTH)
190
    port map (
191
      i_nReset                 => i_nReset,
192
      i_sysclk                 => i_sysclk,
193
      i_receive_fifo_rd_en     => s_receive_fifo_rd_en,
194
      o_receive_fifo_empty     => s_receive_fifo_empty,
195
      o_receive_fifo_data      => s_receive_fifo_data,
196
      o_receive_transfersize   => s_receive_transfersize,
197
      o_receive_end_of_message => s_receive_end_of_message,
198
      o_receive_newdata        => s_receive_newdata,
199
      i_send_fifo_wr_en        => s_send_fifo_wr_en,
200
      o_send_fifo_full         => s_send_fifo_full,
201
      i_send_fifo_data         => s_send_fifo_data,
202
      i_send_transfersize      => s_send_transfersize,
203
      i_send_transfersize_en   => s_send_transfersize_en,
204
      i_send_have_more_data    => s_send_have_more_data,
205
      o_send_data_request      => s_send_data_request,
206
      o_send_finished          => s_send_finished,
207
      o_rx                     => o_LEDrx,
208
      o_tx                     => o_LEDtx,
209
      i_IFCLK                  => i_IFCLK,
210
      i_WRU                    => i_WRU,
211
      i_RDYU                   => i_RDYU,
212
      o_WRX                    => o_WRX,
213
      o_RDYX                   => o_RDYX,
214
      b_gpif_bus               => b_gpif_bus);
215 11 nussgipfel
 
216
 
217 23 nussgipfel
  response_message_rom_1: response_message_rom
218
    port map (
219
      A => s_send_counter_value(3 downto 0),
220
      D => s_message_rom_data);
221
 
222
 
223
  o_LEDrun <= '1';
224
 
225
 
226
  -- purpose: converts the mode_switch input to a binary coded value
227
  -- type   : combinational
228
  -- inputs : i_mode_switch
229
  -- outputs: s_mode
230
  mode_switch_decoder: process (i_mode_switch)
231
  begin  -- process mode_switch_decoder
232 24 nussgipfel
    if i_mode_switch = "001" then
233 23 nussgipfel
      s_mode <= "00";
234 24 nussgipfel
    elsif i_mode_switch = "010" then
235 23 nussgipfel
      s_mode <= "01";
236 24 nussgipfel
    elsif i_mode_switch = "100" then
237 23 nussgipfel
      s_mode <= "10";
238
    else
239
      s_mode <= "00";
240 11 nussgipfel
    end if;
241 23 nussgipfel
  end process mode_switch_decoder;
242 11 nussgipfel
 
243
 
244
  -----------------------------------------------------------------------------
245 23 nussgipfel
  -- components needed in the send path
246
  -----------------------------------------------------------------------------
247
 
248
  -- purpose: mulitiplexer to select the send data source
249
  -- type   : combinational
250
  -- inputs : s_mode, s_prng_data, s_message_rom_data
251
  -- outputs: s_send_fifo_data
252
  send_data_mux: process (s_mode, s_prng_data, s_message_rom_data)
253
  begin  -- process send_data_mux
254 24 nussgipfel
    case s_mode is
255 23 nussgipfel
      when "00" => s_send_fifo_data <= s_message_rom_data;
256
      when "01" => s_send_fifo_data <= s_prng_data;
257 24 nussgipfel
      when others => s_send_fifo_data <= (others => 'X');
258 23 nussgipfel
    end case;
259
  end process send_data_mux;
260 11 nussgipfel
 
261 23 nussgipfel
 
262
  -- purpose: mulitiplexer to select the send transfer size
263
  -- type   : combinational
264
  -- inputs : s_mode, c_transfer_size_rom, c_transfer_size_prng
265
  -- outputs: s_selected_transfer_size
266
  send_transfersize_mode_mux: process (s_mode, c_transfer_size_rom, c_transfer_size_prng)
267
  begin  -- process send_transfersize_mode_mux
268
    case s_mode is
269
      when "00" => s_selected_transfer_size <= c_transfer_size_rom;
270
      when "01" => s_selected_transfer_size <= c_transfer_size_prng;
271 24 nussgipfel
      when others => s_selected_transfer_size <= (others => 'X');
272 23 nussgipfel
    end case;
273
  end process send_transfersize_mode_mux;
274 11 nussgipfel
 
275
 
276 23 nussgipfel
  -- purpose: stores the initial or remaining transfer size
277
  -- type   : sequential
278
  -- inputs : i_sysclk, i_nReset, s_transfer_size_reg_en, s_transfer_size_reg_select,
279
  --          s_subtract_value
280
  -- outputs: s_remaining_transfer_size
281
  remaining_transfer_size_reg: process (i_sysclk, i_nReset)
282
  begin  -- process current_transfer_size_reg
283
    if i_nReset = '0' then              -- asynchronous reset (active low)
284
      s_remaining_transfer_size <= (others => '0');
285
    elsif i_sysclk'event and i_sysclk = '1' then  -- rising clock edge
286
      if s_transfer_size_reg_en = '1' then
287
        if s_transfer_size_reg_select = '1' then
288
          s_remaining_transfer_size <= s_selected_transfer_size;
289
        else
290
          s_remaining_transfer_size <= s_subtract_value;
291
        end if;
292
      end if;
293
    end if;
294 24 nussgipfel
  end process remaining_transfer_size_reg;
295 11 nussgipfel
 
296 23 nussgipfel
 
297
  -- maximum alowed transfer size comparator
298 24 nussgipfel
  s_send_have_more_data <=
299 23 nussgipfel
    '1' when s_remaining_transfer_size > s_receive_transfersize else
300
    '0';
301
 
302
 
303
  -- purpose: mulitiplexer to select the send transfer size
304
  -- type   : combinational
305
  -- inputs : s_have_more_data, s_remaining_transfer_size,
306
  --          s_receive_transfersize
307
  -- outputs: s_send_transfersize
308 24 nussgipfel
  send_transfersize_mux: process (s_send_have_more_data, s_receive_transfersize,
309
                                  s_remaining_transfer_size)
310
 
311 23 nussgipfel
  begin  -- process send_transfersize_mux
312 24 nussgipfel
    case s_send_have_more_data is
313 23 nussgipfel
      when '0' => s_send_transfersize <= s_remaining_transfer_size;
314 24 nussgipfel
      when '1' => s_send_transfersize <= s_receive_transfersize;
315
      when others => s_send_transfersize <= (others => 'X');
316 23 nussgipfel
    end case;
317
  end process send_transfersize_mux;
318
 
319
 
320
  -- purpose: up counter for the send transfer size
321
  -- type   : sequential
322
  -- inputs : i_sysclk, i_nReset, s_send_counter_en, s_send_counter_reset
323
  --          
324
  -- outputs: s_send_counter_value
325
  send_counter : process (i_sysclk, i_nReset)
326
  begin  -- process send_counter
327
    if i_nReset = '0' then              -- asynchronous reset (active low)
328
      s_send_counter_value <= (others => '0');
329
    elsif i_sysclk'event and i_sysclk = '1' then  -- rising clock edge
330 24 nussgipfel
      if s_send_counter_reset = '1' then
331 23 nussgipfel
        s_send_counter_value <= (others => '0');
332 11 nussgipfel
      end if;
333 24 nussgipfel
      if s_send_counter_en = '1' then
334 23 nussgipfel
        s_send_counter_value <= s_send_counter_value + 1;
335
      end if;
336
    end if;
337
  end process send_counter;
338
 
339
  -- transfer size counter comparator
340
  s_send_counter_equals_transfer_size <=
341
    '1' when s_send_counter_value = s_send_transfersize else
342
    '0';
343 11 nussgipfel
 
344
 
345 23 nussgipfel
  -- purpose: subracts the send counter end value from the remaining transfer size value
346
  -- type   : combinational
347
  -- inputs : s_remaining_transfer_size, s_send_counter_value
348
  -- outputs: s_subtract_value
349
  transfer_size_subract: process (s_remaining_transfer_size, s_send_counter_value)
350
  begin  -- process transfer_size_subract
351
    s_subtract_value <= s_remaining_transfer_size - s_send_counter_value;
352
  end process transfer_size_subract;
353 11 nussgipfel
 
354 23 nussgipfel
 
355
 
356
  -----------------------------------------------------------------------------
357
  -- components needed in the receive path
358
  -----------------------------------------------------------------------------
359
 
360
  -- purpose: saves the previous received data word
361
  -- type   : sequential
362
  -- inputs : i_sysclk, i_nReset, s_receive_fifo_data, s_receive_fifo_rd_en
363
  -- outputs: s_receive_fifo_data_old
364
  receive_fifo_data_reg: process (i_sysclk, i_nReset)
365
  begin  -- process receive_fifo_data_reg
366
    if i_nReset = '0' then              -- asynchronous reset (active low)
367 24 nussgipfel
      s_receive_data_old <= (others => '0');
368 23 nussgipfel
    elsif i_sysclk'event and i_sysclk = '1' then  -- rising clock edge
369
      if s_receive_fifo_rd_en = '1' then
370 24 nussgipfel
        s_receive_data_old <= s_receive_fifo_data;
371 23 nussgipfel
      end if;
372
    end if;
373
  end process receive_fifo_data_reg;
374
 
375
 
376
  -- receive data comparator
377
  -- (use together with test data with incrementing values)
378
  s_receive_data_error <=
379 24 nussgipfel
    '0' when s_receive_data_old + 1 = s_receive_fifo_data else
380 23 nussgipfel
    '1';
381
 
382
 
383
  -- purpose: linear shift register for the pseude random number
384
  --          generator (PRNG)
385
  -- type   : sequential
386
  -- inputs : i_sysclk, i_nReset, s_prng_en, s_prng_feedback
387
  -- outputs: s_prng_data
388
  prng_shiftregister: process (i_sysclk, i_nReset)
389
  begin  -- process prng_shiftregister
390
    if i_nReset = '0' then              -- asynchronous reset (active low)
391 24 nussgipfel
      s_prng_data <= "01010101010101010101010101010101";
392 23 nussgipfel
    elsif i_sysclk'event and i_sysclk = '1' then  -- rising clock edge
393
      if s_prng_en = '1' then
394 24 nussgipfel
        s_prng_data(31 downto 1) <= s_prng_data(30 downto 0);
395
        s_prng_data(0) <= s_prng_feedback;
396 23 nussgipfel
      end if;
397
    end if;
398
  end process prng_shiftregister;
399
 
400
  -- purpose: feedback polynom for the pseudo random number generator (PRNG)
401
  -- inputs : s_prng_data
402
  -- outputs: s_prng_feedback
403
  s_prng_feedback <= s_prng_data(15) xor s_prng_data(13) xor s_prng_data(12)
404
                     xor s_prng_data(10);
405
 
406
 
407 24 nussgipfel
 
408 23 nussgipfel
  -----------------------------------------------------------------------------
409
  -- finite state machine (moore)
410
  -----------------------------------------------------------------------------
411
 
412
  -- state reg
413
  fsm_state_reg : process(i_sysclk, i_nReset)
414
  begin
415
    if i_nReset = '0' then
416
      state <= st1_idle;
417
    elsif i_sysclk'event and i_sysclk = '1' then
418
        state <= next_state;
419
    end if;
420
  end process fsm_state_reg;
421
 
422
 
423
  -- comb logic
424
  next_state_decode: process(state, s_receive_fifo_empty, s_send_fifo_full,
425 24 nussgipfel
                             s_send_data_request, s_send_have_more_data, s_mode,
426
                             s_send_counter_equals_transfer_size)
427 23 nussgipfel
  begin  -- process next_state_decode
428
 
429
    --declare default state for next_state to avoid latches
430
    next_state <= state;           --default is to stay in current state
431
 
432
    -- default signal values to avoid latches:
433
    s_receive_fifo_rd_en       <= '0';
434
    s_send_transfersize_en     <= '0';
435
    s_send_fifo_wr_en          <= '0';
436
    s_transfer_size_reg_select <= '0';
437
    s_transfer_size_reg_en     <= '0';
438
    s_send_counter_reset       <= '0';
439
    s_send_counter_en          <= '0';
440
    s_prng_en                  <= '0';
441
 
442
    case state is
443
      -- controll
444
 
445
      when st1_idle =>
446
 
447
        if s_receive_fifo_empty = '0' then
448
          next_state <= st2_get_data;
449
        elsif s_send_data_request = '1' then
450
          next_state <= st3_load_total_transfer_size;
451 11 nussgipfel
        end if;
452 23 nussgipfel
 
453
      when st2_get_data =>
454
        s_receive_fifo_rd_en <= '1';
455 11 nussgipfel
 
456 23 nussgipfel
        if s_receive_fifo_empty = '1' then
457
          next_state <= st1_idle;
458
        end if;
459
 
460
      when st3_load_total_transfer_size =>
461
        s_send_counter_reset       <= '1';
462
        s_transfer_size_reg_en     <= '1';
463
        s_transfer_size_reg_select <= '1';
464 11 nussgipfel
 
465 23 nussgipfel
        next_state <= st4_save_remaining_transfer_size;
466
 
467
      when st4_save_remaining_transfer_size =>
468
        s_send_transfersize_en <= '1';
469 11 nussgipfel
 
470 23 nussgipfel
        next_state <= st5_send_data;
471
 
472
      when st5_send_data =>
473
        s_send_fifo_wr_en <= '1';
474
        s_send_counter_en <= '1';
475
        if s_mode = "01" then
476
          s_prng_en <= '1';
477
        end if;
478
 
479 24 nussgipfel
        if s_send_counter_equals_transfer_size = '1' and
480
          s_send_have_more_data = '0'
481
        then
482 23 nussgipfel
          next_state <= st1_idle;
483 24 nussgipfel
        elsif s_send_counter_equals_transfer_size = '1' and
484
          s_send_have_more_data = '1'
485
        then
486 23 nussgipfel
          next_state <= st7_subtract_transfered_data;
487
        elsif s_send_fifo_full = '1' then
488
          next_state <= st6_send_wait;
489
        end if;
490
 
491
      when st6_send_wait =>
492
 
493
        if s_send_fifo_full = '0' then
494
          next_state <= st5_send_data;
495
        end if;
496
 
497 24 nussgipfel
      when st7_subtract_transfered_data =>
498 23 nussgipfel
          s_transfer_size_reg_select <= '0';
499
        s_transfer_size_reg_en <= '1';
500
 
501
        if s_send_data_request = '1' then
502 24 nussgipfel
          next_state <= st8_reset_send_counter;
503 23 nussgipfel
        end if;
504
 
505
      when st8_reset_send_counter =>
506
        s_send_counter_reset <= '1';
507
 
508
        next_state <= st4_save_remaining_transfer_size;
509
 
510
      when others =>
511
        next_state <= st1_idle;
512
    end case;
513
 
514
  end process next_state_decode;
515
 
516
end  behavour;
517
 
518
 
519
----------------------------------------------------------------------------- 
520
--  RESPONSE MESSAGE ROM  
521
-----------------------------------------------------------------------------
522
-- This file was generated with hex2rom written by Daniel Wallner
523
 
524 24 nussgipfel
library ieee;
525
use ieee.std_logic_1164.all;
526
use IEEE.numeric_std.all;
527
 
528 23 nussgipfel
entity response_message_rom is
529
        port(
530
                A       : in std_logic_vector(3 downto 0);
531
                D       : out std_logic_vector(31 downto 0)
532
        );
533
end response_message_rom;
534
 
535
architecture rtl of response_message_rom is
536
        subtype ROM_WORD is std_logic_vector(31 downto 0);
537
        type ROM_TABLE is array(0 to 3) of ROM_WORD;
538
        signal ROM: ROM_TABLE := ROM_TABLE'(
539
                "00100010001000000010110000110000",     -- 0x0000
540
                "01100101001000000110111101001110",     -- 0x0004
541
                "01110010011011110111001001110010",     -- 0x0008
542
                "00001010000010100000101000100010");    -- 0x000C
543
begin
544
        D <= ROM(to_integer(unsigned(A)));
545
end;

powered by: WebSVN 2.1.0

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