本文整理汇总了C++中Signal::getValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Signal::getValue方法的具体用法?C++ Signal::getValue怎么用?C++ Signal::getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Signal
的用法示例。
在下文中一共展示了Signal::getValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeSteadyStateInputShiftReg
uint32_t Port::computeSteadyStateInputShiftReg()
{
Signal current = getEffectiveDataPortInputPinsValue();
assert(!current.isClock());
uint32_t val = current.getValue(time);
unsigned width = shiftRegEntries;
unsigned shift = getPortWidth();
while (width > 1) {
val = (val << shift) | val;
width >>= 1;
shift *= 2;
}
val &= makeMask(getTransferWidth());
return val;
}
示例2: seePinsChange
void UartRx::seePinsChange(const Signal &value, ticks_t time)
{
currentPinValue = value.getValue(time);
switch (state) {
default:
break;
case WAIT_FOR_HIGH:
if (currentPinValue == 1)
state = WAIT_FOR_START;
break;
case WAIT_FOR_START:
if (currentPinValue == 0) {
state = CHECK_START;
scheduleUpdate(time + bitTime / 2);
}
break;
}
}
示例3: seeCLKChange
void LCDScreen::seeCLKChange(const Signal &newSignal, ticks_t time)
{
CLKSignal = newSignal;
uint32_t newValue = CLKSignal.getValue(time);
if (newValue != CLKValue) {
CLKValue = newValue;
if (CLKValue)
seeSamplingEdge(time);
}
if (CLKSignal.isClock()) {
EdgeIterator nextEdge = CLKSignal.getEdgeIterator(time);
if (nextEdge->type != Edge::RISING)
++nextEdge;
scheduleSamplingEdge(nextEdge->time);
} else if (scheduleReason != SCHEDULE_POLL_FOR_EVENTS) {
schedulePollForEvents(time + minUpdateTicks);
}
}
示例4: seeCLKChange
void SDRAM::seeCLKChange(const Signal &value, ticks_t time)
{
if (value.getValue(time)) {
// Rising edge.
Command newCommand = getCommand(time);
switch (newCommand) {
case Command::ACTIVE:
currentRow = A.getSignal().getValue(time) & ((1 << config.rowBits) - 1);
break;
case Command::AUTO_REFRESH:
case Command::NOP:
case Command::PRECHARGE:
break;
case Command::LOAD_MODE_REGISTER:
modeReg.set(A.getSignal().getValue(time));
break;
case Command::READ:
currentColumn =
A.getSignal().getValue(time) & ((1 << config.columnBits) - 1);
currentBank =
BA.getSignal().getValue(time) & ((1 << config.bankBits) - 1);
counter = 0;
break;
case Command::WRITE:
currentColumn =
A.getSignal().getValue(time) & ((1 << config.columnBits) - 1);
currentBank =
BA.getSignal().getValue(time) & ((1 << config.bankBits) - 1);
counter = 0;
break;
case Command::BURST_TERMINATE:
break;
}
if (newCommand != Command::NOP) {
currentCommand = newCommand;
}
switch (currentCommand) {
default:
break;
case Command::READ:
{
uint16_t mask = getReadWriteMask(time);
unsigned burstLength = modeReg.getReadBurstLength();
uint16_t data = mem[getMemoryIndex(burstLength)] & mask;
uint8_t readEdge = edgeNumber + modeReg.getCASLatency();
pendingReads.push(std::make_pair(data, readEdge));
++counter;
if (burstLength != 0 && counter == burstLength)
currentCommand = Command::NOP;
}
break;
case Command::WRITE:
{
unsigned burstLength = modeReg.getReadBurstLength();
if (WE.getSignal().getValue(time)) {
uint16_t mask = getReadWriteMask(time);
uint32_t index = getMemoryIndex(burstLength);
uint16_t old = mem[index];
uint16_t data = DQ.getSignal().getValue(time);
mem[index] ^= (old ^ data) & mask;
}
++counter;
if (burstLength != 0 && counter == burstLength)
currentCommand = Command::NOP;
}
break;
}
++edgeNumber;
} else {
// Falling edge.
if (!pendingReads.empty() && pendingReads.front().second == edgeNumber) {
DQPort->seePinsChange(Signal(pendingReads.front().first), time);
pendingReads.pop();
}
}
}