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

Subversion Repositories udp_ip_stack

[/] [udp_ip_stack/] [trunk/] [rtl/] [vhdl/] [IPv4_TX.vhd] - Blame information for rev 18

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

Line No. Rev Author Line
1 18 pjf
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:            Peter Fall
4
-- 
5
-- Create Date:    16:20:42 06/01/2011 
6
-- Design Name: 
7
-- Module Name:    IPv4_TX - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--              handle simple IP TX
13
--              doesnt handle segmentation
14
--              dest MAC addr resolution through ARP layer
15
--              Handle IPv4 protocol
16
-- Dependencies: 
17
--
18
-- Revision: 
19
-- Revision 0.01 - File Created
20
-- Revision 0.02 - fixed up setting of tx_result control defaults
21 4 pjf
-- Revision 0.03 - Added data_out_first
22 18 pjf
-- Revision 0.04 - Added handling of broadcast address
23
-- Additional Comments: 
24
--
25
----------------------------------------------------------------------------------
26
library IEEE;
27
use IEEE.STD_LOGIC_1164.all;
28
use IEEE.NUMERIC_STD.all;
29
use work.axi.all;
30
use work.ipv4_types.all;
31
use work.arp_types.all;
32 2 pjf
 
33 18 pjf
entity IPv4_TX is
34
  port (
35
    -- IP Layer signals
36
    ip_tx_start          : in  std_logic;
37
    ip_tx                : in  ipv4_tx_type;                   -- IP tx cxns
38
    ip_tx_result         : out std_logic_vector (1 downto 0);  -- tx status (changes during transmission)
39
    ip_tx_data_out_ready : out std_logic;  -- indicates IP TX is ready to take data
40
 
41
    -- system signals
42
    clk                : in  std_logic;  -- same clock used to clock mac data and ip data
43
    reset              : in  std_logic;
44
    our_ip_address     : in  std_logic_vector (31 downto 0);
45
    our_mac_address    : in  std_logic_vector (47 downto 0);
46
    -- ARP lookup signals
47
    arp_req_req        : out arp_req_req_type;
48
    arp_req_rslt       : in  arp_req_rslt_type;
49
    -- MAC layer TX signals
50
    mac_tx_req         : out std_logic;  -- indicates that ip wants access to channel (stays up for as long as tx)
51
    mac_tx_granted     : in  std_logic;  -- indicates that access to channel has been granted            
52
    mac_data_out_ready : in  std_logic;  -- indicates system ready to consume data
53
    mac_data_out_valid : out std_logic;  -- indicates data out is valid
54
    mac_data_out_first : out std_logic;  -- with data out valid indicates the first byte of a frame
55
    mac_data_out_last  : out std_logic;  -- with data out valid indicates the last byte of a frame
56
    mac_data_out       : out std_logic_vector (7 downto 0)  -- ethernet frame (from dst mac addr through to last byte of frame)      
57
    );
58
end IPv4_TX;
59
 
60
architecture Behavioral of IPv4_TX is
61
 
62
  type tx_state_type is (
63
    IDLE,
64
    WAIT_MAC,                           -- waiting for response from ARP for mac lookup
65
    WAIT_CHN,                           -- waiting for tx access to MAC channel
66
    SEND_ETH_HDR,                       -- sending the ethernet header
67
    SEND_IP_HDR,                        -- sending the IP header
68
    SEND_USER_DATA                      -- sending the users data
69
    );
70
 
71
  type crc_state_type is (IDLE, TOT_LEN, ID, FLAGS, TTL, CKS, SAH, SAL, DAH, DAL, FINAL, WAIT_END);
72
 
73
  type count_mode_type is (RST, INCR, HOLD);
74
  type settable_cnt_type is (RST, SET, INCR, HOLD);
75
  type set_clr_type is (SET, CLR, HOLD);
76
 
77
  -- Configuration
78
 
79
  constant IP_TTL : std_logic_vector (7 downto 0) := x"80";
80
 
81
  -- TX state variables
82
  signal tx_state               : tx_state_type;
83
  signal tx_count               : unsigned (11 downto 0);
84
  signal tx_result_reg          : std_logic_vector (1 downto 0);
85
  signal tx_mac                 : std_logic_vector (47 downto 0);
86
  signal tx_mac_chn_reqd        : std_logic;
