|
User Guide 是這麼說的:& p& Q, ^7 I# p# x( _
+ n* X2 }) d& P) `9 r" s
Appendix B. Using RGB and IR Pins as User IO
. h5 R. P& V1 c0 N6 y, N. _5 z/ ^To use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:" ~1 r: b3 G1 _& m
) L) _, g4 Z$ W \& mmodule top(a,o1);
1 v- w, H, i5 _2 ~. einput a;
7 a; e2 J) F; s% youtput o1;2 e2 T3 f7 i. S
wire o1i;, o7 @2 x3 d+ q! ^0 U) H A1 c
assign o1i = a;( e' \" F/ L6 ]: T- q5 G; p9 L
SB_IO_OD OpenDrainInst0* \$ O, c. N" j; F/ i
(
. w0 a o2 g; g; H9 o; j.PACKAGEPIN (o1), // User’s Pin signal name
: H! N3 `) T! Q) N0 T4 g/ @.LATCHINPUTVALUE (), // Latches/holds the Input value
0 t% ]6 S v+ U1 [.CLOCKENABLE (), // Clock Enable common to input and // output clock+ b' _( |% i3 ]
.INPUTCLK (), // Clock for the input registers
5 `1 V6 C& d6 O.OUTPUTCLK (), // Clock for the output registers
5 t0 j: e9 Z+ L* I.OUTPUTENABLE (), // Output Pin Tristate/Enable // control! a4 K7 m3 @4 B, B9 [
.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk
& y: w; e' u+ Z// edge
6 U# W) F$ l( H1 m p.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge3 i9 _& K! p4 n9 P- q0 R: f& P1 e
.DIN0 (), // Data 0 - Pin input/Rising clk
' E, c4 t k) a// edge3 N& B( r4 d& t% ]0 ]) K: \
.DIN1 () // Data 1 – Pin input/Falling clk // edge
\( ~* Z0 [/ K3 K);
" N4 ^4 n1 z. c! C( h% Qdefparam OpenDrainInst0.PIN_TYPE = 6'b011001;% h' B3 L; O' n& Q5 {3 O
defparam OpenDrainInst0.NEG_TRIGGER = 1'b0;
7 P8 _2 H% \8 t" b E. _3 p0 y4 [endmodule" S# l; c) [# [8 J; P
: M4 s4 O" S Y$ f* V/ s2 \- I
0 l/ M. O8 ?. S! k1 y1 ^$ ?
' x( z5 }2 u1 F# A! T |
|