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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [bench/] [asm/] [wdt.S] - Blame information for rev 119

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 dgisselq
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;
3
; Filename:     wdt.S
4
;
5
; Project:      Zip CPU -- a small, lightweight, RISC CPU soft core
6
;
7
; Purpose:      Test to see whether or not the watchdog timer works.  We'll
8
;               start the watchdog, clear a register, then write as many times
9
;               as we can to memory before the watchdog kicks in.
10
;
11
; Creator:      Dan Gisselquist, Ph.D.
12 69 dgisselq
;               Gisselquist Technology, LLC
13 10 dgisselq
;
14
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
;
16
; Copyright (C) 2015, Gisselquist Technology, LLC
17
;
18
; This program is free software (firmware): you can redistribute it and/or
19
; modify it under the terms of  the GNU General Public License as published
20
; by the Free Software Foundation, either version 3 of the License, or (at
21
; your option) any later version.
22
;
23
; This program is distributed in the hope that it will be useful, but WITHOUT
24
; ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
25
; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26
; for more details.
27
;
28
; License:      GPL, v3, as defined and found on www.gnu.org,
29
;               http://www.gnu.org/licenses/gpl.html
30
;
31
;
32
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
33
;
34
; Registers:
35
;       R12     Peripheral base
36
;       R11     Address of our one memory variable
37
;
38 40 dgisselq
#include "sys.i"
39 10 dgisselq
start:
40 40 dgisselq
        LDI     0xc0000000,R12  ; Get the address of our peripheral base
41
        MOV     $1(PC),R11      ; Get a memory address for a variable
42
        BRA     skip_test_variable
43
test_variable:
44 10 dgisselq
        .DAT    0
45 40 dgisselq
skip_test_variable:
46 11 dgisselq
        LDI     $-1,R0  ; Start the watchdog timer
47 40 dgisselq
        STO     R0,sys.bus.wdt(R12)
48
        LSR     $1,R0   ; R0 now = 0x7fffffff
49
        STO     R0,sys.bus.tma(R12)
50
        LSR     $1,R0   ; R0 now = 0x3fffffff
51
        STO     R0,sys.bus.tmb(R12)
52 10 dgisselq
        LSR     $1,R0
53 40 dgisselq
        STO     R0,sys.bus.tmc(R12)
54 10 dgisselq
        ;
55
        CLR     R0
56 40 dgisselq
wdt_test_loop:
57 10 dgisselq
        ADD     $1,R0
58
        LOD     (R11),R1
59
        CMP     R0,R1
60
        STO.LT  R0,(R11)
61 40 dgisselq
        TST     -1,R0
62
        BLT     wdt_test_program_is_broken
63
        BRA     wdt_test_loop
64 10 dgisselq
 
65 40 dgisselq
wdt_test_program_is_broken:
66 10 dgisselq
        HALT

powered by: WebSVN 2.1.0

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