|
User Guide 是這麼說的:4 Y, f) d/ b% E' p! c9 B3 u! J
: ]) \2 d5 a- |, _( T. OAppendix B. Using RGB and IR Pins as User IO
8 e8 g5 V3 v5 E: OTo use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:
8 \5 a7 T$ A1 S4 ^ ^& o$ [+ g; Q! _
module top(a,o1);
$ o3 E7 Y- j7 H! I o vinput a;
/ i2 q1 t- h6 m+ A, loutput o1;
. m; v- J! I& e A8 }9 dwire o1i;
+ {$ r- L; l& m. Xassign o1i = a;3 T6 W8 f) C( W
SB_IO_OD OpenDrainInst0% n# e, i( b! M* c
(% i3 Y" h* W( T% ^* n9 ?
.PACKAGEPIN (o1), // User’s Pin signal name: h7 f3 e d0 O+ z; a( t- p
.LATCHINPUTVALUE (), // Latches/holds the Input value
, P! a5 W! Q7 J- b$ }" h.CLOCKENABLE (), // Clock Enable common to input and // output clock
0 G/ Y+ K \8 _3 P.INPUTCLK (), // Clock for the input registers
# K. l( Q! ?9 \7 W$ K.OUTPUTCLK (), // Clock for the output registers
3 Z' b0 ~4 k- A( P% S& {/ b+ d.OUTPUTENABLE (), // Output Pin Tristate/Enable // control0 X) Q- W1 h/ k5 @
.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk/ u6 J' l, ~! y% \4 [8 ~% w% L s% J
// edge
% }* g9 M$ F" H7 a# {.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge q5 p! Q% @5 p8 ?. u3 Y# e# ~+ Q
.DIN0 (), // Data 0 - Pin input/Rising clk+ ?6 i* U) ]/ b5 {1 b& ?) p
// edge
, W! Q! P% n$ |) @.DIN1 () // Data 1 – Pin input/Falling clk // edge
' x, F6 Y9 p6 D7 g% v);
( z3 l$ E$ o' _0 N3 l0 w, P* ~defparam OpenDrainInst0.PIN_TYPE = 6'b011001;
# v E# ?1 M0 J+ |) rdefparam OpenDrainInst0.NEG_TRIGGER = 1'b0;- l; i* _( x+ ?4 z
endmodule
# r/ w9 g; a. S/ M! B* k7 I) y$ W) F! e9 c2 J

( ^" Z) S" e; J" r" f9 i
0 m1 N& Q% s/ _# _ u |
|