|
User Guide 是這麼說的:
! A! `) v4 s+ w$ \7 W* E, {% R$ d
) [4 @9 m+ j6 j: h% aAppendix B. Using RGB and IR Pins as User IO
/ ]6 v! l/ x% f6 ?/ J fTo use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:$ c. R% q9 H* ~3 g
$ e6 H0 }3 V7 F. ~2 U# i) l- x. v+ w
module top(a,o1);
' K" y3 Z5 }2 Ginput a;) U" L: U4 Q, o4 n) \' K
output o1;
' c! \' C0 X/ J3 [5 b* z6 I B& k2 f! owire o1i;* I+ P! F0 t1 h
assign o1i = a;
) S6 J5 x) I/ M8 s' `" |) DSB_IO_OD OpenDrainInst0$ G0 i E$ f5 i2 O
(9 i2 l+ p, ], x8 I( }
.PACKAGEPIN (o1), // User’s Pin signal name
0 F( ]: |( `$ d/ k+ b$ w6 I.LATCHINPUTVALUE (), // Latches/holds the Input value
7 R9 o' T% `; T# G.CLOCKENABLE (), // Clock Enable common to input and // output clock
8 B4 j; D. c6 @) j) Q* S.INPUTCLK (), // Clock for the input registers' s9 X1 P P7 }3 K0 @
.OUTPUTCLK (), // Clock for the output registers
3 s7 c' K) D, i- ]2 a9 G.OUTPUTENABLE (), // Output Pin Tristate/Enable // control1 N5 i% a$ v1 e! B, K" ]9 N" y
.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk
$ k7 Z" [) \) X// edge
, k/ ]3 x% ~- N- P.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge% J/ N0 R# N; ?8 c; G' u6 O5 l
.DIN0 (), // Data 0 - Pin input/Rising clk& m7 o" x- {' H
// edge7 r+ E( d0 J" G% b- i. H
.DIN1 () // Data 1 – Pin input/Falling clk // edge. t# J' o4 w' o. b4 z5 t9 q, A- k3 X
);
4 Q2 B2 F+ ]+ j! x% \+ Edefparam OpenDrainInst0.PIN_TYPE = 6'b011001;
- j9 k& h, Q: E& x9 O1 L& i Edefparam OpenDrainInst0.NEG_TRIGGER = 1'b0;( d. `1 A+ N4 ]4 Y
endmodule
0 Y( b& m: a, y/ i
$ _+ O$ [$ G: c5 I
0 V( R! d4 \. x3 [( ?" m2 e. K M
& i; E) |$ d4 |: j4 T- ~1 p2 A$ o* B |
|