OscillatorBase

Package: inet.clock.base

OscillatorBase

simple module

C++ definition

Base module for oscillators.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Known subclasses

Name Type Description
DriftingOscillatorBase simple module

Base module for oscillators whose effective tick rate may drift relative to a nominal tick length. This module provides the mapping used by clocks without generating one event per tick.

IdealOscillator simple module

Ideal strictly periodic oscillator (no drift).

Extends

Name Type Description
SimpleModule simple module

Base module for all INET simple modules.

Parameters

Name Type Default value Description
displayStringTextFormat string "%n"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

emitNumTicksSignal bool false

Enables emitting a signal at each oscillator tick, can be useful for validating the behavior of the more efficient implementation without events

oscillatorTickEventSchedulingPriority int 0

Specifies the scheduling priority of the tick event

Properties

Name Value Description
class OscillatorBase
display i=block/tunnel

Signals

Name Type Unit Description
numTicksChanged unsigned long
driftRateChanged double

Statistics

Name Title Source Record Unit Interpolation Mode Description
numTicksChanged number of ticks vector sample-hold
driftRateChanged Oscillator drift rate vector ppm sample-hold

Source code

//
// Base module for oscillators.
//
simple OscillatorBase extends SimpleModule
{
    parameters:
        @class(OscillatorBase);
        bool emitNumTicksSignal = default(false); // Enables emitting a signal at each oscillator tick, can be useful for validating the behavior of the more efficient implementation without events
        int oscillatorTickEventSchedulingPriority = default(0); // Specifies the scheduling priority of the tick event
        displayStringTextFormat = default("%n"); // Determines the text that is written on top of the submodule
        @display("i=block/tunnel");
        @signal[numTicksChanged](type=unsigned long);
        @signal[driftRateChanged](type=double);
        @statistic[numTicksChanged](title="number of ticks"; record=vector; interpolationmode=sample-hold);
        @statistic[driftRateChanged](title="Oscillator drift rate"; record=vector; interpolationmode=sample-hold; unit=ppm);
}

File: src/inet/clock/base/OscillatorBase.ned