87
  signal tx_hdr_cks             : std_logic_vector (23 downto 0);
88
  signal mac_lookup_req         : std_logic;
89
  signal crc_state              : crc_state_type;
90
  signal arp_req_ip_reg         : std_logic_vector (31 downto 0);
91
  signal mac_data_out_ready_reg : std_logic;
92
 
93
  -- tx control signals
94
  signal next_tx_state   : tx_state_type;
95
  signal set_tx_state    : std_logic;
96
  signal next_tx_result  : std_logic_vector (1 downto 0);
97
  signal set_tx_result   : std_logic;
98
  signal tx_mac_value    : std_logic_vector (47 downto 0);
99
  signal set_tx_mac      : std_logic;
100
  signal tx_count_val    : unsigned (11 downto 0);
101
  signal tx_count_mode   : settable_cnt_type;
102
  signal tx_data         : std_logic_vector (7 downto 0);
103
  signal set_last        : std_logic;
104
  signal set_chn_reqd    : set_clr_type;
105
  signal set_mac_lku_req : set_clr_type;
106
  signal tx_data_valid   : std_logic;   -- indicates whether data is valid to tx or not
107
 
108
  -- tx temp signals
109
  signal total_length : std_logic_vector (15 downto 0);  -- computed combinatorially from header size
110
 
111
 
112
  function inv_if_one(s1 : std_logic_vector; en : std_logic) return std_logic_vector is
113
    --this function inverts all the bits of a vector if
114
    --'en' is '1'.
115
    variable Z : std_logic_vector(s1'high downto s1'low);
116
  begin
