--------------------------------------------------------------------------------
-- Copyright (c) 2000 by Trenz Electronic.
-- Duenner Kirchweg 77, 32257 Buende, Germany, www.trenz-electronic.de
--     
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--     
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--     
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
--------------------------------------------------------------------------------
-- Project:      Application Note: SoC with Xilinx Virtex
-- File:         xsvPHY.vhd
-- Description:  Interface to Philips PDIUSBP11A USB Transceiver.
-- Version:      FB, 2001jan29
--------------------------------------------------------------------------------

library IEEE;
use IEEE.STD_LOGIC_1164.all;

entity xsvPHY is
	port(
		-- Function Controller interface
		urxd:   out STD_LOGIC;
		urx0:   out STD_LOGIC;
		utxd:   in  STD_LOGIC;
		utx0:   in  STD_LOGIC;
		utxoe:  in  STD_LOGIC;
		-- PDIUSBP11A interface
		rcv:    in  STD_LOGIC;
		vp:     in  STD_LOGIC;
		vm:     in  STD_LOGIC;
		vpo:    out STD_LOGIC;
		fse0:   out STD_LOGIC;
		oe:     out STD_LOGIC;
		suspnd: out STD_LOGIC
		);
end xsvPHY;

--------------------------------------------------------------------------------
architecture BHV of xsvPHY is
	signal v, u: STD_LOGIC_VECTOR(1 downto 0);
begin
	-- input
	v<= vp & vm;
	with v select u<=
	"10" when "10",
	"00" when "01",
	"01" when "00",
	"-0" when others;
	urxd<= u(u'left);
	urx0<= u(u'right);
	
	-- output
	vpo <= utxd;
	fse0<= utx0;
	oe  <= not(utxoe);
	
	-- control
	suspnd<= '0';
end BHV;

--------------------------------------------------------------------------------
-- end of file
