com.cmpware.cmp
Class Multiprocessor

java.lang.Object
  extended by com.cmpware.cmp.Multiprocessor

public class Multiprocessor
extends java.lang.Object

This describes the generic multiprocessor.

Copyright (c) 2004, 2005 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
static java.lang.String copyright
          Copyright string
 
Constructor Summary
Multiprocessor()
           
 
Method Summary
 void allocate(java.lang.String[][] processorName)
          This method allocates the processors.
 void clearErrors()
          This clears the errors accumulated from the various processors during a step().
 Processor get()
          This method returns the current processor.
 Processor get(int row, int col)
          This method returns a processor from the array.
 int getCols()
          This method returns the number of columns in the processor array.
 int getCurrentColumn()
          This method returns the column of the currently selected processor.
 int getCurrentRow()
          This method returns the row of the currently selected processor.
 java.lang.Exception[] getErrors()
          This method returns an array containing all of the exceptions collected in the previous cycle.
 long getGlobalCycleCount()
          This method returns the global cycle count.
static ModelLoader getModelLoader()
          This method returns the plugin's model loader.
 int getRows()
          This method returns the number of rows in the processor array.
 void loadAll(Elf elf, int offset)
          This method loads the memory of each processor with the same data.
static java.lang.String[][] makeProcessorTable(java.lang.String processorName, int rows, int cols)
          The method is used to build the array of processor names used to initialize the MpMon.
 void reloadAll(int offset)
          This method loads the memory of each processor with the most recently loaded ELF (or binary) file.
 void reset()
          This method resets all of the processors.
 void set(int row, int col)
          This method sets a processor in the array as the current (focus) processor.
 int step()
          This method steps all of the processors one cycle.
 int step(int n)
          This method steps all of the processors at most cycles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values
Constructor Detail

Multiprocessor

public Multiprocessor()
Method Detail

allocate

public void allocate(java.lang.String[][] processorName)
              throws ProcessorException
This method allocates the processors.

Parameters:
processorName - This is a 2D array of strings representing the processors. Each string should be the class name of a class implementing the Processor interface.
Throws:
ProcessorException - If there was an error allocating or using the Processor class.

step

public int step()
This method steps all of the processors one cycle. It returns the number of errors encountered during this cycle.

Returns:
This method returns returns the number of errors encountered during this cycle.

step

public int step(int n)
This method steps all of the processors at most cycles. If an error or breakpoint is encountered, this method returns immediately.

Returns:
This method returns returns the number of errors encountered during the last cycle stepped.

reset

public void reset()
This method resets all of the processors. Note that this does not clear the processor memory or perform any operations other than a processor reset.


get

public Processor get()
This method returns the current processor.

Returns:
This method returns the current processor.

getGlobalCycleCount

public long getGlobalCycleCount()
This method returns the global cycle count.

Returns:
This method returns the global cycle count.

set

public void set(int row,
                int col)
This method sets a processor in the array as the current (focus) processor. An exception may be thrown if the indicies are out of bounds.

Parameters:
row - The row index of the processor array.
col - The column index of the processor array.

get

public Processor get(int row,
                     int col)
This method returns a processor from the array. An exception may be thrown if the indicies are out of bounds.

Parameters:
row - The row index of the processor array.
col - The column index of the processor array.
Returns:
This method returns a processor from the array.

getRows

public int getRows()
This method returns the number of rows in the processor array.

Returns:
This method returns the number of rows in the processor array.

getCols

public int getCols()
This method returns the number of columns in the processor array.

Returns:
This method returns the number of columns in the processor array.

getCurrentRow

public int getCurrentRow()
This method returns the row of the currently selected processor.

Returns:
This method returns the row of the currently selected processor.

getCurrentColumn

public int getCurrentColumn()
This method returns the column of the currently selected processor.

Returns:
This method returns the column of the currently selected processor.

getErrors

public java.lang.Exception[] getErrors()
This method returns an array containing all of the exceptions collected in the previous cycle.

Returns:
This method returns an array containing all of the exceptions collected in the previous cycle.

clearErrors

public void clearErrors()
This clears the errors accumulated from the various processors during a step().


loadAll

public void loadAll(Elf elf,
                    int offset)
             throws MemoryAccessException
This method loads the memory of each processor with the same data.

Parameters:
elf - The ELF data to be loaded.
offset - The address at which to load a non-ELF (raw binary) file. This parameter is ignored for data in proper ELF format.
Throws:
MemoryAccessException - if an attempt is made to illegally access memory.

reloadAll

public void reloadAll(int offset)
               throws MemoryAccessException
This method loads the memory of each processor with the most recently loaded ELF (or binary) file.

Parameters:
offset - The address at which to load a non-ELF (raw binary) file. This parameter is ignored for data in proper ELF format.
Throws:
MemoryAccessException - if an attempt is made to illegally access memory.

makeProcessorTable

public static java.lang.String[][] makeProcessorTable(java.lang.String processorName,
                                                      int rows,
                                                      int cols)
The method is used to build the array of processor names used to initialize the MpMon. Note that this produces a 2D array of identical processors. In the general case, there may be mixed processor types. This is not directly supported by this method.

Parameters:
processorName - The string representing the processor class.
rows - The number of rows in the processor array.
cols - The number of columns in the processor array.
Returns:
This method returns a 2D array of strings representing the 2D processor array.

getModelLoader

public static ModelLoader getModelLoader()
This method returns the plugin's model loader.

Returns:
This method returns the plugin's model loader.