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.
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.
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.
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.
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.
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.
The New Application Project dialog box appears. It provides some tool flow information - you can simply click Next.
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.
The Application Project Details box opens, and you can type a project name. Choose something meaningful, like “Project1”, and click Next.
The Domain box opens next. We will use the default domain, so you can simply click Next.
Finally, the Templates dialog box appears. Click Empty Application, because we will create projects from scratch with no library support.
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.
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.
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).
A blank editor window will appear. Now, you can add assembly code to the editor window.
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
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.
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.
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”.
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.