A while back I started sharing FPGA projects and code on Github. As I typically only commit sources and not generated files, the process of rebuilding the projects from sources can be a little tricky if you’re not used to working with the Xilinx tools. In this post I’ll explain exactly how you can download and rebuild one of my projects, and hopefully it will make the projects useful to more people.
Download the sources from Github
The first thing you have to do is obviously to get the sources from Github. Now if you’re a user of Git, that’s a simple matter of cloning the repository. If you’re not a user of Git, you’ll have to visit the Github page and use the download link.
1. Go to the Github page of the project you want, for example: https://github.com/fpgadeveloper/zc706-bsb
2. For Git users, use the clone URL that you find circled in the image below. For non-Git users, use the download ZIP link button just below.
3. Extract the files to the folder you want to work in, for this example, create a folder called “zc706-bsb”. Among the extracted files you should find at least two folders: EDK and SDK, that’s the minimum for any of my projects.
- The EDK folder contains the Xilinx Platform Studio (EDK) project files. These files can be directly opened in the EDK.
- The SDK folder contains applications and board support packages for the Xilinx SDK. To use these files, you will use this folder as your new SDK workspace and import the existing applications. We will go into this later.
Build the EDK project
Click “Export & Launch SDK” because we will need the SDK for the next step.
Build the SDK workspace
If you are used to using the Xilinx SDK, you might notice that the SDK folder doesn’t contain any hardware platform (typically it’s called “EDK_hw_platform”). I don’t commit the hardware platform because I don’t consider these files to be true sources because they are generated by the SDK and they change every time you modify the EDK project. So what I prefer to do is to have SDK regenerate the hardware platform when I clone a project. That is what we do in this step.
You should notice “EDK_hw_platform” in the Project Explorer as in the above image. As the name implies, these files are generated by the EDK design and they contain all the files necessary to describe the hardware configuration that you specified in the EDK project. You can see the bitstream in there (system.bit) as well as other configuration files that are specific to the Zynq. Every time you change the EDK project and use the “Export design” button, the SDK will know about it and update its copy of those files if you give it permission to do so.
- Select the SDK folder as your SDK workspace.
- SDK will then open an empty workspace. Select File->New->Project.
- In the New Project Wizard, select Xilinx->Hardware Platform Specification. Click Next.
- In the Target Hardware Specification window, click Browse.
- Browse to the “EDK/SDK/SDK_Export/hw” folder and select the “system.xml” file.
- The project name should be automatically named “EDK_hw_platform”. Make sure that the name is spelt exactly like that and click Finish.
After completing those steps you should have an SDK workspace with a single project named “EDK_hw_platform”.
Now you need to import the applications and BSPs.
1. Select File->Import.
4. Ensure that all applications and BSPs are ticked, then click Finish.
Build and run your application
Before trying to run your code, wait a while for SDK to build the application. It should be automatic, but if it doesn’t start by itself, you can always select Project->Build All. It can sometimes take a while, check the progress at the bottom right corner of the SDK window.
Fork and share
If you port any of my projects to other hardware platforms, or if you have some interesting applications, please send me the code or push it onto GitHub and send me a link so I can share it on my website. The more people that benefit, the better.