Simple Module TTEScheduler

Package: ttethernet.scheduler
File: src/scheduler/TTEScheduler.ned

C++ definition

TTEthernet scheduler module. The module allows to register Events using the registerEvent(SchedulerEvent) method. Allowed Events are:

The Scheduler can be asked for the current time with the getTicks() method. The cycle is configured by the parameters tick and cycle_ticks.

See also: SchedulerTimerEvent, SchedulerActionTimeEvent, SchedulerTimerEvent

Author: Till Steinbach

TTEScheduler

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Used in compound modules:

Name Type Description
TTEEtherHost compound module

Module for a TTEthernet Host. Contains a EtherLLC for best-effort traffic, a TTEPHYPort module as physical port, sync module (Sync) and a TTEScheduler module. The Host is configured by the provided TTEthernet XML network configuration (network_configuration parameter) and uses the device_name parameter to find its config. The configuration is done by the BufferManager that deletes itself at runtime.

TTEEtherSwitch compound module

Module for a TTEthernet Switch with variable number of ports. Contains a configurable best-effort implementation (beRelayUnitType like IMACRelayUnit), TTEPHYPort modules for physical ports, sync module (Sync) and a TTEScheduler module. The switch is configured by the provided TTEthernet XML network configuration (network_configuration parameter) and uses the device_name parameter to find its config. The configuration is done by the BufferManager that deletes itself at runtime.

Networks:

Name Type Description
TTESchedulerTest network (no description)

Parameters:

Name Type Default value Description
tick double 80ns

Length of a tick

max_drift double 16ps

Maximum clock drift (e.g 16ps for 200ppm at 80ns per tick)

max_drift_change double 1ps

Maximum clock drift change per cycle

current_tick double tick

Current length of a tick (with imprecission)

cycle_ticks int 37500

Number of ticks for one cycle

Properties:

Name Value Description
display i=block/cogwheel

Statistics:

Name Title Source Record Unit Interpolation Mode
newCycle Start of cycle count, vector
currentDrift Current drift vector s

Source code:

//
// TTEthernet scheduler module. The module allows to register Events using the
// registerEvent(SchedulerEvent) method. Allowed Events are:
// - SchedulerActionTimeEvent: Event that is triggered at a specified time in the cycle
// - SchedulerTimerEvent: Event that is triggered after a specified time
//
// The Scheduler can be asked for the current time with the getTicks() method.
// The cycle is configured by the parameters tick and cycle_ticks.
//
// @see SchedulerTimerEvent, SchedulerActionTimeEvent, SchedulerTimerEvent
//
// @author Till Steinbach
simple TTEScheduler
{
    parameters:
        @display("i=block/cogwheel");
        //Statistic of the current drift (Difference of configured and actual tick length)
        @statistic[currentDrift](title="Current drift"; unit=s; record=vector);
        //Statistic of the beginning of a new cycle
        @statistic[newCycle](title="Start of cycle"; record=count,vector);
        // Length of a tick
        double tick @unit(s) = default(80ns);
        // Maximum clock drift (e.g 16ps for 200ppm at 80ns per tick)
        double max_drift @unit(s) = default(16ps);
        // Maximum clock drift change per cycle
        double max_drift_change @unit(s) = default(1ps);
        // Current length of a tick (with imprecission)
        volatile double current_tick @unit(s) = tick;
        // Number of ticks for one cycle
        int cycle_ticks = default(37500);
}