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