117
    for i in (s1'low) to s1'high loop
118
      Z(i) := en xor s1(i);
119
    end loop;
120
    return Z;
121
  end inv_if_one;  -- end function
122
 
123
 
124 2 pjf
-- IP datagram header format
125
--
126 18 pjf
--      0          4          8                      16      19             24                    31
127
--      --------------------------------------------------------------------------------------------
128
--      | Version  | *Header  |    Service Type      |        Total Length including header        |
129
--      |   (4)    |  Length  |     (ignored)        |                 (in bytes)                  |
130
--      --------------------------------------------------------------------------------------------
131
--      |           Identification                   | Flags |       Fragment Offset               |
132
--      |                                            |       |      (in 32 bit words)              |
133
--      --------------------------------------------------------------------------------------------
134
--      |    Time To Live     |       Protocol       |             Header Checksum                 |
135
--      |     (ignored)       |                      |                                             |
136
--      --------------------------------------------------------------------------------------------
137
--      |                                   Source IP Address                                      |
138
--      |                                                                                          |
139
--      --------------------------------------------------------------------------------------------
140
--      |                                 Destination IP Address                                   |
141
--      |                                                                                          |
142
--      --------------------------------------------------------------------------------------------
143
--      |                          Options (if any - ignored)               |       Padding        |
144
--      |                                                                   |      (if needed)     |
145
--      --------------------------------------------------------------------------------------------
146
--      |                                          Data                                            |
147
--      |                                                                                          |
148
--      --------------------------------------------------------------------------------------------
149
--      |                                          ....                                            |
150
--      |                                                                                          |
151
--      --------------------------------------------------------------------------------------------
152 2 pjf
--
153
-- * - in 32 bit words 
154 18 pjf
 
155
begin
156
  -----------------------------------------------------------------------
157
  -- combinatorial process to implement FSM and determine control signals
158
  -----------------------------------------------------------------------
159
 
160
  tx_combinatorial : process(
161
    -- input signals
162
    ip_tx_start, ip_tx, our_ip_address, our_mac_address, arp_req_rslt,  --clk, 
163
    mac_tx_granted, mac_data_out_ready,
164
    -- state variables
165
    tx_state, tx_count, tx_result_reg, tx_mac, tx_mac_chn_reqd,
166
    mac_lookup_req, tx_hdr_cks, arp_req_ip_reg, mac_data_out_ready_reg,
167
    -- control signals
168
    next_tx_state, set_tx_state, next_tx_result, set_tx_result, tx_mac_value, set_tx_mac, tx_count_mode,
169
    tx_data, set_last, set_chn_reqd, set_mac_lku_req, total_length,
170
    tx_data_valid, tx_count_val
171
    )
172
  begin
173
    -- set output followers
174
    ip_tx_result           <= tx_result_reg;
175
    mac_tx_req             <= tx_mac_chn_reqd;
176
    arp_req_req.lookup_req <= mac_lookup_req;
177
    arp_req_req.ip         <= arp_req_ip_reg;
178
 
179
    -- set initial values for combinatorial outputs
180
    mac_data_out_first <= '0';
181
 
182
    case tx_state is
183
      when SEND_ETH_HDR | SEND_IP_HDR =>
184
        mac_data_out      <= tx_data;
185
        tx_data_valid     <= mac_data_out_ready;  -- generated internally
186
        mac_data_out_last <= set_last;
187
 
188
      when SEND_USER_DATA =>
189
        mac_data_out      <= ip_tx.data.data_out;
190
        tx_data_valid     <= ip_tx.data.data_out_valid;
191
        mac_data_out_last <= ip_tx.data.data_out_last;
192
 
193
      when others =>
194
        mac_data_out      <= (others => '0');
195
        tx_data_valid     <= '0';       -- not transmitting during this phase
196
        mac_data_out_last <= '0';
197
    end case;
198
 
199
    mac_data_out_valid <= tx_data_valid and mac_data_out_ready;
200
 
201
    -- set signal defaults
202
    next_tx_state   <= IDLE;
203
    set_tx_state    <= '0';
204
    tx_count_mode   <= HOLD;
205
    tx_data         <= x"00";
206
    set_last        <= '0';
207
    set_tx_mac      <= '0';
208
    set_chn_reqd    <= HOLD;
209
    set_mac_lku_req <= HOLD;
210
    next_tx_result  <= IPTX_RESULT_NONE;
211
    set_tx_result   <= '0';
212
    tx_count_val    <= (others => '0');
213
    tx_mac_value    <= (others => '0');
214
 
215
    -- set temp signals
216
    total_length <= std_logic_vector(unsigned(ip_tx.hdr.data_length) + 20);  -- total length = user data length + header length (bytes)
217
 
218
    -- TX FSM
219
    case tx_state is
220
      when IDLE =>
221
        ip_tx_data_out_ready <= '0';  -- in this state, we are unable to accept user data for tx
222
        tx_count_mode        <= RST;
223
        set_chn_reqd         <= CLR;
224
        if ip_tx_start = '1' then
225
                                        -- check header count for error if too high
226
          if unsigned(ip_tx.hdr.data_length) > 1480 then
227
            next_tx_result <= IPTX_RESULT_ERR;
228
            set_tx_result  <= '1';
229
          else
230
            next_tx_result <= IPTX_RESULT_SENDING;
231
            set_tx_result  <= '1';
232
 
233
                                        -- TODO - check if we already have the mac addr for this ip, if so, bypass the WAIT_MAC state
234
 
235
            if ip_tx.hdr.dst_ip_addr = IP_BC_ADDR then
236
                                        -- for IP broadcast, dont need to look up the MAC addr
237
              tx_mac_value  <= MAC_BC_ADDR;
238
              set_tx_mac    <= '1';
239
              next_tx_state <= WAIT_CHN;
240
              set_tx_state  <= '1';
241
            else
242
                                        -- need to req the mac address for this ip
243
              set_mac_lku_req <= SET;
244
              next_tx_state   <= WAIT_MAC;
245
              set_tx_state    <= '1';
246
            end if;
247
          end if;
248
        else
249
          set_mac_lku_req <= CLR;
250
        end if;
251
 
252
      when WAIT_MAC =>
253
        ip_tx_data_out_ready <= '0';  -- in this state, we are unable to accept user data for tx
254
        set_mac_lku_req      <= CLR;  -- clear the request - will have been latched in the ARP layer
255
        if arp_req_rslt.got_mac = '1' then
256
                                        -- save the MAC we got back from the ARP lookup
257
          tx_mac_value <= arp_req_rslt.mac;
258
          set_tx_mac   <= '1';
259
          set_chn_reqd <= SET;
260
                                        -- check for optimise when already have the channel
261
          if mac_tx_granted = '1' then
262
                                        -- ready to send data
263
            next_tx_state <= SEND_ETH_HDR;
264
            set_tx_state  <= '1';
265
          else
266
            next_tx_state <= WAIT_CHN;
267
            set_tx_state  <= '1';
268
          end if;
269
        elsif arp_req_rslt.got_err = '1' then
270
          set_mac_lku_req <= CLR;
271
          next_tx_result  <= IPTX_RESULT_ERR;
272
          set_tx_result   <= '1';
273
          next_tx_state   <= IDLE;
274
          set_tx_state    <= '1';
275
        end if;
276
 
277
      when WAIT_CHN =>
278
        ip_tx_data_out_ready <= '0';  -- in this state, we are unable to accept user data for tx
279
        if mac_tx_granted = '1' then
280
                                        -- ready to send data
281
          next_tx_state <= SEND_ETH_HDR;
282
          set_tx_state  <= '1';
283
        end if;
284
        -- probably should handle a timeout here
285
 
286
      when SEND_ETH_HDR =>
287
        ip_tx_data_out_ready <= '0';  -- in this state, we are unable to accept user data for tx
288
        if mac_data_out_ready = '1' then
289
          if tx_count = x"00d" then
290
            tx_count_mode <= RST;
291
            next_tx_state <= SEND_IP_HDR;
292
            set_tx_state  <= '1';
293
          else
294
            tx_count_mode <= INCR;
295
          end if;
296
          case tx_count is
297
            when x"000" =>
298
              mac_data_out_first <= mac_data_out_ready;
299
              tx_data            <= tx_mac (47 downto 40);  -- trg = mac from ARP lookup                                            
300
 
301
            when x"001" => tx_data <= tx_mac (39 downto 32);
302
            when x"002" => tx_data <= tx_mac (31 downto 24);
303
            when x"003" => tx_data <= tx_mac (23 downto 16);
304
            when x"004" => tx_data <= tx_mac (15 downto 8);
305
            when x"005" => tx_data <= tx_mac (7 downto 0);
306
            when x"006" => tx_data <= our_mac_address (47 downto 40);  -- src = our mac
307
            when x"007" => tx_data <= our_mac_address (39 downto 32);
308
            when x"008" => tx_data <= our_mac_address (31 downto 24);
309
            when x"009" => tx_data <= our_mac_address (23 downto 16);
310
            when x"00a" => tx_data <= our_mac_address (15 downto 8);
311
            when x"00b" => tx_data <= our_mac_address (7 downto 0);
312
            when x"00c" => tx_data <= x"08";  -- pkt type = 0800 : IP                                         
313
            when x"00d" => tx_data <= x"00";
314
            when others =>
315
                                        -- shouldnt get here - handle as error
316
              next_tx_result <= IPTX_RESULT_ERR;
317
              set_tx_result  <= '1';
318
              next_tx_state  <= IDLE;
319
              set_tx_state   <= '1';
320
          end case;
321
        end if;
322
 
323
      when SEND_IP_HDR =>
324
        ip_tx_data_out_ready <= '0';  -- in this state, we are unable to accept user data for tx
325
        if mac_data_out_ready = '1' then
326
          if tx_count = x"013" then
327
            tx_count_val  <= x"001";
328
            tx_count_mode <= SET;
329
            next_tx_state <= SEND_USER_DATA;
330
            set_tx_state  <= '1';
331
          else
332
            tx_count_mode <= INCR;
333
          end if;
334
          case tx_count is
335
            when x"000" => tx_data <= x"45";  -- v4, 5 words in hdr
336
            when x"001" => tx_data <= x"00";  -- service type
337
            when x"002" => tx_data <= total_length (15 downto 8);            -- total length
338
            when x"003" => tx_data <= total_length (7 downto 0);
339
            when x"004" => tx_data <= x"00";  -- identification
340
            when x"005" => tx_data <= x"00";
341
            when x"006" => tx_data <= x"00";  -- flags and fragment offset
342
            when x"007" => tx_data <= x"00";
343
            when x"008" => tx_data <= IP_TTL;                                -- TTL
344
            when x"009" => tx_data <= ip_tx.hdr.protocol;                    -- protocol
345
            when x"00a" => tx_data <= tx_hdr_cks (15 downto 8);              -- HDR checksum
346
            when x"00b" => tx_data <= tx_hdr_cks (7 downto 0);               -- HDR checksum
347
            when x"00c" => tx_data <= our_ip_address (31 downto 24);         -- src ip
348
            when x"00d" => tx_data <= our_ip_address (23 downto 16);
349
            when x"00e" => tx_data <= our_ip_address (15 downto 8);
350
            when x"00f" => tx_data <= our_ip_address (7 downto 0);
351
            when x"010" => tx_data <= ip_tx.hdr.dst_ip_addr (31 downto 24);  -- dst ip
352
            when x"011" => tx_data <= ip_tx.hdr.dst_ip_addr (23 downto 16);
353
            when x"012" => tx_data <= ip_tx.hdr.dst_ip_addr (15 downto 8);
354
            when x"013" => tx_data <= ip_tx.hdr.dst_ip_addr (7 downto 0);
355
            when others =>
356
                                        -- shouldnt get here - handle as error
357
              next_tx_result <= IPTX_RESULT_ERR;
358
              set_tx_result  <= '1';
359
              next_tx_state  <= IDLE;
360
              set_tx_state   <= '1';
361
          end case;
362
        end if;
363
 
364
      when SEND_USER_DATA =>
365
        ip_tx_data_out_ready <= mac_data_out_ready;-- and mac_data_out_ready_reg;  -- in this state, we are always ready to accept user data for tx
366
        if mac_data_out_ready = '1' then
367
          if ip_tx.data.data_out_valid = '1' or tx_count = x"000" then
368
                                                                                -- only increment if ready and valid has been subsequently established, otherwise data count moves on too fast
369
            if unsigned(tx_count) = unsigned(ip_tx.hdr.data_length) then
370
                                        -- TX terminated due to count - end normally
371
              set_last       <= '1';
372
              set_chn_reqd   <= CLR;
373
              tx_data        <= ip_tx.data.data_out;
374
              next_tx_result <= IPTX_RESULT_SENT;
375
              set_tx_result  <= '1';
376
              next_tx_state  <= IDLE;
377
              set_tx_state   <= '1';
378
              if ip_tx.data.data_out_last = '0' then
379
                next_tx_result <= IPTX_RESULT_ERR;
380
              end if;
381
            elsif ip_tx.data.data_out_last = '1' then
382
                                                                                -- TX terminated due to receiving last indication from upstream - end with error
383
              set_last       <= '1';
384
              set_chn_reqd   <= CLR;
385
              tx_data        <= ip_tx.data.data_out;
386
              next_tx_result <= IPTX_RESULT_ERR;
387
              set_tx_result  <= '1';
388
              next_tx_state  <= IDLE;
389
              set_tx_state   <= '1';
390
            else
391
                                        -- TX continues
392
              tx_count_mode <= INCR;
393
              tx_data       <= ip_tx.data.data_out;
394
            end if;
395
          end if;
396
        end if;
397
 
398
    end case;
399
  end process;
400
 
401
  -----------------------------------------------------------------------------
402
  -- sequential process to action control signals and change states and outputs
403
  -----------------------------------------------------------------------------
404
 
405
  tx_sequential : process (clk)--, reset, mac_data_out_ready_reg)
