|
User Guide 是這麼說的:' W g6 b9 P2 }# R. y0 l$ k8 X
' ?4 e! V9 B- g3 O, y# k8 S" u
Appendix B. Using RGB and IR Pins as User IO' `& Z; T. L* F/ w3 P! @+ }' ?
To use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:( O- }$ j7 I' N t3 ?2 ]
# C& u6 R; F3 @1 o. |1 L/ E& k
module top(a,o1);
5 P! a- W, a( K6 h4 t* e) c$ pinput a;
- A4 H. H( l; X* Ooutput o1;+ S& G5 {3 B: e( O }
wire o1i;. ~. r! | v! a3 r
assign o1i = a;
8 W7 j7 b+ z4 Z9 m4 Y# }SB_IO_OD OpenDrainInst01 l# b: c- K* k6 t8 A" A/ w( t
(
0 p ]( ~ V$ t5 f.PACKAGEPIN (o1), // User’s Pin signal name
% j8 i' j: y0 t4 s' _4 g+ Y.LATCHINPUTVALUE (), // Latches/holds the Input value
/ m2 y4 b; z2 j& z.CLOCKENABLE (), // Clock Enable common to input and // output clock( |& r* m5 d- e0 Y
.INPUTCLK (), // Clock for the input registers4 E- i7 Z% f0 a. f& x/ F
.OUTPUTCLK (), // Clock for the output registers
* s' R, k9 x% m# i.OUTPUTENABLE (), // Output Pin Tristate/Enable // control+ s1 z' b% L' A& I) J' k
.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk+ x0 `1 { u6 S5 S
// edge8 W/ Z& D& e3 f" {
.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge, @2 \& X R8 `
.DIN0 (), // Data 0 - Pin input/Rising clk
8 T/ y6 A0 X% E- e1 u; P// edge4 z8 K+ _2 V' q4 W; m
.DIN1 () // Data 1 – Pin input/Falling clk // edge r7 \# I; {0 Z
);! Q: M. L- I4 G k' s
defparam OpenDrainInst0.PIN_TYPE = 6'b011001;
0 Z# a" C' O! w' a# E+ M( Ndefparam OpenDrainInst0.NEG_TRIGGER = 1'b0;
6 h% ]( b* Q+ B' uendmodule5 t: v. c+ J- W. Q, T! S
% L+ n$ d! @8 }7 _
) p2 a" v& Q3 d! ^% C7 f' J' N: _& r- `- t) t' {' u0 e9 _
|
|