element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
FPGA
  • Technologies
  • More
FPGA
Blog Getting Started with Arty S7-50 (7 Ways to Leave Your Spartan-6 FPGA)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: cbohra00627
  • Date Created: 19 Jul 2022 1:30 PM Date Created
  • Views 2480 views
  • Likes 6 likes
  • Comments 2 comments
  • 7 Ways to Leave Your Spartan-6 FPGA
  • spartan-7
  • cbohra00627
  • Spartan_Migration
  • spartan-6
Related
Recommended

Getting Started with Arty S7-50 (7 Ways to Leave Your Spartan-6 FPGA)

cbohra00627
cbohra00627
19 Jul 2022

Introduction:
In this blog, I will walk through the steps to create our first project on the Arty S7-50 FPGA board. I received this board from E14 for the 7 Ways to Leave your Spartan-6 program.

In this blog, I will do the first start of the board and check if its working or notSweat smile! Then I will list all the steps that I followed to create my first project.
The board comes with preloaded binary. So, if you connect the board to the power supply or your system, the LEDs on it will start blinking as shown below.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image



Setting Up:
To work with the Arty-S7 board, we need to install the Vivado design suite by Xilinx. There are two versions of Vivado available (Vivado ML and Vivado Enterprise). We need to install the Vivado ML (free) version.

Follow this tutorial if you need help with installation.

Some points to keep in mind while installing Vivado are:

  • Download the Xilinx Unified Installer for the latest version. I am using Vivado 2021.2 (ML Edition). Latest boards might not be supported by older versions of Vivado.
  • Selecting "Vitis" will install both Vivado and Vitis. I will recommend to select "Vitis". This blog doesn't need Vitis but the following blogs might need it.
  • Vivado Design suite requires large space. It is a 40-50GB download. And after installing, it will take around 100GB of space.
  • I will advice you to install it in some other disk space rather than your windows (boot) disk.
  • One good thing is that the download can be paused and resumed. If you are using your mobile data, you will have to be patient to fully download and install it. It took me 5 days to download and install itCry.

Once you are ready with the software, you can go through the rest of the tutorial.