406
  begin
407
--    if rising_edge(clk) then
408
--      mac_data_out_ready_reg <= mac_data_out_ready;
409
--    else
410
--      mac_data_out_ready_reg <= mac_data_out_ready_reg;
411
--    end if;
412
 
413
    if rising_edge(clk) then
414
      if reset = '1' then
415
        -- reset state variables
416
        tx_state        <= IDLE;
417
        tx_count        <= x"000";
418
        tx_result_reg   <= IPTX_RESULT_NONE;
419
        tx_mac          <= (others => '0');
420
        tx_mac_chn_reqd <= '0';
421
        mac_lookup_req  <= '0';
422
 
423
      else
424
        -- Next tx_state processing
425
        if set_tx_state = '1' then
426
          tx_state <= next_tx_state;
427
        else
428
          tx_state <= tx_state;
429
        end if;
430
 
431
        -- tx result processing
432
        if set_tx_result = '1' then
433
          tx_result_reg <= next_tx_result;
434
        else
435
          tx_result_reg <= tx_result_reg;
436
        end if;
437
 
438
        -- control arp lookup request
439
        case set_mac_lku_req is
440
          when SET =>
441
            arp_req_ip_reg <= ip_tx.hdr.dst_ip_addr;
442
            mac_lookup_req <= '1';
