Skip to content

Commit

Permalink
fix multix test hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubfi committed Jun 19, 2024
1 parent 0a9a756 commit 072a8ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/io/mx/mx.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,6 @@ int mx_int_enqueue(struct mx *multix, int intr, int line)
uint16_t *i = (uint16_t *) malloc(sizeof(uint16_t));
*i = (intr << 8) | line;

// Workaround for the interrupt comming too early sometimes
// for the tests to pass, which may also affect real software
// TODO: Real multix processing delays?
usleep(1);

pthread_mutex_lock(&multix->int_mutex);
int res = elst_nlock_append(multix->intq, i);
pthread_mutex_unlock(&multix->int_mutex);
Expand Down
20 changes: 13 additions & 7 deletions tests/functional/multix/winch-sect-addr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ addr_check:
; check if sector address is correct
lw r2, [rdbuf]
cw r2, [r7+LOOPS]
bb r0, ?E
jes .cont
im msk_0
hlt 045
.cont:
; decrement sector number
awt r2, -1
rw r2, readf+SECT_POS
Expand All @@ -86,9 +88,10 @@ mx_proc:
md [STACKP]
lw r1, [-1]
cw r1, [r7+INT]
bb r0, ?E
jes .cont1
im msk_0
hlt 044

.cont1:
; check test result
lw r1, [r7+PROC]
cw r1, 0
Expand All @@ -103,9 +106,10 @@ mx_proc:
jn test_cont
awt r7, TLEN
cw r7, seqe
bc r0, ?E
jn .cont2
im msk_0
hlt 077

.cont2:
; send next I/O
test_cont:
lw r1, [r7+CMD]
Expand All @@ -117,9 +121,11 @@ c_ou: ou r2, r1
.word c_no, c_en, c_ok, c_pe
c_in: in r2, r1
.word c_no, c_en, c_ok, c_pe
c_no: hlt 041 ; error
c_no: im msk_0
hlt 041 ; error
c_en: ujs repeat ; repeat if engaged
c_pe: hlt 042 ; error
c_pe: im msk_0
hlt 042 ; error
c_ok:
lip

Expand Down
4 changes: 1 addition & 3 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ def wait_for_finish(self):
if s == "WAIT":
ir = self.reg("ir")
if ir & 0b1111110111000000 == 0b1110110000000000 and ir & 0b0000000000111111 >= 0o40:
ir = self.reg("ir")
if ir & 0b1111110111000000 == 0b1110110000000000 and ir & 0b0000000000111111 >= 0o40:
break
break
elif s == "STOP":
break
if self.polldelay:
Expand Down

0 comments on commit 072a8ef

Please sign in to comment.