usb_arc_term.v
3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//**************************************************************************************
//
// 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