1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #define UC_CACHE_SZ 512
24
25
26
27 struct ucache_s {
28 bool valid;
29 word15 segno;
30 word18 offset;
31 word14 bound;
32 word1 p;
33 word24 address;
34 word3 r1;
35 bool paged;
36 };
37 typedef struct ucache_s ucache_t;
38
39 #define UC_INSTRUCTION_FETCH 0
40 #define UC_INDIRECT_WORD_FETCH 1
41 #define UC_OPERAND_READ 2
42 #define UC_OPERAND_READ_TRA 3
43 #define UC_OPERAND_READ_CALL6 4
44 #define UC_NUM 5
45
46 struct uCache_s {
47 ucache_t caches [UC_NUM][UC_CACHE_SZ];
48 #if defined(UCACHE_STATS)
49 uint64_t hits [UC_NUM];
50 uint64_t misses [UC_NUM];
51 uint64_t skips [UC_NUM];
52 uint64_t call6Skips;
53 uint64_t ralrSkips;
54 uint64_t segnoSkips;
55 #endif
56 };
57
58 typedef struct uCache_s uCache_t;
59
60 struct cpu_state_s;
61
62 void ucInvalidate (struct cpu_state_s * cpup);
63 void ucCacheSave \
64 (struct cpu_state_s * cpup, uint ucNum, word15 segno,
65 word18 offset, word14 bound, word1 p, word24 address, word3 r1, bool paged);
66 bool ucCacheCheck \
67 (struct cpu_state_s * cpup, uint ucNum, word15 segno,
68 word18 offset, word14 * bound, word1 * p, word24 * address, word3 * r1, bool * paged);
69 #if defined(UCACHE_STATS)
70 void ucacheStats (int cpuNo);
71 #endif