Microprocessor Application Definition (MAD)

Microprocessor Application Definition Overview

A MAD file contains directives for customizing software application. This section describes the Microprocessor Application Definition (MAD) format, Platform Specification Format 2.1.0. and the parameters that can be used to customize applications.

Requirements

Each application has an MAD file and a Tool Command Language (Tcl) file associated with it.

The MAD file is used by Hsi to recognize it as an application and to consider its configuration while generating the application sources. The MAD file for each application must be located in its data directory.

Microprocessor Application Definition Files

Application Definition involves defining a Microprocessor Application Definition file (MAD) and a Data Generation file (Tcl file).

Application Definition File

The MAD file (<application_name>.mad) contains the name, description and other configurable parameters. A detailed description of the various parameters and the MAD format is described in MAD Format Specification.

Data Generation File

The second file (<application_name>.tcl, .with the filename being the same as the MAD filename) uses the parameters in the MAD file for the application to generate data.

Data generated includes, but is not limited to, generation of header files, C files, running DRCs for the application and generating executables. The Tcl file includes procedures that are called by the tool at various stages of its execution. Various procedures in a Tcl file includes the following:
  • DRC (swapp_is_supported_hw, swapp_is_supported_sw)

  • swapp_generate (tool defined procedure) called after application source files are copied

MAD Format Specification

The MAD format specification involves the MAD file format specification and the Tcl file format specification.

MAD File Format Specification

The MAD file format specification describes the parameters using a sample MAD file and its corresponding Tcl file.

The following example shows a MAD file for a sample application called my_application.

 option psf_version = 2.1;

option is a keyword identified by the tool. The option name following the option keyword is a directive to the tool to do a specific action.

The psf_version of the MAD file is defined to be 2.1 in this example. This is the only option that can occur before a BEGIN APPLICATION construct .
 BEGIN APPLICATION my_application
The BEGIN APPLICATION construct defines the start of an application named my_application.
 option NAME = myapplication
					option DESCRIPTION = "My custom application"
					END APPLICATION
Note: The application NAME should match the return value of the Tcl process swapp_get_name in the application Tcl file described above.

Tcl File Format Specification

Each application has a Tcl file associated with the MAD file. This Tcl file has the following sections:
  • DRC Section: This section contains Tcl routines that validate your hardware and software instances and their configuration needed for the application.
  • Generation Section: This section contains Tcl routines that generate the application header and C files based on the hardware and software configuration.

MAD Format Example

This section explains the MAD format through an example MAD file and its corresponding Tcl file.

Example: MAD File

The following is an example of an MAD file for a sample application called my_application.
 option psf_version = 2.1;

option is a keyword identified by the tool. The option name following the option keyword is a directive to the tool to do a specific action.

The psf_version of the MAD file is defined to be 2.1 in this example. This is the only option that can occur before a BEGIN APPLICATION construct .
 BEGIN APPLICATION my_application
The BEGIN APPLICATION construct defines the start of an application named my_application.
 option NAME = myapplication
					option DESCRIPTION = "My custom application"
					END APPLICATION
Note: Application NAME should match the return value of Tcl proc swapp_get_name in application Tcl file described above.