OpenCores
URL https://opencores.org/ocsvn/t48/t48/trunk

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_1/] [sw/] [verif/] [black_box/] [rb/] [misc/] [test.asm] - Diff between revs 289 and 292

Only display areas with differences | Details | Blame | View Log

Rev 289 Rev 292
        ;; *******************************************************************
        ;; *******************************************************************
        ;; $Id: test.asm,v 1.1.1.1 2004-03-25 22:29:18 arniml Exp $
        ;; $Id: test.asm,v 1.1.1.1 2004-03-25 22:29:18 arniml Exp $
        ;;
        ;;
        ;; Test several operations in conjunction with RB-switching.
        ;; Test several operations in conjunction with RB-switching.
        ;; *******************************************************************
        ;; *******************************************************************
        INCLUDE "cpu.inc"
        INCLUDE "cpu.inc"
        INCLUDE "pass_fail.inc"
        INCLUDE "pass_fail.inc"
        ORG     0
        ORG     0
        ;; Start of test
        ;; Start of test
        ;; fill data memory with 0
        ;; fill data memory with 0
        clr     a
        clr     a
        mov     r0, a
        mov     r0, a
fill_loop:
fill_loop:
        mov     @r0, a
        mov     @r0, a
        djnz    r0, fill_loop
        djnz    r0, fill_loop
        ;; set up both register banks with indirect writes
        ;; set up both register banks with indirect writes
        mov     r0, #01FH
        mov     r0, #01FH
        mov     r1, #008H
        mov     r1, #008H
fill_rb1_loop:
fill_rb1_loop:
        mov     a, r0
        mov     a, r0
        mov     @r0, a
        mov     @r0, a
        dec     r0
        dec     r0
        djnz    r1, fill_rb1_loop
        djnz    r1, fill_rb1_loop
        mov     r0, #007H
        mov     r0, #007H
fill_rb0_loop:
fill_rb0_loop:
        mov     a, r0
        mov     a, r0
        mov     @r0, a
        mov     @r0, a
        djnz    r0, fill_rb0_loop
        djnz    r0, fill_rb0_loop
        mov     a, r0
        mov     a, r0
        mov     @r0, a
        mov     @r0, a
        ;; check RB0
        ;; check RB0
        call    check_rb0
        call    check_rb0
        ;; check RB1
        ;; check RB1
        sel     rb1
        sel     rb1
        call    check_rb1
        call    check_rb1
        ;; check RB0 again
        ;; check RB0 again
        sel     rb0
        sel     rb0
        call    check_rb0
        call    check_rb0
        ;; check memory between RB0 and RB1 for 0
        ;; check memory between RB0 and RB1 for 0
        mov     r0, #00EH       ; check 14 bytes
        mov     r0, #00EH       ; check 14 bytes
        mov     r1, #00AH       ; starting from address A
        mov     r1, #00AH       ; starting from address A
chk_loop1:
chk_loop1:
        mov     a, @r1
        mov     a, @r1
        jnz     fail
        jnz     fail
        inc     r1
        inc     r1
        djnz    r0, chk_loop1
        djnz    r0, chk_loop1
        ;; check memory above RB1 for 0
        ;; check memory above RB1 for 0
        mov     r0, #0100H - 0020H ; check 256-32 bytes
        mov     r0, #0100H - 0020H ; check 256-32 bytes
        mov     r1, #020H       ; starting from address 20H
        mov     r1, #020H       ; starting from address 20H
chk_loop2:
chk_loop2:
        mov     a, @r1
        mov     a, @r1
        jnz     fail
        jnz     fail
        inc     r1
        inc     r1
        djnz    r0, chk_loop2
        djnz    r0, chk_loop2
        ;; now use RB1 to indirect address register 0-7
        ;; now use RB1 to indirect address register 0-7
        mov     r1, #001H       ; restore r1
        mov     r1, #001H       ; restore r1
        mov     r0, #000H       ; restore r0, set trap
        mov     r0, #000H       ; restore r0, set trap
        sel     rb1
        sel     rb1
        mov     r0, #007H
        mov     r0, #007H
ind_chk_loop:
ind_chk_loop:
        mov     a, @r0
        mov     a, @r0
        cpl     a
        cpl     a
        add     a, r0
        add     a, r0
        cpl     a
        cpl     a
        jnz     fail
        jnz     fail
        djnz    r0, ind_chk_loop
        djnz    r0, ind_chk_loop
pass:   PASS
pass:   PASS
fail:   FAIL
fail:   FAIL
        ORG     0300H
        ORG     0300H
check_rb0:
check_rb0:
        mov     a, r0
        mov     a, r0
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r1
        mov     a,r1
        add     a, #0FFH
        add     a, #0FFH
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r2
        mov     a,r2
        add     a, #0FEH
        add     a, #0FEH
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r3
        mov     a,r3
        add     a, #0FDH
        add     a, #0FDH
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r4
        mov     a,r4
        add     a, #0FCH
        add     a, #0FCH
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r5
        mov     a,r5
        add     a, #0FBH
        add     a, #0FBH
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r6
        mov     a,r6
        add     a, #0FAH
        add     a, #0FAH
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r7
        mov     a,r7
        add     a, #0F9H
        add     a, #0F9H
        jnz     fail_p3
        jnz     fail_p3
        ret
        ret
check_rb1:
check_rb1:
        mov     a, r0
        mov     a, r0
        add     a, #0E8H
        add     a, #0E8H
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r1
        mov     a,r1
        add     a, #0E7H
        add     a, #0E7H
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r2
        mov     a,r2
        add     a, #0E6H
        add     a, #0E6H
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r3
        mov     a,r3
        add     a, #0E5H
        add     a, #0E5H
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r4
        mov     a,r4
        add     a, #0E4H
        add     a, #0E4H
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r5
        mov     a,r5
        add     a, #0E3H
        add     a, #0E3H
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r6
        mov     a,r6
        add     a, #0E2H
        add     a, #0E2H
        jnz     fail_p3
        jnz     fail_p3
        mov     a,r7
        mov     a,r7
        add     a, #0E1H
        add     a, #0E1H
        jnz     fail_p3
        jnz     fail_p3
        ret
        ret
fail_p3:
fail_p3:
        FAIL
        FAIL
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.