22 #include "SignalData.hpp"
44 enum SignalLoggerSpecification {
47 InputOutputSignals = 3,
51 enum TraceSpecification {
54 TraceGlobalCheckpoint = 2,
55 TraceLocalCheckpoint = 4,
61 STATIC_CONST( SignalLength = 25 );
71 void setTestCommand(Command);
72 void getTestCommand(Command&)
const;
77 void setTraceCommand(Command, TraceSpecification);
82 void getTraceCommand(Command&, TraceSpecification&)
const;
90 UintR getNoOfSignalLoggerCommands()
const;
95 void addSignalLoggerCommand(BlockNumber, Command, SignalLoggerSpecification);
103 void addSignalLoggerCommand(Command, SignalLoggerSpecification);
108 void getSignalLoggerCommand(
int no, BlockNumber&, Command&, SignalLoggerSpecification&)
const;
112 UintR noOfSignalLoggerCommands;
113 UintR signalLoggerCommands[22];
116 #define COMMAND_SHIFT (0)
117 #define TRACE_SHIFT (2)
118 #define LOG_SHIFT (2)
120 #define BLOCK_NO_SHIFT (16)
121 #define BLOCK_NO_MASK 65535
129 setTestCommand(KeepUnchanged);
130 setTraceCommand(KeepUnchanged, TraceAPI);
131 noOfSignalLoggerCommands = 0;
139 TestOrd::setTestCommand(Command cmd){
140 ASSERT_RANGE(cmd, 0, COMMAND_MASK,
"TestOrd::setTestCommand");
146 TestOrd::getTestCommand(Command & cmd)
const{
147 cmd = (Command)(testCommand >> COMMAND_SHIFT);
155 TestOrd::setTraceCommand(Command cmd, TraceSpecification spec){
156 ASSERT_RANGE(cmd, 0, COMMAND_MASK,
"TestOrd::setTraceCommand");
157 ASSERT_RANGE(spec, 0, TRACE_MASK,
"TestOrd::setTraceCommand");
158 traceCommand = (cmd << COMMAND_SHIFT) | (spec << TRACE_SHIFT);
166 TestOrd::getTraceCommand(Command & cmd, TraceSpecification & spec)
const{
167 cmd = (Command)((traceCommand >> COMMAND_SHIFT) & COMMAND_MASK);
168 spec = (TraceSpecification)((traceCommand >> TRACE_SHIFT) & TRACE_MASK);
179 TestOrd::getNoOfSignalLoggerCommands()
const{
180 return noOfSignalLoggerCommands;
188 TestOrd::addSignalLoggerCommand(BlockNumber bnr,
189 Command cmd, SignalLoggerSpecification spec){
190 ASSERT_RANGE(cmd, 0, COMMAND_MASK,
"TestOrd::addSignalLoggerCommand");
191 ASSERT_RANGE(spec, 0, LOG_MASK,
"TestOrd::addSignalLoggerCommand");
194 signalLoggerCommands[noOfSignalLoggerCommands] =
195 (bnr << BLOCK_NO_SHIFT) | (cmd << COMMAND_SHIFT) | (spec << LOG_SHIFT);
196 noOfSignalLoggerCommands ++;
207 TestOrd::addSignalLoggerCommand(Command cmd, SignalLoggerSpecification spec){
208 ASSERT_RANGE(cmd, 0, COMMAND_MASK,
"TestOrd::addSignalLoggerCommand");
209 ASSERT_RANGE(spec, 0, LOG_MASK,
"TestOrd::addSignalLoggerCommand");
211 noOfSignalLoggerCommands = ~0;
212 signalLoggerCommands[0] = (cmd << COMMAND_SHIFT) | (spec << LOG_SHIFT);
220 TestOrd::getSignalLoggerCommand(
int no, BlockNumber & bnr,
222 SignalLoggerSpecification & spec)
const{
223 bnr = (BlockNumber)((signalLoggerCommands[no] >> BLOCK_NO_SHIFT)
225 cmd = (Command)((signalLoggerCommands[no] >> COMMAND_SHIFT)
227 spec = (SignalLoggerSpecification)((signalLoggerCommands[no] >> LOG_SHIFT)