μShell is a lightweight shell environment for engineers and software developers working with embedded microprocessors in Xilinx FPGAs. (μShell has also been successfully ported to run on ARM Cortex-M1 microprocessors in Actel ProASIC3 FPGAs, but without project-integration support.) μShell decreases the time spent performing initial tests of field-programmable gate array (FPGA) designs, simplifies running customizable one-time-only experiments, and provides a familiar-feeling command-line interface. The program comes with a collection of useful functions and enables the designer to add an unlimited number of custom commands, which are callable from the command-line. The commands are parameterizable (using the C-based command-line parameter idiom), so the designer can use one function to exercise hardware with different values. Also, since many hardware peripherals instantiated in FPGAs have reasonably simple register-mapped I/O interfaces, the engineer can edit and view hardware parameter settings at any time without stopping the processor.

μShell comes with a set of support scripts that interface seamlessly with Xilinx’s EDK tool. Adding an instance of μShell to a project is as simple as marking a check box in a library configuration dialog box and specifying a

software project directory. The support scripts then examine the hardware design, build design-specific functions, conditionally include processor-specific functions, and complete the compilation process. For code-size constrained designs, most of the stock functionality can be excluded from the compiled library.

When all of the configurable options are removed from the binary, μShell has an unoptimized memory footprint of about 4.8 kB and a size-optimized footprint of about 2.3 kB. Since μShell allows unfettered access to all processor-accessible memory locations, it is possible to perform live patching on a running system. This can be useful, for instance, if a bug is discovered in a routine but the system cannot be rebooted: μShell allows a skilled operator to directly edit the binary executable in memory. With some forethought, μShell code can be located in a different memory location from custom code, permitting the custom functionality to be overwritten at any time without stopping the controlling shell.

This work was done by Thomas A. Werne of Caltech for NASA’s Jet Propulsion Laboratory.

This software is available for commercial licensing. Please contact Daniel Broderick of the California Institute of Technology at This email address is being protected from spambots. You need JavaScript enabled to view it.. Refer to NPO-47495.



This Brief includes a Technical Support Package (TSP).
Document cover
Shell Minimalist Shell for Xilinx Microprocessors

(reference NPO-47495) is currently available for download from the TSP library.

Don't have an account?



Magazine cover
Software Tech Briefs Magazine

This article first appeared in the September, 2011 issue of Software Tech Briefs Magazine (Vol. 35 No. 9).

Read more articles from this issue here.

Read more articles from the archives here.


Overview

The document presents an overview of μShell, a minimalist shell designed for Xilinx microprocessors, particularly those embedded in FPGAs. Developed by NASA's Jet Propulsion Laboratory, μShell aims to provide an easy-to-use, extensible shell environment that is lightweight and efficient, with a memory footprint as small as 2.3KB. This allows it to be integrated into designs and run from Block RAM, ensuring availability upon power-up.

μShell is primarily written in portable C and GCC extensions, making it easily portable to any processor with a GCC compiler. It has been successfully demonstrated on various platforms, including the ARM Cortex M1 in an Actel ProASIC3 FPGA. The shell offers a familiar command-line interface and includes a collection of built-in functions for memory and device control, memory operations, and interaction with hardware peripherals. Users can perform operations without needing to know the specific memory addresses, as peripheral names and keys are utilized instead.

One of the key features of μShell is its customizability. Programmers can add project-specific, parameterizable functions to the shell, enhancing its functionality. This is achieved by using the keyword USHELL before the header-file declaration of any function intended for use within μShell. The document provides an example of how to implement a custom bitwise-not function, illustrating the straightforward process of adding new capabilities.

μShell was initially developed to assist in real-time debugging of hardware/software interfaces in FPGA designs. However, its utility extends beyond this purpose. It has been effectively used for various applications, including driving demonstrations, testing new designs during initial power-on, monitoring and interacting with deployed projects in real-time, and patching running executables.

The integration of μShell into the Xilinx Embedded Development Kit (EDK) is seamless, allowing users to easily incorporate it into their projects. The document emphasizes the importance of following the correct installation procedures to ensure proper functionality within the Xilinx library generator build system.

Overall, μShell represents a powerful tool for developers working with embedded systems, offering a combination of extensibility, efficiency, and ease of use, making it suitable for a wide range of applications in aerospace and beyond.