element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Using Xilinx Tools Forum Execution's problem of a simple verilog program on ZedBoard
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 335 subscribers
  • Views 364 views
  • Users 0 members are here
Related

Execution's problem of a simple verilog program on ZedBoard

Former Member
Former Member over 11 years ago

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

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 11 years ago

    Anytime you are reading a mechanical switch pushed in a 'human' time frame you should debounce the signal with either hardware (HDL) or software. Sven gives an example of this in this blog entry: http://svenand.blogdrive.com/archive/207.html#.VBC80PmwI8k

     

    -Gary

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube