1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #if !defined(API)
18 # define N_SYMBOLS 1024
19 #else
20 # define N_SYMBOLS 0
21 #endif
22
23 #define SYMBOL_SZ 32
24 enum symbolType {
25 SYM_EMPTY = 0,
26 SYM_STATE_OFFSET = 1,
27 SYM_STRUCT_OFFSET = 2,
28 SYM_STRUCT_SZ = 3,
29 SYM_CONSTANT = 4,
30 SYM_ENUM = 5,
31 };
32
33 enum valueType {
34 SYM_UNDEF = 0,
35 SYM_STRING = 10,
36 SYM_PTR = 20,
37 SYM_ARRAY = 21,
38 SYM_SZ = 30,
39
40 SYM_UINT8 = 800,
41 SYM_UINT8_1 = 801,
42 SYM_UINT8_3 = 803,
43 SYM_UINT8_6 = 806,
44 SYM_UINT16 = 1600,
45 SYM_UINT16_9 = 1609,
46 SYM_UINT16_12 = 1612,
47 SYM_UINT16_14 = 1614,
48 SYM_UINT16_15 = 1615,
49 SYM_UINT32 = 3200,
50 SYM_UINT32_18 = 3218,
51 SYM_UINT32_24 = 3224,
52 SYM_UINT32_27 = 3227,
53 SYM_UINT64 = 6400,
54 SYM_UINT64_36 = 6436,
55 };
56
57 struct symbol_s {
58 char name[SYMBOL_SZ];
59 uint32_t symbolType;
60 uint32_t valueType;
61 uint32_t value;
62 };
63
64 #define SYMTAB_HDR "dps8m symtab"
65 #define SYMTAB_HDR_SZ 16
66 #define SYMTAB_VER 1
67
68 struct symbolTable_s {
69 char symtabHdr[SYMTAB_HDR_SZ];
70 int32_t symtabVer;
71 struct symbol_s symbols[N_SYMBOLS];
72 };
73
74 #define STATE_HDR "dps8m state"
75 #define STATE_HDR_SZ 16
76 #define STATE_VER 1
77
78 struct system_state_s {
79
80 char stateHdr[STATE_HDR_SZ];
81 int32_t stateVer;
82 struct symbolTable_s symbolTable;
83 #if !defined(API)
84 char commit_id [41];
85 vol word36 M [MEMSIZE];
86 cpu_state_t cpus [N_CPU_UNITS_MAX];
87 struct cables_s cables;
88 #endif
89 };
90
91 #if !defined(API)
92 extern struct system_state_s * system_state;
93 #else
94 int sim_iglock = 0;
95 int sim_nolock = 0;
96 int sim_randompst = 0;
97 int sim_randstate = 0;
98 int sim_nostate = 0;
99 #endif