|
User Guide 是這麼說的:
6 q' e! T% M4 V* K8 P. A0 q; U4 ^9 \% k! h' Z: d
Appendix B. Using RGB and IR Pins as User IO
. V/ w* ~' T" B' V( @! MTo use the RGB and IRLED pins as general io user must instantiate the SB_IO_OD primitive, see example below:
" ?# _/ h% ?; O0 w T# U6 Y3 S# m: a- n7 z* R. K
module top(a,o1);: ?1 Y6 M0 ?* x0 e. ^% B0 d5 j
input a;
. k1 ?9 m5 ? F+ {output o1;
0 T$ v/ ^7 p, O" y1 h/ L- O4 xwire o1i;2 X6 s8 G2 W& d2 _6 `! z0 O
assign o1i = a;
' z2 D- I1 \" n# a/ |- {( BSB_IO_OD OpenDrainInst0* N- p/ z: q e" }) k& _
(6 L0 M3 ~7 z h4 ?8 M7 C
.PACKAGEPIN (o1), // User’s Pin signal name
6 A7 J6 ^4 [! U, \. C: d.LATCHINPUTVALUE (), // Latches/holds the Input value0 [$ J/ I" k1 n/ u
.CLOCKENABLE (), // Clock Enable common to input and // output clock& E% } l& _$ h6 H4 S- v
.INPUTCLK (), // Clock for the input registers
4 h0 _6 `2 @1 ^2 \- u3 A.OUTPUTCLK (), // Clock for the output registers
" B, \- F+ S& j2 i.OUTPUTENABLE (), // Output Pin Tristate/Enable // control1 O+ S; u+ z" y& C. A
.DOUT0 (o1i), // Data 0 – out to Pin/Rising clk8 _1 [% V- d% e2 ~7 x a( G
// edge1 x) K# N9 ?) }6 o$ V' ]' `
.DOUT1 (), // Data 1 - out to Pin/Falling clk // edge; i9 R7 I$ r9 v7 H1 p" }2 R
.DIN0 (), // Data 0 - Pin input/Rising clk
" I N/ c" `- w" F* y// edge. o/ r* O$ F4 q6 G' u1 k
.DIN1 () // Data 1 – Pin input/Falling clk // edge
( L; U) A$ _, N. c);, @3 S+ S' E0 b3 y; U! r( v' x, }
defparam OpenDrainInst0.PIN_TYPE = 6'b011001;5 L; i3 F) G3 P4 r5 X0 ?
defparam OpenDrainInst0.NEG_TRIGGER = 1'b0;+ }7 m' n( p0 N, J
endmodule
$ b! p e4 Y/ Y; h- R1 D: s2 b% e9 }* B
9 Y8 ]6 i5 T/ r$ e+ I& d
+ V+ K' L* N' D$ A, G
|
|