blob: ea417d6375982bd2a7d01eda1dc84f46ebcf453c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// file : test/ui/v1/mbops/ui.c
// project : Salis-VM
// author : Paul Oliver <contact@pauloliver.dev>
#include <assert.h>
#include <stdint.h>
#include <threads.h>
#include <zlib.h>
#include "arch_spec.h"
#include "arch_inst.h"
#include "compress.h"
#include "salis.h"
int main(void) {
salis_init();
while (g_cores->pvec->ip < ANC_SIZE) {
bool on_swap = mvec_get_inst(g_cores, g_cores->pvec->ip) == bswp;
bool on_clear = mvec_get_inst(g_cores, g_cores->pvec->ip) == bclr;
uint64_t mb0a = g_cores->pvec->mb0a;
uint64_t mb0s = g_cores->pvec->mb0s;
uint64_t mb1a = g_cores->pvec->mb1a;
uint64_t mb1s = g_cores->pvec->mb1s;
salis_step(1);
if (on_swap) {
if (mb1s) {
assert(g_cores->pvec->mb0a == mb1a);
assert(g_cores->pvec->mb0s == mb1s);
assert(g_cores->pvec->mb1a == mb0a);
assert(g_cores->pvec->mb1s == mb0s);
}
}
if (on_clear) {
assert(g_cores->pvec->mb1a == 0);
assert(g_cores->pvec->mb1s == 0);
}
}
salis_save_and_free();
return 0;
}
|