1 |
2 |
ZTEX |
component ezusb_io
|
2 |
|
|
generic (
|
3 |
|
|
OUTEP : INTEGER := 2; -- EP for FPGA -> EZ-USB transfers
|
4 |
|
|
INEP : INTEGER := 6; -- EP for EZ-USB -> FPGA transfers
|
5 |
|
|
CLKBUF_TYPE : STRING := "" -- selects the clock preparation method (buffering, filtering, ...)
|
6 |
|
|
-- "SPARTAN6" for Xilinx Spartan 6,
|
7 |
|
|
-- all other values: no clock preparation
|
8 |
|
|
); -- "SERIES7" for Xilinx Series 7,
|
9 |
|
|
port (
|
10 |
|
|
ifclk : out std_logic; -- buffered output of the interface clock
|
11 |
|
|
reset : in std_logic; -- asynchronous reset input
|
12 |
|
|
reset_out : out std_logic; -- synchronous reset output
|
13 |
|
|
|
14 |
|
|
-- FPGA pins that are connected directly to EZ-USB.
|
15 |
|
|
ifclk_in : in std_logic; -- interface clock IFCLK
|
16 |
|
|
fd : inout std_logic_vector(15 downto 0); -- 16 bit data bus
|
17 |
|
|
SLWR : out std_logic; -- SLWR (slave write) flag
|
18 |
|
|
PKTEND : out std_logic; -- PKTEND (packet end) flag
|
19 |
|
|
SLRD : out std_logic; -- SLRD (slave read) flag
|
20 |
|
|
SLOE : out std_logic; -- SLOE (slave output enable) flag
|
21 |
|
|
FIFOADDR : out std_logic_vector(1 downto 0); -- FIFOADDR pins select the endpoint
|
22 |
|
|
EMPTY_FLAG : in std_logic; -- EMPTY flag of the slave FIFO interface
|
23 |
|
|
FULL_FLAG : in std_logic; -- FULL flag of the slave FIFO interface
|
24 |
|
|
|
25 |
|
|
-- Signals for FPGA -> EZ-USB transfer. The are controlled by user logic.
|
26 |
|
|
DI : in std_logic_vector(15 downto 0); -- data written to EZ-USB
|
27 |
|
|
DI_valid : in std_logic; -- 1 indicates valid data; DI and DI_valid must be hold if DI_ready is 0
|
28 |
|
|
DI_ready : out std_logic; -- 1 if new data are accepted
|
29 |
|
|
DI_enable : in std_logic; -- setting to 0 disables FPGA -> EZ-USB transfers
|
30 |
|
|
pktend_timeout : in std_logic_vector(15 downto 0); -- timeout in multiples of 65536 clocks before a short packet committed
|
31 |
|
|
-- setting to 0 disables this feature
|
32 |
|
|
-- signals for EZ-USB -> FPGA transfer
|
33 |
|
|
DO : out std_logic_vector(15 downto 0); -- data read from EZ-USB
|
34 |
|
|
DO_valid : out std_logic; -- 1 indicates valid data
|
35 |
|
|
DO_ready : in std_logic; -- setting to 1 enables writing new data to DO in next clock
|
36 |
|
|
-- DO and DO_valid are hold if DO_ready is 0
|
37 |
|
|
-- set to 0 to disable data reads
|
38 |
|
|
-- debug output
|
39 |
|
|
status : out std_logic_vector(3 downto 0)
|
40 |
|
|
);
|
41 |
|
|
end component;
|
42 |
|
|
|