443
 
444
          when CLR =>
445
            mac_lookup_req <= '0';
446
            arp_req_ip_reg <= arp_req_ip_reg;
447
 
448
          when HOLD =>
449
            mac_lookup_req <= mac_lookup_req;
450
            arp_req_ip_reg <= arp_req_ip_reg;
451
        end case;
452
 
453
        -- save MAC
454
        if set_tx_mac = '1' then
455
          tx_mac <= tx_mac_value;
456
        else
457
          tx_mac <= tx_mac;
458
        end if;
459
 
460
        -- control access request to mac tx chn
461
        case set_chn_reqd is
462
          when SET  => tx_mac_chn_reqd <= '1';
463
          when CLR  => tx_mac_chn_reqd <= '0';
464
          when HOLD => tx_mac_chn_reqd <= tx_mac_chn_reqd;
465
        end case;
466
 
467
        -- tx_count processing
468
        case tx_count_mode is
469
          when RST  => tx_count <= x"000";
470
          when SET  => tx_count <= tx_count_val;
471
          when INCR => tx_count <= tx_count + 1;
472
          when HOLD => tx_count <= tx_count;
473
        end case;
474
 
475
      end if;
476
    end if;
477
  end process;
478
 
479
  -----------------------------------------------------------------------------
480
  -- Process to calculate CRC in parallel with pkt out processing
