看了教程第七章 ZYNQ GPIO使用之EMIO有个疑问,MIO或者EMIO一定要输出在管脚上么?能够在片内和PL连接么?
加入在PL建立一个模块控制LED:
module LED(
input wire CLK,
input wire nRESET,
input wire [2:0] LED_C,
output wire [7:0] LED
);
reg [7:0] LED_reg;
always @(posedge CLK or negedge nRESET) begin
if(!nRESET) begin
LED_reg = 8'D0;
end
else begin
case(LED_C)
3'D0: begin
LED_reg = 8'H1;
end
3'D1: begin
LED_reg = 8'H2;
end
3'D2: begin
LED_reg = 8'H4;
end
3'D3: begin
LED_reg = 8'H8;
end
3'D4: begin
LED_reg = 8'H10;
end
3'D5: begin
LED_reg = 8'H20;
end
3'D6: begin
LED_reg = 8'H40;
end
3'D7: begin
LED_reg = 8'H80;
end
endcase
end
end