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

Subversion Repositories gecko3

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

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

Line No. Rev Author Line
1 22 nussgipfel
--  GECKO3COM IP Core
2
--
3
--  Copyright (C) 2009 by
4
--   ___    ___   _   _
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
--------------------------------------------------------------------------------
26
--
27
--  Author:  Christoph Zimmermann
28
--  Date of creation:  3 february 2010 
29
--  Description:
30
--      This is the finite-state-mashine for the GECKO3com simple IP core.
31
--   
32
--      This core provides a simple FIFO and register interface to the
33
--      USB data transfer capabilities of the GECKO3COM/GECKO3main system.
34
--
35 23 nussgipfel
--      Look at GECKO3COM_simple_test.vhd for an example how to use it.
36 22 nussgipfel
--
37
--  Target Devices:     general
38
--  Tool versions:      11.1
39
--
40
--------------------------------------------------------------------------------
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
library work;
48
use work.GECKO3COM_defines.all;
49
 
50
 
51
entity GECKO3COM_simple_fsm is
52
 
53
  port (
54
    i_nReset                     : in  std_logic;
55
    i_sysclk                     : in  std_logic;
56
    o_receive_fifo_wr_en         : out std_logic;
57
    i_receive_fifo_full          : in  std_logic;
58
    o_receive_fifo_reset         : out std_logic;
59
    o_receive_transfersize_en    : out std_logic_vector((32/SIZE_DBUS_GPIF)-1 downto 0);
60 26 nussgipfel
    i_receive_transfersize_lsb   : in  std_logic;
61 22 nussgipfel
    o_receive_counter_load       : out std_logic;
62
    o_receive_counter_en         : out std_logic;
63
    i_receive_counter_zero       : in  std_logic;
64
    i_dev_dep_msg_out            : in  std_logic;
65
    i_request_dev_dep_msg_in     : in  std_logic;
66
    o_btag_reg_en                : out std_logic;
67
    o_nbtag_reg_en               : out std_logic;
68
    i_btag_correct               : in  std_logic;
69
    i_eom_bit_detected           : in  std_logic;
70
    i_send_transfersize_en       : in  std_logic;
71
    o_send_fifo_rd_en            : out std_logic;
72
    i_send_fifo_empty            : in  std_logic;
73
    o_send_fifo_reset            : out std_logic;
74
    o_send_counter_load          : out std_logic;
75
    o_send_counter_en            : out std_logic;
76
    i_send_counter_zero          : in  std_logic;
77
    o_send_mux_sel               : out std_logic_vector(2 downto 0);
78
    o_send_finished              : out std_logic;
79
    o_receive_newdata_set        : out std_logic;
80
    o_receive_end_of_message_set : out std_logic;
81
    o_send_data_request_set      : out std_logic;
82
    i_gpif_rx                    : in  std_logic;
83
    i_gpif_rx_empty              : in  std_logic;
84
    o_gpif_rx_rd_en              : out std_logic;
85
    i_gpif_tx                    : in  std_logic;
86
    i_gpif_tx_full               : in  std_logic;
87
    o_gpif_tx_wr_en              : out std_logic;
88
    i_gpif_abort                 : in  std_logic;
89
    o_gpif_eom                   : out std_logic);
90
 
91
end GECKO3COM_simple_fsm;
92
 
93
 
94
architecture fsm of GECKO3COM_simple_fsm is
95
 
96
  -- XST specific synthesize attributes
97
  attribute safe_implementation : string;
98
  attribute safe_recovery_state : string;
99 27 nussgipfel
  attribute fsm_encoding       : string;
100 22 nussgipfel
 
101 26 nussgipfel
  type   state_type is (st1_idle, st2_abort, st3_read_msg_id, st4_check_msg_id,
102
                        st5_read_nbtag, st6_read_transfer_size_low,
103 22 nussgipfel
                        st7_read_transfer_size_high, st8_check_attributes,
104
                        st9_signal_data_request, st10_signal_receive_new_data,
105
                        st11_receive_data, st12_receive_wait,
106
                        st13_wait_for_receive_end, st14_read_align_bytes,
107
                        st15_start_response, st16_send_msg_id,
108
                        st17_send_nbtag, st18_send_transfer_size_low,
109
                        st19_send_transfer_size_high, st20_send_attributes,
110 26 nussgipfel
                        st21_send_reserved, st22_send_data, st23_send_wait,
111 22 nussgipfel
                        st24_wait_for_send_end);
