|
User Guide 是這麼說的:
9 y6 O; H" c2 l: }3 G5 B$ ?
* V0 Y6 N0 m- h* i x" qAppendix B. Using RGB and IR Pins as User IO6 s: W; v* J7 x. k$ v$ d1 ~2 p: J& M2 ?8 p
To use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:$ _. Q/ v5 _4 d+ {) A; O
( O& X) u! _8 |$ pmodule top(a,o1);! E7 Z+ x* \& G( Q& H
input a;
, d: k; K8 X* G- |3 noutput o1;, s6 j5 L u$ t% G: M
wire o1i;+ ?* E$ o& ?( E5 W4 \+ n! ?0 v
assign o1i = a;
3 I. C- z( I7 t) G/ V2 f7 w5 C) ^SB_IO_OD OpenDrainInst0+ Y% X; y2 ?( e" B
(( w* }0 f T, W; n: F. b: y) I! D
.PACKAGEPIN (o1), // User’s Pin signal name
& f+ m; z2 T4 e8 X.LATCHINPUTVALUE (), // Latches/holds the Input value
' B9 C' w2 |! |( p( X( a" J.CLOCKENABLE (), // Clock Enable common to input and // output clock
7 c' L0 o" n7 ^2 i.INPUTCLK (), // Clock for the input registers' R1 M g; u% w
.OUTPUTCLK (), // Clock for the output registers
, o/ R4 b) p, a1 v L.OUTPUTENABLE (), // Output Pin Tristate/Enable // control
, Z4 D/ ~9 v; C* D0 v* Z.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk4 A( |% ^: ?4 s T! _9 Y
// edge
/ Z: ?* V' ~' e! }.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge
4 \7 A$ k; K8 a- w8 X, O8 }4 L- c.DIN0 (), // Data 0 - Pin input/Rising clk
( L( [; z# d: h1 m/ C7 Z// edge
. [' o- y% U9 t1 u.DIN1 () // Data 1 – Pin input/Falling clk // edge# {3 W0 ^3 y: M" `" u# H
);/ a5 Q* P, W/ o' a7 h4 o- N* Q+ ^
defparam OpenDrainInst0.PIN_TYPE = 6'b011001;3 }6 T. A6 l2 x" A7 A
defparam OpenDrainInst0.NEG_TRIGGER = 1'b0;7 j8 l* H% W$ k7 }. {7 e
endmodule
% i% _1 d7 f4 ?, Y; ?8 n( K# k5 U+ `& x. c1 m" ]
1 Y+ I# a5 t1 O! \2 Z$ d7 Y( b$ N
, |7 n* _+ ]* q. m/ C" n: j. s5 B |
|