|
User Guide 是這麼說的:
* t# v1 C! p1 A3 D& A; u# |& S. w8 W' ~' L& v
Appendix B. Using RGB and IR Pins as User IO1 @: C- T# c5 @$ @
To use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:" K2 k' d$ W6 c# `4 C
c" F# @( d) [# P
module top(a,o1);' g' I- T4 ^# N) r
input a;/ e) f) }* W' \2 [/ F( p- a
output o1;
" R. N3 _/ V+ Hwire o1i;1 G Y+ j' j8 o* F+ e2 A# [
assign o1i = a;/ B3 T" ]( B [+ N9 C
SB_IO_OD OpenDrainInst0' |1 ^0 {: }. i# E' q5 Y
(
) z E0 e% _. o.PACKAGEPIN (o1), // User’s Pin signal name
/ L5 ]5 j& ?6 r9 _1 i.LATCHINPUTVALUE (), // Latches/holds the Input value+ ?& I/ _- k1 W8 p% y1 x# b/ n! N
.CLOCKENABLE (), // Clock Enable common to input and // output clock
& `( C9 i0 a) ?8 R.INPUTCLK (), // Clock for the input registers2 d& ]4 }4 [ }. G& U; u
.OUTPUTCLK (), // Clock for the output registers
\1 L7 A+ N; }& V5 N& t4 S.OUTPUTENABLE (), // Output Pin Tristate/Enable // control
$ X/ }' [ V8 O- ?& L% }.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk- R0 E1 p7 k. j
// edge
& a* |# M) L3 f8 q& q9 Y) J.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge" t4 `7 y) \$ w* t+ ?, S* X* L; x
.DIN0 (), // Data 0 - Pin input/Rising clk* L' v* C! y1 ~% k
// edge2 U1 {" B5 W$ e
.DIN1 () // Data 1 – Pin input/Falling clk // edge+ B: t, O I& \ e
);
: t* s! D/ O m1 |5 [defparam OpenDrainInst0.PIN_TYPE = 6'b011001;7 u% {' d9 O# s; Y8 @ `' f! e' ~
defparam OpenDrainInst0.NEG_TRIGGER = 1'b0;# d( I, s$ m9 l9 J
endmodule q/ u) a w5 I0 x g
' @6 Z0 d6 p; M% C) `: B9 y
1 f2 {4 g/ {- j: h
+ l, @+ l4 m" ~# [! r! Z+ _ |
|