|
User Guide 是這麼說的:; S; d9 g {" w& p& y1 H+ q
9 N" g5 i2 E ^ _. c/ r/ `/ O+ HAppendix B. Using RGB and IR Pins as User IO6 \$ o6 m* k" D
To use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:
9 b8 O# ^& Q; ~+ O* s; _3 {! |3 z6 u* G, h/ J) Z" w7 s) v! F# |
module top(a,o1);6 D+ j: q. l ]/ N% ?! }
input a;
9 P# R5 P" q. `, P) v0 ~! ?output o1;
$ G V. i4 c6 H+ Kwire o1i;. Y1 V9 O! w2 G
assign o1i = a;
. D, w+ }( B# V2 m1 wSB_IO_OD OpenDrainInst0
( {: z# ^7 I9 V3 @0 S0 v7 f(
& a6 L t' g( _$ b8 u) q" S3 O.PACKAGEPIN (o1), // User’s Pin signal name
; T# b: g- q) B# P& D8 H* p.LATCHINPUTVALUE (), // Latches/holds the Input value
8 o# U+ D2 U: [.CLOCKENABLE (), // Clock Enable common to input and // output clock* ^7 K. \5 [3 T" P
.INPUTCLK (), // Clock for the input registers$ C+ o, U2 Q0 {* h! n* |
.OUTPUTCLK (), // Clock for the output registers
3 ]( G' p. \" F* q6 K.OUTPUTENABLE (), // Output Pin Tristate/Enable // control
3 a! w, L* i! I' \/ b.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk
0 c6 d" N% }' c! k1 E+ q9 X// edge( T; H2 n. O1 I+ ^# \, w
.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge
* N+ E; Q9 `7 x6 _1 r.DIN0 (), // Data 0 - Pin input/Rising clk
1 q2 E! J5 @- L O! C D' G0 j// edge) w# h1 L' o$ W& `4 ?
.DIN1 () // Data 1 – Pin input/Falling clk // edge/ J3 h4 g: z6 {' ^9 C
);
) I. W+ A$ Q9 c* L7 n6 udefparam OpenDrainInst0.PIN_TYPE = 6'b011001;
& K; m6 k$ N* S% Adefparam OpenDrainInst0.NEG_TRIGGER = 1'b0;* d; @ [1 I% Z+ m' ?" X( y
endmodule+ z- k' }4 L9 U8 L+ H
% F+ x; O& @9 f, g& I
, D; l7 O- {3 y7 K" Y, _' d) T+ y: B+ s- ?6 F" v* s) B1 |
|
|