112
  signal state, next_state : state_type;
113
 
114
  -- XST specific synthesize attributes
115
  attribute safe_recovery_state of state : signal is "st1_idle";
116
  attribute safe_implementation of state : signal is "yes";
117 27 nussgipfel
  attribute fsm_encoding of state        : signal is "johnson";
118 22 nussgipfel
 
119 27 nussgipfel
 
120 22 nussgipfel
  --Declare internal signals for all outputs of the state-machine
121
  signal s_receive_fifo_wr_en         : std_logic;
122
  signal s_receive_fifo_reset         : std_logic;
123
  signal s_receive_transfersize_en    : std_logic_vector((32/SIZE_DBUS_GPIF)-1 downto 0);
124
  signal s_receive_counter_load       : std_logic;
125
  signal s_receive_counter_en         : std_logic;
126
  signal s_btag_reg_en                : std_logic;
127
  signal s_nbtag_reg_en               : std_logic;
128
  signal s_send_fifo_rd_en            : std_logic;
129
  signal s_send_fifo_reset            : std_logic;
130
  signal s_send_counter_load          : std_logic;
131
  signal s_send_counter_en            : std_logic;
132
  signal s_send_mux_sel               : std_logic_vector(2 downto 0);
133
  signal s_send_finished              : std_logic;
134
  signal s_receive_newdata_set        : std_logic;
135
  signal s_receive_end_of_message_set : std_logic;
136
  signal s_send_data_request_set      : std_logic;
137
  signal s_gpif_eom                   : std_logic;
138
  signal s_gpif_rx_rd_en              : std_logic;
139
  signal s_gpif_tx_wr_en              : std_logic;
140
 
141
 
142
begin  -- fsm
143 26 nussgipfel
 
144
  o_receive_fifo_wr_en         <= s_receive_fifo_wr_en;
145
  o_receive_fifo_reset         <= s_receive_fifo_reset;
146
  o_receive_transfersize_en    <= s_receive_transfersize_en;
147
  o_receive_counter_load       <= s_receive_counter_load;
148
  o_receive_counter_en         <= s_receive_counter_en;
149
  o_btag_reg_en                <= s_btag_reg_en;
150
  o_nbtag_reg_en               <= s_nbtag_reg_en;
151
  o_send_fifo_rd_en            <= s_send_fifo_rd_en;
152
  o_send_fifo_reset            <= s_send_fifo_reset;
153
  o_send_counter_load          <= s_send_counter_load;
154
  o_send_counter_en            <= s_send_counter_en;
155
  o_send_mux_sel               <= s_send_mux_sel;
156
  o_send_finished              <= s_send_finished;
157
  o_receive_newdata_set        <= s_receive_newdata_set;
158
  o_receive_end_of_message_set <= s_receive_end_of_message_set;
159
  o_send_data_request_set      <= s_send_data_request_set;
160
  o_gpif_eom                   <= s_gpif_eom;
161
  o_gpif_rx_rd_en              <= s_gpif_rx_rd_en;
162
  o_gpif_tx_wr_en              <= s_gpif_tx_wr_en;
163
 
164 22 nussgipfel
 
165
  SYNC_PROC : process (i_sysclk)
166
  begin
