Esempio n. 1
0
void ClockBlock::setSourceRefClock(Thread &thread, ticks_t time)
{
  updateAttachedPorts(time);
  if (source) {
    source->deregisterAsSourceOf(this);
    source = 0;
  }
  Signal newValue = value;
  newValue.changeFrequency(time, getHalfPeriod());
  setValue(newValue, time);
}
Esempio n. 2
0
bool ClockBlock::setData(Thread &thread, uint32_t newDivide, ticks_t time) {
  if (source)
    return false;
  newDivide = newDivide & 0xff;
  if (newDivide == 0)
    divide = 1;
  else
    divide = 2 * newDivide;
  Signal newValue = value;
  newValue.changeFrequency(time, getHalfPeriod());
  setValue(newValue, time);
  return true;
}