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

Dataflow Virtual Machine. More...

Namespaces

 context
 DVM Contexts.
 
 contextMatcher
 DVM context matcher.
 
 dispatcher
 DVM token dispatcher.
 
 instruction
 DVM instruction definitions.
 
 memory
 DVM instruction memory.
 
 runtime
 DVM runtime core.
 
 scheduler
 DVM instruction scheduler.
 
 token
 DVM Tagged tokens.
 
 tokenizer
 DVM token creator.
 

Functions

def addOperationInstruction
 Add an operation instruction. More...
 
def addConstant
 Add a constant instruction. More...
 
def addSink
 Add a sink instruction. More...
 
def addSwitch
 Create a switch instruction. More...
 
def addContextChange
 Add a context change instruction. More...
 
def addSplit
 Add a split instruction. More...
 
def addContextRestore
 Add a context restore instruction. More...
 
def addStopInstruction
 Add a stop instruction. More...
 
def addDestination
 Add a destination to a given instruction. More...
 
def addLiteral
 Add a literal to a given instruction. More...
 
def start
 Start the execution cores. More...
 
def addData
 Add an external token containing data. More...
 
def addTrivial
 Add data to the core, that immediately adds a stop token containing data. More...
 
def getPort
 Check the current port of the runtime. More...
 
def getIn
 Return the amount of input the runtime requires. More...
 
def setIn
 Set the amount of inputs that the runtime expects. More...
 
def hasIn
 See if the runtime expects additional input. More...
 

Detailed Description

Dataflow Virtual Machine.

This is the core of DVM. It contains the code that is necessary to execute the program in instruction memory.

This top level namespace also declares some convenience functions to control the instruction memory and runtime.

Function Documentation

def core.addOperationInstruction (   op,
  inputs 
)

Add an operation instruction.

Parameters
opThe operation of this instruction.
inputsThe amount of inputs this instruction will accept.
Returns
The key of the operation instruction.
def core.addConstant (   value)

Add a constant instruction.

Parameters
valueThe value the constant should return.
Returns
The key of the constant instruction.
def core.addSink ( )

Add a sink instruction.

Returns
The key of the sink instruction.
def core.addSwitch (   dstList)

Create a switch instruction.

Parameters
dstListThe list of the possible destinations.
Returns
The key of the switch instruction.
def core.addContextChange (   binds,
  restores,
  destSink,
  retSink 
)

Add a context change instruction.

Parameters
bindsThe amount of tokens to bind to a new context.
restoresThe amount of tokens the context will produce before being deleted.
destSinkThe destination of the token after the context change.
retSinkThe destination of the token after the context restore.
Returns
The key of the context change instruction.
def core.addSplit (   binds,
  dest,
  merge 
)

Add a split instruction.

Parameters
bindsThe amount of inputs that the split will take. A split should always take at least one argument, which is the array that will be split.
destThe destination of the tokens after the context change.
mergeThe instruction that will recreate the array after the contextrestore.
Returns
The key of the context map instruction.
def core.addContextRestore ( )

Add a context restore instruction.

Returns
The key of the context restore instruction.
def core.addStopInstruction ( )

Add a stop instruction.

Returns
The key of the stop instruction.
def core.addDestination (   srcKey,
  srcPort,
  dstKey,
  dstPort 
)

Add a destination to a given instruction.

This only works on instruction::OperationInstruction and on instruction::Sink

Parameters
srcKeyThe key of the from instruction.
srcPortThe index of the from port.
dstKeyThe key of the destination instruction.
dstPortThe index of the destination port.
def core.addLiteral (   key,
  port,
  val 
)

Add a literal to a given instruction.

This only works on instruction::OperationInstruction and on instruction:ContextChangeInstruction

def core.start (   cores)

Start the execution cores.

See also
runtime::init()
def core.addData (   data)

Add an external token containing data.

See also
runtime::addData()
def core.addTrivial (   data)

Add data to the core, that immediately adds a stop token containing data.

This can be used if the program does not require any user input.

See also
runtime::addTrivial()
def core.getPort ( )

Check the current port of the runtime.

def core.getIn ( )

Return the amount of input the runtime requires.

def core.setIn (   i)

Set the amount of inputs that the runtime expects.

def core.hasIn ( )

See if the runtime expects additional input.

Returns
True if the runtime has received all the required data.