================
(1) INTRODUCTION
================

This file describes the formation of the SCI model configuration file.
The following notations are used:

- Rules are described in regular expression.
- Terminal symbols are shown in lower case on the left-hand side of
  parser's grammar rules; the right-hand side of a grammar rule defines 
  a terminal symbol.
- Token symbols are shown in upper case on the left-hand side of
  lexer's lexical rules; the right-hand side of a lexical rule defines 
  a token symbol.
- A word followed by a ':' and a terminal or token symbol describes the
  semantic meaning of the terminal or token symbol. For instance, the
  "major:INT" says that this is a INT token representing the major
  number. The "type:ID" tells you that this ID token contains a type.

The grammar rules and token rules for the SCI model configuration file
are shown in the next two sections.

A C++ ModelConfigCl class is provided and can be used to read in a SCI
model configuration file; an internal database is constructed to store
the configuration settings. Utility functions are implemented such
that they can be used by an OCP channel, or core module to copy
parameter settings from the ModelConfigCl object to a C++ map structure
provided by the OCP channel, or core module. Sample code is shown
below:

=====
#include "ModelConfigCl.h"

.....

// =====
// create a model configuration database object MConf from
// the simple.sci input file
ModelConfigCl MConf("simple.sci");

// =====
// create a C++ map structure
MAPType my_ocp_map;

// copy the parameter settings of the "ocp1" OCP connection
// into a local C++ map structure
MConf.getOCPConfiguration("ocp1",my_ocp_map);

// retrive the addr_wdth parameter's setting from the
// map structure
int addr_wdth = atoi(my_ocp_map[".ocp1.addr_wdth"].c_str()+2);

// =====
// create a C++ map structure
MAPType my_ms_map;

// copy the parameter settings of the "ms1" core instance
// into a local C++ map structure
MConf.getInstanceConfiguration("ms1",my_ms_map);

// retrive the latency parameter's setting from the
// map structure
int latency = atoi(my_ms_map[".ms1.latency"].c_str()+2);
=====

When the my_ocp_map[".ocp1.addr_wdth"] is used, a string, "i:16",
representing the parameter's setting is returned. The character
before the colon indicates the value type of the setting; it can
be 'i' for integer, 'f' for floating number, 'l' for long integer,
or 's' for string.



==========================
(2) Parser's grammar rules
==========================

program : headerSection ( defaultClockStatement )?  body ;
headerSection : "sci" ocpip:ID major:INT PERIOD minor:INT ENDL ;
defaultClockStatement : "defaultclock" name:ID rate:INT ENDL
                        ( parameter )* ;
body : ( clockStatement )* ( connectionStatement )* ( instanceStatement )* ;
clockStatement : "clock" name:ID rate:INT ENDL ( parameter )* ;
connectionStatement : "connection" name:ID type:ID ENDL
                      ( "clock" clk_name:ID ENDL )?
                      ( parameter )* ;
instanceStatement : "instance" name:ID type:ID ENDL
                    ( "clock" clk_name:ID ENDL )?
                    ( parameter )*
                    ( interface )* ;
parameter : "param" name:ID ( value:intFloatParam | value:stringParam ) ENDL ;
stringParam : STRING "S" ;
intFloatParam : ( INT PERIOD INT "F" | INT "L" | INT "I" ) ;
interface : "interface" name:ID conn_name:intfName type:intfName ENDL ;
intfName : ( ID | QUESTIONMARK ) ;



=========================
(3) lexer's lexical rules
=========================

PERIOD : '.' ;
SEMICOLON : ';' ;
COLON : ':' ;
COMMA : ',' ;
QUESTIONMARK : '?' ;
GREATER : '>' ;
EQUAL : '=' ;
SMALLER : '<' ;
ATSIGN : '@' ;
PSIGN : '#' ;
COMMENT : "//" ( ~'\n' )* '\n' ;
WS : ( ' ' | '\t' )+ ;
ENDL : '\n' ;
STRING : '"' ( ~( '"' | '\n' ) )* '"' ;
INT : ( '-' | '+' )* ( '0'..'9' )+ ;
ID : ( 'a'..'z' ) ( 'a'..'z' | '0'..'9' | '_' | '.' | '(' | ')' )* ;
