TEMU  3.0
The Terma Emulator
Clock.h
Go to the documentation of this file.
1 //===------------------------------------------------------------*- C++ -*-===//
2 //
3 // TEMU: The Terma Emulator
4 // (c) Terma 2016
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef TEMU_CLOCK_H
10 #define TEMU_CLOCK_H
11 
12 #include "temu-c/Support/Objsys.h"
13 #include "temu-c/Support/Events.h"
14 
15 #include <stdint.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /*
22  * THIS INTERFACE IS EXPERIMENTAL AND UNSTABLE
23  */
24 
29 typedef enum {
36 
37 typedef struct {
38  temu_ClockStopReason (*step)(void *Obj, uint64_t Steps);
39  temu_ClockStopReason (*stepUntil)(void *Obj, uint64_t Steps, uint64_t Cycles);
40  temu_ClockStopReason (*advanceCycles)(void *Obj, uint64_t Cycles);
41  temu_ClockStopReason (*advanceToCycles)(void *Obj, uint64_t Cycles);
42 
43  uint64_t (*getSteps)(void *Obj);
44  uint64_t (*getCycles)(void *Obj);
45  uint64_t (*getNanos)(void *Obj);
46  double (*getSecs)(void *Obj);
47  /* Set time to arbitrary values without executing events */
48  void (*setSteps)(void *Obj, uint64_t Steps);
49  void (*setCycles)(void *Obj, uint64_t Ticks);
50  void (*setNanos)(void *Obj, uint64_t Nanos);
51  void (*setSecs)(void *Obj, double Secs);
52 
53  double (*getFreq)(void *Obj);
54  void (*setFreq)(void *Obj, double Freq);
56 
57 #define TEMU_CLOCK_IFACE_TYPE "ClockIface"
58 TEMU_IFACE_REFERENCE_TYPE(temu_Clock);
59 
60 typedef struct {
64 
65 
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif /* ! TEMU_CLOCK_H */
Exited due to breakpoint or watchpoint hit.
Definition: Clock.h:32
Definition: Events.h:41
Normal exit (cannot be passed to early exit)
Definition: Clock.h:30
Definition: Clock.h:60
Definition: Clock.h:37
temu_ClockStopReason
Definition: Clock.h:29
temu_EventIface * Event
Definition: Clock.h:62
Clock had a serious internal error.
Definition: Clock.h:34
TEMU_IFACE_REFERENCE_TYPE(temu_Clock)
temu_ClockIface * Clock
Definition: Clock.h:61
Other early stop reason.
Definition: Clock.h:33
Exited due to clock halting.
Definition: Clock.h:31