Last change
on this file since 13233 was 11755, checked in by neise, 13 years ago |
reinit of this svn repos .... it was all too messy
deleted the old folders and restarted with FACT_FAD_lib only.
(well and the testbenches)
|
File size:
1.9 KB
|
Line | |
---|
1 |
|
---|
2 | LIBRARY IEEE;
|
---|
3 | USE IEEE.STD_LOGIC_1164.ALL;
|
---|
4 | USE IEEE.NUMERIC_STD.ALL;
|
---|
5 | USE ieee.std_logic_unsigned.all;
|
---|
6 |
|
---|
7 | ENTITY w5300_interface_tester IS
|
---|
8 | PORT(
|
---|
9 | clk : IN std_logic;
|
---|
10 |
|
---|
11 |
|
---|
12 | -- interface to W5300 chip ports:
|
---|
13 | cs : IN std_logic;
|
---|
14 | rd : IN std_logic;
|
---|
15 | wiz_addr : IN std_logic_vector (9 DOWNTO 0);
|
---|
16 | wiz_data : INOUT std_logic_vector (15 DOWNTO 0);
|
---|
17 | wiz_reset : IN std_logic;
|
---|
18 | wr : IN std_logic;
|
---|
19 | int : OUT std_logic;
|
---|
20 |
|
---|
21 |
|
---|
22 | data_o : IN std_logic_vector (15 DOWNTO 0);
|
---|
23 | addr_i : OUT std_logic_vector (9 DOWNTO 0);
|
---|
24 | data_i : OUT std_logic_vector (15 DOWNTO 0);
|
---|
25 | read_i : OUT std_logic;
|
---|
26 | ready_o : IN std_logic;
|
---|
27 | write_i : OUT std_logic
|
---|
28 |
|
---|
29 | );
|
---|
30 |
|
---|
31 | -- Declarations
|
---|
32 |
|
---|
33 | END w5300_interface_tester ;
|
---|
34 |
|
---|
35 | --
|
---|
36 | ARCHITECTURE beha OF w5300_interface_tester IS
|
---|
37 | type state_t is (
|
---|
38 | PRESTART,
|
---|
39 | WRITE_TEST, WRITING,
|
---|
40 | READ_TEST, READING
|
---|
41 | --FINAL
|
---|
42 | );
|
---|
43 |
|
---|
44 | signal state : state_t;
|
---|
45 |
|
---|
46 | signal write : std_logic;
|
---|
47 | signal read : std_logic;
|
---|
48 |
|
---|
49 | BEGIN
|
---|
50 |
|
---|
51 | write_i <= write;
|
---|
52 | read_i <= read;
|
---|
53 | wiz_data <= X"1234";
|
---|
54 |
|
---|
55 | process(clk)
|
---|
56 | begin
|
---|
57 |
|
---|
58 | if rising_edge(clk) then
|
---|
59 | case state is
|
---|
60 | when PRESTART =>
|
---|
61 | read <= '0';
|
---|
62 | write <= '0';
|
---|
63 | if (ready_o = '1') then
|
---|
64 | state <= WRITE_TEST;
|
---|
65 | end if;
|
---|
66 |
|
---|
67 | when WRITE_TEST =>
|
---|
68 | if (ready_o = '1') then
|
---|
69 | addr_i <= "0000111100";
|
---|
70 | data_i <= X"ABCD";
|
---|
71 | write <= '1';
|
---|
72 | state <= WRITING;
|
---|
73 | end if;
|
---|
74 |
|
---|
75 | when WRITING =>
|
---|
76 | if (ready_o = '0') then
|
---|
77 | write <= '0';
|
---|
78 | state <= READ_TEST;
|
---|
79 | end if;
|
---|
80 |
|
---|
81 | when READ_TEST =>
|
---|
82 | if (ready_o = '1') then
|
---|
83 | addr_i <= "0100110101";
|
---|
84 | read <= '1';
|
---|
85 | state <= READING;
|
---|
86 | end if;
|
---|
87 |
|
---|
88 | when READING =>
|
---|
89 | if (ready_o = '0') then
|
---|
90 | read <= '0';
|
---|
91 | state <= WRITE_TEST;
|
---|
92 | end if;
|
---|
93 |
|
---|
94 |
|
---|
95 |
|
---|
96 |
|
---|
97 | end case;
|
---|
98 |
|
---|
99 | end if; --clk
|
---|
100 |
|
---|
101 | end process;
|
---|
102 |
|
---|
103 | END ARCHITECTURE beha;
|
---|
104 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.