|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.krep.evalbench.comm.CommunicationProtocol
de.cau.cs.kieler.krep.evalbench.comm.KlpProtocol
public class KlpProtocol
Implementation of the communication protocol interface that uses the KREP protocol. Currently, this is only the KLP. The protocol itself is documented in ctr's thesis.
Field Summary |
---|
Fields inherited from interface de.cau.cs.kieler.krep.evalbench.comm.ICommunicationProtocol |
---|
P_KEP, P_KREP |
Constructor Summary | |
---|---|
KlpProtocol(IConnection connectionProtocol)
Constructs a new instance of the KREP protocol. |
Method Summary | |
---|---|
void |
continuousRun()
When executed the target is set to continuous mode. |
int[] |
getExecutionTrace()
Requests an execution trace for the last tick command. |
String |
getTargetInfo()
Requests target information from the target and translates the received return string. |
boolean |
loadProgram(IAssembler program,
IProgressMonitor monitor)
Loads a program onto the connected target. |
void |
reset()
Resets the current program on the target. |
void |
stopContinuous()
Stops continuous mode and returns to single tick mode. |
int |
tick(int maxSignals,
LinkedList<Signal> inputs,
LinkedList<Signal> outputs)
Performs a program tick by sending the global input signal status, executing the tick command and reading the global output signal status. |
boolean |
verifyCommunication()
Verifies communication by sending a command and receiving a return string. |
Methods inherited from class de.cau.cs.kieler.krep.evalbench.comm.CommunicationProtocol |
---|
addCommunicationListener, getCommunicationListeners, getConnection, notifyComment, notifyReceive, notifySend, removeCommunicationListener, setCommunicationListeners, setConnection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KlpProtocol(IConnection connectionProtocol)
connectionProtocol
- underlying connection protocol to be used; this protocol instance is expected to
be already initializedMethod Detail |
---|
public void continuousRun() throws CommunicationException
CommunicationException
- when an exception occurs while sending the commandpublic int[] getExecutionTrace() throws CommunicationException
CommunicationException
- when the received trace is invalidpublic String getTargetInfo() throws CommunicationException
CommunicationException
- when the return string is invalidpublic boolean loadProgram(IAssembler program, IProgressMonitor monitor) throws CommunicationException, LoadException
program
- array of hex encoded instructionsmonitor
- progress-monitor, null if nothing shall be displayed
CommunicationException
- when the program string has an invalid length
LoadException
- cannot execute this programpublic void reset() throws CommunicationException
CommunicationException
- when an invalid reply was receivedpublic void stopContinuous() throws CommunicationException
CommunicationException
- when an invalid reply was receivedpublic int tick(int maxSignals, LinkedList<Signal> inputs, LinkedList<Signal> outputs) throws CommunicationException
maxSignals
- number of signals in the current program.inputs
- input signalsoutputs
- An empty list of output signals, the actual outputs are added by the tick function.
CommunicationException
- when an invalid reply was receivedpublic boolean verifyCommunication() throws CommunicationException
CommunicationException
- when no return string could be read
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |