本文整理汇总了C++中Signal::isClock方法的典型用法代码示例。如果您正苦于以下问题:C++ Signal::isClock方法的具体用法?C++ Signal::isClock怎么用?C++ Signal::isClock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Signal
的用法示例。
在下文中一共展示了Signal::isClock方法的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: updateAttachedPorts
void ClockBlock::
setValue(const Signal &newValue, ticks_t time)
{
if (newValue == value)
return;
if (isFixedFrequency() || newValue.isClock())
updateAttachedPorts(time);
uint32_t oldValue = value.getValue(time);
value = newValue;
if (!running)
return;
if (value.getValue(time) != oldValue) {
seeEdgeOnAttachedPorts(oldValue == 0 ? Edge::RISING : Edge::FALLING, time);
}
if (isFixedFrequency()) {
seeChangeOnAttachedPorts(time);
}
}
示例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: run
void LCDScreen::run(ticks_t time)
{
switch (scheduleReason) {
case SCHEDULE_SAMPLING_EDGE:
assert(CLKSignal.isClock());
seeSamplingEdge(time);
if (time - lastPollForEvents >= minUpdateTicks) {
if (screen.pollForEvents()) {
throw ExitException(time, 0);
}
lastPollForEvents = time;
}
scheduleSamplingEdge(time + CLKSignal.getPeriod());
break;
case SCHEDULE_POLL_FOR_EVENTS:
if (screen.pollForEvents()) {
throw ExitException(time, 0);
}
schedulePollForEvents(time + minUpdateTicks);
lastPollForEvents = time;
break;
}
}