diff options
Diffstat (limited to 'test/ui')
| -rw-r--r-- | test/ui/null/ui.c | 10 | ||||
| -rw-r--r-- | test/ui/null/vars.py | 3 | ||||
| -rw-r--r-- | test/ui/v1/noops/ui.c | 114 | ||||
| -rw-r--r-- | test/ui/v1/noops/vars.py | 3 |
4 files changed, 130 insertions, 0 deletions
diff --git a/test/ui/null/ui.c b/test/ui/null/ui.c new file mode 100644 index 0000000..5872342 --- /dev/null +++ b/test/ui/null/ui.c @@ -0,0 +1,10 @@ +int main(void) { +#if defined(COMMAND_NEW) + salis_init(); +#elif defined(COMMAND_LOAD) + salis_load(); +#endif + salis_save(SIM_PATH); + salis_free(); + return 0; +} diff --git a/test/ui/null/vars.py b/test/ui/null/vars.py new file mode 100644 index 0000000..9c2a9f3 --- /dev/null +++ b/test/ui/null/vars.py @@ -0,0 +1,3 @@ +flags = set() +defines = set() +links = set() diff --git a/test/ui/v1/noops/ui.c b/test/ui/v1/noops/ui.c new file mode 100644 index 0000000..230e98d --- /dev/null +++ b/test/ui/v1/noops/ui.c @@ -0,0 +1,114 @@ +#if !defined(COMMAND_NEW) +#error +#endif + +void check_invariants(void) { + assert(g_cores->mall == ANC_SIZE); + assert(g_cores->muta[0] == 0); + assert(g_cores->muta[1] == 0); + assert(g_cores->muta[2] == 0); + assert(g_cores->muta[3] == 0); + + assert(g_cores->pnum == 1); + assert(g_cores->pcap == 1); + assert(g_cores->pfst == 0); + assert(g_cores->plst == 0); + assert(g_cores->pcur == 0); + assert(g_cores->psli == 0); + + for (uint64_t i = 0; i < SYNC_INTERVAL; i++) { + assert(g_cores->ivav[i] == 0); + assert(g_cores->iviv[i] == 0); + } + + assert(g_cores->emb1 == 0); + assert(g_cores->eliv == 0); + assert(g_cores->edea == 0); + + for (uint64_t i = 0; i < MVEC_SIZE; i++) { + assert(g_cores->aeva[i] == 0); + assert(g_cores->beva[i] == 0); + } + + for (uint64_t i = 0; i < INST_COUNT; i++) { + assert(g_cores->ipop[i] == 0); + assert(g_cores->iwrt[i] == 0); + } + + assert(g_cores->wmb0 == 0); + assert(g_cores->wmb1 == 0); + assert(g_cores->wdea == 0); + + for (uint64_t i = 0; i < MVEC_SIZE; i++) { + assert(g_cores->weva[i] == 0); + assert(g_cores->xeva[i] == 0); + } + + assert(g_cores->pvec->mb0a == 0); + assert(g_cores->pvec->mb0s == ANC_SIZE); + assert(g_cores->pvec->mb1a == 0); + assert(g_cores->pvec->mb1s == 0); + assert(g_cores->pvec->r0x == 0); + assert(g_cores->pvec->r1x == 0); + assert(g_cores->pvec->r2x == 0); + assert(g_cores->pvec->r3x == 0); + assert(g_cores->pvec->s0 == 0); + assert(g_cores->pvec->s1 == 0); + assert(g_cores->pvec->s2 == 0); + assert(g_cores->pvec->s3 == 0); + assert(g_cores->pvec->s4 == 0); + assert(g_cores->pvec->s5 == 0); + assert(g_cores->pvec->s6 == 0); + assert(g_cores->pvec->s7 == 0); +} + +void check_variants(uint64_t step) { + assert(g_cores->cycl == step); + assert(g_cores->ivpt == step); + + assert(g_cores->emb0 == step); + + for (uint64_t i = 0; i < MVEC_SIZE; i++) { + assert(g_cores->eeva[i] == (i < step ? 1 : 0)); + } + + for (uint64_t i = 0; i < INST_COUNT; i++) { + uint64_t exed = 0; + + for (uint64_t j = 0; j < step; j++) { + if (mvec_get_inst(g_cores, j) == i) { + exed = 1; + } + } + + assert(g_cores->iexe[i] == exed); + } + + assert(g_cores->pvec->ip == step); + assert(g_cores->pvec->sp == step); +} + +void check_final(void) { + assert(g_cores->pvec->ip == ANC_SIZE); + assert(g_cores->pvec->sp == ANC_SIZE); +} + +int main(void) { + uint64_t step = 0; + + salis_init(); + check_invariants(); + check_variants(step); + + while (mvec_is_proc_owner(g_cores, g_cores->pvec->ip, g_cores->pcur)) { + salis_step(1); + step++; + + check_invariants(); + check_variants(step); + } + + check_final(); + salis_free(); + return 0; +} diff --git a/test/ui/v1/noops/vars.py b/test/ui/v1/noops/vars.py new file mode 100644 index 0000000..9c2a9f3 --- /dev/null +++ b/test/ui/v1/noops/vars.py @@ -0,0 +1,3 @@ +flags = set() +defines = set() +links = set() |
