usb_arc_term.v 3.6 KB
//**************************************************************************************
//
//	Model Name	: usb_arc_term.v
//	Revision	: $Revision: 1.6 $
//	Date		: $Date: 2003/01/08 22:00:44 $
//	Author		: Bill Saperstein
//	Description	: USB termination block to interface to arc host controller
//
//**************************************************************************************


//**************************************************************************************
// Module Definition
//**************************************************************************************
module usb_arc_term
		(
	// Inputs
		bb_is_device ,
		tb_is_device ,
		bb_is_disconnect ,
	// outputs
		tb_is_disconnect ,
	// Bi-directionals
		dplus ,
		dminus 
		) ;

//**************************************************************************************
// Define Parameters (optional)
//**************************************************************************************


//**************************************************************************************
// Port Declarations
//**************************************************************************************

	input
		bb_is_device, tb_is_device, bb_is_disconnect ;
	output
		tb_is_disconnect ;
	inout
		dplus, dminus ;

//**************************************************************************************
// Net Assignments and Declarations
//**************************************************************************************

	reg	cbl_connect, dev_speed ;
	wire	master, connect, speed ;

//**************************************************************************************
// Pre-Defined Module Instantiations
//**************************************************************************************

// Not Applicable

//**************************************************************************************
// Gate and Structural Declarations
//**************************************************************************************

	//*** the ipc environment needs to set the bb_slave register and
	//	cbl_connect register to configure the termination block
	//	these registers can be written whenever the OTG mode changes
	//	or the cable is connected/disconnected

	//*** the termination for the arc host controller is configured
	//	once the bb_slave register is written

	//*** the dev_speed is set via the ipc environment with the
	//	following definitions
	//	full_speed -> dev_speed = 1'b1 
	//	low_speed  -> dev_speed = 1'b0

   assign
	master = bb_is_device | ~tb_is_device ,
	connect = cbl_connect ,
	speed = dev_speed ,
	tb_is_disconnect = ~connect ;

	//*** define the resistor terminations

	bufif0 (pull1,highz0)
		g1	(dplus,1'b1,((master | ~connect | bb_is_disconnect) | ~speed)) ,
		g2	(dminus,1'b1,((master | ~connect | bb_is_disconnect) | speed)) ;
	bufif1 (highz1,weak0)
		g3	(dplus,1'b0,master) ,
		g4	(dminus,1'b0,master) ;

//**************************************************************************************
// Procedural Assignments
//**************************************************************************************

	//*** set initial conditions
	initial
	   begin
		cbl_connect <= 1'b1 ;
		dev_speed <= 1'b1 ;
	   end

//**************************************************************************************
// Task and Function Definitions
//**************************************************************************************

// Not Applicable

//**************************************************************************************
// End of Model
//**************************************************************************************
endmodule // usb_arc_term