OVERVIEW

This document is designed to provide a initial walk-through of a basic Linux design on the Xilinx ML300. The first part is creation of a hardware build for and existing kernel, and the second part compiles a kernel for existing hardware and downloads by two methods.

It is assumed the user has already performed an ISE and EDK installation, a cross compile installation, and completed the EDK Tutorial material, but by way of review, a short synopsis of the EDK tool view is presented.

Recall the left-mosti EDK white window contains a listing of the files and IP present in the project. The items are summarized roughly in the microprocessor hardware specification file (system.mhs) and microprocessor software specification (system.mss) files respectively. These two main files are edited and modified using "Project>Add/Edit Cores..." and "Project>Software Platform Settings..." dialog tools. Recall also that various activities are initiated using the "Tools" pulldown on the taskbar, and proceed generally down the list presented. Results, warnings, and errors are displayed in the lower panel.

It is possible, and occasionally useful, to manually configure the MHS and MSS files. EDK will automatically synchronize both files when using the above dialogs, but difficulties can arise if edited by external means; use caution in doing this. Viewing a project block diagram (and some manipulation) can be performed by "Project>View Block Diagram", but be aware that a similar synchronization is performed whenever this happens as well.

JumpStart Sequence

As mentioned earlier, the fastest approach is a three-step process: first, learn the overall tool flow with a basic design, next, learn something about Virtex Pro platform design and advanced techninques such as exporting/importing to ISE, and finally, perform this ML300 board-specific build and download.

  1. After first obtaining and setting up ISE, EDK, and the cross compile environment, and after having performed the Xilinx built-in tutorials, then create a clean workspace and download the project files and start EDK:

    • Into the new workspace, copy the ML300 project file in and unzip.

      In the next step, notice that EDK will initially locate itself in the last directory worked; it is prudent to select Look in: to confirm the correct location as the default files and directories have common names regardless of the project designation. This hint also applies to other tools, for example, importing or exporting files to ISE, etc.

    • Start XPS, and using File>Open Project navigate to the ml300_work21/projects/ml300_edk3, and select system_linux.xmp.

      This design is a complete project with a hardware pre-compiled bit file and a compiled kernel (in implementation/download.bit and kernel/executable.elf respectively). It is technically feasible to create a systemACE file with the downloaded components and boot the kernel. In fact, a prebuilt top.ace file is already present as well, which could be copied to the microdrive for immediate usage as a sanity check or troubleshooting step.

  2. In order to regenerate the hardware design, it is first necessary to delete the existing results. From the toolbar, select Tools>Clean>All. As more experience is gained, which files can be selectively deleted will become apparent. It is always safe, albeit time consuming, to remove all files and start cleanly.

  3. Each step in the Tools pulldown corresponds to a necessary action, and selecting a lower item will cause any prerequisite actions to be initiated. For illustration, individual tasks are separately performed below.

    • Select Tools>Generate Libraries and BSPs. This examines the specification files and configures appropriate paramter widths, investigates for possible memory overlap, checks the license status of various IP parts as well as operational status, and finally assembles a board support package or BSP, which is a directory tree of correct drivers, parameters, etc. required for the kernel build.

      It is tempting to omit this step when not actually compiling a kernel, but because of the checking performed, it is nearly always valuable. The following listing "Build All User Applications" is specific to code for standalone systems and can be safely skipped. Likewise, "Get Program Size" is aimed at strictly-budgeted embedded projects and will also be omitted for our Linux work.

    • Select Tools>Generate Netlist in order to prepare and initiate synthesis. This step is fairly time consuming, taking about 20 minutes on a 2 GHz processor.

    • Select Tools>Generate Bitstream to invoke PAR. This step generally takes approximately the same amount of time as the synthesis step, but due to the high utilization of the 2VP7 chip, will take significantly longer in this particular instance, perhaps a factor of 2X or 3X.

      At this point, the design has been synthesized, placed, and routed. In the earlier tutorials, the possibility of exporting to ISE for these steps was illustrated. Under most circumstances, using the above procedure is preferred as optimal flags are already set by various scripts interacting with XST and ngdbuild. The final requirement is to incorporate some necessary BRAM initialization. As it happens, the PPC processor comes out of reset relatively quickly, and will need a small piece of assembly code to initiate a tight loop prior to being exposed to the kernel startup procedure. Xilinx calls this bootloop, and terms inclusion of the initialization process "updating the bitstream".

    • Select Tools>Update Bitstream to incorporate the instructions within the bit file, which is a fairly rapid procedure.

    The hardware compilation should now be complete. Next, the FPGA configuration file will be merged with the existing compressed kernel elf and assembled into a single top.ace file, which in turn will be copied onto the demo microdrive for booting. This will be accomplished from a command line invocation of the Xilinx Microprocessor Debugger, or XMD. A number of steps are embodied in the script which produces the top.ace file, for example, the iMPACT software download utility is run in non-graphical form. Because of this interaction, it should be remembered that most tools are being started with EDK-specific .ini parameters.

    For future projects, remember to copy over these setup files, or reproduce their behavior with a new file.

  4. Select Tools>Xygwin Shell which will open a window and type pwd to confirm you are in the same directory edk3_ml300/projects/edk3_ml300. This directory will contain the system_linux.xmp file, and running the scripts from here will ensure the proper initialization files are utilized.

  5. Type the following command in the Xygwin shell:

    xmd genace.tcl -jprog -board ml300 -hw implementation/download.bit -elf kernel/executable.elf -ace top.ace

    Summary of the various commands:
    • xmd starts the Xilinx Microprocessor debugger and runs the genace TCL script.
    • -jprog option configures via JTAG
    • -board is specified as ML300 so genace script can locate the devices in the chain
    • -hw is location of bitstream configuration
    • -elf is location of compiled kernel
    • -ace is the output ace file name

    Linux will need a root filesystem to operate. This tutorial will initially utilize the rootfs shipping on the demo microdrive. Later tutorials will create this anew from scratch. Also, the Xilinx boot screen allowing selection of the proper kernel to boot will be retained. The following steps insert the top.ace into the existing microdrive arrangement.

  6. If the local machine has a compact flash slot, the microdrive can be inserted directly. If not the top.ace file must be transfered to a location where that can be accomplished, either to a USB CF device, or most likely a laptop with PCMCIA capability (for the supplied adapter).

  7. On the microdrive, copy the top.ace to the directory XILINX/myace.

  8. Insert the updated microdrive into the CF slot on the ML300 and power on the board. On the boot screen, select My Own ACE File to boot. You should see the Tux Penguin in the upper left corner, after 15 seconds, the PS2 keyboard lights should flash, and after about 40 seconds the X11 login screen should appear. This kernel is presently directing boot information to serial0 for diagnostic reasons, so if a terminal is connected to the first serial port it will be possible to view those messages.

    To avoid corrupting the microdrive, the system should always be halted by logging as root, opening an Xterm, and typing telinit 0 .

Next, ML300 Part 2: Building and Downloading a Linux Kernel



Please send corrections, information, and comments to webpage maintainer
This page last updated on 7 Nov 04

©2004 Board of Trustees, University of Illinois.
All rights reserved.