Controlling LEDs and Switches:
In this section, we will create our first project and try to control the LEDs and the Switches present on the board.

  1. Open Vivado and click on "Create Project".
  2. Give your project a name and select your project location. Click on "Next".
    Create_Project
  3. Choose the type of project. In our case, it is "RTL Project". If you don't want to add your source file at this stage, select the corresponding option. You can always add new source files later. Click on "Next".
    Project_Type
  4. If you didn't select the option to specify source file later, it will now ask you to add source files. Source file will contain the HDL code. Click on "Create File".
    Create_Src
  5. Write the name of your source file and select the HDL which you want to use. I am using Verilog and named my file as "main.v" (You don't need to enter the extension). Click on "OK" then click on "Next".
    Src_File_Name
  6. Now, it will ask to add constraint files. You can simulate your HDL code without constraint file but to deploy it on your board, you need a proper constraint file.
  7. Constraint files for Digilent boards can be downloaded from this link.
  8. Now click on "Add Files" in the "Add Constraints" wizard. Browse the downloaded folder and select the proper constraint file relevant to your board. In my case, it is "Arty-S7-50-Master.xdc". Click on "OK" then click on " Next".
    (I would advice to select first make a copy of the original constraint file and select that because you will need to modify the contents of the file to build the project and you don't want to modify your original constraint file.)
    Constraint_Files
  9. Now, click on the "Boards" tab and select your board from the list. In case it is not present in the list, click on the "Refresh" button then search for it again and download it if its not downloaded already. I am using Arty S7-50. Click on "Next".
    Select_Board
  10. Click on "Finish".

Now, since we have created our project, we can now start to write the HDL code.

  1. First, we will modify our constraint file.
  2. We will need a clock (12MHz), switches, RGB LEDs and Simple LEDs.
  3. So, in the constraint file, uncomment all those lines related to the above mentioned interfaces as shown below. You can also change the names of the interfaces as I have done. Leave everything else as it is in the constraint file.
    Modify_Constraint
  4. We can use these interfaces to access the LEDs and the switches on the board.
  5. Now, we can start writing the HDL code. Our HDL code will implement the following functions:
    • The whole circuit will be driven by a 12 MHz clock.
    • If sw[0] is turned on, led[0] will turn on.
    • If sw[1] is turned on, led[0] and led[1] will turn on.
    • If sw[2] is turned on, led[0], led[1] and led[2] will turn on.
    • If sw[3] is turned on, led[0], led[1], led[2] and led[3] will turn on.
    • If more than one switch is on, all the leds will turn off.
    • The two RGB leds will keep changing their color according to some bits of a 32 bit counter.
  6. The HDL code is given below.
    module main(
        input CLK12MHZ,
        input [3:0] sw,
        output reg [3:0] led,
        output reg [2:0] led_rgb0,
        output reg [2:0] led_rgb1);
        
        wire out0;
        wire out1;
        wire out2;
        wire out3;
        
        and sw0 (out0, sw[0], !sw[1], !sw[2], !sw[3]);
        and sw1 (out1, !sw[0], sw[1], !sw[2], !sw[3]);
        and sw2 (out2, !sw[0], !sw[1], sw[2], !sw[3]);
        and sw3 (out3, !sw[0], !sw[1], !sw[2], sw[3]);
        
        reg [31:0] counter = 32'h0;
        
        always @(posedge CLK12MHZ) begin
            counter <= counter + 1'b1;
            
            if (counter == 32'hFFFFFFFF) begin
                counter = 32'h0;
            end
        end
        
        always @(posedge CLK12MHZ) begin
            
            if (out0 || out1 || out2 || out3) begin
                if (out0 == 1'b1) begin
                    led[0] <= 1'b1;
                end
                else if (out1 == 1'b1) begin
                    led[0] <= 1'b1;
                    led[1] <= 1'b1;
                end
                else if (out2 == 1'b1) begin
                    led[0] <= 1'b1;
                    led[1] <= 1'b1;
                    led[2] <= 1'b1;
                end
                else if (out3 == 1'b1) begin
                    led[0] <= 1'b1;
                    led[1] <= 1'b1;
                    led[2] <= 1'b1;
                    led[3] <= 1'b1;
                end
            end
            else begin
                led[0] <= 1'b0;
                led[1] <= 1'b0;
                led[2] <= 1'b0;
                led[3] <= 1'b0;
            end
            
            led_rgb0[0] <= counter[25];
            led_rgb0[1] <= counter[26];
            led_rgb0[2] <= counter[27];
            
            led_rgb1[0] <= counter[22];
            led_rgb1[1] <= counter[23];
            led_rgb1[2] <= counter[24];
        end
    
    endmodule
  7. Now, after writing the HDL code, you can try to get its circuit schematic by clicking on "Schematic" under the "RTL Analysis" drop down menu in the left pane. My schematic is given below.
    Schematic
  8. If there are no errors in the code, the schematic will be build successfully otherwise it will show the errors.
  9. You can now connect the board to your system using a micro-USB cable.
  10. Next step is to generate the bitstream. Click on "Generate Bitstream" in the left pane. The following window will open.
    Generate_Bitstream
  11. Select "Number of jobs" as your choice. The lower the number of jobs you choose, the more time it will take to generate the bitstream (but higher number of jobs will use more resources). Click on "OK".
  12. The process might take a few minutes (if it takes much longer, just click on cancel and then try to generate it again). You can see the status of the process at top right corner of the window.
  13. After the bitstream gets generated, open the "Hardware Manager" from the left pane under "Program and Debug" drop down menu.
    Hardware_Manager
  14. Click on "Open target" and then click on "Auto Connect". It will take a few minutes to connect to the device.
  15. Once connected, click on "program device". This will program your device with the bitstream we earlier generated.
  16. You can check your board by turning the switches on and off as shown below.
    (Remember that if you disconnect your board from power supply and reconnect it you will have to reprogram it. The program doesn't get stored on the board. After reconnecting, the board will run the inbuilt binary code).

The device is shown below after programming it:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

There is a button ("PROG") on the board, pressing which will load the preloaded binary code.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Conclusion:

Working with Vivado is quite easy. Sometimes it gets stuck but runs fine if I restart it. It was very simple to program the board. There are many other interesting features like the IP Integrator which I will cover in later blogs.

Actually, I am a little bit disappointed by the fact that I need to reprogram it every time I disconnect it from power supply and reconnect it. I don't know why it doesn't have the feature to store its state when power is disconnected! I hope there is some good reason behind it.

  • Sign in to reply
  • cbohra00627
    cbohra00627 over 2 years ago in reply to rsjawale24

    Yeah that seems to be a solution!

    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsjawale24
    rsjawale24 over 2 years ago

    Generally, all FPGAs are volatile. Once you disconnect it from power, it loses the programmed bitstream. You can store your bitstream in the EEPROM or any other type of memory present on the board such that the FPGA will load the bitstream from memory on power up.

    A good example of this is the pre-loaded LEDs flashy demo.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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