edu.cmu.emulator.controlComm
Class SetTimedScaleMessage

java.lang.Object
  extended by edu.cmu.emulator.controlComm.CMessage
      extended by edu.cmu.emulator.controlComm.TupleMessage
          extended by edu.cmu.emulator.controlComm.SetTimedScaleMessage

public class SetTimedScaleMessage
extends TupleMessage

Sends scaling updates to the auxfpga with timing information that allows the precise time that the updates occur to be controlled. Each message consists of several scale sets. Each set occurs at a specified offset relative to a reference time contained in this message. This message also contains the current system time so that the auxfpga can synchronize its clock to the system clock.


Field Summary
protected  int filledTuples
           
protected static int I_START_TIME
           
protected static int I_SYSTEM_TIME
           
protected static int I_TUPLE_0
           
protected static int O_INDEX
           
protected static int O_MULT_FACTOR
           
protected static int O_SHIFT_FACTOR
           
protected static int O_TIME_DELTA
           
 
Fields inherited from class edu.cmu.emulator.controlComm.TupleMessage
I_NUM_TUPLES, TUPLE_SIZE
 
Fields inherited from class edu.cmu.emulator.controlComm.CMessage
D_AUX_FPGA, I_BODY, I_DEST, I_SOURCE, I_TYPE, MAX_LENGTH, msg, S_EMU_CONTROLLER, T_DCC_LOCAL, T_MISC_COMMAND, T_READ_REG, T_REG_VALUE, T_SET_DELAY, T_SET_PHASE_SHIFT, T_SET_SCALE, T_SET_TIMED_SCALE, T_STORE_SIGNAL, T_TEST, T_WRITE_REG
 
Constructor Summary
SetTimedScaleMessage(int numTuples, int sysTime, int startTime)
           
 
Method Summary
 void addScaleSet(int index, int multFactor, int shiftFactor, int timeDelta)
           
(package private)  byte[] getBytes()
           
private  int getIndex(int tupleNum)
           
private  int getMultFactor(int tupleNum)
           
 int getNumTuples()
           
private  int getShiftFactor(int tupleNum)
           
private  int getTimeDelta(int tupleNum)
           
 String toString()
           
 
Methods inherited from class edu.cmu.emulator.controlComm.CMessage
getByte, getDest, getLength, getSource, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

filledTuples

protected int filledTuples

I_SYSTEM_TIME

protected static final int I_SYSTEM_TIME
See Also:
Constant Field Values

I_START_TIME

protected static final int I_START_TIME
See Also:
Constant Field Values

I_TUPLE_0

protected static final int I_TUPLE_0
See Also:
Constant Field Values

O_INDEX

protected static final int O_INDEX
See Also:
Constant Field Values

O_MULT_FACTOR

protected static final int O_MULT_FACTOR
See Also:
Constant Field Values

O_SHIFT_FACTOR

protected static final int O_SHIFT_FACTOR
See Also:
Constant Field Values

O_TIME_DELTA

protected static final int O_TIME_DELTA
See Also:
Constant Field Values
Constructor Detail

SetTimedScaleMessage

public SetTimedScaleMessage(int numTuples,
                            int sysTime,
                            int startTime)
Parameters:
sysTime - - the current system time (e.g. EmuSynch.curTimeMillis() cast to an int
startTime - - the reference time for all scaling sets contained in this message. usually, this is the time of the first scaling update.
Method Detail

getNumTuples

public int getNumTuples()

addScaleSet

public void addScaleSet(int index,
                        int multFactor,
                        int shiftFactor,
                        int timeDelta)
Parameters:
timeDelta - - the offset from startTime at which this scale set should occur

getIndex

private int getIndex(int tupleNum)

getMultFactor

private int getMultFactor(int tupleNum)

getShiftFactor

private int getShiftFactor(int tupleNum)

getTimeDelta

private int getTimeDelta(int tupleNum)

getBytes

byte[] getBytes()
Overrides:
getBytes in class CMessage

toString

public String toString()
Overrides:
toString in class CMessage


Copyright © 2013. All Rights Reserved.