167
    if (i_sysclk'event and i_sysclk = '1') then
168
      if (i_nReset = '0') then
169
        state <= st1_idle;
170
      else
171
        state <= next_state;
172
      end if;
173
    end if;
174
  end process;
175
 
176
  --MEALY State-Machine - Outputs based on state and inputs
177
  OUTPUT_DECODE : process (state, i_receive_fifo_full,
178
                           i_receive_counter_zero, i_dev_dep_msg_out,
179 26 nussgipfel
                           i_request_dev_dep_msg_in, --i_btag_correct,
180 22 nussgipfel
                           i_eom_bit_detected, i_send_transfersize_en,
181
                           i_send_fifo_empty, i_send_counter_zero,
182
                           i_gpif_rx, i_gpif_rx_empty, i_gpif_tx,
183 26 nussgipfel
                           i_gpif_tx_full, i_gpif_abort,
184
                           i_receive_transfersize_lsb)
185 22 nussgipfel
  begin
186
 
187
    s_receive_fifo_wr_en         <= '0';
188
    s_receive_fifo_reset         <= '0';
189
    s_receive_transfersize_en    <= (others => '0');
190
    s_receive_counter_load       <= '0';
191
    s_receive_counter_en         <= '0';
192
    s_btag_reg_en                <= '0';
193
    s_nbtag_reg_en               <= '0';
194
    s_send_fifo_rd_en            <= '0';
195
    s_send_fifo_reset            <= '0';
196
    s_send_counter_load          <= '0';
197
    s_send_counter_en            <= '0';
198
    s_send_mux_sel               <= (others => '0');
199 24 nussgipfel
    s_send_finished              <= '0';
200 22 nussgipfel
    s_receive_newdata_set        <= '0';
201
    s_receive_end_of_message_set <= '0';
202
    s_send_data_request_set      <= '0';
203
    s_gpif_eom                   <= '0';
204
    s_gpif_rx_rd_en              <= '0';
205
    s_gpif_tx_wr_en              <= '0';
206
 
207
    if state = st11_receive_data then
208
      s_receive_fifo_wr_en <= '1';
209
    end if;
210
 
211
    if state = st2_abort then
212
      s_receive_fifo_reset <= '1';
213
    end if;
214
 
215
    if state = st6_read_transfer_size_low then
216
      s_receive_transfersize_en <= "01";
217
    elsif state = st7_read_transfer_size_high then
218
      s_receive_transfersize_en <= "10";
219
    end if;
220
 
221 26 nussgipfel
    if state = st8_check_attributes and
222
      i_dev_dep_msg_out = '1' and
223
      i_gpif_rx_empty = '0'
224
    then
225 22 nussgipfel
      s_receive_counter_load <= '1';
226
    end if;
227
 
228
    if (state = st10_signal_receive_new_data and
229
        i_gpif_rx_empty = '0' and
230 26 nussgipfel
        i_receive_fifo_full = '0' and
231
        i_receive_transfersize_lsb = '0')  -- if it is '1' then we have to read
232
                                           -- one time more from the fifo (which
233
                                           -- is 16bit wide)
234
      or (state = st11_receive_data and
235
          i_receive_counter_zero = '0' and
236
          i_gpif_rx_empty = '0' and
237
          i_receive_fifo_full = '0')
238 22 nussgipfel
      or (state = st12_receive_wait and
239
          i_gpif_rx_empty = '0' and
240 26 nussgipfel
          i_receive_fifo_full = '0')
241 22 nussgipfel
    then
242
      s_receive_counter_en <= '1';
243
    end if;
244
 
245
    if state = st3_read_msg_id then
246
      s_btag_reg_en <= '1';
247
    end if;
248
 
249 26 nussgipfel
    if state = st5_read_nbtag then
250 22 nussgipfel
      s_nbtag_reg_en <= '1';
251
    end if;
252
 
253 26 nussgipfel
    if (state = st21_send_reserved and
254 22 nussgipfel
        i_gpif_tx_full = '0' and
255
        i_send_fifo_empty = '0')
256 26 nussgipfel
      or (state = st22_send_data and
257
          i_gpif_tx_full = '0' and
258
          i_send_fifo_empty = '0' and
259
          i_send_counter_zero = '0')
260 22 nussgipfel
      or (state = st23_send_wait and
261
          i_gpif_tx_full = '0' and
262
          i_send_fifo_empty = '0')
263
    then
264
      s_send_fifo_rd_en <= '1';
265
    end if;
266
 
267 23 nussgipfel
    if state = st2_abort or state = st24_wait_for_send_end then
268 22 nussgipfel
      s_send_fifo_reset <= '1';
269
    end if;
270
 
271 26 nussgipfel
    if state = st20_send_attributes then
272 22 nussgipfel
      s_send_counter_load <= '1';
273
    end if;
274
 
275 26 nussgipfel
    if (state = st21_send_reserved and i_gpif_tx_full = '0' and
276
        i_send_fifo_empty = '0')
277
      or (state = st22_send_data and
278
          i_gpif_tx_full = '0' and
279
          i_send_fifo_empty = '0' and
280
          i_send_counter_zero = '0')
281
      or (state = st23_send_wait and
282
          i_gpif_tx_full = '0' and
283
          i_send_fifo_empty = '0')
284 22 nussgipfel
    then
285
      s_send_counter_en <= '1';
286
    end if;
287
 
288
    if state = st16_send_msg_id then
289
      s_send_mux_sel <= "000";
290
    elsif state = st17_send_nbtag then
291
      s_send_mux_sel <= "001";
292
    elsif state =st18_send_transfer_size_low then
293
      s_send_mux_sel <= "010";
294
    elsif state = st19_send_transfer_size_high then
295
      s_send_mux_sel <= "011";
296
    elsif state = st20_send_attributes then
297
      s_send_mux_sel <= "100";
298 26 nussgipfel
    elsif state = st21_send_reserved then
299 22 nussgipfel
      s_send_mux_sel <= "101";
300 26 nussgipfel
    elsif state = st22_send_data or state = st23_send_wait then
301
      s_send_mux_sel <= "110";
302 22 nussgipfel
    end if;
303
 
304
    if state = st24_wait_for_send_end and i_gpif_tx = '0' then
305 24 nussgipfel
      s_send_finished <= '1';
306 22 nussgipfel
    end if;
307
 
308
    if state = st10_signal_receive_new_data then
309
      s_receive_newdata_set <= '1';
310
    end if;
311
 
312
    if state = st8_check_attributes and i_eom_bit_detected = '1' then
313
      s_receive_end_of_message_set <= '1';
314
    end if;
315
 
316
    if state = st9_signal_data_request then
317
      s_send_data_request_set <= '1';
318
    end if;
319 24 nussgipfel
 
320 26 nussgipfel
    if (state = st22_send_data and i_send_counter_zero = '1')
321
      or state = st24_wait_for_send_end
322
    then
323 22 nussgipfel
      s_gpif_eom <= '1';
324
    end if;
325
 
326
    if (i_gpif_rx_empty = '0' and
327
        (state = st1_idle or
328 26 nussgipfel
         state = st5_read_nbtag or
329 22 nussgipfel
         state = st6_read_transfer_size_low or
330
         state = st7_read_transfer_size_high or
331
         state = st8_check_attributes))
332 26 nussgipfel
      or (state = st4_check_msg_id and
333
          i_gpif_rx_empty = '0' and
334
          (i_dev_dep_msg_out = '1' or i_request_dev_dep_msg_in = '1'))
335 22 nussgipfel
      or ((state = st10_signal_receive_new_data or state = st12_receive_wait)
336
          and i_gpif_rx_empty = '0' and i_receive_fifo_full = '0')
337 26 nussgipfel
      or (state = st11_receive_data and
338
          i_receive_counter_zero = '0' and
339
          i_gpif_rx_empty = '0' and
340
          i_receive_fifo_full = '0')
341
      or (state = st12_receive_wait and
342
          i_gpif_rx_empty = '0' and
343
          i_receive_fifo_full = '0')
344 22 nussgipfel
      or (state = st14_read_align_bytes and i_gpif_rx_empty = '0')
345
    then
346
      s_gpif_rx_rd_en <= '1';
347
    end if;
348
 
349
    if (i_gpif_tx_full = '0' and
350
        (state = st16_send_msg_id or
351
         state = st17_send_nbtag or
352
         state = st18_send_transfer_size_low or
353
         state = st19_send_transfer_size_high or
354
         state = st20_send_attributes or
355 26 nussgipfel
         state = st21_send_reserved))
356 27 nussgipfel
      or (state = st22_send_data and
357
          i_gpif_tx_full = '0' and
358
          i_send_fifo_empty = '0')
359
      or (state = st23_send_wait and
360
          i_gpif_tx_full = '0' and
361
          i_send_fifo_empty = '0')
362 22 nussgipfel
    then
363
      s_gpif_tx_wr_en <= '1';
364
    end if;
365
  end process;
366
 
367
  NEXT_STATE_DECODE : process (state, i_receive_fifo_full,
368
                               i_receive_counter_zero, i_dev_dep_msg_out,
369
                               i_request_dev_dep_msg_in, i_btag_correct,
370
                               i_eom_bit_detected, i_send_transfersize_en,
371
                               i_send_fifo_empty, i_send_counter_zero,
372
                               i_gpif_rx, i_gpif_rx_empty, i_gpif_tx,
373
                               i_gpif_tx_full, i_gpif_abort)
374
  begin
375
    --declare default state for next_state to avoid latches
376
    next_state <= state;                --default is to stay in current state
377
 
378
    case (state) is
379
      when st1_idle =>
380
        if i_gpif_abort = '1' then
381
          next_state <= st2_abort;
382
        elsif i_gpif_rx_empty = '0' then
383
          next_state <= st3_read_msg_id;
384
        end if;
385
 
386
      when st2_abort =>
387 27 nussgipfel
        if i_gpif_abort = '0' then
388
          next_state <= st1_idle;
389
        end if;
390 22 nussgipfel
 
391
      when st3_read_msg_id =>
392 26 nussgipfel
        next_state <= st4_check_msg_id;
393
 
394
      when st4_check_msg_id =>
395 22 nussgipfel
        if i_gpif_abort = '1' then
396
          next_state <= st2_abort;
397 26 nussgipfel
        elsif i_dev_dep_msg_out = '0' and i_request_dev_dep_msg_in = '0' then
398
          next_state <= st1_idle;
399
        elsif i_gpif_rx_empty = '0' and
400
          (i_dev_dep_msg_out = '1' or i_request_dev_dep_msg_in = '1')
401
        then
402
          next_state <= st5_read_nbtag;
403 22 nussgipfel
        end if;
404
 
405 26 nussgipfel
      when st5_read_nbtag =>
406 22 nussgipfel
        if i_gpif_abort = '1' then
407
          next_state <= st2_abort;
408
        elsif i_gpif_rx_empty = '0' then
409 26 nussgipfel
          next_state <= st6_read_transfer_size_low;
410 22 nussgipfel
        end if;
411
 
412 26 nussgipfel
      when st6_read_transfer_size_low =>
413 22 nussgipfel
        if i_gpif_abort = '1' then
414
          next_state <= st2_abort;
415
        elsif i_btag_correct = '0' then
416
          next_state <= st1_idle;
417 26 nussgipfel
        elsif i_gpif_rx_empty = '0' and i_btag_correct = '1' then
418 22 nussgipfel
          next_state <= st7_read_transfer_size_high;
419
        end if;
420
 
421
      when st7_read_transfer_size_high =>
422
        if i_gpif_abort = '1' then
423
          next_state <= st2_abort;
424
        elsif i_gpif_rx_empty = '0' then
425
          next_state <= st8_check_attributes;
426
        end if;
427
 
428
      when st8_check_attributes =>
429
        if i_gpif_abort = '1' then
430
          next_state <= st2_abort;
431 26 nussgipfel
        elsif i_dev_dep_msg_out = '0' and i_request_dev_dep_msg_in = '0' then
432
          next_state <= st1_idle;
433 22 nussgipfel
        elsif i_gpif_rx_empty = '0' and i_request_dev_dep_msg_in = '1' then
434
          next_state <= st9_signal_data_request;
435
        elsif i_gpif_rx_empty = '0' and i_dev_dep_msg_out = '1' then
436
          next_state <= st10_signal_receive_new_data;
437
        end if;
438
 
439
      when st9_signal_data_request =>
440
        if i_gpif_abort = '1' then
441
          next_state <= st2_abort;
442
        elsif i_send_transfersize_en = '1' then
443
          next_state <= st15_start_response;
444
        end if;
445
 
446
      when st10_signal_receive_new_data =>
447
        if i_gpif_abort = '1' then
448
          next_state <= st2_abort;
449
        elsif i_gpif_rx_empty = '0' and i_receive_fifo_full = '0' then
450
          next_state <= st11_receive_data;
451
        end if;
452
 
453
      when st11_receive_data =>
454
        if i_gpif_abort = '1' then
455
          next_state <= st2_abort;
456
        elsif i_receive_counter_zero = '1' then
457 26 nussgipfel
          --next_state <= st13_wait_for_receive_end;
458
          next_state <= st1_idle;
459 22 nussgipfel
        elsif  i_gpif_rx_empty = '1' or i_receive_fifo_full = '1' then
460
          next_state <= st12_receive_wait;
461
        end if;
462
 
463
      when st12_receive_wait =>
464
        if i_gpif_abort = '1' then
465
          next_state <= st2_abort;
466
        elsif  i_gpif_rx_empty = '0' and i_receive_fifo_full = '0' then
467
          next_state <= st11_receive_data;
468
        end if;
469
 
470
      when st13_wait_for_receive_end =>
471
        if i_gpif_abort = '1' then
472
          next_state <= st2_abort;
473
        elsif i_gpif_rx = '0' then
474
          next_state <= st14_read_align_bytes;
475
        end if;
476
 
477
      when st14_read_align_bytes =>
478
        if i_gpif_abort = '1' then
479
          next_state <= st2_abort;
480
        elsif i_gpif_rx_empty = '1' then
481
          next_state <= st1_idle;
482
        end if;
483
 
484
      when st15_start_response =>
485
        if i_gpif_abort = '1' then
486
          next_state <= st2_abort;
487
        elsif i_gpif_tx_full = '0' then
488
          next_state <= st16_send_msg_id;
489
        end if;
490
 
491
      when st16_send_msg_id =>
492
        if i_gpif_abort = '1' then
493
          next_state <= st2_abort;
494
        elsif i_gpif_tx_full = '0' then
495
          next_state <= st17_send_nbtag;
496
        end if;
497
 
498
      when st17_send_nbtag =>
499
        if i_gpif_abort = '1' then
500
          next_state <= st2_abort;
501
        elsif i_gpif_tx_full = '0' then
502
          next_state <= st18_send_transfer_size_low;
503
        end if;
504
 
505
      when st18_send_transfer_size_low =>
506
        if i_gpif_abort = '1' then
507
          next_state <= st2_abort;
508
        elsif i_gpif_tx_full = '0' then
509
          next_state <= st19_send_transfer_size_high;
510
        end if;
511
 
512
      when st19_send_transfer_size_high =>
513
        if i_gpif_abort = '1' then
514
          next_state <= st2_abort;
515
        elsif i_gpif_tx_full = '0' then
516
          next_state <= st20_send_attributes;
517
        end if;
518
 
519
      when st20_send_attributes =>
520
        if i_gpif_abort = '1' then
521
          next_state <= st2_abort;
522
        elsif i_gpif_tx_full = '0' then
523 26 nussgipfel
          next_state <= st21_send_reserved;
524 22 nussgipfel
        end if;
525
 
526 26 nussgipfel
      when st21_send_reserved =>
527 22 nussgipfel
        if i_gpif_abort = '1' then
528
          next_state <= st2_abort;
529
        elsif i_gpif_tx_full = '0' and i_send_fifo_empty = '0' then
530
          next_state <= st22_send_data;
531
        end if;
532
 
533
      when st22_send_data =>
534
        if i_gpif_abort = '1' then
535
          next_state <= st2_abort;
536
        elsif i_send_counter_zero = '1' then
537
          next_state <= st24_wait_for_send_end;
538
        elsif i_gpif_tx_full = '1' or i_send_fifo_empty = '1' then
539
          next_state <= st23_send_wait;
540
        end if;
541
 
542
      when st23_send_wait =>
543
        if i_gpif_abort = '1' then
544
          next_state <= st2_abort;
545
        elsif i_gpif_tx_full = '0' and i_send_fifo_empty = '0' then
546
          next_state <= st22_send_data;
547
        end if;
548
 
549
      when st24_wait_for_send_end =>
550
        if i_gpif_abort = '1' then
551
          next_state <= st2_abort;
552
        elsif i_gpif_tx = '0' then
553
          next_state <= st1_idle;
554
        end if;
555
 
556
      when others =>
557
        next_state <= st1_idle;
558
    end case;
559
  end process;
560
 
561
end fsm;

powered by: WebSVN 2.1.0

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