XPS Intro - Implementing the software design

This section describes the process of adding new software application projects, customizing programs and creating the final bitstream to download to the FPGA Board.

Start by choosing Software -> Add Software Application Project...

You can name the software project anything you like. Be sure it's assigned to the ppc405_0 processor. Click OK.

Your new software project will show up in the Applications tab. Right-click on your project and select Mark to Initialize BRAMs. Notice that the little red X disappears from your project (and appears on the ppc405_0 bootloop). This means your project will be used to initialize the FPGA's internal memory devices. Only one project can initialize the internal memory. You can use this feature to switch between multiple software projects easily.

Now you need to add source code to your software project. For this exercise, we've provided a source file that will blink the LEDs on the FPGA board.

If you are using FPGAv1.2 download this code from the repository; there are two files:
UserIO_Demo_v1.c
- warp_userio_v1.h

If you are using FPGAv2.2 download this code from the repository; there is just one file:
- UserIO_Demo_v2.c

Save these files to your project folder, in a sub-folder named 'src'. Then, in XPS, right-click the Sources entry and choose Add Existing Files. Navigate to your src folder and select UserIO_Demo_v#.c.

If you have a header file, then right-click Headers, choose Add Existing Files and select warp_userio_v1.h.

You can expand the Sources entry and double-click the source file to see the code. There are comments throughout explaining how it works. Don't make any changes (for now). Choose Device Configuration -> Update Bitstream. This will start the software compilation of the board support files, peripheral drivers and your source code.

When the log viewer shows Memory Initialization completed successfully, your software platform and application are compiled. There's one last step before actually using your project in hardware.

Right-click on your software application and select Generate Linker Script.

The linker script editor controls the mapping of sections of code and data to memory resources in hardware. Each drop-down box in the Section View lists the available memory resources. In this simple design, the only memory resources are the Data On-Chip Memory (DOCM) and Instruction On-Chip Memory (IOCM) devices. The default selections are valid in this case. Click OK.

Now that you have a fully synthesized hardware platform, compiled software platform and valid linker script, you can run Update Bitstream one last time. When this is finished, you're ready to download the file /implementation/download.bit to your FPGA board.

<< XPS Intro - Implementing the hardware platform Top