|
User Guide 是這麼說的:" n$ o7 d( |+ W2 \
9 |% N& _- z/ f* T) D x1 c, C
Appendix B. Using RGB and IR Pins as User IO
' f9 F G' D: y- h# q8 k9 {To use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:) o+ c3 Q$ ?1 B+ a& q. M
0 F' ?; Z& T5 a) O( `# b% Qmodule top(a,o1);6 V* C. T! U1 u" {
input a;; F! U( I0 E2 [3 C9 @
output o1;. k! j4 i- @5 s5 x" j1 _" }$ D
wire o1i;7 j0 i: y0 D) o3 r
assign o1i = a;
+ q+ f4 z0 J; l5 U8 ESB_IO_OD OpenDrainInst0
- i3 S9 ~' ~4 _* t0 ^(
5 y! u/ g+ z, a) L.PACKAGEPIN (o1), // User’s Pin signal name) d6 C# z* C0 C
.LATCHINPUTVALUE (), // Latches/holds the Input value3 {4 z1 H: k2 [' U+ \. N9 V" p* o
.CLOCKENABLE (), // Clock Enable common to input and // output clock
4 K5 W# v. a F.INPUTCLK (), // Clock for the input registers
0 E8 R$ j# A# `' V+ Y' R. v6 n.OUTPUTCLK (), // Clock for the output registers
/ W8 Y8 A2 F: x$ N7 r.OUTPUTENABLE (), // Output Pin Tristate/Enable // control; C# h0 [4 x; `7 c! Z7 n
.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk
* H+ s0 D C1 n$ d) D: C; l* J// edge `" R: n2 Q2 A z: A2 w
.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge* G$ W# ^" b. S2 {7 W& D5 A
.DIN0 (), // Data 0 - Pin input/Rising clk
5 J7 q& s% J! A3 G ~; ?// edge7 L( |/ }: j$ {6 ~9 Y
.DIN1 () // Data 1 – Pin input/Falling clk // edge
$ y( ~$ i* c; W1 o);& G, J( A+ X3 C
defparam OpenDrainInst0.PIN_TYPE = 6'b011001;3 W( s4 X( w3 b M; K) d# b; d
defparam OpenDrainInst0.NEG_TRIGGER = 1'b0;
- \7 r- |; F* v+ }endmodule. f% E1 r4 \2 Q7 [
! @) z. [) q. e6 D: S: D% R8 J. [. e 3 m. j8 o2 o' x9 |( l
+ A+ @: g' m$ v/ ?! b D
|
|