Setting up a new Vitis Project (2020.1)

3912

Tools Installation

Download and install the Vitis tool from the Xilinx website. You will need to create and account and register with Xilinx to download Vitis. The installation image is quite large, so you’ll want a good internet connection.

Create an empty VITIS Project

First, create a project directory for your coursework, and then download the Blackboard/Vitis “board support package” to your directory. The board support package is available as a .zip file at the Board Support Files link on Real Digital’s “Resources” page.

Figure 1. Real Digital Blackboard Resources Page
Figure 1. Real Digital Blackboard Resources Page

Download the .zip file for your board and tool revision. If the .zip file name includes any spaces, rename the file and remove the spaces.

Figure 2. Choose the correct .zip file
Figure 2. Choose the correct .zip file

Start the Vitis tool. The first time you start the tool you will be asked to select a directory as your workspace – browse to the directory you created and click Launch. This will open the Vitis IDE, with the Welcome screen showing – you can close the Welcome screen.

Figure 3. Vitis Welcome Screen
Figure 3. Vitis Welcome Screen

After closing the welcome screen, you will see an empty Vitis IDE screen. The first step in creating a new project is to define the target hardware system, so that Vitis knows what hardware resources are available. Click File -> Import, navigate to the .zip file you downloaded in step 1, and click Next. This will load the “blackboard_bist” hardware definition file that defines all of Blackboard’s hardware resources.

Figure 4. Import the blackboard_bist.zip file
Figure 4. Import the blackboard_bist.zip file

After the file loads, select “blackboard.bist” in the explorer panel, and then select Project -> Build Project to extract and load the relevant data into your project workspace. The build may take a few moments – there’s a lot going on.

Figure 5. Build the hardware project
Figure 5. Build the hardware project

Now that the hardware platform is defined, you can add a new application (software) project to the workspace by clicking File -> New -> Application Project to bring up the New Application Wizard.

Figure 6. Add a new application (software) project
Figure 6. Add a new application (software) project

The New Application Project dialog box appears. It provides some tool flow information - you can simply click Next.

Figure 7. Click through the New Application dialog box
Figure 7. Click through the New Application dialog box

Now, the blackboard_bist platform that you built in the previous steps can be added to your new project. Select the blackboard_bist file, and click Next.

Figure 8. Add the Blackboard hardware definition to your project
Figure 8. Add the Blackboard hardware definition to your project

The Application Project Details box opens, and you can type a project name. Choose something meaningful, like “Project1”, and click Next.

Figure 9. Name your project
Figure 9. Name your project

The Domain box opens next. We will use the default domain, so you can simply click Next.

Figure 10. Click through the domain dialog box
Figure 10. Click through the domain dialog box

Finally, the Templates dialog box appears. Click Empty Application, because we will create projects from scratch with no library support.

Figure 11. Select the Empty Project template
Figure 11. Select the Empty Project template

Now, the project workspace is defined, and the Vitis tool places you in the Workspace view. From here, you can see all the files associated with the project, including the hardware project files you loaded earlier. Feel free to click around the workspace, and get a feel for what’s there. You can close the Application Project Settings window and the System Project Settings window if you would like – they are displayed by default in case you want to verify the settings.

Figure 12. The Vitis workspace view
Figure 12. The Vitis workspace view

Now you can add new source code files to your project. Right click on the “src” file icon located underneath your project name in the Explorer window, and click New -> File to bring up the New File box.

Figure 13. Add (software) source files
Figure 13. Add (software) source files

Enter a name for your source file, and be sure to use the “.S” suffix to tell the tools you are creating and assembly language source file (if you don’t use the .s suffix, it won’t work properly).

Figure 14. Be sure to use the “.S” suffix for assembly language sources
Figure 14. Be sure to use the “.S” suffix for assembly language sources

A blank editor window will appear. Now, you can add assembly code to the editor window.

Figure 15. Empty editor view
Figure 15. Empty editor view

Copy the following Assembly source code into the Assembly file you just defined. Your editor window should look like the picture below. To execute the program, you must first build the software project, and then choose a Run Configuration. To build the software project, make sure the src folder is selected in the explorer window, and then click Project -> Build Project. Since you already built the hardware part of the project, this should go fairly quickly.

.text
.global main

@define constants, these can be used as symbols in your code
.equ LED_CTL, 0x41210000
.set SW_DATA, 0x41220000

@the set and equ directives are equivalent and can be used interchangeably

main:
	ldr r1,=SW_DATA	@load switch address from constant
	ldr r2,=LED_CTL	@load LED address from constant
loop:
	ldr r0,[r1]	@load switch value *r1 ->r0
	str r0,[r2]	@store value to led register *r2 <-r0
	b loop		@go back to "loop"

.end

Figure 16. Build the software
Figure 16. Build the software

To choose a Run Configuration, open the pull-down menu next to the run icon (the white arrow in the green circle), and choose Run Configurations. In the window that opens, double-click the Single Application Debug (GDB) option.

Figure 17. Choose a Run Configuration
Figure 17. Choose a Run Configuration

That will bring up the GDB Run Configuration settings screen. For now, you can leave all the defaults as they are, and click Run in the lower right corner. That will transfer your program to the Blackboard and start it running.

Figure 18. Run your project
Figure 18. Run your project

After a Run Configuration has been selected, you can just click the arrow icon for future runs. Note that the Run Configuration programs the FPGA by default. If you don’t power-cycle your board, you can make the Run process faster by turning off FPGA programming for each new run. To turn off automatic FPGA programming, select the “Target Setup” tab in the Run Configuration, and uncheck “Reset entire system” and “Program FPGA”.

Figure 19. Run Configuration settings
Figure 19. Run Configuration settings

After you have successfully programmed your Blackboard, you should be able to control the individual LEDs with the slide switches. That’s it for this tutorial! Before moving on, you are highly encouraged to spend a few moments looking around the tool space, and building more familiarity with the environment.