Alternate Mapping File Syntax

The concepts used in mapping a Sequoia program to different target machines are independent of any specific mapping syntax. The Sequoia compiler now supports an alternate mapping file interface that is designed to be more human-readable. The mapping information provided via the alternate syntax is the same as is described in the Generic Mapping Concepts section.

Alternate Mapping File Grammar

The following is a formal grammar for the alternate mapping file syntax. The notation is that of a standard regular expression. Literal open and close braces are indicated as \[ and \], respectively. Variables are indicated by capital letters.

#include "MACHINE_FILE"

[
task TASK_NAME [: entrypoint(INSTANCE_NAME)]?
{
  [
  instance INSTANCE_NAME::VARIANT_NAME([level LEVEL]?) [:]? [unique overlay|external("FILENAME")]*
  {
    [
    tunable TUNABLE_NAME[\[LEXNUM\]]? = TUNABLE_VALUE;
    |
    data([level LEVEL]?) [: spaceshare(ARRAY_NAME [, ARRAY_NAME]*)]?
    {
      [
      array ARRAY_NAME[\[LEXNUM\]]?([level LEVEL]?)
      {
        [
        [elements|pitch] [<|=|>] VALUE [, VALUE]*;
        |
        blockcyclic { [grid = VALUE [, VALUE]*; | blocksize = VALUE [, VALUE]*;]* }
        ]*
      }
      ]*
    }
    |
    control([level LEVEL]?)
    {
      [
      loop LOOP_NAME[\[LEXNUM\]]?([level LEVEL]?) [: flat]?
      {
        [
        swp = STAGES;
        |
        unroll = DEPTH;
        |
        spmd { [fullrange = LOWER,UPPER; | ways = [WAYS|auto]; | iterblk = BLOCKS;]* }
        ]*
      }
      |
      callsite TASK_NAME[\[LEXNUM\]]?()
      {
        [
        target INSTANCE_NAME() [:]? [dynamic|copy(ARRAY_NAME [, ARRAY_NAME]*)]*
        {
          [
          ARRAY_NAME.elements [<|=|>] VALUE [, VALUE]*;
          |
          instantiations [<|<=|=|>=|>] VALUE;
          ]*
        }
        ]*
      }
      ]*
    }
    ]*
  }
  ]*
}
]*

As with the XML mapping file syntax, if there are multiple objects in a task with the same name, then the LEXNUM field can be used to identify which one is being referred to,