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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_0_4_beta/] [sw/] [verif/] [black_box/] [cnt/] [int/] [test.asm] - Blame information for rev 292

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 94 arniml
        ;; *******************************************************************
2
        ;; $Id: test.asm,v 1.1 2004-05-16 16:25:14 arniml Exp $
3
        ;;
4
        ;; Test Counter Interrupt.
5
        ;; *******************************************************************
6
 
7
        INCLUDE "cpu.inc"
8
        INCLUDE "pass_fail.inc"
9
 
10
        ORG     0
11
        jmp     start
12
        nop
13
        jmp     fail
14
        jmp     fail
15
        jmp     counter_int
16
        jmp     fail
17
 
18
        ;; Start of test
19
start:  mov     a, #0FEH
20
        mov     t, a
21
 
22
        mov     r0, #000H
23
 
24
        strt    cnt
25
        en      tcnti
26
 
27
        jtf     fail
28
 
29
        ;; apply falling edge on T1 -> T = 0FFH
30
        anl     P1, #0FDH
31
        call    check_cnt_idle
32
        mov     a, t
33
        inc     a
34
        jnz     fail
35
        ;; apply rising edge on T1
36
        orl     P1, #002H
37
        call    check_cnt_idle
38
        mov     a, t
39
        inc     a
40
        jnz     fail
41
 
42
        ;; apply falling edge on T1 -> T = 000H
43
        anl     P1, #0FDH
44
        jtf     goon
45
        jmp     fail
46
goon:   mov     a, r0
47
        inc     a
48
        jnz     fail
49
        mov     r0, a
50
        jtf     fail
51
        ;; apply rising edge on T1
52
        orl     P1, #002H
53
        call    check_cnt_idle
54
 
55
        ;; apply falling edge on T1 -> T = 001H
56
        anl     P1, #0FDH
57
        call    check_cnt_idle
58
        mov     a, t
59
        dec     a
60
        jnz     fail
61
        ;; apply rising edge on T1
62
        orl     P1, #002H
63
        call    check_cnt_idle
64
        mov     a, t
65
        dec     a
66
        jnz     fail
67
 
68
        ;; apply falling edge on T1 -> T = 002H
69
        anl     P1, #0FDH
70
        call    check_cnt_idle
71
        mov     a, t
72
        dec     a
73
        dec     a
74
        jnz     fail
75
        ;; apply rising edge on T1
76
        orl     P1, #002H
77
        call    check_cnt_idle
78
        mov     a, t
79
        dec     a
80
        dec     a
81
        jnz     fail
82
 
83
        ;; disable interrupt and trigger overflow
84
        dis     tcnti
85
        mov     a, #0FFH
86
        mov     t, a
87
        call    check_cnt_idle
88
 
89
        ;; apply falling edge on T1 -> T = 000H
90
        anl     P1, #0FDH
91
        jtf     goon2
92
        jmp     fail
93
goon2:  mov     a, r0
94
        jnz     fail
95
        mov     a, t
96
        jnz     fail
97
 
98
 
99
pass:   PASS
100
 
101
fail:   FAIL
102
 
103
 
104
check_cnt_idle:
105
        jtf     fail
106
        mov     a, r0
107
        jnz     fail
108
        ret
109
 
110
 
111
counter_int:
112
        mov     r0, #0FFH
113
        retr

powered by: WebSVN 2.1.0

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