annotate venus/src/usb/usb_domain.v @ 98:3ab69117b09f default tip

minnie/doc/Design-spec: finished in the first pass
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 01 Oct 2023 08:17:05 +0000
parents 3becdb3b6dce
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module encapsulates the USB domain of FC Venus.
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 module usb_domain (GND, VBUS, Host_TxD, Host_RxD, Host_RTS, Host_CTS,
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 Host_DTR, Host_DCD, Host_RI, Host_TxD2, Host_RxD2,
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 RPWON, nTESTRESET);
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 input GND;
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 output VBUS;
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 output Host_TxD, Host_RTS, Host_DTR, Host_TxD2;
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 input Host_RxD, Host_CTS, Host_DCD, Host_RI, Host_RxD2;
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 output RPWON, nTESTRESET;
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 /* USB domain wires */
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 wire P_5V, P_3V3;
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 wire [7:0] ADBUS, BDBUS;
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 wire [3:0] ACBUS, BCBUS;
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 usb_core usb ( .GND(GND),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 .VBUS(VBUS),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 .P_5V(P_5V),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 .VCCIOA(P_3V3),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 .VCCIOB(P_3V3),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 .ADBUS(ADBUS),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 .ACBUS(ACBUS),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 .SI_WUA(P_3V3),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 .BDBUS(BDBUS),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 .BCBUS(BCBUS),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 .SI_WUB(P_3V3),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 .PWREN() /* no connect */
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 );
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 regulator_with_caps reg_3V3 (.GND(GND), .IN(P_5V), .OUT(P_3V3));
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38
39
3becdb3b6dce implement USB domain load resistor as proposed in document
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
39 /* load resistor per USB-and-mobile-domains article section 2.4.1 */
3becdb3b6dce implement USB domain load resistor as proposed in document
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
40 resistor Rload (P_3V3, GND);
3becdb3b6dce implement USB domain load resistor as proposed in document
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
41
24
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 usb_domain_buf buf (.GND(GND),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 .P_3V3(P_3V3),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 .Int_TxD(ADBUS[0]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 .Int_RxD(ADBUS[1]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 .Int_RTS(ADBUS[2]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 .Int_CTS(ADBUS[3]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 .Int_DTR(ADBUS[4]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 .Int_DCD(ADBUS[6]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 .Int_RI(ADBUS[7]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 .Int_TxD2(BDBUS[0]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 .Int_RxD2(BDBUS[1]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 .Host_TxD(Host_TxD),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 .Host_RxD(Host_RxD),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 .Host_RTS(Host_RTS),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 .Host_CTS(Host_CTS),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 .Host_DTR(Host_DTR),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 .Host_DCD(Host_DCD),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 .Host_RI(Host_RI),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 .Host_TxD2(Host_TxD2),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 .Host_RxD2(Host_RxD2)
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 );
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 usb_domain_bctl bctl ( .GND(GND),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 .P_3V3(P_3V3),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 .ChanB_RTS(BDBUS[2]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 .ChanB_DTR(BDBUS[4]),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 .CTL1_out(RPWON),
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 .CTL2_out(nTESTRESET)
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 );
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71
4722b265cb8c Venus src: USB domain captured
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 endmodule