ext_host_ctl.v 1.8 KB

module ext_host_ctl(
	usb_dminus,
	usb_dplus,
	usb_dp_high,
	usb_d_low_n,
	usb_vbus_vld,
	usb_id,
	usb_vbus_on,
	usbxr_oen
);

inout        usb_dminus;        // D-
inout        usb_dplus;         // D+
input        usb_dp_high;       // pullup resistor
input        usb_d_low_n;
input        usbxr_oen;
output       usb_id;
output	     usb_vbus_vld;
input        usb_vbus_on;

parameter    LOW_SPEED_DEV = 0;
wire [16:1]	 usb_speed_dp;
wire [16:1]   usb_power_dp;
assign usb_speed_dp = 16'd0;
assign usb_power_dp = 16'd0;
//defparam u_host_ctl.lsdev = LOW_SPEED_DEV;
wire         tb_is_device;
wire		bb_is_device ;
wire		bb_is_disconnect ;
wire		tb_is_disconnect ;

wire dplus, dminus;

usb_hostio usb_hostio(
	.t_p(usb_dplus),
	.t_m(usb_dminus),
	.w_p(dplus),
	.w_m(dminus),
	.oe(usbxr_oen)); 

vusb_host_ctl u_host_ctl(
	.dplus(dplus),
	.dminus(dminus),
	.port_sel(),
	.low_speed_dp(),
	.connect_dp(),
	.rmt_wake_dp(),
	.speed_dp(usb_speed_dp),
	.power_dp(usb_power_dp),
	.usb_b_sess_end_n(),           //XXXX OTG test end
	.tb_is_device(tb_is_device),
    .sim_done());

usb_bb_term u_vusb_term (
	.usb_dp_high(usb_dp_high) ,
	.usb_d_low_n(usb_d_low_n) ,
	.usb_vbus_on(usb_vbus_on) ,
	.tb_is_device(tb_is_device) ,
	.tb_is_disconnect(tb_is_disconnect) ,
	.usb_id(usb_id) ,
	.usb_sess_vld(usb_vbus_vld) ,
	.bb_device(bb_is_device) , 
	.bb_is_disconnect(bb_is_disconnect) ,
	.dplus(dplus) ,
	.dminus(dminus) 
	) ;

usb_arc_term u_vusb_bias (
	.bb_is_device(bb_is_device) ,
	.bb_is_disconnect(bb_is_disconnect) , 
	.tb_is_disconnect(tb_is_disconnect) ,
	.tb_is_device(tb_is_device) ,
	.dplus(dplus) ,
	.dminus(dminus)
	) ;

vusb_otg_lpbck u_vusb_otg_lpbck0 (
	.usb_id(),
    .usb_sess_vld_n(),
    .usb_a_vbus_vld_n(),
    .usb_b_sess_end_n(),
    .usb_vbus_on_n(~usb_vbus_on),
    .usb_vbus_chg_n(1'b1),
    .usb_vbus_dschg_n());

endmodule