Dataflow Software Stack  032db78
Master Thesis of Mathijs Saey at the VUB
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
core.contextMatcher.ContextMatcher Class Reference

DVM Context matcher. More...

Inherits object.

Public Member Functions

def __init__
 Initialize a context matcher. More...
 
def setKey
 Dynamically set the amount of tokens a certain instruction should receive. More...
 
def checkKey
 See if a given key is already a part of the tokens we are matching. More...
 
def updateKeyArr
 Update the token array for a key This method assumes that there is an array for the given key. More...
 
def isKeyReady
 See if all the input tokens are present for a given key. More...
 
def executeKey
 Add the tokens for key to the scheduler. More...
 
def add
 Add a token to the matcher. More...
 

Public Attributes

 tokens
 Dictionary that contains the tokens for all the keys. More...
 
 core
 Reference to the DVM::Core. More...
 

Detailed Description

DVM Context matcher.

The matcher is responsible for gathering inputs to the same instruction based on their contexts. The matcher should forward these tokens to the scheduler once that all of the inputs for a given context are available.

The matcher utilizes (instruction, context) pairs as keys

Constructor & Destructor Documentation

def core.contextMatcher.ContextMatcher.__init__ (   self,
  core 
)

Initialize a context matcher.

Parameters
coreThe runtime core that this matcher is a part of.

Member Function Documentation

def core.contextMatcher.ContextMatcher.setKey (   self,
  inst,
  cont,
  amount 
)

Dynamically set the amount of tokens a certain instruction should receive.

Parameters
instThe address of the instruction to set the token amount for.
contThe context for which this amount is valid.
amountThe amount of tokens this matcher requires for this key.
def core.contextMatcher.ContextMatcher.checkKey (   self,
  key 
)

See if a given key is already a part of the tokens we are matching.

Create an array to match these tokens if it's not.

Parameters
keyThe key to check
def core.contextMatcher.ContextMatcher.updateKeyArr (   self,
  key,
  port,
  token 
)

Update the token array for a key This method assumes that there is an array for the given key.

Parameters
keyThe key to find the array we want to update.
portThe destination port of the token we want to add.
tokenThe token we want to add.
def core.contextMatcher.ContextMatcher.isKeyReady (   self,
  key 
)

See if all the input tokens are present for a given key.

Parameters
keyThe key to check
Returns
True if all the input tokens are present for key.
def core.contextMatcher.ContextMatcher.executeKey (   self,
  key 
)

Add the tokens for key to the scheduler.

def core.contextMatcher.ContextMatcher.add (   self,
  token 
)

Add a token to the matcher.

This method can be seen as the main method of the matcher as it utilizes all the other methods to define the behaviour that the matcher will use when a token is added.

Parameters
tokenthe token to add.

Member Data Documentation

core.contextMatcher.ContextMatcher.tokens

Dictionary that contains the tokens for all the keys.

core.contextMatcher.ContextMatcher.core

Reference to the DVM::Core.