Getting started

December 25, 2017 ยท View on GitHub

The purpose of this document is to get you started with the following topics:

  • generating and opening the Vivado project (which can be used to generate the bitstream for the FPGA),
  • generating and opening the SDK workspace (which contains the software projects to be run on the MicroBlaze soft CPU core).

By the end of this guide you should have Hastlayer set up to be able to run the default sample design. Once you're done here check out Running hardware designs on how you can run the sample or your custom implementations generated by Hastlayer.

We use the TCL-based approach for keeping a minimum set of required files under version control.

Generating the Vivado project with the batch file (CreateProject.bat)

Run CreateProject.bat which will open Vivado, generate the project files in the Project subdirectory and generate the bitstream for the sample hardware design.

Once the project has been generated, you can re-open it next time by entering the Project subdirectory and opening Hastlayer.xpr.

The Project subdirectory will not be checked into version control, it only contains all the temporary files needed for editing and compiling the project and its corresponding IP cores.

Generating the Vivado project manually

If the Create file associations option is not selected while installing Vivado, CreateProject.bat might not work. In any case, you can open Vivado and type the following into the TCL console to open the project:

cd C:/path-to-my-project/hastlayer-hardware
source CreateProject.tcl

(Do not forget that we have to use the slash '/' inside the paths here, instead of the Windows default backslash.)

Once this is done you'll have to click Generate Bitstream in Vivado, wait until the process ends, and choose Export โ†’ Export Hardware.

Export Hardware

Generating the SDK workspace with the batch file (CreateSdkWorkspace.bat)

For the first time, you will have to run CreateSdkWorkspace.bat from the root of the repository, which will create the workspace in the SDK directory, and it will also import the projects into it.

Close any program that may lock the SDK folder, including Explorer, if you receive the following error:

Moving SDK folder...
Access is denied.
        0 dir(s) moved.

You should run CreateSdkWorkspace.bat only once. The next time you can open the workspace by launching Xilinx SDK from Vivado (but make sure you have set the directories correctly):

Launch SDK

You will have to press OK at the Xilinx SDK Workspace Launcher screen, and then close the welcome screen:

Close SDK welcome screen

Now you are ready to develop with the Xilinx SDK:

Ready to develop with SDK

You may have only one Hastlayer_wrapper_hw_platform_x project or multiple ones, this doesn't matter (due to a Xilinx SDK bug these can be duplicated).

If you run into problems while building a project, try this:

  1. Right click on the project in Project Explorer.
  2. Select Change Referenced BSP.
  3. Select Hastlayer_bsp in the popup window.
  4. Press OK.
  5. Clean and rebuild the project.

Generating the SDK workspace manually

If CreateSdkWorkspace.bat accidentally fails, you create the workspace manually:

Launch Xilinx SDK from Vivado, selecting the the SDK folder as your workspace.

Launch SDK

Import the projects:

Launch SDK

If you get a lot of build errors, you have to set the references for each project correctly.

  • All of the application projects (including HastlayerOperatingSystem) should have to reference the BSP.

  • The BSP has to reference the Hardware Platform.

    HastlayerOperatingSystem
    Ethernet_cpp ----- > Hastlayer BSP ---> Hastlayer Hardware Platform Ethernet_bare_cpp /

To do this, right click on each and every application project, and select Change referenced BSP, then click OK.

Then right click the BSP project and open up the Properties window for it:

BSP Properties

On the Project References page, check the reference for Hastlayer_wrapper_hw_platform_0 (and uncheck all others).

Project References

Right click the BSP project and Re-generate BSP Sources:

Regenerate BSP Sources

Then clean all projects, and re-build them. The errors should be gone.