481
  -- this process must yield a valid CRC before it is required to be used in the hdr
482
  -----------------------------------------------------------------------------
483
 
484
  crc : process (clk)--, reset)
485
  begin
486
    if rising_edge(clk) then
487
      case crc_state is
488
        when IDLE =>
489
          if ip_tx_start = '1' then
490
            tx_hdr_cks <= x"004500";    -- vers & hdr len & service
491
            crc_state  <= TOT_LEN;
492
          end if;
493
 
494
        when TOT_LEN =>
495
          tx_hdr_cks <= std_logic_vector (unsigned(tx_hdr_cks) + unsigned(total_length));
496
          crc_state  <= ID;
497
 
498
        when ID =>
499
          tx_hdr_cks <= tx_hdr_cks;
500
          crc_state  <= FLAGS;
501
 
502
        when FLAGS =>
503
          tx_hdr_cks <= tx_hdr_cks;
504
          crc_state  <= TTL;
505
 
506
        when TTL =>
507
          tx_hdr_cks <= std_logic_vector (unsigned(tx_hdr_cks) + unsigned(IP_TTL & ip_tx.hdr.protocol));
508
          crc_state  <= CKS;
509
 
510
        when CKS =>
511
          tx_hdr_cks <= tx_hdr_cks;
512
          crc_state  <= SAH;
513
 
514
        when SAH =>
515
          tx_hdr_cks <= std_logic_vector (unsigned(tx_hdr_cks) + unsigned(our_ip_address(31 downto 16)));
516
          crc_state  <= SAL;
517
 
518
        when SAL =>
519
          tx_hdr_cks <= std_logic_vector (unsigned(tx_hdr_cks) + unsigned(our_ip_address(15 downto 0)));
520
          crc_state  <= DAH;
521
 
522
        when DAH =>
523
          tx_hdr_cks <= std_logic_vector (unsigned(tx_hdr_cks) + unsigned(ip_tx.hdr.dst_ip_addr(31 downto 16)));
524
          crc_state  <= DAL;
525
 
526
        when DAL =>
527
          tx_hdr_cks <= std_logic_vector (unsigned(tx_hdr_cks) + unsigned(ip_tx.hdr.dst_ip_addr(15 downto 0)));
528
          crc_state  <= FINAL;
529
 
530
        when FINAL =>
531
          tx_hdr_cks <= inv_if_one(std_logic_vector (unsigned(tx_hdr_cks) + unsigned(tx_hdr_cks(23 downto 16))), '1');
532
          crc_state  <= WAIT_END;
533
 
534
        when WAIT_END =>
535
          tx_hdr_cks <= tx_hdr_cks;
536
          if ip_tx_start = '0' then
537
            crc_state <= IDLE;
538
          else
539
            crc_state <= WAIT_END;
540
          end if;
541
 
542
 
543
      end case;
544
    end if;
545
  end process;
546
 
547
 
548
end Behavioral;
549
 

powered by: WebSVN 2.1.0

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