zynq PS控制PL端流水灯2

参见我的工程E:\vivado_program\ILA_VIO

该例程是在ZC706开发板上实现的,在vivado中如下所示:

zynq PS控制PL端流水灯2_第1张图片

led_ip是自己定制的,程序如下所示:

module my_led#(
parameter integer LED_WIDTH=4
)
(
input wire ACLK,
input wire ARESETN,
input wire slv_reg_wren,
input wire [31:0]WDATA,
output reg [LED_WIDTH-1:0] led
    );
always@(posedge ACLK)
begin
    if(ARESETN==1'b0)    
        led<=4'b0;
    else
    begin
        if(slv_reg_wren)
            led<=WDATA[3:0];
    end
end

endmodule

在SDK中的程序如下所示:

#include 
#include "platform.h"
#include "xil_io.h"
#include "xparameters.h"

//void print(char *str);

int main()
{
    init_platform();

    //print("Hello World\n\r");
    char i;
    unsigned long j;
    xil_printf("..........the test is start.........\n\r");
    //Xil_Out32(XPAR_LED_IP_0_S00_AXI_BASEADDR,1);

    for(i=0;i<255;i++)
    {
    	Xil_Out32(XPAR_LED_IP_0_S00_AXI_BASEADDR,i);
    	for(j=0;j<=9999999;j++);
    }


    xil_printf("..........the test is end.........\n\r");
    cleanup_platform();
    return 0;
}


你可能感兴趣的:(zynq7000)