Introduction

The machine class is used to assemble and group related processors in machines. The machine class is intended to be used for SMP and multi-core systems. It provides the following capabilities:

  1. A multi-CPU scheduler that executes all the CPUs in the machine in sequence (for a fixed time quanta).

  2. A synchronised event queue. CPUs can post events in the next time quanta to be executed after all the processors have reached a specific time point.

  3. A scheduling interface enabling the machine to be run for a time specified in seconds, not cycles.

Note that the machine class supports the scheduling of different CPUs with different clock frequencies.

Synchronised events are posted on a CPUs event queue by adding the flag TEMU_EVENT_SYNC to the posting function, this will bypass the CPU event queue and put it in the machine object’s queue.

Attributes

Properties

Name Type Description

cpus

irefarray

Processors in the machine

currentCPU

iref

Current CPU

currentCPUIdx

int32_t

Current CPU Index

devices

irefarray

Devices to reset when machine is reset

object.timeSource

object

Time source object (a cpu or machine object)

quanta

uint64_t

Quanta length in nanoseconds

quantaEnd

uint64_t

End point of current quanta in nanoseconds

quantaStart

uint64_t

Quanta start in nanoseconds

syncMask

uint64_t

Synchronised CPU mask

Interfaces

Name Type Description

EventIface

EventIface

LegacyIface

LegacyIface

MachineIface

MachineIface

ObjectIface

ObjectIface

Ports

Prop Iface Description

-

-

-

Limitations

  • The machine class cannot have more than 64 CPU cores connected.