TEMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Clock.h
Go to the documentation of this file.
1 //===------------------------------------------------------------*- C++ -*-===//
2 //
3 // T-EMU: 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 #include <stdint.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 /*
21  * THIS INTERFACE IS EXPERIMENTAL AND UNSTABLE
22  */
23 
28 typedef enum {
35 
36 typedef struct {
37  temu_ClockStopReason (*step)(void *Obj, uint64_t Steps);
38  temu_ClockStopReason (*stepUntil)(void *Obj, uint64_t Steps, uint64_t Cycles);
39  temu_ClockStopReason (*advanceCycles)(void *Obj, uint64_t Cycles);
40  temu_ClockStopReason (*advanceToCycles)(void *Obj, uint64_t Cycles);
41 
42  uint64_t (*getSteps)(void *Obj);
43  uint64_t (*getCycles)(void *Obj);
44  uint64_t (*getNanos)(void *Obj);
45  double (*getSecs)(void *Obj);
46  /* Set time to arbitrary values without executing events */
47  void (*setSteps)(void *Obj, uint64_t Steps);
48  void (*setCycles)(void *Obj, uint64_t Ticks);
49  void (*setNanos)(void *Obj, uint64_t Nanos);
50  void (*setSecs)(void *Obj, double Secs);
51 
52  double (*getFreq)(void *Obj);
53  void (*setFreq)(void *Obj, double Freq);
55 
56 #define TEMU_CLOCK_IFACE_TYPE "ClockIface"
57 TEMU_IFACE_REFERENCE_TYPE(temu_Clock);
58 
59 typedef struct {
63 
64 
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* ! TEMU_CLOCK_H */
temu_EventIface * Event
Definition: Clock.h:61
Clock had a serious internal error.
Definition: Clock.h:33
#define TEMU_IFACE_REFERENCE_TYPE(N)
Definition: Objsys.h:129
Other early stop reason.
Definition: Clock.h:32
temu_ClockStopReason
Definition: Clock.h:28
temu_ClockIface * Clock
Definition: Clock.h:60
Exited due to clock halting.
Definition: Clock.h:30
Exited due to breakpoint or watchpoint hit.
Definition: Clock.h:31
Normal exit (cannot be passed to early exit)
Definition: Clock.h:29