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

Subversion Repositories funbase_ip_library

[/] [funbase_ip_library/] [trunk/] [TUT/] [ip.hwp.interface/] [eth_lan91c111_ctrl/] [1.0/] [vhd/] [quick_and_dirty_test.vhd] - Blame information for rev 145

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 145 lanttu
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.numeric_std.all;
4
 
5
use work.lan91c111_ctrl_pkg.all;
6
 
7
entity quick_and_dirty_test is
8
 
9
  port (
10
    clk               : in    std_logic;
11
    rst_n             : in    std_logic;
12
    but_in            : in    std_logic;
13
    but2_in           : in    std_logic;
14
 
15
    -- interface to LAN91C111
16
    eth_data_inout    : inout std_logic_vector( lan91_data_width_c-1 downto 0 );
17
    eth_addr_out      : out   std_logic_vector( lan91_addr_width_c-1 downto 0 );
18
    eth_interrupt_in  : in    std_logic;
19
    eth_read_out      : out   std_logic;
20
    eth_write_out     : out   std_logic;
21
    eth_nADS_out      : out   std_logic;
22
    eth_nAEN_out      : out   std_logic;
23
    eth_nBE_out       : out   std_logic_vector(3 downto 0);
24
 
25
    ready_out         : out   std_logic
26
 
27
    );
28
 
29
end quick_and_dirty_test;
30
 
31
architecture structural of quick_and_dirty_test is
32
 
33
  signal clk25, tx_re : std_logic;
34
 
35
  signal but_r1, but_r, but2_r1, but2_r : std_logic;
36
 
37
  signal but_cnt_r : integer range 0 to 25000000;
38
 
39
  signal tx_len_r : integer range 0 to 1400;
40
 
41
  signal new_tx_r : std_logic;
42
 
43
begin  -- structural
44
 
45
  synch: process (clk, rst_n)
46
  begin  -- process synch
47
    if rst_n = '0' then                 -- asynchronous reset (active low)
48
      but_r1 <= '0';
49
      but_r <= '0';
50
      but2_r1 <= '0';
51
      but2_r <= '0';
52
    elsif clk'event and clk = '1' then  -- rising clock edge
53
      but_r <= but_r1;
54
      but_r1 <= not but_in;
55
      but2_r <= but2_r1;
56
      but2_r1 <= not but2_in;
57
    end if;
58
  end process synch;
59
 
60
  joo: process (clk, rst_n)
61
  begin  -- process joo
62
    if rst_n = '0' then                 -- asynchronous reset (active low)
63
      new_tx_r <= '0';
64
      tx_len_r <= 28; --899;
65
    elsif clk'event and clk = '1' then  -- rising clock edge
66
      if but_cnt_r /= 0 then
67
        but_cnt_r <= but_cnt_r - 1;
68
      end if;
69
 
70
      if but_r = '1' and but_cnt_r = 0 then
71
        new_tx_r <= '1';
72
        tx_len_r <= tx_len_r + 1;
73
        but_cnt_r <= 25000000;
74
      end if;
75
 
76
      if new_tx_r = '1' and tx_re = '1' then
77
        new_tx_r <= '0';
78
      end if;
79
 
80
    end if;
81
  end process joo;
82
 
83
  pll_1: entity work.pll
84
    port map (
85
      inclk0 => clk,
86
      c0     => clk25);
87
 
88
  lan91c111_controller_1: entity work.lan91c111_controller
89
    generic map (
90
      enable_tx_g => '1',
91
      enable_rx_g => '1',
92
      interface_width_g => 16)
93
    port map (
94
      clk               => clk25,
95
      rst_n             => rst_n,
96
      eth_data_inout    => eth_data_inout,
97
      eth_addr_out      => eth_addr_out,
98
      eth_interrupt_in  => eth_interrupt_in,
99
      eth_read_out      => eth_read_out,
100
      eth_write_out     => eth_write_out,
101
      eth_nADS_out      => eth_nADS_out,
102
      eth_nAEN_out      => eth_nAEN_out,
103
      eth_nBE_out       => eth_nBE_out,
104
      tx_data_in        => x"ABCD",
105
      tx_data_valid_in  => '1',
106
      tx_re_out         => tx_re,
107
      rx_re_in          => '1',
108
      rx_data_out       => open,
109
      rx_data_valid_out => open,
110
      target_MAC_in     => x"000102CEF343",  -- vanha kone
111
--      target_MAC_in     => x"FFFFFFFFFFFF",
112
      new_tx_in         => new_tx_r or but2_r,
113
      tx_len_in         => std_logic_vector(to_unsigned(tx_len_r, 11)),
114
      tx_frame_type_in  => x"0800",
115
      new_rx_out        => open,
116
      rx_len_out        => open,
117
      rx_frame_type_out => open,
118
      rx_erroneous_out  => open,
119
      ready_out         => ready_out,
120
      fatal_error_out   => open);
121
 
122
end structural;

powered by: WebSVN 2.1.0

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