Hello,
I'm a new user of Vivado 2014.2 and I have begun to learn the Verilog language recently. I have tried for 2-3 days to do a simple program that I want to test on my Zedboard. I would like to shift right or left one led (depending on the pushing button choice).
This is the top module file (.v):
`timescale 1ns / 1ps
module pilotage_leds(
input BTNU,
input BTND,
output [7:0] leds
);
reg [7:0]leds=8'b00010000;
always @(posedge BTNU or posedge BTND)
begin
if(BTNU==1)
begin
if(leds==8'b10000000)
begin
leds=8'b00000001;
end
else
begin
leds=(leds<<1);
end
end
else
begin
if(BTND==1)
begin
if(leds==8'b00000001)
begin
leds=8'b10000000;
end
else
begin
leds=(leds>>1);
end
end
end
end
endmodule
and here, the XDC file :
set_property PACKAGE_PIN T18 [get_ports BTNU]
set_property PACKAGE_PIN R16 [get_ports BTND]
set_property PACKAGE_PIN T22 [get_ports leds[0]]
set_property PACKAGE_PIN T21 [get_ports leds[1]]
set_property PACKAGE_PIN U22 [get_ports leds[2]]
set_property PACKAGE_PIN U21 [get_ports leds[3]]
set_property PACKAGE_PIN V22 [get_ports leds[4]]
set_property PACKAGE_PIN W22 [get_ports leds[5]]
set_property PACKAGE_PIN U19 [get_ports leds[6]]
set_property PACKAGE_PIN U14 [get_ports leds[7]]
set_property LVCMOS33 [get_ports leds[0]]
set_property LVCMOS33 [get_ports leds[1]]
set_property LVCMOS33 [get_ports leds[2]]
set_property LVCMOS33 [get_ports leds[3]]
set_property LVCMOS33 [get_ports leds[4]]
set_property LVCMOS33 [get_ports leds[5]]
set_property LVCMOS33 [get_ports leds[6]]
set_property LVCMOS33 [get_ports leds[7]]
set_property LVCMOS25 [get_ports BTNU]
set_property LVCMOS25 [get_ports BTND]
set_property SEVERITY {Warning} [get_drc_checks NSTD-1]
set_property SEVERITY {Warning} [get_drc_checks UCIO-1]
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets BTND_IBUF]
set_property CLOCK_DEDICATED_ROUTE FALSE [get_nets BTNU_IBUF]
When I transfer the program the leds[4] is lightening. The problem is when I push the BTNU button on the ZedBoard, all leds turn off.BTND runs normally.
I have tried to simulate with the vivado simulator. The code is running correctly.
I don't know if it is only a problem of code or if it's a problem of incompatibility of timing/signals regarding my code and the ZedBoard.
Thanks to help me.
Best regards
Thomas C