Dataflow Software Stack  032db78
Master Thesis of Mathijs Saey at the VUB
 All Classes Namespaces Files Functions Variables Pages
Functions | Variables
read Namespace Reference

DIS parser. More...

Functions

def parseValue
 Parse a value string. More...
 
def extractValue
 Extract the value of a statement. More...
 
def getInstructionList
 Get a list of instruction addresses from the array, starting at idx start. More...
 
def createSink
 Create a sink. More...
 
def createConstant
 Create a constant. More...
 
def createStop
 Create a stop instruction. More...
 
def createStart
 Create a start instruction. More...
 
def createContextChange
 Create a context change instruction. More...
 
def createSplit
 Create a context map function. More...
 
def createContextRestore
 Create a context restore. More...
 
def createOperation
 Create an operation. More...
 
def createSwitch
 Create a switch instruction. More...
 
def parseInst
 Parse an instruction declaration. More...
 
def parseChunk
 Parse a chunk declaration. More...
 
def parseLit
 Parse a literal declarations. More...
 
def parseLink
 Parse a link statement. More...
 
def parseTriv
 Parse a trivial statement. More...
 
def parseLine
 Parse a single DIS line. More...
 
def parse
 Parse a dis string. More...
 

Variables

tuple log = logging.getLogger(__name__)
 
 chunk = None
 
dictionary instructions
 Defines the operation codes and the functions to create them. More...
 
dictionary functions
 Functions to parse the various statements. More...
 

Detailed Description

DIS parser.

This module defines the function necessary to read DIS files.

Function Documentation

def read.parseValue (   str)

Parse a value string.

def read.extractValue (   stmt)

Extract the value of a statement.

The value of a statement is found after the statement, and seperated from the statement by a <= and a space.

def read.getInstructionList (   arr,
  start 
)

Get a list of instruction addresses from the array, starting at idx start.

def read.createSink (   arr,
  stmt 
)

Create a sink.

def read.createConstant (   arr,
  stmt 
)

Create a constant.

def read.createStop (   arr,
  stmt 
)

Create a stop instruction.

def read.createStart (   arr,
  stmt 
)

Create a start instruction.

Creates a sink and adds the amount of incoming elements to the runtime.

def read.createContextChange (   arr,
  stmt 
)

Create a context change instruction.

def read.createSplit (   arr,
  stmt 
)

Create a context map function.

def read.createContextRestore (   arr,
  stmt 
)

Create a context restore.

def read.createOperation (   arr,
  stmt 
)

Create an operation.

def read.createSwitch (   arr,
  stmt 
)

Create a switch instruction.

def read.parseInst (   arr,
  stmt 
)

Parse an instruction declaration.

Verify that it ended up in the correct chunk.

def read.parseChunk (   arr,
  stmt 
)

Parse a chunk declaration.

A chunk declaration has the form: CHUNK <idx>

def read.parseLit (   arr,
  stmt 
)

Parse a literal declarations.

A literal declaration has the form: LITR <instruction> <port> <= <value>

def read.parseLink (   arr,
  stmt 
)

Parse a link statement.

A link statement has the form: LINK <from> -> <to> where from and to have the form: <chunk> <instruction> <port>

def read.parseTriv (   arr,
  stmt 
)

Parse a trivial statement.

A trivial statement has the form: TRIV <= <value>

def read.parseLine (   line)

Parse a single DIS line.

def read.parse (   str)

Parse a dis string.

Variable Documentation

tuple read.log = logging.getLogger(__name__)
read.chunk = None
dictionary read.instructions
Initial value:
1 = {
2  'SWI' : createSwitch,
3  'SNK' : createSink,
4  'BGN' : createStart,
5  'STP' : createStop,
6  'SPL' : createSplit,
7  'CHN' : createContextChange,
8  'RST' : createContextRestore,
9  'OPR' : createOperation,
10  'CNS' : createConstant
11 }

Defines the operation codes and the functions to create them.

dictionary read.functions
Initial value:
1 = {
2  'CHUNK' : parseChunk,
3  'INST' : parseInst,
4  'LINK' : parseLink,
5  'LITR' : parseLit,
6  'TRIV' : parseTriv
7 }

Functions to parse the various statements.